drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
PATCH 1/1 drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
Commit 102d44b3a8fa ("drm/i915/backlight: Fix VESA backlight possible check condition") restricted the VESA backlight path to fully AUX-based panels (enable and adjustment both via AUX), on the grounds that the hybrid configurations are not currently supported.
The hybrid pin-enable + AUX-adjustment configuration is however already
handled: intel_dp_aux_vesa_enable_backlight() falls back to the PWM funcs for enable when info.aux_enable is unset, and drm_edp_backlight_init() supports aux_set without aux_enable.
At least one panel requires this configuration to work at all: the Tianma Y156ZAN02.0 in the Google Pixel Slate (nocturne) advertises DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP but not DP_EDP_BACKLIGHT_AUX_ENABLE_CAP (DP_EDP_GENERAL_CAP_1 = 0xfb, DP_EDP_BACKLIGHT_ADJUSTMENT_CAP = 0xff). The panel ignores the PWM pin for brightness adjustment, and resets its AUX brightness register (DP_EDP_BACKLIGHT_BRIGHTNESS_MSB/LSB) to 0 whenever panel power is cycled. With the PWM backlight funcs selected, the panel comes back black after every suspend/resume or DPMS off/on cycle while all driver-visible state (link training, PPS, PWM duty) looks healthy. Firmware rewrites the register at boot, which masks the problem until the first runtime panel power cycle.
Allow the hybrid configuration by requiring only AUX brightness adjustment capability; backlight enable keeps using the pin/PWM path via the existing fallback.
Tested on the Google Pixel Slate (KBL-Y) on 7.1.4: i915 now selects the VESA AUX backlight interface, the panel's AUX brightness register is restored across suspend/resume, and brightness control works over the full range where it previously had no effect.
--- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +8 -4
@@ -616,11 +616,15 @@ check_if_vesa_backlight_possible(struct intel_dp *intel_dp)u8 bit_min, bit_max;/* -* Since we only support Fully AUX Based VESA Backlight interface make sure -* backlight enable is possible via AUX along with backlight adjustment +* Brightness adjustment must be possible via AUX. Backlight *enable* +* may come either via AUX (DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) or via the +* BL_ENABLE pin, which the VESA backlight code already supports by +* falling back to the PWM funcs for enable when aux_enable is not set. +* Some panels (e.g. Tianma Y156ZAN02.0 in the Google Pixel Slate) +* support only that hybrid configuration and ignore the PWM pin for +* brightness adjustment. */ -if (!(intel_dp->edp_dpcd[1 ] &DP_EDP_BACKLIGHT_AUX_ENABLE_CAP && - intel_dp->edp_dpcd[2 ] &DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP )) +if (!(intel_dp->edp_dpcd[2 ] &DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP ))return false; ret =drm_dp_dpcd_read_byte (&intel_dp->aux,DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN , &bit_min);
Signature · 1 line
2.47.3
Quoted 36 lines
Subject: [PATCH] drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
Commit
102d44b3a8fa("drm/i915/backlight: Fix VESA backlight possible check condition") restricted the VESA backlight path to fully AUX-based panels (enable and adjustment both via AUX), on the grounds that the hybrid configurations are not currently supported.The hybrid pin-enable + AUX-adjustment configuration is however already
handled:intel_dp_aux_vesa_enable_backlight()falls back to the PWM funcs for enable when info.aux_enable is unset, anddrm_edp_backlight_init()supportsaux_setwithoutaux_enable.At least one panel requires this configuration to work at all: the Tianma Y156ZAN02.0 in the Google Pixel Slate (nocturne) advertises
DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAPbut notDP_EDP_BACKLIGHT_AUX_ENABLE_CAP(DP_EDP_GENERAL_CAP_1=0xfb,DP_EDP_BACKLIGHT_ADJUSTMENT_CAP=0xff). The panel ignores the PWM pin for brightness adjustment, and resets its AUX brightness register (DP_EDP_BACKLIGHT_BRIGHTNESS_MSB/LSB) to 0 whenever panel power is cycled. With the PWM backlight funcs selected, the panel comes back black after every suspend/resume or DPMS off/on cycle while all driver-visible state (link training, PPS, PWM duty) looks healthy.
Firmware rewrites the register at boot, which masks the problem until the first runtime panel power cycle.Allow the hybrid configuration by requiring only AUX brightness adjustment capability; backlight enable keeps using the pin/PWM path via the existing fallback.
Tested on the Google Pixel Slate (KBL-Y) on 7.1.4: i915 now selects the VESA AUX backlight interface, the panel's AUX brightness register is restored across suspend/resume, and brightness control works over the full range where it previously had no effect.
Quoted 6 lines
Fixes 102d44b3a8fa ("drm/i915/backlight: Fix VESA backlight possible checkcondition")
Cc Suraj Kandpal <[email protected]>Signed-off-by John Foushee <[email protected]>
Hi John this fix has been already floated, reviewed and merged some days ago to drm-intel-next.
https://patchwork.freedesktop.org/series/170522/
Regards,
Suraj Kandpal
Quoted 38 lines
--- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0
-1@@ -616,11 +616,15 @@ check_if_vesa_backlight_possible(struct intel_dp *intel_dp)u8 bit_min, bit_max;/* -* Since we only support Fully AUX Based VESA Backlight interface make sure
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2
-1-* backlight enable is possible via AUX along with backlight adjustment +* Brightness adjustment must be possible via AUX. Backlight *enable* +* may come either via AUX (DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) or via the
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5
-1+* BL_ENABLE pin, which the VESA backlight code already supports by +* falling back to the PWM funcs for enable when aux_enable is not set. +* Some panels (e.g. Tianma Y156ZAN02.0 in the Google Pixel Slate) +* support only that hybrid configuration and ignore the PWM pin for +* brightness adjustment. */ - if (!(intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP&&
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0
-1- intel_dp->edp_dpcd[2] &
DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP))drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2
-0+if (!(intel_dp->edp_dpcd[2 ] & +DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP ))return false; ret = drm_dp_dpcd_read_byte(&intel_dp->aux,
DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN,&bit_min);
--
2.47.3
John Foushee
Tested-byQuoted 4 lines
Hi John this fix has been already floated, reviewed and merged some days ago to drm-intel-next.
Thanks, glad it's fixed, and happy to see the same conclusion; please disregard my patch.
For the record: independently root-caused and tested the same change on a Google Pixel Slate (nocturne, Tianma Y156ZAN02.0: advertises BRIGHTNESS_AUX_SET_CAP without AUX_ENABLE_CAP, ignores PWM for brightness, and resets the AUX brightness register on every panel power cycle, so it resumes from suspend to a permanently black screen without this fix). With the equivalent change on 7.1.4 the panel's AUX brightness register is restored across suspend/resume and full-range brightness control works, so feel free to count that as a
for commit 7d594b24 on real affected hardware.
One question: the regression (ed8be780bdbc upstream / 102d44b3a8fa in mainline) is present in the shipping 7.1.x stable series, but 7d594b24 doesn't carry Cc: stable. Will the Fixes: tag be enough for it to be picked up for 7.1.x/7.2.x, or should it be nominated to stable explicitly? Affected devices are unusable after any suspend without it, so a backport would matter to users on current stable kernels.
Diagnosis details, DPCD dumps and EDID, if useful:
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/16679
Thanks,
John
Quoted 90 lines · Suraj
Quoted 37 lines
Subject: [PATCH] drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
Commit
102d44b3a8fa("drm/i915/backlight: Fix VESA backlight possible check condition") restricted the VESA backlight path to fully AUX-based panels (enable and adjustment both via AUX), on the grounds that the hybrid configurations are not currently supported.The hybrid pin-enable + AUX-adjustment configuration is however already
handled:intel_dp_aux_vesa_enable_backlight()falls back to the PWM funcs for enable when info.aux_enable is unset, anddrm_edp_backlight_init()supportsaux_setwithoutaux_enable.At least one panel requires this configuration to work at all: the Tianma Y156ZAN02.0 in the Google Pixel Slate (nocturne) advertises
DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAPbut notDP_EDP_BACKLIGHT_AUX_ENABLE_CAP(DP_EDP_GENERAL_CAP_1=0xfb,DP_EDP_BACKLIGHT_ADJUSTMENT_CAP=0xff). The panel ignores the PWM pin for brightness adjustment, and resets its AUX brightness register (DP_EDP_BACKLIGHT_BRIGHTNESS_MSB/LSB) to 0 whenever panel power is cycled. With the PWM backlight funcs selected, the panel comes back black after every suspend/resume or DPMS off/on cycle while all driver-visible state (link training, PPS, PWM duty) looks healthy.
Firmware rewrites the register at boot, which masks the problem until the first runtime panel power cycle.Allow the hybrid configuration by requiring only AUX brightness adjustment capability; backlight enable keeps using the pin/PWM path via the existing fallback.
Tested on the Google Pixel Slate (KBL-Y) on 7.1.4: i915 now selects the VESA AUX backlight interface, the panel's AUX brightness register is restored across suspend/resume, and brightness control works over the full range where it previously had no effect.
Quoted 6 lines
Fixes 102d44b3a8fa ("drm/i915/backlight: Fix VESA backlight possible checkcondition")
Cc Suraj Kandpal <[email protected]>Signed-off-by John Foushee <[email protected]>Hi John this fix has been already floated, reviewed and merged some days ago to drm-intel-next.
https://patchwork.freedesktop.org/series/170522/
Regards,
Suraj KandpalQuoted 38 lines
--- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0
-1@@ -616,11 +616,15 @@ check_if_vesa_backlight_possible(struct intel_dp *intel_dp)u8 bit_min, bit_max;/* -* Since we only support Fully AUX Based VESA Backlight interface make sure
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2
-1-* backlight enable is possible via AUX along with backlight adjustment +* Brightness adjustment must be possible via AUX. Backlight *enable* +* may come either via AUX (DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) or via the
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5
-1+* BL_ENABLE pin, which the VESA backlight code already supports by +* falling back to the PWM funcs for enable when aux_enable is not set. +* Some panels (e.g. Tianma Y156ZAN02.0 in the Google Pixel Slate) +* support only that hybrid configuration and ignore the PWM pin for +* brightness adjustment. */ - if (!(intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP&&
- intel_dp->edp_dpcd[2] &DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP))drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2
-0+if (!(intel_dp->edp_dpcd[2 ] & +DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP ))return false; ret = drm_dp_dpcd_read_byte(&intel_dp->aux,
DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN,&bit_min);
--
2.47.3
Signature · 1 line
@foush
Quoted 11 lines
Subject: Re: [PATCH] drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
Quoted 4 lines
Hi John this fix has been already floated, reviewed and merged some days ago to drm-intel-next.
Thanks, glad it's fixed, and happy to see the same conclusion; please disregard my patch.
Quoted 9 lines
For the record: independently root-caused and tested the same change on a Google Pixel Slate (nocturne, Tianma Y156ZAN02.0: advertises
BRIGHTNESS_AUX_SET_CAPwithoutAUX_ENABLE_CAP, ignores PWM for brightness, and resets the AUX brightness register on every panel power cycle, so it resumes from suspend to a permanently black screen without this fix). With the equivalent change on 7.1.4 the panel's AUX brightness register is restored across suspend/resume and full-range brightness control works, so feel free to count that as a
Hi Thanks for the patch, yes I had a lot of gitlab from panels that don’t have a PWM fallback which led to this same fix.
Quoted 10 lines
Tested-by John Foushee <[email protected]>for commit
7d594b24on real affected hardware.One question: the regression (
ed8be780bdbcupstream /102d44b3a8fain mainline) is present in the shipping 7.1.x stable series, but7d594b24doesn't carry Cc: stable. Will the Fixes: tag be enough for it to be picked up for 7.1.x/7.2.x, or should it be nominated to stable explicitly? Affected devices are unusable after any suspend without it, so a backport would matter to users on current stable kernels.
Yes I just Cc'ed them so that it gets picked up. Added you in it too.
Regards,
Suraj Kandpal
Quoted 115 lines
Diagnosis details, DPCD dumps and EDID, if useful:
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/16679Thanks,
JohnQuoted 17 lines · Suraj
Quoted 17 lines
Subject: [PATCH] drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
Commit
102d44b3a8fa("drm/i915/backlight: Fix VESA backlight possible check
condition") restricted the VESA backlight path to fully AUX-based panels (enable and adjustment both via AUX), on the grounds that the hybrid configurations are not currently supported.The hybrid pin-enable + AUX-adjustment configuration is however already
handled:intel_dp_aux_vesa_enable_backlight()falls back to the PWM funcs for enable when info.aux_enable is unset, anddrm_edp_backlight_init()supportsaux_setwithoutaux_enable.Quoted 6 lines
Quoted 6 lines
At least one panel requires this configuration to work at all: the Tianma
Y156ZAN02.0 in the Google Pixel Slate (nocturne) advertisesDP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAPbut notDP_EDP_BACKLIGHT_AUX_ENABLE_CAP(DP_EDP_GENERAL_CAP_1=0xfb,DP_EDP_BACKLIGHT_ADJUSTMENT_CAP=0xff). The panel ignores thePWM
Quoted 3 lines
Quoted 3 lines
pin for brightness adjustment, and resets its AUX brightness register
(DP_EDP_BACKLIGHT_BRIGHTNESS_MSB/LSB) to 0 whenever panel poweris
Quoted 24 lines
Quoted 15 lines
cycled. With the PWM backlight funcs selected, the panel comes back black after every suspend/resume or DPMS off/on cycle while all driver-visible state (link training, PPS, PWM duty) looks healthy. Firmware rewrites the register at boot, which masks the problem until the first runtime panel power cycle.
Allow the hybrid configuration by requiring only AUX brightness adjustment capability; backlight enable keeps using the pin/PWM path via the existing fallback.
Tested on the Google Pixel Slate (KBL-Y) on 7.1.4: i915 now selects the VESA AUX backlight interface, the panel's AUX brightness register is restored across suspend/resume, and brightness control works over the full range where it previously had no effect.
Quoted 8 lines
Fixes 102d44b3a8fa ("drm/i915/backlight: Fix VESA backlightpossible check
condition")
Closes:
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/16679Cc Suraj Kandpal <[email protected]>Signed-off-by John Foushee <[email protected]>Quoted 1 line
Hi John this fix has been already floated, reviewed and merged some days
ago to drm-intel-next.
Quoted 41 lines
https://patchwork.freedesktop.org/series/170522/
Regards,
Suraj KandpalQuoted 35 lines
--- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0
-0@@ -616,11 +616,15 @@ check_if_vesa_backlight_possible(struct
intel_dp*intel_dp)u8 bit_min, bit_max; /*- * Since we only support Fully AUX Based VESA Backlight interface make
suredrivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2
-1-* backlight enable is possible via AUX along with backlight adjustment +* Brightness adjustment must be possible via AUX. Backlight *enable* +* may come either via AUX (DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) or via the
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5
-1+* BL_ENABLE pin, which the VESA backlight code already supports by +* falling back to the PWM funcs for enable when aux_enable is not set. +* Some panels (e.g. Tianma Y156ZAN02.0 in the Google Pixel Slate) +* support only that hybrid configuration and ignore the PWM pin for +* brightness adjustment. */ - if (!(intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP&&
- intel_dp->edp_dpcd[2] &DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP))drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2
-0+if (!(intel_dp->edp_dpcd[2 ] & +DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP ))return false;Quoted 5 lines
Quoted 4 lines
ret = drm_dp_dpcd_read_byte(&intel_dp->aux,
DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN,&bit_min);
--
2.47.3--
@foush
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Hybrid eDP panels supporting luminance control (luminance_set == true) but lacking AUX enable capability (aux_enable == false) will fail to turn on the backlight. --
--- Patch [1]: [PATCH] drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels --- commit 5c1988c15272e150c5abfa3acb528c1a51340cb5
Author: John Foushee <[email protected]>
drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
This commit allows the use of hybrid eDP backlight configurations (where brightness is adjusted via AUX but enablement happens via the BL_ENABLE PWM pin) by dropping the DP_EDP_BACKLIGHT_AUX_ENABLE_CAP requirement in the VESA backlight check.
Quoted 5 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0
-0
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c check_if_vesa_backlight_possible(struct intel_dp *intel_dp) · line 622
Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +4
-2@@ -616,11 +616,15 @@ check_if_vesa_backlight_possible(struct intel_dp *intel_dp)u8 bit_min, bit_max;/* -* Since we only support Fully AUX Based VESA Backlight interface make sure -* backlight enable is possible via AUX along with backlight adjustment +* Brightness adjustment must be possible via AUX. Backlight *enable* +* may come either via AUX (DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) or via the +* BL_ENABLE pin, which the VESA backlight code already supports by +* falling back to the PWM funcs for enable when aux_enable is not set.
[Severity: High]
This is a pre-existing issue, but does the PWM fallback actually execute for panels with luminance control?
Looking at the existing logic in intel_dp_aux_vesa_enable_backlight():
if (!(panel->backlight.edp.vesa.info.aux_enable ||
panel->backlight.edp.vesa.info.luminance_set)) {
u32 pwm_level;
// ... (PWM fallback enable code)If an eDP panel supports luminance control (luminance_set == true) but lacks AUX enable capability (aux_enable == false), wouldn't this condition evaluate to false, skipping the PWM fallback entirely?
If the fallback is skipped, the backlight enable pin won't be asserted via PWM, and the AUX enablement won't happen since aux_enable is false. Could this cause such panels to remain permanently black and unusable?
Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +4
-2+* Some panels (e.g. Tianma Y156ZAN02.0 in the Google Pixel Slate) +* support only that hybrid configuration and ignore the PWM pin for +* brightness adjustment. */ -if (!(intel_dp->edp_dpcd[1 ] &DP_EDP_BACKLIGHT_AUX_ENABLE_CAP && - intel_dp->edp_dpcd[2 ] &DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP )) +if (!(intel_dp->edp_dpcd[2 ] &DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP ))return false;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Patchwork
CI✗ LGCI.VerificationFailed: failure for drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
In reply to John Foushee== Series Details ==
== Series Details ==
Series: drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
URL : https://patchwork.freedesktop.org/series/170998/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://intel-gfx-ci-public.igk.intel.com:8080/job/xe_pw_trigger/1223750/ (on master)
Patchwork
CI✗ LGCI.VerificationFailed: failure for drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
In reply to John Foushee== Series Details ==
== Series Details ==
Series: drm/i915/backlight: allow hybrid pin-enable + AUX brightness panels
URL : https://patchwork.freedesktop.org/series/171000/
State : failure
== Summary ==
Series author address '[email protected]' is not on the allowlist, which prevents CI from being automatically triggered. If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork. Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_PW_kernel/181971/ (on built-in)