]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
UBUNTU: SAUCE: drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED...
authorLyude Paul <lyude@redhat.com>
Thu, 12 Dec 2019 09:07:43 +0000 (17:07 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 16 Dec 2019 19:33:31 +0000 (13:33 -0600)
BugLink: https://bugs.launchpad.net/bugs/1856134
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=112376
Signed-off-by: Lyude Paul <lyude@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
(backported from https://patchwork.freedesktop.org/patch/342166/?series=69914&rev=4)
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/gpu/drm/drm_dp_helper.c
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
include/drm/drm_dp_helper.h

index ffc68d305afe434c01cdaad5cad87969ac49b07c..f1f14f4144e35b1ac2a00ad17100311a22bf82db 100644 (file)
@@ -1260,6 +1260,10 @@ 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
index 87b59db9ffe3e2f729d92fa1a8e318688a91914b..3d61260b08adab89eca1563968a3b7d183e6fd81 100644 (file)
@@ -325,11 +325,17 @@ 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_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))
+            dev_priv->vbt.backlight.type !=
+                    INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
+            !drm_dp_has_quirk(&intel_dp->desc,
+                              DP_DPCD_QUIRK_FORCE_DPCD_BACKLIGHT)))
                return -ENODEV;
 
        if (!intel_dp_aux_display_control_capable(intel_connector))
index 8364502f92cfe4545ea94cef2e9568b3afbd06e7..cd22d632fd7492eae6c659c0e9955c7e2d54df1d 100644 (file)
@@ -1434,6 +1434,14 @@ 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,
 };
 
 /**