From mboxrd@z Thu Jan 1 00:00:00 1970 From: sourab.gupta@intel.com Subject: [PATCH 3/3] drm/i915: Fix mmio page flip vs mmio set base race Date: Thu, 22 May 2014 20:06:33 +0530 Message-ID: <1400769393-15403-4-git-send-email-sourab.gupta@intel.com> References: <1400608955.9396.88.camel@sourabgu-desktop> <1400769393-15403-1-git-send-email-sourab.gupta@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id E52EF6EC2C for ; Thu, 22 May 2014 07:36:10 -0700 (PDT) In-Reply-To: <1400769393-15403-1-git-send-email-sourab.gupta@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org Cc: Akash Goel , Sourab Gupta List-Id: intel-gfx@lists.freedesktop.org From: Sourab Gupta 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 Signed-off-by: Akash Goel --- drivers/gpu/drm/i915/intel_display.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b3e7fc6..0099c56 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9221,8 +9221,8 @@ 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)); } @@ -9296,6 +9296,10 @@ static int intel_queue_mmio_flip(struct drm_device *dev, goto err_unpin; } + 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; -- 1.8.5.1