From patchwork Thu May 22 14:36:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sourab.gupta@intel.com X-Patchwork-Id: 4223331 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 369569F23C for ; Thu, 22 May 2014 14:36:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E94C201DD for ; Thu, 22 May 2014 14:36:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9905E201C7 for ; Thu, 22 May 2014 14:36:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 387B16EC2B; Thu, 22 May 2014 07:36:12 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 22 May 2014 07:32:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,887,1392192000"; d="scan'208";a="536064374" Received: from sourabgu-desktop.iind.intel.com ([10.223.82.83]) by fmsmga001.fm.intel.com with ESMTP; 22 May 2014 07:36:09 -0700 From: sourab.gupta@intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 22 May 2014 20:06:33 +0530 Message-Id: <1400769393-15403-4-git-send-email-sourab.gupta@intel.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1400769393-15403-1-git-send-email-sourab.gupta@intel.com> References: <1400608955.9396.88.camel@sourabgu-desktop> <1400769393-15403-1-git-send-email-sourab.gupta@intel.com> Cc: Akash Goel , Sourab Gupta Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Fix mmio page flip vs mmio set base race X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;