From patchwork Wed Mar 4 06:00:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1248825 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=G1lxsvSe; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XNXz2xrRz9sSQ; Wed, 4 Mar 2020 17:01:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1j9N5a-0007xG-N5; Wed, 04 Mar 2020 06:01:02 +0000 Received: from mail-pg1-f196.google.com ([209.85.215.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j9N5Z-0007wB-EC for kernel-team@lists.ubuntu.com; Wed, 04 Mar 2020 06:01:01 +0000 Received: by mail-pg1-f196.google.com with SMTP id t24so458131pgj.7 for ; Tue, 03 Mar 2020 22:01:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=e19oxmgLMefIUhqxf4Pg0WmsOrIW//NMz8oWSEc0G8M=; b=G1lxsvSe3IchomoR1r5FoUU56iBYys+Tw4Iyp9ZFJYtAL8BGz//STVo1OxwkwUmbm7 gRidb38WJRwe+NaA7s5G+0BBtyhjPw/4Sk3ig+rqTFlx/tfPnJ02aEzYEjJ0jkGeV9Jy WF4N6nJkP2Fimh5T4A1Zdhld4eTMXayDDetduZnHFovnitzGe0wQnGoje3Ym59C1Khrk Rm+W629QQOrAgNZmq0AKtOzwCzSgjg75y5dMJg9OrvJkEcOJjbTxKDoup8i6vRri61r3 FKk/rVb6mt0ejhxv2YqLDQpmDsMdRgAO4g1QFI8/lahjcLWl4HSHT7btSK+hwM+bZNJ7 lt3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=e19oxmgLMefIUhqxf4Pg0WmsOrIW//NMz8oWSEc0G8M=; b=rWBVRcpVN2i82gRifo2cOIF2Xkv4OKiXiWBzawEW9Aab4qBfeRw1QYrXxs4hoqS2Nw Gp2GNu55JLO90xC6LDZHC8G2wA0NgB5/GXr7xK/UWLi+gdKoVJbFBIDXFBgU/sDdiM/u 0nvtZFmBovW6S1+DcR7wi6rXufeqjFqLNcRQK+PzH5kp9LM2Uy2Od4NIRBB3nbt5rtUg 4yhc44wydJisfmCvnndNuzrTq4QnwRzfJdUCpF5/s5QrProtc91nyZ7G/IgSU1JzE08h 6smyOnO9rCfjIyKmer86IJuHutsn5nlLeWti6hBaaI2I5eHfBcJfFU1Oc1pymUi7dhKx UYcA== X-Gm-Message-State: ANhLgQ3BrgBPhNCT8Tt9+I2XEitS5qyBpDYUqiTdyT8PEfOSeKj1dSMG Ue8ABBsMzpUV4ENgvOfSBwHu0QhM X-Google-Smtp-Source: ADFU+vvbXqyHwOYk8wKpTtVps+WclT6IqEFLpj+4yr5yg+3l8PsggNfPLtFOI1tEVGKkGiHIAwkzVA== X-Received: by 2002:a63:b91d:: with SMTP id z29mr1197020pge.52.1583301659546; Tue, 03 Mar 2020 22:00:59 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id ev22sm1173875pjb.0.2020.03.03.22.00.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Mar 2020 22:00:58 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/5][SRU][F] Revert "USUNTU: SAUCE: drm/i915: Force DPCD backlight mode on Dell Precision 4K sku" Date: Wed, 4 Mar 2020 14:00:46 +0800 Message-Id: <20200304060055.5776-2-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200304060055.5776-1-acelan.kao@canonical.com> References: <20200304060055.5776-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1861521 This reverts commit 3269788061d24e316633165608259de1c110b801. Signed-off-by: AceLan Kao --- drivers/gpu/drm/drm_dp_helper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 0d3381f1377b..f1f14f4144e3 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1264,7 +1264,6 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { * only supports DPCD backlight controls, despite advertising otherwise */ { OUI(0xba, 0x41, 0x59), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT) }, - { OUI(0x38, 0xec, 0x11), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT) }, }; #undef OUI From patchwork Wed Mar 4 06:00:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1248826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=AmEGaQaj; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XNY00tD1z9sST; Wed, 4 Mar 2020 17:01:08 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1j9N5c-0007yV-S1; Wed, 04 Mar 2020 06:01:04 +0000 Received: from mail-pf1-f196.google.com ([209.85.210.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j9N5b-0007xK-K6 for kernel-team@lists.ubuntu.com; Wed, 04 Mar 2020 06:01:03 +0000 Received: by mail-pf1-f196.google.com with SMTP id i13so405681pfe.3 for ; Tue, 03 Mar 2020 22:01:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=v9qrl3UuqPJuA3NsKfOkY4NA+3jX27RHCGYbcADR9qg=; b=AmEGaQajAQRKda+jvzCKgwhE0p41q22CPzmcbyvKxFVO1El5DUHOvvtNqyu4D3253p 9A/uHvuZ3aM2AEFAb9qc8UeVZxXDE4TzN25Ta0wlOCB5FaRCxKCmjmuZbipssi2Kktza t/JO+VSA3ac/dtvq/xSDzCBKyGnJseYo+KUNocOaKDs3fC+x2ikPMD8UxTNxRiCTO0kc n0fQEoavgqVmy2OCsqUsd/4TvDmGyxcqQszyxFSb1VD9cVq2H4+bK5yi0YCTzw+SSbSF Nd8EU8WhcAM7kq/AAqyTgHkdgty0kH2+KerN5hEYjnyZWJr+xQkDZ5Sog73SIsZmsgwH 8cLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=v9qrl3UuqPJuA3NsKfOkY4NA+3jX27RHCGYbcADR9qg=; b=ZIzzWO1clS0pCR4+fCZWpVh9K/CG6gGZr0UaW4H+tvFDFByh9mYy0uFqpSJ9dy8Hxr SJmUqhHAY9GH21DRneQXK2SMEQXeglarp6u7NutqddOr/1CZLM5FTgtXslfECifbEMDm 9jZ55pxGb7dPNCj+ybc+/jLLAQMi7wu46bD6tSgzmFXlkCrUpS9Z/l/Agce/M6G/7R5C ijCftNRTJFeknvUu7/Z7M+ixa6rcNZmFvW/ue0MfugRme4qbOz9DFGW0rbHnmd+3R2As T77qmYzJ/ngZc81NHkyg1RIoT5fvBh6iHvT8YE+ma+Edrcu42SEuzPKwA4w7oxGGA3XM ncZA== X-Gm-Message-State: ANhLgQ27pdNx7GaNxcqN8RjGVk8eis9SuT2aN358BBBXoCJS1bcpsLhS nRPfKRSuffK+IjA1P3QGMFafHXau X-Google-Smtp-Source: ADFU+vtGUV6a7T9Q5yl5gQV7D/bVKfVeDJwDTPvvKIz9hoNdMa5Yd3fAsmtbj6Y8RNsXvi/LKLUa5w== X-Received: by 2002:a63:d4d:: with SMTP id 13mr1097313pgn.376.1583301661667; Tue, 03 Mar 2020 22:01:01 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id na18sm881347pjb.9.2020.03.03.22.01.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Mar 2020 22:01:01 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/5][SRU][F] Revert "UBUNTU: SAUCE: drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED panel" Date: Wed, 4 Mar 2020 14:00:47 +0800 Message-Id: <20200304060055.5776-3-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200304060055.5776-1-acelan.kao@canonical.com> References: <20200304060055.5776-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1861521 This reverts commit 163215682f9be577adefacdc97ed3cd45af849e2. Signed-off-by: AceLan Kao --- drivers/gpu/drm/drm_dp_helper.c | 4 ---- drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++-------- include/drm/drm_dp_helper.h | 8 -------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index f1f14f4144e3..ffc68d305afe 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1260,10 +1260,6 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR) }, /* CH7511 seems to leave SINK_COUNT zeroed */ { OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false, BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) }, - /* Optional 4K AMOLED panel in the ThinkPad X1 Extreme 2nd Generation - * only supports DPCD backlight controls, despite advertising otherwise - */ - { OUI(0xba, 0x41, 0x59), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT) }, }; #undef OUI diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c index 3d61260b08ad..87b59db9ffe3 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -325,17 +325,11 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector) int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector) { struct intel_panel *panel = &intel_connector->panel; - struct intel_dp *intel_dp = - enc_to_intel_dp(&intel_connector->encoder->base); - struct drm_i915_private *dev_priv = - to_i915(intel_connector->base.dev); + struct drm_i915_private *dev_priv = to_i915(intel_connector->base.dev); if (i915_modparams.enable_dpcd_backlight == 0 || (i915_modparams.enable_dpcd_backlight == -1 && - dev_priv->vbt.backlight.type != - INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE && - !drm_dp_has_quirk(&intel_dp->desc, - DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT))) + dev_priv->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE)) return -ENODEV; if (!intel_dp_aux_display_control_capable(intel_connector)) diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index cd22d632fd74..8364502f92cf 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1434,14 +1434,6 @@ enum drm_dp_quirk { * The driver should ignore SINK_COUNT during detection. */ DP_DPCD_QUIRK_NO_SINK_COUNT, - /** - * @DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT: - * - * The device is telling the truth when it says that it uses DPCD - * backlight controls, even if the system's firmware disagrees. - * The driver should honor the DPCD backlight capabilities advertised. - */ - DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT, }; /** From patchwork Wed Mar 4 06:00:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1248827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EE9q99St; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XNY32ryBz9sSG; Wed, 4 Mar 2020 17:01:11 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1j9N5g-00080c-2S; Wed, 04 Mar 2020 06:01:08 +0000 Received: from mail-pf1-f196.google.com ([209.85.210.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j9N5d-0007yN-Hl for kernel-team@lists.ubuntu.com; Wed, 04 Mar 2020 06:01:05 +0000 Received: by mail-pf1-f196.google.com with SMTP id i13so405729pfe.3 for ; Tue, 03 Mar 2020 22:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=oltv2Sa3bAVne4d+iAFWfEf7+5VUtD9UGI1I/W8BZT8=; b=EE9q99StCb6b6pSyOyuZZzesJNshmknFiwUl20DRNzsQ26V4Mo5lnmLUTYmrgnpbLR v13ZtijTIXtXDko0VuxeSsDjgauU6zJcvDdFT+1ixxWCYBQjAgi1pZLs+lfdza7HEPVa +LTuxA6pjc4HVpnAU/vvgI8NDLuKbD5kBvaaMrp0kyCNVE1xLckBrm7EUSVeVSDwKvX+ J3rjIgqzScqMt+cbfNCDojE3WAji8bEhLAqhEM/RwIj141i/7uK/Ue17B8hibKNpfvWj d+TcsHf5N5v+bSs+c7/9e1lee3GUbbvsZwvWWfyyB3PWoEzCkaUf1L9JoUty2xmtHCmE OLSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=oltv2Sa3bAVne4d+iAFWfEf7+5VUtD9UGI1I/W8BZT8=; b=g2EeAVt1F6aPguzXlMHqg5tRannQSOdfHHRNUMNyTYbxVkP3//OgH2/T9K9ZlVWIYq 66lCsn/os9kU5iC3yc9tm0Tzhp2SZwal7+MdOsF/jFMFIJebcSfv/fIEfC3QIqFx6Q7V eKn13HQrkfJfenPBcJDfZ//3yKAqmcz7HSzp9MxFgg9H/YWN3rXsyc3oVfUYoX6odsHd WLEjAuMl5Ghh9zqlc2r6T+ynr5bxh3gRGRbkJ/YoWEK5UvuNPt2UnnHWzzoGqMdA+JYt moeNsQJ04nMGWIVX5Ry49KhifWbp29xr1fmMqR9QrfWYPWnWx28CiAdOShu2jDuLNT+0 1biQ== X-Gm-Message-State: ANhLgQ1utnBYCnaeawUqp/yu5MmT3YQF+YiYkpTy6/argKWIPL6wrqiP jcyk6/zmPDEZ5ZfZIJuB+bpCK6Uq X-Google-Smtp-Source: ADFU+vs7OnXoC7LEknYrb4I0bAUZ7Aki/eKcWJ1aHpMn8o0gKbqfjHfgDfoTeSN6JbxoBDdYQ+EzkA== X-Received: by 2002:a62:7bc5:: with SMTP id w188mr1547057pfc.207.1583301663642; Tue, 03 Mar 2020 22:01:03 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id 5sm14403524pfw.179.2020.03.03.22.01.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Mar 2020 22:01:03 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/5][SRU][F] drm/dp: Introduce EDID-based quirks Date: Wed, 4 Mar 2020 14:00:48 +0800 Message-Id: <20200304060055.5776-4-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200304060055.5776-1-acelan.kao@canonical.com> References: <20200304060055.5776-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Lyude Paul BugLink: https://bugs.launchpad.net/bugs/1861521 The whole point of using OUIs is so that we can recognize certain devices and potentially apply quirks for them. Normally this should work quite well, but there appears to be quite a number of laptop panels out there that will fill the OUI but not the device ID. As such, for devices like this I can't imagine it's a very good idea to try relying on OUIs for applying quirks. As well, some laptop vendors have confirmed to us that their panels have this exact issue. So, let's introduce the ability to apply DP quirks based on EDID identification. We reuse the same quirk bits for OUI-based quirks, so that callers can simply check all possible quirks using drm_dp_has_quirk(). Signed-off-by: Lyude Paul Cc: Jani Nikula (backported from https://patchwork.kernel.org/patch/11376663/) Signed-off-by: AceLan Kao --- drivers/gpu/drm/drm_dp_helper.c | 61 +++++++++++++++++++ .../drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 11 ++-- drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/display/intel_psr.c | 2 +- include/drm/drm_dp_helper.h | 11 +++- 6 files changed, 79 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..a5151b31fd35 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1302,6 +1302,67 @@ drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch) #undef DEVICE_ID_ANY #undef DEVICE_ID +struct edid_quirk { + u8 mfg_id[2]; + u8 prod_id[2]; + u32 quirks; +}; + +#define MFG(first, second) { (first), (second) } +#define PROD_ID(first, second) { (first), (second) } + +/* + * Some devices have unreliable OUIDs where they don't set the device ID + * correctly, and as a result we need to use the EDID for finding additional + * DP quirks in such cases. + */ +static const struct edid_quirk edid_quirk_list[] = { +}; + +#undef MFG +#undef PROD_ID + +/** + * drm_dp_get_edid_quirks() - Check the EDID of a DP device to find additional + * DP-specific quirks + * @edid: The EDID to check + * + * While OUIDs are meant to be used to recognize a DisplayPort device, a lot + * of manufacturers don't seem to like following standards and neglect to fill + * the dev-ID in, making it impossible to only use OUIDs for determining + * quirks in some cases. This function can be used to check the EDID and look + * up any additional DP quirks. The bits returned by this function correspond + * to the quirk bits in &drm_dp_quirk. + * + * Returns: a bitmask of quirks, if any. The driver can check this using + * drm_dp_has_quirk(). + */ +u32 drm_dp_get_edid_quirks(const struct edid *edid) +{ + const struct edid_quirk *quirk; + u32 quirks = 0; + int i; + + if (!edid) + return 0; + + for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) { + quirk = &edid_quirk_list[i]; + if (memcmp(quirk->mfg_id, edid->mfg_id, + sizeof(edid->mfg_id)) == 0 && + memcmp(quirk->prod_id, edid->prod_code, + sizeof(edid->prod_code)) == 0) + quirks |= quirk->quirks; + } + + DRM_DEBUG_KMS("DP sink: EDID mfg %*phD prod-ID %*phD quirks: 0x%04x\n", + (int)sizeof(edid->mfg_id), edid->mfg_id, + (int)sizeof(edid->prod_code), edid->prod_code, quirks); + + return quirks; +} +EXPORT_SYMBOL(drm_dp_get_edid_quirks); + /** * drm_dp_read_desc - read sink/branch descriptor from DPCD * @aux: DisplayPort AUX channel diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 10c5db93dc8a..58cacbddc02d 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1179,6 +1179,7 @@ struct intel_dp { int max_link_rate; /* sink or branch descriptor */ struct drm_dp_desc desc; + u32 edid_quirks; struct drm_dp_aux aux; u8 train_set[4]; int panel_power_up_delay; diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 4ab6531a4a74..88182210941d 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2251,7 +2251,7 @@ intel_dp_compute_config(struct intel_encoder *encoder, struct intel_connector *intel_connector = intel_dp->attached_connector; struct intel_digital_connector_state *intel_conn_state = to_intel_digital_connector_state(conn_state); - bool constant_n = drm_dp_has_quirk(&intel_dp->desc, + bool constant_n = drm_dp_has_quirk(&intel_dp->desc, 0, DP_DPCD_QUIRK_CONSTANT_N); int ret = 0, output_bpp; @@ -4327,7 +4327,8 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) * it don't care about read it here and in intel_edp_init_dpcd(). */ if (!intel_dp_is_edp(intel_dp) && - !drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_NO_SINK_COUNT)) { + !drm_dp_has_quirk(&intel_dp->desc, 0, + DP_DPCD_QUIRK_NO_SINK_COUNT)) { u8 count; ssize_t r; @@ -5328,6 +5329,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp) intel_dp->has_audio = drm_detect_monitor_audio(edid); drm_dp_cec_set_edid(&intel_dp->aux, edid); + intel_dp->edid_quirks = drm_dp_get_edid_quirks(edid); } static void @@ -5340,6 +5342,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) intel_connector->detect_edid = NULL; intel_dp->has_audio = false; + intel_dp->edid_quirks = 0; } static int @@ -7046,8 +7049,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, edid = drm_get_edid(connector, &intel_dp->aux.ddc); if (edid) { if (drm_add_edid_modes(connector, edid)) { - drm_connector_update_edid_property(connector, - edid); + drm_connector_update_edid_property(connector, edid); + intel_dp->edid_quirks = drm_dp_get_edid_quirks(edid); } else { kfree(edid); edid = ERR_PTR(-EINVAL); diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 74d45a0eecb8..98731f351216 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -50,7 +50,7 @@ static int intel_dp_mst_compute_link_config(struct intel_encoder *encoder, const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; void *port = connector->port; - bool constant_n = drm_dp_has_quirk(&intel_dp->desc, + bool constant_n = drm_dp_has_quirk(&intel_dp->desc, 0, DP_DPCD_QUIRK_CONSTANT_N); int bpp, slots = -EINVAL; diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 3bfb720560c2..e32adbbf4ee4 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -291,7 +291,7 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp) DRM_DEBUG_KMS("eDP panel supports PSR version %x\n", intel_dp->psr_dpcd[0]); - if (drm_dp_has_quirk(&intel_dp->desc, DP_DPCD_QUIRK_NO_PSR)) { + if (drm_dp_has_quirk(&intel_dp->desc, 0, DP_DPCD_QUIRK_NO_PSR)) { DRM_DEBUG_KMS("PSR support not currently available for this panel\n"); return; } diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 8364502f92cf..34c5d615e646 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1404,13 +1404,16 @@ struct drm_dp_desc { int drm_dp_read_desc(struct drm_dp_aux *aux, struct drm_dp_desc *desc, bool is_branch); +u32 drm_dp_get_edid_quirks(const struct edid *edid); /** * enum drm_dp_quirk - Display Port sink/branch device specific quirks * * Display Port sink and branch devices in the wild have a variety of bugs, try * to collect them here. The quirks are shared, but it's up to the drivers to - * implement workarounds for them. + * implement workarounds for them. Note that because some devices have + * unreliable OUIDs, the EDID of sinks should also be checked for quirks using + * drm_dp_get_edid_quirks(). */ enum drm_dp_quirk { /** @@ -1439,14 +1442,16 @@ enum drm_dp_quirk { /** * drm_dp_has_quirk() - does the DP device have a specific quirk * @desc: Device decriptor filled by drm_dp_read_desc() + * @edid_quirks: Optional quirk bitmask filled by drm_dp_get_edid_quirks() * @quirk: Quirk to query for * * Return true if DP device identified by @desc has @quirk. */ static inline bool -drm_dp_has_quirk(const struct drm_dp_desc *desc, enum drm_dp_quirk quirk) +drm_dp_has_quirk(const struct drm_dp_desc *desc, u32 edid_quirks, + enum drm_dp_quirk quirk) { - return desc->quirks & BIT(quirk); + return (desc->quirks | edid_quirks) & BIT(quirk); } #ifdef CONFIG_DRM_DP_CEC From patchwork Wed Mar 4 06:00:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1248828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lHpsqhh8; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XNY447z8z9sSJ; Wed, 4 Mar 2020 17:01:12 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1j9N5h-00081T-92; Wed, 04 Mar 2020 06:01:09 +0000 Received: from mail-pl1-f196.google.com ([209.85.214.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j9N5f-0007zq-Jo for kernel-team@lists.ubuntu.com; Wed, 04 Mar 2020 06:01:07 +0000 Received: by mail-pl1-f196.google.com with SMTP id b8so531532plx.4 for ; Tue, 03 Mar 2020 22:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=LrKmfsJJbvheQQot2I9T+P8L+E4WlR0fxLi608E+/CU=; b=lHpsqhh8ZWwsN870iGTjQ62r+TAOd78J09SHHmPwP6baR7cvP/FQiiApmUW2P++K1l n1n3YADepkwM8XYhuijMkvZ7/DqQvwM41nM4ay6pRMPfbsH62v4N76QGvfCXmE7s9Hfr lwvL61W8UyfiT0cL2AgmHAl42ToCHwO9W1q9IUTFaBxhlXuRdjnPnrPEicLudUnHTTbW 1oPGeXnLyECh5xwZwgqbBjB3C9QAKfhQdazCkEYDWMJNh5/VN6Xur+jRk8w+4JswqWWV jwhw/j/wJIHzyrRXCSuZIm8+mShH37wX5WHWmmzQkKBcmFFTQQm4bo1AsCyWLPAvrJ7g dq0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=LrKmfsJJbvheQQot2I9T+P8L+E4WlR0fxLi608E+/CU=; b=pMlART4DyBm1/TWksepFW8pSEBqpbi9tsXX6h4E5ca8XRHgmzGDW+EG1I0qGEmYTGK bB6KRPLwNfwk4aGtGFgnLGyI6X9VieCjynIxqduPvcCwCVY7YP8CfJ9Mu4VUzN6Hm3xt DQNuHhrlWGfN1q9DfJxEHZohvTHAg/egGTPusAQq+2Gux3CbvgdCBbqnv0h/dJH03EYJ STLJ2NdcG3JIgWy0wBrL7qq/fHZSvirgrWoCzLG2JNGm7gB9dYJkywocq2hapHqQ+dPt 4Cy4pUMSSoQ6pp5KeLv9lYKb/rDnNvGYbw2uwgacDGoH6jaFI1En38vS2k0678e/8MDO UPzw== X-Gm-Message-State: ANhLgQ0I+lGsWwIewVjXBAs7G8tT73KGNgBDdoMlDNDqAJ7cyfRF8NhA ppY7lFVrUD24KGEGzeeSWIYLiOWL X-Google-Smtp-Source: ADFU+vtG52aE8oNnVO28qaXCQujsLHtNiHcv8+unabNoGd30tZOTazESfOTu5Z9a7NqU0YrTrgdxjg== X-Received: by 2002:a17:902:44d:: with SMTP id 71mr1578017ple.95.1583301665573; Tue, 03 Mar 2020 22:01:05 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id 26sm1112549pjk.3.2020.03.03.22.01.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Mar 2020 22:01:05 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/5][SRU][F] drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED panel Date: Wed, 4 Mar 2020 14:00:49 +0800 Message-Id: <20200304060055.5776-5-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200304060055.5776-1-acelan.kao@canonical.com> References: <20200304060055.5776-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Lyude Paul BugLink: https://bugs.launchpad.net/bugs/1861521 The X1 Extreme is one of the systems that lies about which backlight interface that it uses in its VBIOS as PWM backlight controls don't work at all on this machine. It's possible that this panel could be one of the infamous ones that can switch between PWM mode and DPCD backlight control mode, but we haven't gotten any more details on this from Lenovo just yet. For the time being though, making sure the backlight 'just works' is a bit more important. So, add a quirk to force DPCD backlight controls on for these systems based on EDID (since this panel doesn't appear to fill in the device ID). Hopefully in the future we'll figure out a better way of probing this. Signed-off-by: Lyude Paul Cc: Jani Nikula (backported from https://patchwork.kernel.org/patch/11376671/) Signed-off-by: AceLan Kao --- drivers/gpu/drm/drm_dp_helper.c | 4 +++ .../drm/i915/display/intel_dp_aux_backlight.c | 25 ++++++++++++++++--- include/drm/drm_dp_helper.h | 10 ++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index a5151b31fd35..b49473bbb505 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1317,6 +1317,10 @@ struct edid_quirk { * DP quirks in such cases. */ static const struct edid_quirk edid_quirk_list[] = { + /* Optional 4K AMOLED panel in the ThinkPad X1 Extreme 2nd Generation + * only supports DPCD backlight controls + */ + { MFG(0x4c, 0x83), PROD_ID(0x41, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) }, }; #undef MFG diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c index 87b59db9ffe3..af6ee93aaed4 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -325,15 +325,32 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector) int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector) { struct intel_panel *panel = &intel_connector->panel; - struct drm_i915_private *dev_priv = to_i915(intel_connector->base.dev); + struct intel_dp *intel_dp = enc_to_intel_dp(&intel_connector->encoder->base); + struct drm_device *dev = intel_connector->base.dev; + struct drm_i915_private *dev_priv = to_i915(dev); if (i915_modparams.enable_dpcd_backlight == 0 || - (i915_modparams.enable_dpcd_backlight == -1 && - dev_priv->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE)) + !intel_dp_aux_display_control_capable(intel_connector)) return -ENODEV; - if (!intel_dp_aux_display_control_capable(intel_connector)) + /* + * There are a lot of machines that don't advertise the backlight + * control interface to use properly in their VBIOS, :\ + */ + if (dev_priv->vbt.backlight.type != + INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE && + !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks, + DP_QUIRK_FORCE_DPCD_BACKLIGHT)) { + DRM_DEV_INFO(dev->dev, + "Panel advertises DPCD backlight support, but " + "VBT disagrees. If your backlight controls " + "don't work try booting with " + "i915.enable_dpcd_backlight=1. If your machine " + "needs this, please file a _new_ bug report on " + "bugs.freedesktop.org against DRI -> " + "DRM/Intel\n"); return -ENODEV; + } panel->backlight.setup = intel_dp_aux_setup_backlight; panel->backlight.enable = intel_dp_aux_enable_backlight; diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 34c5d615e646..5bcb3f7d5d8e 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1437,6 +1437,16 @@ enum drm_dp_quirk { * The driver should ignore SINK_COUNT during detection. */ DP_DPCD_QUIRK_NO_SINK_COUNT, + /** + * @DP_QUIRK_FORCE_DPCD_BACKLIGHT: + * + * The device is telling the truth when it says that it uses DPCD + * backlight controls, even if the system's firmware disagrees. This + * quirk should be checked against both the ident and panel EDID. + * When present, the driver should honor the DPCD backlight + * capabilities advertised. + */ + DP_QUIRK_FORCE_DPCD_BACKLIGHT, }; /** From patchwork Wed Mar 4 06:00:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1248829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NdOQ9acb; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XNY938Ylz9sQt; Wed, 4 Mar 2020 17:01:17 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1j9N5l-000852-I7; Wed, 04 Mar 2020 06:01:13 +0000 Received: from mail-pj1-f65.google.com ([209.85.216.65]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1j9N5h-00081E-MH for kernel-team@lists.ubuntu.com; Wed, 04 Mar 2020 06:01:09 +0000 Received: by mail-pj1-f65.google.com with SMTP id cx7so424534pjb.3 for ; Tue, 03 Mar 2020 22:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=oXxbXo0PwiOep7Upzd/LOOxEkFatSD/aWricKXXhRy8=; b=NdOQ9acbRVNco/dkEJ/xvCU1F3Qdc8LNeDfnNahfjdqm7gwy8uvK1GUp3rffrthDvK L0LjJBjHHEp5tEcb5vUov6j4sLanfUNaU7mNR/dpA5wnsnyX2H4OJTDTkV72qsmsfUBs g1z/Nf2KTxaU/BFe0mD9KqBm3eNLbo8A5jXF2GFUO8Sb7FqNu9Pif9pJafLZV4xDFKxU iXoGt+6RgibppY95NwtYjmDbDUDE9rjLRUibeD+F5g4FyDVDFXDKsOdaSCbDpJzUA9Hy lhUAujdP8vOrQ8Gh0iH22cX+lG06axuF0Ugr1ONvARYvonqS7OZw0wz1lsGp9LNTyDep YhRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=oXxbXo0PwiOep7Upzd/LOOxEkFatSD/aWricKXXhRy8=; b=XDGtyk8UgsG1FIcXpqc+/btZIkZVjuJDpxZEzxv7NU99A6LFCQhvKHEgmhRhELbSoZ pmi0lQ7eJg2XMlhdK3gNdOH8AN9UHt0s6H7kNIdGXsyWf7DOsquXfZsZZMVeC64NSROZ Smfun5EIRDwVeWWd/OvcGBnUu1nFjAItqS3P7jx+UT4W62qW5xaPUWmmiTXBmjhCVKpu vbAfdtmz2/wJ717HUsOqBBDZUwUkcwADmUyF0XxQvJ6GQLIcw7LzBNBWNzTRGLFNcW6t ZYrO9H6guAWxLfcegynLSWMHiCNSAKxkZaRemKYIPte5ceUGQiaQ3IavD5OkmWeFSwin gn+Q== X-Gm-Message-State: ANhLgQ3Sh5kGkAZjMpJRjJm53uVQmumfuVTHJCX8mZD20kuQwCrywVYU 052OszzjmXM9f3NDBoSJp8T+ctEH X-Google-Smtp-Source: ADFU+vt1t0JuluPp7jmLOXfvuyBagF27jG/e0b7uDRHp9XKPKUau0gTRJLIK9r5eJpryCnSzijcMQA== X-Received: by 2002:a17:902:6809:: with SMTP id h9mr1613191plk.32.1583301667483; Tue, 03 Mar 2020 22:01:07 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id u7sm26129246pfh.128.2020.03.03.22.01.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Mar 2020 22:01:06 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/5][SRU][F] drm/i915: Force DPCD backlight mode for some Dell CML 2020 panels Date: Wed, 4 Mar 2020 14:00:50 +0800 Message-Id: <20200304060055.5776-6-acelan.kao@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200304060055.5776-1-acelan.kao@canonical.com> References: <20200304060055.5776-1-acelan.kao@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Lyude Paul BugLink: https://bugs.launchpad.net/bugs/1861521 According to Dell, trying to match their panels via OUI is not reliable enough and we've been told that we should check against the EDID instead. As well, Dell seems to have some panels that are actually intended to switch between using PWM for backlight controls and DPCD for backlight controls depending on whether or not the panel is in HDR or SDR mode. Yikes. Regardless, we need to add quirks for these so that DPCD backlight controls get enabled by default, since without additional driver support that's the only form of brightness control that will work. Hopefully in the future we can remove these quirks once we have a better way of probing for this. Changes since v1: * Add one more EDID per Dell's request * Remove model number (which is possibly wrong) and replace with Dell CML 2020 systems Signed-off-by: Lyude Paul Cc: Jani Nikula (backported from https://patchwork.kernel.org/patch/11376665/) Signed-off-by: AceLan Kao --- drivers/gpu/drm/drm_dp_helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index b49473bbb505..4b2f6a1b140d 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1321,6 +1321,20 @@ static const struct edid_quirk edid_quirk_list[] = { * only supports DPCD backlight controls */ { MFG(0x4c, 0x83), PROD_ID(0x41, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) }, + /* + * Some Dell CML 2020 systems have panels support both AUX and PWM + * backlight control, and some only support AUX backlight control. All + * said panels start up in AUX mode by default, and we don't have any + * support for disabling HDR mode on these panels which would be + * required to switch to PWM backlight control mode (plus, I'm not + * even sure we want PWM backlight controls over DPCD backlight + * controls anyway...). Until we have a better way of detecting these, + * force DPCD backlight mode on all of them. + */ + { MFG(0x06, 0xaf), PROD_ID(0x9b, 0x32), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) }, + { MFG(0x06, 0xaf), PROD_ID(0xeb, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) }, + { MFG(0x4d, 0x10), PROD_ID(0xc7, 0x14), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) }, + { MFG(0x4d, 0x10), PROD_ID(0xe6, 0x14), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) }, }; #undef MFG