From patchwork Fri Feb 22 15:52:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10826473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D087F17E9 for ; Fri, 22 Feb 2019 15:52:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE82732953 for ; Fri, 22 Feb 2019 15:52:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2B0732956; Fri, 22 Feb 2019 15:52:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C2B532953 for ; Fri, 22 Feb 2019 15:52:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9962C8970E; Fri, 22 Feb 2019 15:52:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E5D98970E for ; Fri, 22 Feb 2019 15:52:55 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2019 07:52:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,400,1544515200"; d="scan'208";a="120007709" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 22 Feb 2019 07:52:52 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 22 Feb 2019 17:52:51 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Fri, 22 Feb 2019 17:52:48 +0200 Message-Id: <20190222155251.16730-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/4] drm/i915: Disable LP1+ watermarks on Lenovo Thinkpad T431s X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrea , stable@vger.kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Lenovo Thinkpad T431s (ivb) apparently can't handle LP1+ watermarks being enabled. It underruns severly enough that the screen is unusable. The latency values and watemarks look as expected. And sadly updating the BIOS to the latest version (BIOS GHET41WW (1.26 ) 11/21/2018) did not help. One glimmer of hope I had was the VBT. It seems to have some sort of flag for "self refresh = yes/no", but when I looked at a bunch of VBTs I had lying around most of them had that field set to "no". So if we used that we'd end up disabling LP1+ on most machines. That seems a bit harsh since we know LP1+ works just fine on most machines. Since I have no better ideas let's just disable LP1+ watermarks on this particular machine via a quirk. Cc: stable@vger.kernel.org Cc: Andrea Reported-by: Andrea Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109477 Fixes: a46a7350b1e8 ("drm/i915: Fix ilk+ watermarks when disabling pipes") Signed-off-by: Ville Syrjälä Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/intel_pm.c | 51 +++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 4c0e43caa5cd..75dceac19950 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3015,6 +3015,29 @@ static void snb_wm_latency_quirk(struct drm_i915_private *dev_priv) intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); } +static void ilk_wm_disable_quirk(struct drm_i915_private *dev_priv, + int level) +{ + int max_level = ilk_wm_max_level(dev_priv); + + if (dev_priv->wm.pri_latency[level] == 0 && + dev_priv->wm.spr_latency[level] == 0 && + dev_priv->wm.cur_latency[level] == 0) + return; + + DRM_DEBUG_KMS("LP%d+ watermarks disabled by quirk\n", level); + + for (; level <= max_level; level++) { + dev_priv->wm.pri_latency[level] = 0; + dev_priv->wm.spr_latency[level] = 0; + dev_priv->wm.cur_latency[level] = 0; + } + + intel_print_wm_latency(dev_priv, "Primary", dev_priv->wm.pri_latency); + intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency); + intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); +} + static void snb_wm_lp3_irq_quirk(struct drm_i915_private *dev_priv) { /* @@ -3028,23 +3051,18 @@ static void snb_wm_lp3_irq_quirk(struct drm_i915_private *dev_priv) * interrupts only. To play it safe we disable LP3 * watermarks entirely. */ - if (dev_priv->wm.pri_latency[3] == 0 && - dev_priv->wm.spr_latency[3] == 0 && - dev_priv->wm.cur_latency[3] == 0) - return; - - dev_priv->wm.pri_latency[3] = 0; - dev_priv->wm.spr_latency[3] = 0; - dev_priv->wm.cur_latency[3] = 0; + ilk_wm_disable_quirk(dev_priv, 3); +} - DRM_DEBUG_KMS("LP3 watermarks disabled due to potential for lost interrupts\n"); - intel_print_wm_latency(dev_priv, "Primary", dev_priv->wm.pri_latency); - intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency); - intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); +static void ilk_wm_disable_lp1_quirk(struct drm_i915_private *dev_priv) +{ + ilk_wm_disable_quirk(dev_priv, 1); } static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv) { + struct pci_dev *pdev = dev_priv->drm.pdev; + intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency); memcpy(dev_priv->wm.spr_latency, dev_priv->wm.pri_latency, @@ -3063,6 +3081,15 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv) snb_wm_latency_quirk(dev_priv); snb_wm_lp3_irq_quirk(dev_priv); } + + /* + * Lenovo Thinkpad T431s (ivb) + * Massive underruns. + */ + if (pdev->device == 0x0166 && + pdev->subsystem_vendor == 0x17aa && + pdev->subsystem_device == 0x2208) + ilk_wm_disable_lp1_quirk(dev_priv); } static void skl_setup_wm_latency(struct drm_i915_private *dev_priv)