From patchwork Mon Oct 7 20:15:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2999021 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 604649F245 for ; Mon, 7 Oct 2013 20:18:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C6DC20213 for ; Mon, 7 Oct 2013 20:18:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8CEA620212 for ; Mon, 7 Oct 2013 20:18:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D1B8E5E16 for ; Mon, 7 Oct 2013 13:18:20 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ye0-f175.google.com (mail-ye0-f175.google.com [209.85.213.175]) by gabe.freedesktop.org (Postfix) with ESMTP id C385DE74EA for ; Mon, 7 Oct 2013 13:17:24 -0700 (PDT) Received: by mail-ye0-f175.google.com with SMTP id q8so1722480yen.34 for ; Mon, 07 Oct 2013 13:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=EUGOG+Z31uiIbuKmgDAukS9uXwmPNXi2i9/Ap2GljsI=; b=hAbU3TmI+qtwjTTyJxydrhdXc+EnQGniuAoYZJyTgkxHqG5wiAifZl2ggjUpzsIwUq b+51/zmuznrQGPCFQHn9F1RJ6awNaiP1d8FV1SJLCgoBCJME84KMXFiw8ubNSylNbl3P dlixnw56nm1W1GrtYdRRKHFytvof45cD9IK6E+c/GHy+C7zbseYohfjBvRAya+9GiV2H xyx5QJ0PF3ER2Z8rihnJboyWsi0zydv70xzX3abEiSaBVR0rvQq1YVGiF+8B+3Lr2ZCK +n1Nz50pyCD7qqqjcXV+BRPei4tz5Wl+oRrJ/frQMI4GlGvfYuc9jYoPJBvKTRAE6lz7 H8Ow== X-Received: by 10.236.38.162 with SMTP id a22mr27526101yhb.30.1381177044341; Mon, 07 Oct 2013 13:17:24 -0700 (PDT) Received: from localhost.localdomain (200.188.217.18.dedicated.neoviatelecom.com.br. [200.188.217.18]) by mx.google.com with ESMTPSA id 48sm46243569yhq.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 07 Oct 2013 13:17:23 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 7 Oct 2013 17:15:47 -0300 Message-Id: <1381176948-2754-4-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1381176948-2754-1-git-send-email-rodrigo.vivi@gmail.com> References: <1381176948-2754-1-git-send-email-rodrigo.vivi@gmail.com> MIME-Version: 1.0 Cc: Paulo Zanoni , stable@vger.kernel.org Subject: [Intel-gfx] [PATCH 3/4] drm/i915: implement another plane WM workaround for HSW X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Paulo Zanoni In some Haswell machines we're seeing a full system hang while calling haswell_crtc_enable. Ville bisected the problem to the following commit: commit 90a8864320b2a9f91e5b5d561924a4bb70b90dcc Author: Paulo Zanoni Date: Fri May 3 17:23:45 2013 -0300 drm/i915: set FORCE_ARB_IDLE_PLANES workaround After some BSpec-digging I discovered that we don't implement one of the workarounds mentioned in the description of bit 31 of PRI_CTL, SPR_CTL and CUR_CTL. This patch implements the workaround, which makes the problem go away on my machine. Also notice that the workaround implementation is almost a revert of the commit mentioned above, but it still allows LP watermarks to be used. Thanks to Ville for the help debugging the issue and for doing the bisect. Cc: stable@vger.kernel.org Credits-to: Ville Syrjälä Signed-off-by: Paulo Zanoni Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/intel_display.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bc47f1e..8069bff 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3565,6 +3565,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc) struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_encoder *encoder; int pipe = intel_crtc->pipe; + uint32_t wm_dbg_val; WARN_ON(!crtc->enabled); @@ -3597,6 +3598,11 @@ static void haswell_crtc_enable(struct drm_crtc *crtc) intel_ddi_set_pipe_settings(crtc); intel_ddi_enable_transcoder_func(crtc); + /* Workaround described in PRI_CTL, CUR_CTL and SPR_CTL bit 31. */ + wm_dbg_val = I915_READ(WM_DBG); + I915_WRITE(WM_DBG, wm_dbg_val | WM_DBG_DISALLOW_MULTIPLE_LP | + WM_DBG_DISALLOW_MAXFIFO | WM_DBG_DISALLOW_SPRITE); + intel_update_watermarks(crtc); intel_enable_pipe(dev_priv, pipe, intel_crtc->config.has_pch_encoder, false); @@ -3623,6 +3629,9 @@ static void haswell_crtc_enable(struct drm_crtc *crtc) * happening. */ intel_wait_for_vblank(dev, intel_crtc->pipe); + + /* Second part of the WM_DBG workaround. */ + I915_WRITE(WM_DBG, wm_dbg_val); } static void ironlake_pfit_disable(struct intel_crtc *crtc)