From patchwork Tue May 20 10:49:48 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: 4208921 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D0697BEEAB for ; Tue, 20 May 2014 10:49:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 182012035E for ; Tue, 20 May 2014 10:49:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 265FD2035D for ; Tue, 20 May 2014 10:49:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1CDE6E8AE; Tue, 20 May 2014 03:49:19 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EDF26E8AE for ; Tue, 20 May 2014 03:49:17 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 20 May 2014 03:49:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,873,1392192000"; d="scan'208";a="534762324" Received: from sourabgu-desktop.iind.intel.com ([10.223.82.83]) by fmsmga001.fm.intel.com with ESMTP; 20 May 2014 03:49:15 -0700 From: sourab.gupta@intel.com To: intel-gfx@lists.freedesktop.org Date: Tue, 20 May 2014 16:19:48 +0530 Message-Id: <1400582988-28602-4-git-send-email-sourab.gupta@intel.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1400582988-28602-1-git-send-email-sourab.gupta@intel.com> References: <1400582988-28602-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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;