]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Force PWM backlight on Lenovo Legion 5 15ARH05
authorAlessandro Rinaldi <ale@alerinaldi.it>
Fri, 26 Jun 2026 14:36:00 +0000 (16:36 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 17 Jul 2026 21:41:15 +0000 (17:41 -0400)
The Lenovo Legion 5 15ARH05 (Renoir) ships a BOE 0x08DF eDP panel that
advertises AUX/DPCD backlight control, so amdgpu's automatic detection
(amdgpu_backlight == -1) selects AUX. On this panel the AUX backlight
path has no effect: brightness writes are accepted but the panel level
never changes, the display is stuck at a fixed brightness and
max_brightness is reported as a bogus 511000. As a result neither the
desktop brightness slider nor the brightness hotkeys do anything.

Forcing PWM backlight (amdgpu.backlight=0) restores working control:
max_brightness becomes 65535 and the level tracks writes. This has long
been applied by users as a manual kernel-parameter workaround.

Extend the generic panel backlight quirk with a force_pwm flag, add an
entry for the Legion 5 15ARH05 / BOE 0x08DF panel, and have amdgpu
disable AUX backlight (use PWM) when the quirk matches and the user
lets the driver auto-select the backlight type.

Signed-off-by: Alessandro Rinaldi <ale@alerinaldi.it>
Tested-by: Alessandro Rinaldi <ale@alerinaldi.it>
Reviewed-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 81b39f43e7e53589491e2eef6bad5389626b4b9c)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/drm_panel_backlight_quirks.c
include/drm/drm_utils.h

index fe6eea28d1192ae846d3607bad7d120b1237bc71..6210a1ff7cc2a882398a81e45f98b94b1d05df11 100644 (file)
@@ -4069,6 +4069,8 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
        caps->ext_caps = &aconnector->dc_link->dpcd_sink_ext_caps;
        caps->aux_support = false;
 
+       panel_backlight_quirk = drm_get_panel_backlight_quirk(aconnector->drm_edid);
+
        if (caps->ext_caps->bits.oled == 1
            /*
             * ||
@@ -4081,6 +4083,9 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
                caps->aux_support = false;
        else if (amdgpu_backlight == 1)
                caps->aux_support = true;
+       else if (!IS_ERR_OR_NULL(panel_backlight_quirk) &&
+                panel_backlight_quirk->force_pwm)
+               caps->aux_support = false;
        if (caps->aux_support)
                aconnector->dc_link->backlight_control_type = BACKLIGHT_CONTROL_AMD_AUX;
 
@@ -4096,8 +4101,6 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
        else
                caps->aux_min_input_signal = 1;
 
-       panel_backlight_quirk =
-               drm_get_panel_backlight_quirk(aconnector->drm_edid);
        if (!IS_ERR_OR_NULL(panel_backlight_quirk)) {
                if (panel_backlight_quirk->min_brightness) {
                        caps->min_input_signal =
index f85cb293a3dbc877ac08e7f80e3bfd841c8dfa7e..e417c7533053d2fedc48a1a7857697171ed5ec29 100644 (file)
@@ -20,6 +20,15 @@ struct drm_get_panel_backlight_quirk {
 };
 
 static const struct drm_get_panel_backlight_quirk drm_panel_min_backlight_quirks[] = {
+       /* Lenovo Legion 5 15ARH05, AUX backlight non-functional, force PWM */
+       {
+               .dmi_match.field = DMI_SYS_VENDOR,
+               .dmi_match.value = "LENOVO",
+               .dmi_match_other.field = DMI_PRODUCT_VERSION,
+               .dmi_match_other.value = "Lenovo Legion 5 15ARH05",
+               .ident.panel_id = drm_edid_encode_panel_id('B', 'O', 'E', 0x08df),
+               .quirk = { .force_pwm = true, },
+       },
        /* 13 inch matte panel */
        {
                .dmi_match.field = DMI_BOARD_VENDOR,
index 6a46f755daba0d22b1097033db1c332373b2715d..7e077484c5bbfc1c04a31d9f83bcab1bc1613d62 100644 (file)
@@ -19,6 +19,7 @@ int drm_get_panel_orientation_quirk(int width, int height);
 struct drm_panel_backlight_quirk {
        u16 min_brightness;
        u32 brightness_mask;
+       bool force_pwm;
 };
 
 const struct drm_panel_backlight_quirk *