diff mbox

drm/i915: untangle page flip completion

Message ID 20100205014509.GB32470@zhen-devel.sh.intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Zhenyu Wang Feb. 5, 2010, 1:45 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 50ddf4a..eabdb85 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -310,19 +310,17 @@  irqreturn_t ironlake_irq_handler(struct drm_device *dev)
 		ironlake_opregion_gse_intr(dev);
 
 	if (de_iir & DE_PLANEA_FLIP_DONE)
-		intel_prepare_page_flip(dev, 0);
+		intel_finish_page_flip(dev, 0);
 
 	if (de_iir & DE_PLANEB_FLIP_DONE)
-		intel_prepare_page_flip(dev, 1);
+		intel_finish_page_flip(dev, 1);
 
 	if (de_iir & DE_PIPEA_VBLANK) {
 		drm_handle_vblank(dev, 0);
-		intel_finish_page_flip(dev, 0);
 	}
 
 	if (de_iir & DE_PIPEB_VBLANK) {
 		drm_handle_vblank(dev, 1);
-		intel_finish_page_flip(dev, 1);
 	}
 
 	/* check event from PCH */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 0cf764a..26ea815 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4208,6 +4208,13 @@  static int intel_crtc_page_flip(struct drm_crtc *crtc,
 	/* Reference the old fb object for the scheduled work. */
 	drm_gem_object_reference(work->obj);
 
+	/* On Ironlake, page flip irq is for 'done' event, so try to
+	   make page flip prepare here, and will handle finish job after
+	   receive page flip done irq.
+	 */
+	if (IS_IRONLAKE(dev))
+		intel_prepare_page_flip(dev, intel_crtc->plane);
+
 	crtc->fb = fb;
 	i915_gem_object_flush_write_domain(obj);
 	drm_vblank_get(dev, intel_crtc->pipe);