[PATCH 60/81] drm/i915: Unpin old fbs only when appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Don't unpin the old fb after flips, unless a new fb was pinned, or we're
disabling the plane/crtc.

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_atomic.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index a119896..b795cb2 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -2133,8 +2133,10 @@ static void atomic_pipe_commit(struct drm_device *dev,
 			intel_flip->old_cursor_bo = st->old.cursor_bo;
 		}
 
-		if (st->old.fb) {
+		if (st->old.fb)
 			intel_flip->old_fb_id = st->old.fb->base.id;
+
+		if (st->fb_dirty && st->old.fb) {
 			intel_flip->old_bo = to_intel_framebuffer(st->old.fb)->obj;
 
 			mutex_lock(&dev->struct_mutex);
@@ -2177,8 +2179,10 @@ static void atomic_pipe_commit(struct drm_device *dev,
 
 		intel_plane->calc(plane, plane->fb, &st->coords);
 
-		if (st->old.fb) {
+		if (st->old.fb)
 			intel_flip->old_fb_id = st->old.fb->base.id;
+
+		if (st->dirty && st->old.fb) {
 			intel_flip->old_bo = to_intel_framebuffer(st->old.fb)->obj;
 
 			mutex_lock(&dev->struct_mutex);
-- 
1.7.8.6

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux