drm/i915: Wait for vblank before unpinning old fb
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 14 Dec 2010 16:09:31 +0000 (16:09 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 Dec 2010 10:33:23 +0000 (10:33 +0000)
Be paranoid and ensure that the vblank has passed and the scanout has
switched to the new fb, before unpinning the old one and possibly
tearing down its PTEs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_display.c

index f2d50141e0c233f0eab6551d6938923a467f553e..840bfc3ae719d4ad6d609f7f4a577231e44b0b24 100644 (file)
@@ -1626,8 +1626,10 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
                return ret;
        }
 
-       if (old_fb)
+       if (old_fb) {
+               intel_wait_for_vblank(dev, intel_crtc->pipe);
                i915_gem_object_unpin(to_intel_framebuffer(old_fb)->obj);
+       }
 
        mutex_unlock(&dev->struct_mutex);