Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp23944ybc; Fri, 22 Nov 2019 15:21:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxp4/KjMcK4JfApRMTTrhP/28HHQ+Z4ZqJPOAJSRCPVoreSjBDfqw63Ksd2mKLn8DmMarKy X-Received: by 2002:a50:9f65:: with SMTP id b92mr4410015edf.63.1574464884718; Fri, 22 Nov 2019 15:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574464884; cv=none; d=google.com; s=arc-20160816; b=gLhq3sUTxdCUOj7DAsl+AhcdLWyXB3DhRy+58nVrpCP6HSTfboE3V7ECjJZgLJZ38p vNXsQnRkYrQEJyLA9yYsM59n/VNrMj+Uz2tLSFX2b44TZpMBQdfgLtWwwRqRL2rGeDXJ xINTPR7RyhsUzp1MhXUOrbg2V9oWZeOJhUj4xlpqEcf0sYmd4f7KWz6fywIAQpo1HXOR dmZccOtB/vnhHRscvchHYgAi+rbaWelWjE3t2S8nvKN9R8PEDzv8E+otCaFQU0nl4R3j tZe5kTa+VuzrJAWW6rsPTZ+TF+BvRuSKxkssYJlwvkMU7NaGR26lYgKtARbm56zFK4uQ cTTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7312nuaCf2oM+T3c7efGgGdfgGSQaSpW7hnjMJf3528=; b=o9emRL5m0Z/bxNWQ4iBkD9MpNHGdwCPhL+s1bucc8dk153Q6kBy3mLBUilYlkRC6vb Pj29pOKu8+dkp9tLCs89JLwsfGw+4ov16qffsWrM55cfnAo3b0ylYXszrCjQThrM1HZX f9yytIFymswnFqM3B5cgALjJfue/SwqhrbHcHYgpdG32FRvr5lXeAvf14dczEy+trYNG lNgJfzCMg4dJr4UQgYqxfAwAN65TScALoq++NDxeJsgCInkRX6qyfRcM0pQtyDzfcfBN Pl1qCBENA4F+uvGSfrlJbz6zSnrr3KREB/eUMDD3s0iwWBEHeEIWTfMYP0kHhMVqXnG0 PI1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BqiJd8gC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si7502924edt.143.2019.11.22.15.21.00; Fri, 22 Nov 2019 15:21:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BqiJd8gC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbfKVXQ5 (ORCPT + 99 others); Fri, 22 Nov 2019 18:16:57 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:42756 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726895AbfKVXQ4 (ORCPT ); Fri, 22 Nov 2019 18:16:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574464615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7312nuaCf2oM+T3c7efGgGdfgGSQaSpW7hnjMJf3528=; b=BqiJd8gCqfa7QzHSjgG9AhNMlpYx3LuJ7HHyl4A1rTqy3jl13WNZzIXmg5d2fm6Tih4IbU hnLfuixm1FT0w4JraWZeBZtBgp8FCeE0YLIIUPuU8XD7TjlJVYkf40cImLX7mGxLSXAiVI iC3+5FgVcpznoqDkmqR6SwmxLLunXIA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-PaXPggKFOBmZIAzBidVXRw-1; Fri, 22 Nov 2019 18:16:53 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EC31100726A; Fri, 22 Nov 2019 23:16:51 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-34.bss.redhat.com [10.20.1.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30FEC19C4F; Fri, 22 Nov 2019 23:16:50 +0000 (UTC) From: Lyude Paul To: intel-gfx@lists.freedesktop.org Cc: Maarten Lankhorst , Maxime Ripard , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Chris Wilson , Lee Shawn C , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED panel Date: Fri, 22 Nov 2019 18:16:03 -0500 Message-Id: <20191122231616.2574-6-lyude@redhat.com> In-Reply-To: <20191122231616.2574-1-lyude@redhat.com> References: <20191122231616.2574-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: PaXPggKFOBmZIAzBidVXRw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Annoyingly, the VBT on the ThinkPad X1 Extreme 2nd Gen indicates that the system uses plain PWM based backlight controls, when in reality the only backlight controls that work are the standard VESA eDP DPCD backlight controls. Honestly, this makes me wonder how many other systems have these issues or lie about this in their VBT. Not sure we have any good way of finding out until panels like this become more common place in the laptop market. For now, just add a DRM DP quirk to indicate that this panel is telling the truth and is being a good LCD. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3D112376 Signed-off-by: Lyude Paul --- 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, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helpe= r.c index 2c7870aef469..ec7061e3a99b 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1155,6 +1155,10 @@ static const struct dpcd_quirk dpcd_quirk_list[] =3D= { =09{ OUI(0x00, 0x10, 0xfa), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_NO_PSR= ) }, =09/* CH7511 seems to leave SINK_COUNT zeroed */ =09{ OUI(0x00, 0x00, 0x00), DEVICE_ID('C', 'H', '7', '5', '1', '1'), false= , BIT(DP_DPCD_QUIRK_NO_SINK_COUNT) }, +=09/* Optional 4K AMOLED panel in the ThinkPad X1 Extreme 2nd Generation +=09 * only supports DPCD backlight controls, despite advertising otherwise +=09 */ +=09{ OUI(0xba, 0x41, 0x59), DEVICE_ID_ANY, false, BIT(DP_DPCD_QUIRK_FORCE_= DPCD_BACKLIGHT) }, }; =20 #undef OUI diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/driver= s/gpu/drm/i915/display/intel_dp_aux_backlight.c index 87b59db9ffe3..3d61260b08ad 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -325,11 +325,17 @@ intel_dp_aux_display_control_capable(struct intel_con= nector *connector) int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connec= tor) { =09struct intel_panel *panel =3D &intel_connector->panel; -=09struct drm_i915_private *dev_priv =3D to_i915(intel_connector->base.dev= ); +=09struct intel_dp *intel_dp =3D +=09=09enc_to_intel_dp(&intel_connector->encoder->base); +=09struct drm_i915_private *dev_priv =3D +=09=09to_i915(intel_connector->base.dev); =20 =09if (i915_modparams.enable_dpcd_backlight =3D=3D 0 || =09 (i915_modparams.enable_dpcd_backlight =3D=3D -1 && -=09 dev_priv->vbt.backlight.type !=3D INTEL_BACKLIGHT_VESA_EDP_AUX_INTE= RFACE)) +=09 dev_priv->vbt.backlight.type !=3D +=09=09 INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE && +=09 !drm_dp_has_quirk(&intel_dp->desc, +=09=09=09 DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT))) =09=09return -ENODEV; =20 =09if (!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 51ecb5112ef8..a444209cd54b 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1520,6 +1520,14 @@ enum drm_dp_quirk { =09 * The driver should ignore SINK_COUNT during detection. =09 */ =09DP_DPCD_QUIRK_NO_SINK_COUNT, +=09/** +=09 * @DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT: +=09 * +=09 * The device is telling the truth when it says that it uses DPCD +=09 * backlight controls, even if the system's firmware disagrees. +=09 * The driver should honor the DPCD backlight capabilities advertised. +=09 */ +=09DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT, }; =20 /** --=20 2.21.0