From patchwork Thu Feb 27 19:30:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3735371 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 1FC919F2F7 for ; Thu, 27 Feb 2014 19:31:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54C0A2024D for ; Thu, 27 Feb 2014 19:31:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 376972022D for ; Thu, 27 Feb 2014 19:31:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D221FB586; Thu, 27 Feb 2014 11:31:17 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f53.google.com (mail-yh0-f53.google.com [209.85.213.53]) by gabe.freedesktop.org (Postfix) with ESMTP id CCA5DFB586 for ; Thu, 27 Feb 2014 11:31:14 -0800 (PST) Received: by mail-yh0-f53.google.com with SMTP id v1so3209027yhn.40 for ; Thu, 27 Feb 2014 11:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=y45zgIDjR0uDS4UhEoAcRulC6TdFpldIPa9X83nd9dg=; b=XSzo8Hf/nvVB/2J0TqkuqJOW4i74Ab5IQdpGkXAGrEmAhk4NQWynKTMPoFe6k/E2aN OjnmMHqr407KwE0A2hUgzwCiY7J2JyNC1aNr/oBcocDjoZN/K2S87rpM+s6fYBeiEi8+ pIe7iEzkGJnABCHOCg2VxfE9gIAoDvwuoBdrobwtn7DCRXJTFxZyPHJsHi1HwQTNWJij s6Qsjm9A4A4ia7h3VEr7/S0nmHfHeaPIVbWagNuuAmytU9MUs7viENVdEW3edrZfwc56 PwO+84+nRKIPcUeSMvBAuoAIvFbk8PG/pde3uhTj9uScNIpjXx5CQcwYRVPNzqoV6h+P lX0w== X-Received: by 10.236.37.105 with SMTP id x69mr16665988yha.15.1393529474548; Thu, 27 Feb 2014 11:31:14 -0800 (PST) Received: from localhost.localdomain ([177.132.50.39]) by mx.google.com with ESMTPSA id p63sm16664163yhl.15.2014.02.27.11.31.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Feb 2014 11:31:14 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 27 Feb 2014 16:30:56 -0300 Message-Id: <1393529456-2036-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.5.3 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH] drm/i915: fix assert_cursor on BDW 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: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 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 We need to read the correct register, not a register that doesn't exist and will trigger "Unclaimed register" messages when we touch it. Also rearrange the checks in an attempt to prevent this error from happening again. Signed-off-by: Paulo Zanoni Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_display.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) This patch is untested, but the "Uncalimed register" message is real, as long as we have the patch to print them. diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f19e6ea..2e05d1e 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -1095,12 +1095,13 @@ static void assert_cursor(struct drm_i915_private *dev_priv, struct drm_device *dev = dev_priv->dev; bool cur_state; - if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) - cur_state = I915_READ(CURCNTR_IVB(pipe)) & CURSOR_MODE; - else if (IS_845G(dev) || IS_I865G(dev)) + + if (IS_845G(dev) || IS_I865G(dev)) cur_state = I915_READ(_CURACNTR) & CURSOR_ENABLE; - else + else if (INTEL_INFO(dev)->gen <= 6 || IS_VALLEYVIEW(dev)) cur_state = I915_READ(CURCNTR(pipe)) & CURSOR_MODE; + else + cur_state = I915_READ(CURCNTR_IVB(pipe)) & CURSOR_MODE; WARN(cur_state != state, "cursor on pipe %c assertion failure (expected %s, current %s)\n",