diff mbox

[3/3] drm/i915: Fix mmio page flip vs mmio set base race

Message ID 1400582988-28602-4-git-send-email-sourab.gupta@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sourab.gupta@intel.com May 20, 2014, 10:49 a.m. UTC
From: Sourab Gupta <sourab.gupta@intel.com>

This patch fixes the race condition between flip done interrupt
from set base and mmio based page flip.

This patch is dependent on
http://lists.freedesktop.org/archives/intel-gfx/2014-April/043761.html

Also, for the details of the race condition please refer to the mentioned
patch.

Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Akash Goel <akash.goel@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 21f1fa5..8e85d6c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9073,8 +9073,7 @@  static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
 
 	intel_mark_page_flip_active(intel_crtc);
 
-	I915_WRITE(DSPSURF(intel_crtc->plane), i915_gem_obj_ggtt_offset(obj) +
-			intel_crtc->dspaddr_offset);
+	I915_WRITE(DSPSURF(intel_crtc->plane), intel_crtc->unpin_work->gtt_offset);
 	POSTING_READ(DSPSURF(intel_crtc->plane));
 }
 
@@ -9142,6 +9141,9 @@  static int intel_queue_mmio_flip(struct drm_device *dev,
 	if (ret)
 		goto err;
 
+	intel_crtc->unpin_work->gtt_offset =
+		i915_gem_obj_ggtt_offset(obj) + intel_crtc->dspaddr_offset;
+
 	ret = intel_postpone_flip(obj);
 	if (ret < 0) {
 		goto err_unpin;