diff mbox

drm/i915: fix current fb blocking for flipping.

Message ID 1287653550-3026-1-git-send-email-olvaffe@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chia-I Wu Oct. 21, 2010, 9:32 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5e21b31..2e8cf7d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4664,7 +4664,7 @@  static void do_intel_finish_page_flip(struct drm_device *dev,
 
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 
-	obj_priv = to_intel_bo(work->pending_flip_obj);
+	obj_priv = to_intel_bo(work->old_fb_obj);
 
 	/* Initial scanout buffer will have a 0 pending flip count */
 	if ((atomic_read(&obj_priv->pending_flip) == 0) ||
@@ -4729,6 +4729,8 @@  static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	work->dev = crtc->dev;
 	intel_fb = to_intel_framebuffer(crtc->fb);
 	work->old_fb_obj = intel_fb->obj;
+	obj_priv = to_intel_bo(intel_fb->obj);
+	atomic_inc(&obj_priv->pending_flip);
 	INIT_WORK(&work->work, intel_unpin_work_fn);
 
 	/* We borrow the event spin lock for protecting unpin_work */
@@ -4770,7 +4772,6 @@  static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	i915_gem_object_flush_write_domain(obj);
 	drm_vblank_get(dev, intel_crtc->pipe);
 	obj_priv = to_intel_bo(obj);
-	atomic_inc(&obj_priv->pending_flip);
 	work->pending_flip_obj = obj;
 
 	if (intel_crtc->plane)