Re: [PATCH v2] drm/panel-edp: disable the backlight at probe
From: Haipeng Lin
Date: Mon Nov 16 2026 - 22:41:44 EST
Hi Neil,
On 11/2/26 8:15 AM, Neil Armstrong wrote:
> On 10/30/26 02:40, Doug Anderson wrote:
>> Hi,
>>
>> On Mon, Oct 26, 2026 at 6:14 PM Haipeng Lin via B4 Relay
>> <devnull+jimmie.lin.gmail.com@xxxxxxxxxx> wrote:
>>>
>>> From: Haipeng Lin <jimmie.lin@xxxxxxxxx>
>>>
>>> pwm-backlight can preserve the enabled state left by firmware to
>>> support a seamless display handoff. However, panel-edp does not support
>>> such a handoff. When probing a generic eDP panel, it powers the panel
>>> on to read its EDID. If display pipeline binding takes longer than the
>>> runtime-PM autosuspend delay, the panel is then powered off while the
>>> backlight remains enabled.
>
> So we don't support handoff _now_ but we may certainly support it someday.
[...]>
> I lack some knowledge, but when the display pipeline is probed
> who's in charge of disabling the backlight when suspending ?
My understanding of the lifecycle is that once the display pipeline is
bound, and the first modeset is done, the DRM panel core via the panel
bridge is in charge of the backlight:
Enable:
panel_bridge_atomic_pre_enable() -> drm_panel_prepare() ->
pm_runtime_get_sync() (panel power on)
panel_bridge_atomic_enable() -> drm_panel_enable() ->
backlight_enable()
Disable/suspend:
panel_bridge_atomic_disable() -> drm_panel_disable() ->
backlight_disable()
panel_bridge_atomic_post_disable() -> drm_panel_unprepare() ->
pm_runtime_put_sync_suspend() (.. power off)
So normally (e.g., DPMS off) drm_panel_disable() always disables the
backlight before drm_panel_unprepare() cuts the panel power.
The gap happens at boot before the first modeset:
1. pwm-backlight probes and preserves the enabled state from firmware
(BL_EN high) while drm_panel starts with panel->{enabled,prepared} =
false.
2. generic_edp_panel_probe() calls pm_runtime_get_sync() and
pm_runtime_put_autosuspend() directly to read the EDID outside of
drm_panel_prepare/unprepare()
3. If the display pipeline takes >1s to bind, runtime PM autosuspends
the panel (which calls panel_edp_suspend() and cuts panel VDD)
but drm_panel_disable() never runs because the panel was never
enabled via DRM.
The backlight is then left on with the panel power off, which breaks
power sequencing on any panel but on the Surface Pro 11 LCD it leaves
the backlight controller stuck. At first modeset BL_EN is never toggled
because pwm-backlight thinks it is already enabled.
>
> Why don't we handle the backlight state in the PM ops ?
>
> Neil
Since panel-edp's runtime PM ops tracks prepare/unprepare state
(panel power) rather than enable/disable (backlight), by disabling the
backlight at panel_edp_probe() we sync the initial backlight state with
panel->enabled = false until panel-edp supports seamless handoff.
As Doug mentioned, v1 did backlight_disable in panel_edp_suspend() but
Doug suggested that disabling it at probe could be a one-time work-
around to handle the bootloader handoff.
I hope this addresses your concern, happy to try other approaches.
Thanks,
Haipeng