* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
@ 2025-09-10 15:17 Vicente Bergas
2025-09-11 8:01 ` Aradhya Bhatia
0 siblings, 1 reply; 17+ messages in thread
From: Vicente Bergas @ 2025-09-10 15:17 UTC (permalink / raw)
To: aradhya.bhatia
Cc: Laurent.pinchart, airlied, alexander.sverdlin, andrzej.hajda,
devarsht, dri-devel, j-choudhary, jernej.skrabec, Jonas Karlman,
Linux Kernel Mailing List, lumag, maarten.lankhorst, mripard,
neil.armstrong, nm, rfoss, simona, tomi.valkeinen, tzimmermann,
vigneshr
Hi,
this patch causes a regression. It has been reported in
https://bugzilla.kernel.org/show_bug.cgi?id=220554
It affects the gru/kevin platform (arm64,RK3399) with the Panfrost DRM driver.
When it boots in console mode, the blinking of the cursor keeps the display on.
If it is turned off via /sys/class/graphics/fbcon/cursor_blink, then
the display briefly shows each key press presented on screen for less
than one second and then powers off.
When starting the graphical mode (wayland), if there are no
applications drawing on the screen, the only way to keep the display
on is by continuously moving the mouse.
Regards,
Vicente.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-09-10 15:17 [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Vicente Bergas
@ 2025-09-11 8:01 ` Aradhya Bhatia
2025-10-06 15:30 ` Aradhya Bhatia
0 siblings, 1 reply; 17+ messages in thread
From: Aradhya Bhatia @ 2025-09-11 8:01 UTC (permalink / raw)
To: Vicente Bergas
Cc: Laurent.pinchart, airlied, alexander.sverdlin, andrzej.hajda,
devarsht, dri-devel, jernej.skrabec, Jonas Karlman,
Linux Kernel Mailing List, lumag, maarten.lankhorst, mripard,
neil.armstrong, nm, rfoss, simona, tomi.valkeinen, tzimmermann,
vigneshr
Hi Vicente,
Thank you for the bisection and reporting the issue.
On 10/09/25 16:17, Vicente Bergas wrote:
> Hi,
> this patch causes a regression. It has been reported in
> https://bugzilla.kernel.org/show_bug.cgi?id=220554
>
> It affects the gru/kevin platform (arm64,RK3399) with the Panfrost DRM driver.
I believe the Panfrost DRM driver may only be for the GPU.
Based on the dts files in arm64/rockchip/, this is the pipeline of the
gru-kevin setup that I understand.
rk3399-vop (Big/Lite) -> rk3399-edp -> sharp,lq123p (edp-panel)
The setup seems to be using the drm/rockchip drivers for the display
controller and for the bridge.
>
> When it boots in console mode, the blinking of the cursor keeps the display on.
> If it is turned off via /sys/class/graphics/fbcon/cursor_blink, then
> the display briefly shows each key press presented on screen for less
> than one second and then powers off.
>
> When starting the graphical mode (wayland), if there are no
> applications drawing on the screen, the only way to keep the display
> on is by continuously moving the mouse.
>
Okay!
I will have a look through the drivers. In the meanwhile, please do
report back if you find any other observations.
--
Regards
Aradhya
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-09-11 8:01 ` Aradhya Bhatia
@ 2025-10-06 15:30 ` Aradhya Bhatia
2025-12-01 19:34 ` Vicente Bergas
2025-12-03 3:43 ` Chaoyi Chen
0 siblings, 2 replies; 17+ messages in thread
From: Aradhya Bhatia @ 2025-10-06 15:30 UTC (permalink / raw)
To: Vicente Bergas
Cc: Laurent.pinchart, airlied, alexander.sverdlin, andrzej.hajda,
devarsht, dri-devel, jernej.skrabec, Jonas Karlman,
Linux Kernel Mailing List, lumag, maarten.lankhorst, mripard,
neil.armstrong, nm, rfoss, simona, tomi.valkeinen, tzimmermann,
vigneshr, Dmitry Baryshkov, Douglas Anderson, Damon Ding,
Sandy Huang, Heiko Stübner, Andy Yan,
Linux Rockchip Support List, Devarsh Thakkar
+rockchip maintainers
Hi Vicente, all,
I went through the drivers and the affected areas in the gru-kevin
chromebook pipeline last week, but nothing has stood out.
Pipeline:
rockchip,display-subsystem / rk3399-vop (Big/Lite) (CRTC) ->
rk3399-edp (Encoder) -> analogix_dp_core (Bridge) ->
sharp,lq123p (edp-panel)
I am unable to debug this further since I do not have the hardware.
I could use some help, especially from folks who understand the hardware
requirements better.
On 11/09/25 09:01, Aradhya Bhatia wrote:
> Hi Vicente,
>
> Thank you for the bisection and reporting the issue.
>
> On 10/09/25 16:17, Vicente Bergas wrote:
>> Hi,
>> this patch causes a regression. It has been reported in
>> https://bugzilla.kernel.org/show_bug.cgi?id=220554
>>
>> It affects the gru/kevin platform (arm64,RK3399) with the Panfrost DRM driver.
>
> I believe the Panfrost DRM driver may only be for the GPU.
>
> Based on the dts files in arm64/rockchip/, this is the pipeline of the
> gru-kevin setup that I understand.
>
> rk3399-vop (Big/Lite) -> rk3399-edp -> sharp,lq123p (edp-panel)
>
> The setup seems to be using the drm/rockchip drivers for the display
> controller and for the bridge.
>
>>
>> When it boots in console mode, the blinking of the cursor keeps the display on.
>> If it is turned off via /sys/class/graphics/fbcon/cursor_blink, then
>> the display briefly shows each key press presented on screen for less
>> than one second and then powers off.
>>
>> When starting the graphical mode (wayland), if there are no
>> applications drawing on the screen, the only way to keep the display
>> on is by continuously moving the mouse.
>>
>
> Okay!
>
> I will have a look through the drivers. In the meanwhile, please do
> report back if you find any other observations.
>
>
--
Regards
Aradhya
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-10-06 15:30 ` Aradhya Bhatia
@ 2025-12-01 19:34 ` Vicente Bergas
2025-12-02 6:29 ` Laurent Pinchart
2025-12-03 3:43 ` Chaoyi Chen
1 sibling, 1 reply; 17+ messages in thread
From: Vicente Bergas @ 2025-12-01 19:34 UTC (permalink / raw)
To: Aradhya Bhatia
Cc: Laurent.pinchart, airlied, alexander.sverdlin, andrzej.hajda,
dri-devel, jernej.skrabec, Jonas Karlman,
Linux Kernel Mailing List, lumag, maarten.lankhorst, mripard,
neil.armstrong, nm, rfoss, simona, tomi.valkeinen, tzimmermann,
vigneshr, Dmitry Baryshkov, Douglas Anderson, Damon Ding,
Sandy Huang, Heiko Stübner, Andy Yan,
Linux Rockchip Support List, Devarsh Thakkar
On Mon, Oct 6, 2025 at 5:30 PM Aradhya Bhatia <aradhya.bhatia@linux.dev> wrote:
>
> +rockchip maintainers
>
> Hi Vicente, all,
Hi everybody,
please, can some expert on this platform take a look at this bug?
Regards,
Vicente.
> I went through the drivers and the affected areas in the gru-kevin
> chromebook pipeline last week, but nothing has stood out.
>
>
> Pipeline:
>
> rockchip,display-subsystem / rk3399-vop (Big/Lite) (CRTC) ->
> rk3399-edp (Encoder) -> analogix_dp_core (Bridge) ->
> sharp,lq123p (edp-panel)
>
> I am unable to debug this further since I do not have the hardware.
>
> I could use some help, especially from folks who understand the hardware
> requirements better.
>
>
> On 11/09/25 09:01, Aradhya Bhatia wrote:
> > Hi Vicente,
> >
> > Thank you for the bisection and reporting the issue.
> >
> > On 10/09/25 16:17, Vicente Bergas wrote:
> >> Hi,
> >> this patch causes a regression. It has been reported in
> >> https://bugzilla.kernel.org/show_bug.cgi?id=220554
> >>
> >> It affects the gru/kevin platform (arm64,RK3399) with the Panfrost DRM driver.
> >
> > I believe the Panfrost DRM driver may only be for the GPU.
> >
> > Based on the dts files in arm64/rockchip/, this is the pipeline of the
> > gru-kevin setup that I understand.
> >
> > rk3399-vop (Big/Lite) -> rk3399-edp -> sharp,lq123p (edp-panel)
> >
> > The setup seems to be using the drm/rockchip drivers for the display
> > controller and for the bridge.
> >
> >>
> >> When it boots in console mode, the blinking of the cursor keeps the display on.
> >> If it is turned off via /sys/class/graphics/fbcon/cursor_blink, then
> >> the display briefly shows each key press presented on screen for less
> >> than one second and then powers off.
> >>
> >> When starting the graphical mode (wayland), if there are no
> >> applications drawing on the screen, the only way to keep the display
> >> on is by continuously moving the mouse.
> >>
> >
> > Okay!
> >
> > I will have a look through the drivers. In the meanwhile, please do
> > report back if you find any other observations.
> >
> >
>
> --
> Regards
> Aradhya
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-12-01 19:34 ` Vicente Bergas
@ 2025-12-02 6:29 ` Laurent Pinchart
0 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2025-12-02 6:29 UTC (permalink / raw)
To: Vicente Bergas
Cc: Aradhya Bhatia, airlied, alexander.sverdlin, andrzej.hajda,
dri-devel, jernej.skrabec, Jonas Karlman,
Linux Kernel Mailing List, lumag, maarten.lankhorst, mripard,
neil.armstrong, nm, rfoss, simona, tomi.valkeinen, tzimmermann,
vigneshr, Dmitry Baryshkov, Douglas Anderson, Damon Ding,
Sandy Huang, Heiko Stübner, Andy Yan,
Linux Rockchip Support List, Devarsh Thakkar, Linus Walleij,
Marek Vasut
+Linus, Marek and Tomi.
On Mon, Dec 01, 2025 at 08:34:37PM +0100, Vicente Bergas wrote:
> On Mon, Oct 6, 2025 at 5:30 PM Aradhya Bhatia <aradhya.bhatia@linux.dev> wrote:
> >
> > +rockchip maintainers
> >
> > Hi Vicente, all,
>
> Hi everybody,
> please, can some expert on this platform take a look at this bug?
There are similar issues with MCDE and R-Car DU, see
https://lore.kernel.org/all/CAD++jLkNCH=8VmwXh0UJS5QZ9wB-iP2kinytT+__fq0L1PzoZQ@mail.gmail.com/
I think we should revert commit c9b1150a68d9362a0827609fc0dc1664c0d8bfe1
and work on a clean solution. It broke too many drivers.
> > I went through the drivers and the affected areas in the gru-kevin
> > chromebook pipeline last week, but nothing has stood out.
> >
> >
> > Pipeline:
> >
> > rockchip,display-subsystem / rk3399-vop (Big/Lite) (CRTC) ->
> > rk3399-edp (Encoder) -> analogix_dp_core (Bridge) ->
> > sharp,lq123p (edp-panel)
> >
> > I am unable to debug this further since I do not have the hardware.
> >
> > I could use some help, especially from folks who understand the hardware
> > requirements better.
> >
> >
> > On 11/09/25 09:01, Aradhya Bhatia wrote:
> > > Hi Vicente,
> > >
> > > Thank you for the bisection and reporting the issue.
> > >
> > > On 10/09/25 16:17, Vicente Bergas wrote:
> > >> Hi,
> > >> this patch causes a regression. It has been reported in
> > >> https://bugzilla.kernel.org/show_bug.cgi?id=220554
> > >>
> > >> It affects the gru/kevin platform (arm64,RK3399) with the Panfrost DRM driver.
> > >
> > > I believe the Panfrost DRM driver may only be for the GPU.
> > >
> > > Based on the dts files in arm64/rockchip/, this is the pipeline of the
> > > gru-kevin setup that I understand.
> > >
> > > rk3399-vop (Big/Lite) -> rk3399-edp -> sharp,lq123p (edp-panel)
> > >
> > > The setup seems to be using the drm/rockchip drivers for the display
> > > controller and for the bridge.
> > >
> > >>
> > >> When it boots in console mode, the blinking of the cursor keeps the display on.
> > >> If it is turned off via /sys/class/graphics/fbcon/cursor_blink, then
> > >> the display briefly shows each key press presented on screen for less
> > >> than one second and then powers off.
> > >>
> > >> When starting the graphical mode (wayland), if there are no
> > >> applications drawing on the screen, the only way to keep the display
> > >> on is by continuously moving the mouse.
> > >>
> > >
> > > Okay!
> > >
> > > I will have a look through the drivers. In the meanwhile, please do
> > > report back if you find any other observations.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-10-06 15:30 ` Aradhya Bhatia
2025-12-01 19:34 ` Vicente Bergas
@ 2025-12-03 3:43 ` Chaoyi Chen
1 sibling, 0 replies; 17+ messages in thread
From: Chaoyi Chen @ 2025-12-03 3:43 UTC (permalink / raw)
To: Aradhya Bhatia, Vicente Bergas
Cc: Laurent.pinchart, airlied, alexander.sverdlin, andrzej.hajda,
devarsht, dri-devel, jernej.skrabec, Jonas Karlman,
Linux Kernel Mailing List, lumag, maarten.lankhorst, mripard,
neil.armstrong, nm, rfoss, simona, tomi.valkeinen, tzimmermann,
vigneshr, Dmitry Baryshkov, Douglas Anderson, Damon Ding,
Sandy Huang, Heiko Stübner, Andy Yan, Damon Ding,
Linus Walleij, Linux Rockchip Support List
[-- Attachment #1: Type: text/plain, Size: 724 bytes --]
Hi Aradhya,
On 10/6/2025 11:30 PM, Aradhya Bhatia wrote:
> +rockchip maintainers
>
> Hi Vicente, all,
>
>
> I went through the drivers and the affected areas in the gru-kevin
> chromebook pipeline last week, but nothing has stood out.
>
>
> Pipeline:
>
> rockchip,display-subsystem / rk3399-vop (Big/Lite) (CRTC) ->
> rk3399-edp (Encoder) -> analogix_dp_core (Bridge) ->
> sharp,lq123p (edp-panel)
>
> I am unable to debug this further since I do not have the hardware.
>
> I could use some help, especially from folks who understand the hardware
> requirements better.
>
>
Sorry for late reply. Could you please try the patch in the
attachment? I think this should work without PSR. Thank you.
--
Best,
Chaoyi
[-- Attachment #2: 0001-drm-bridge-analogix_dp-Force-prepare-drm-panel-in-pr.patch --]
[-- Type: text/plain, Size: 1269 bytes --]
From ae2f62f1e738b22d6f0724e3dd14df3fde5ae434 Mon Sep 17 00:00:00 2001
From: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Date: Wed, 3 Dec 2025 11:29:43 +0800
Subject: [PATCH] drm/bridge: analogix_dp: Force prepare drm panel in
pre_enable
Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index efe534977d12..2c4415fc1e6e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1126,17 +1126,6 @@ static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge,
struct drm_atomic_state *old_state)
{
struct analogix_dp_device *dp = to_dp(bridge);
- struct drm_crtc *crtc;
- struct drm_crtc_state *old_crtc_state;
-
- crtc = analogix_dp_get_new_crtc(dp, old_state);
- if (!crtc)
- return;
-
- old_crtc_state = drm_atomic_get_old_crtc_state(old_state, crtc);
- /* Don't touch the panel if we're coming back from PSR */
- if (old_crtc_state && old_crtc_state->self_refresh_active)
- return;
drm_panel_prepare(dp->plat_data->panel);
}
--
2.51.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v13 0/4] drm/atomic-helper: Re-order CRTC and Bridge ops
@ 2025-06-05 17:15 Aradhya Bhatia
2025-06-05 17:15 ` [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Aradhya Bhatia
0 siblings, 1 reply; 17+ messages in thread
From: Aradhya Bhatia @ 2025-06-05 17:15 UTC (permalink / raw)
To: Tomi Valkeinen, Dmitry Baryshkov, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Aradhya Bhatia, Alexander Sverdlin
Hello all,
This series re-orders the sequences in which the drm CRTC and the drm
Bridge get enabled and disabled with respect to each other.
The bridge pre_enable calls have been shifted before the crtc_enable and
the bridge post_disable calls have been shifted after the crtc_disable.
This has been done as per the definition of bridge pre_enable.
"The display pipe (i.e. clocks and timing signals) feeding this bridge will
not yet be running when this callback is called".
Since CRTC is also a source feeding the bridge, it should not be enabled
before the bridges in the pipeline are pre_enabled.
The original sequence. for display pipe enable looks like:
crtc_enable
bridge[n]_pre_enable
...
bridge[1]_pre_enable
encoder_enable
bridge[1]_enable
...
bridge[n]_enable
The sequence of enable after this patch-set will look like:
bridge[n]_pre_enable
...
bridge[1]_pre_enable
crtc_enable
encoder_enable
bridge[1]_enable
...
bridge[n]_enable
For the disable sequence, this is what the original looks like:
bridge[n]_disable
...
bridge[1]_disable
encoder_disable
bridge[1]_post_disable
...
bridge[n]_post_disable
crtc_disable
This is what the disable sequence will be, after this series of patches:
bridge[n]_disable
...
bridge[1]_disable
encoder_disable
crtc_disable
bridge[1]_post_disable
...
bridge[n]_post_disable
This series further updates the bridge API definitions to accurately
reflect the updated scenario.
This series is a subset of its v11[0] which had 14 patches in the revision.
9 of those 14 patches (which were specific to the cdns-dsi bridge driver)
were merged[1].
Regards
Aradhya
---
References:
[0]: Revision v11 of this series.
https://lore.kernel.org/all/20250329113925.68204-1-aradhya.bhatia@linux.dev/
[1]: Patches 1 through 9 getting merged.
https://lore.kernel.org/all/174335361171.2556605.12634785416741695829.b4-ty@oss.qualcomm.com/
---
Change Log:
- Changes in v13:
- Style changes in patch 2/4. (Thomas)
- Squash patch v12:4/5 into v12:3/5, which is now v13:3/4. (Thomas)
- Add R-b tags from Thomas Zimmermann in patches 1-3.
- Rebase onto latest drm-misc-next.
- Changes in v12:
- Drop patches 1 through 9 since they have been merged.
- Rebase onto newer drm-misc-next.
- Re-word the patch 3/4, ("drm/bridge: Update the bridge enable/disable doc")
to make it more readable.
- Changes in v11:
- Add patch v11:13/14 ("drm/bridge: Update the bridge enable/disable doc"),
that updates the documentation about the order of the various bridge
enable/disable hooks being called wrt the CRTC and encoder hooks.
- Rebase on drm-misc-next instead of linux-next.
As part of rebase, accommodate the following change:
- Change patch v10:08/13 ("drm/bridge: cdns-dsi: Support atomic bridge
APIs") to v11:08/13 ("drm/bridge: cdns-dsi: Add input format
negotiation"), since Maxime has already updated the bridge hooks to
their atomic versions in commit 68c98e227a96 ("drm/bridge: cdns-csi:
Switch to atomic helpers").
My new patch now only adds the format negotiation hook for the cdns-dsi.
(Note: Since the new patch is now only a subset of the old one, without
any change in logic, I decided to carry forward the R-b and T-b tags.)
- Add Alexander Sverdlin's T-b in patches 10, 11, 12.
- Changes in v10:
- Rebase on latest linux-next (next-20250226).
- As part of rebase, update the patches to accommodate a couple of
widespread changes in DRM Framework -
- All the ("drm/atomic-helper: Change parameter name of ***") commits.
- All the ("drm/bridge: Pass full state to ***") commits.
(These updates are only trivial substitutions.)
- Add Tomi Valkeinen's T-b tags in all the patches.
- Changes in v9:
- Fix the oops in 11/13 - where the encoder_bridge_enable _was_ pre_enabling
the bridges instead of enabling.
- Add the following tags:
- Dmitry Baryshkov's R-b in patches 2, 10, 11, and A-b in patch 12.
- Jayesh Choudhary's R-b in patch 12.
- Tomi Valkeinen's R-b in patches 2, 10, 11, 12.
- Changes in v8:
- Move the phy de-initialization to bridge post_disable() instead of bridge
disable() in patch-3.
- Copy the private bridge state (dsi_cfg), in addition to the bridge_state,
in patch-9.
- Split patch v7:11/12 into three patches, v8:{10,11,12}/13, to separate out
different refactorings into different patches, and improve bisectability.
- Move patch v7:02/12 down to v8:06/12, to keep the initial patches for
fixes only.
- Drop patch v7:04/12 as it doesn't become relevant until patch v7:12/12.
- Add R-b tags of Dmitry Baryshkov in patch-9 and patch-3, and of
Tomi Valkeinen in patch-9.
- Changes in v7:
- phy_init()/exit() were called from the PM path in v6. Change it back to
the bridge enable/disable path in patch-3, so that the phy_init() can go
back to being called after D-Phy reset assert.
- Reword commit text in patch-5 to explain the need of the fix.
- Drop the stray code in patch-10.
- Add R-b tag of Dmitry Baryshkov in patch-6.
- Changes in v6:
- Reword patch 3 to better explain the fixes around phy de-init.
- Fix the Lane ready timeout condition in patch 7.
- Fix the dsi _bridge_atomic_check() implementation by adding a new
bridge state structure in patch 10.
- Rework and combine patches v5:11/13 and v5:12/13 to v6:11/12.
- Generate the patches of these series using the "patience" algorithm.
Note: All patches, except v6:11/12, *do not* differ from their default
(greedy) algorithm variants.
For patch 11, the patience algorithm significantly improves the readability.
- Rename and move the Bridge enable/disable enums from public to private
in patch 11.
- Add R-b tags of Tomi Valkeinen in patch 6, and Dmitry Baryshkov in patch 2.
- Changes in v5:
- Fix subject and description in patch 1/13.
- Add patch to check the return value of
phy_mipi_dphy_get_default_config() (patch: 6/13).
- Change the Clk and Data Lane ready timeout from forever to 5s.
- Print an error instead of calling WARN_ON_ONCE in patch 7/13.
- Drop patch v4-07/11: "drm/bridge: cdns-dsi: Reset the DCS write FIFO".
There has been some inconsistencies found with this patch upon further
testing. This patch was being used to enable a DSI panel based on ILITEK
ILI9881C bridge. This will be debugged separately.
- Add patch to move the DSI mode check from _atomic_enable() to
_atomic_check() (patch: 10/13).
- Split patch v4-10/11 into 2 patches - 11/13 and 12/13.
Patch 11/13 separates out the Encoder-Bridge operations into a helper
function *without* changing the logic. Patch 12/13 then changes the order
of the encoder-bridge operations as was intended in the original patch.
- Add detailed comment for patch 13/13.
- Add Tomi Valkeinen's R-b in patches 1, 2, 4, 5, 7, 8, 9, 13.
- Changes in v4:
- Add new patch, "drm/bridge: cdns-dsi: Move to devm_drm_of_get_bridge()",
to update to an auto-managed way of finding next bridge in the chain.
- Drop patch "drm/bridge: cdns-dsi: Fix the phy_initialized variable" and
add "drm/bridge: cdns-dsi: Fix Phy _init() and _exit()" that properly
de-initializes the Phy and maintains the initialization state.
- Reword patch "drm/bridge: cdns-dsi: Reset the DCS write FIFO" to explain
the HW concerns better.
- Add R-b tag from Dmitry Baryshkov for patches 1/11 and 8/11.
- Changes in v3:
- Reword the commit message for patch "drm/bridge: cdns-dsi: Fix OF node
pointer".
- Add a new helper API to figure out DSI host input pixel format
in patch "drm/mipi-dsi: Add helper to find input format".
- Use a common function for bridge pre-enable and enable, and bridge disable
and post-disable, to avoid code duplication.
- Add T-b tag from Dominik Haller in patch 5/10. (Missed to add it in v2).
- Add R-b tag from Dmitry Baryshkov for patch 8/10.
- Changes in v2:
- Drop patch "drm/tidss: Add CRTC mode_fixup"
- Split patch "drm/bridge: cdns-dsi: Fix minor bugs" into 4 separate ones
- Drop support for early_enable/late_disable APIs and instead re-order the
pre_enable / post_disable APIs to be called before / after crtc_enable /
crtc_disable.
- Drop support for early_enable/late_disable in cdns-dsi and use
pre_enable/post_disable APIs instead to do bridge enable/disable.
Previous versions:
v1: https://lore.kernel.org/all/20240511153051.1355825-1-a-bhatia1@ti.com/
v2: https://lore.kernel.org/all/20240530093621.1925863-1-a-bhatia1@ti.com/
v3: https://lore.kernel.org/all/20240617105311.1587489-1-a-bhatia1@ti.com/
v4: https://lore.kernel.org/all/20240622110929.3115714-1-a-bhatia1@ti.com/
v5: https://lore.kernel.org/all/20241019195411.266860-1-aradhya.bhatia@linux.dev/
v6: https://lore.kernel.org/all/20250111192738.308889-1-aradhya.bhatia@linux.dev/
v7: https://lore.kernel.org/all/20250114055626.18816-1-aradhya.bhatia@linux.dev/
v8: https://lore.kernel.org/all/20250126191551.741957-1-aradhya.bhatia@linux.dev/
v9: https://lore.kernel.org/all/20250209121032.32655-1-aradhya.bhatia@linux.dev/
v10: https://lore.kernel.org/all/20250226155228.564289-1-aradhya.bhatia@linux.dev/
v11: https://lore.kernel.org/all/20250329113925.68204-1-aradhya.bhatia@linux.dev/
v12: https://lore.kernel.org/all/20250406131642.171240-1-aradhya.bhatia@linux.dev/
---
Aradhya Bhatia (4):
drm/atomic-helper: Refactor crtc & encoder-bridge op loops into
separate functions
drm/atomic-helper: Separate out bridge pre_enable/post_disable from
enable/disable
drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
drm/bridge: cdns-dsi: Use pre_enable/post_disable to enable/disable
.../gpu/drm/bridge/cadence/cdns-dsi-core.c | 64 +++--
drivers/gpu/drm/drm_atomic_helper.c | 160 +++++++++--
include/drm/drm_bridge.h | 249 +++++++++++++-----
3 files changed, 355 insertions(+), 118 deletions(-)
base-commit: 0b3d99425891e3c4a87259afb88fbd1168dc7707
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-05 17:15 [PATCH v13 0/4] drm/atomic-helper: Re-order CRTC and Bridge ops Aradhya Bhatia
@ 2025-06-05 17:15 ` Aradhya Bhatia
2025-06-11 10:45 ` Marek Szyprowski
2025-10-22 8:24 ` Linus Walleij
0 siblings, 2 replies; 17+ messages in thread
From: Aradhya Bhatia @ 2025-06-05 17:15 UTC (permalink / raw)
To: Tomi Valkeinen, Dmitry Baryshkov, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Aradhya Bhatia, Alexander Sverdlin
From: Aradhya Bhatia <a-bhatia1@ti.com>
Move the bridge pre_enable call before crtc enable, and the bridge
post_disable call after the crtc disable.
The sequence of enable after this patch will look like:
bridge[n]_pre_enable
...
bridge[1]_pre_enable
crtc_enable
encoder_enable
bridge[1]_enable
...
bridge[n]_enable
And, the disable sequence for the display pipeline will look like:
bridge[n]_disable
...
bridge[1]_disable
encoder_disable
crtc_disable
bridge[1]_post_disable
...
bridge[n]_post_disable
The definition of bridge pre_enable hook says that,
"The display pipe (i.e. clocks and timing signals) feeding this bridge
will not yet be running when this callback is called".
Since CRTC is also a source feeding the bridge, it should not be enabled
before the bridges in the pipeline are pre_enabled. Fix that by
re-ordering the sequence of bridge pre_enable and bridge post_disable.
While at it, update the drm bridge API documentation as well.
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
---
drivers/gpu/drm/drm_atomic_helper.c | 8 +-
include/drm/drm_bridge.h | 249 ++++++++++++++++++++--------
2 files changed, 187 insertions(+), 70 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 539b7f072c72..2fe6c91910a1 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1336,9 +1336,9 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *state)
{
encoder_bridge_disable(dev, state);
- encoder_bridge_post_disable(dev, state);
-
crtc_disable(dev, state);
+
+ encoder_bridge_post_disable(dev, state);
}
/**
@@ -1674,10 +1674,10 @@ encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state)
void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
struct drm_atomic_state *state)
{
- crtc_enable(dev, state);
-
encoder_bridge_pre_enable(dev, state);
+ crtc_enable(dev, state);
+
encoder_bridge_enable(dev, state);
drm_atomic_helper_commit_writebacks(dev, state);
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index 0af5db244db8..ecdeb90e5586 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -165,17 +165,33 @@ struct drm_bridge_funcs {
/**
* @disable:
*
- * This callback should disable the bridge. It is called right before
- * the preceding element in the display pipe is disabled. If the
- * preceding element is a bridge this means it's called before that
- * bridge's @disable vfunc. If the preceding element is a &drm_encoder
- * it's called right before the &drm_encoder_helper_funcs.disable,
- * &drm_encoder_helper_funcs.prepare or &drm_encoder_helper_funcs.dpms
- * hook.
+ * The @disable callback should disable the bridge.
*
* The bridge can assume that the display pipe (i.e. clocks and timing
* signals) feeding it is still running when this callback is called.
*
+ *
+ * If the preceding element is a &drm_bridge, then this is called before
+ * that bridge is disabled via one of:
+ *
+ * - &drm_bridge_funcs.disable
+ * - &drm_bridge_funcs.atomic_disable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called before the encoder is disabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_disable
+ * - &drm_encoder_helper_funcs.prepare
+ * - &drm_encoder_helper_funcs.disable
+ * - &drm_encoder_helper_funcs.dpms
+ *
+ * and the CRTC is disabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.prepare
+ * - &drm_crtc_helper_funcs.atomic_disable
+ * - &drm_crtc_helper_funcs.disable
+ * - &drm_crtc_helper_funcs.dpms.
+ *
* The @disable callback is optional.
*
* NOTE:
@@ -188,17 +204,34 @@ struct drm_bridge_funcs {
/**
* @post_disable:
*
- * This callback should disable the bridge. It is called right after the
- * preceding element in the display pipe is disabled. If the preceding
- * element is a bridge this means it's called after that bridge's
- * @post_disable function. If the preceding element is a &drm_encoder
- * it's called right after the encoder's
- * &drm_encoder_helper_funcs.disable, &drm_encoder_helper_funcs.prepare
- * or &drm_encoder_helper_funcs.dpms hook.
- *
* The bridge must assume that the display pipe (i.e. clocks and timing
- * signals) feeding it is no longer running when this callback is
- * called.
+ * signals) feeding this bridge is no longer running when the
+ * @post_disable is called.
+ *
+ * This callback should perform all the actions required by the hardware
+ * after it has stopped receiving signals from the preceding element.
+ *
+ * If the preceding element is a &drm_bridge, then this is called after
+ * that bridge is post-disabled (unless marked otherwise by the
+ * @pre_enable_prev_first flag) via one of:
+ *
+ * - &drm_bridge_funcs.post_disable
+ * - &drm_bridge_funcs.atomic_post_disable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called after the encoder is disabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_disable
+ * - &drm_encoder_helper_funcs.prepare
+ * - &drm_encoder_helper_funcs.disable
+ * - &drm_encoder_helper_funcs.dpms
+ *
+ * and the CRTC is disabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.prepare
+ * - &drm_crtc_helper_funcs.atomic_disable
+ * - &drm_crtc_helper_funcs.disable
+ * - &drm_crtc_helper_funcs.dpms
*
* The @post_disable callback is optional.
*
@@ -241,18 +274,30 @@ struct drm_bridge_funcs {
/**
* @pre_enable:
*
- * This callback should enable the bridge. It is called right before
- * the preceding element in the display pipe is enabled. If the
- * preceding element is a bridge this means it's called before that
- * bridge's @pre_enable function. If the preceding element is a
- * &drm_encoder it's called right before the encoder's
- * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or
- * &drm_encoder_helper_funcs.dpms hook.
- *
* The display pipe (i.e. clocks and timing signals) feeding this bridge
- * will not yet be running when this callback is called. The bridge must
- * not enable the display link feeding the next bridge in the chain (if
- * there is one) when this callback is called.
+ * will not yet be running when the @pre_enable is called.
+ *
+ * This callback should perform all the necessary actions to prepare the
+ * bridge to accept signals from the preceding element.
+ *
+ * If the preceding element is a &drm_bridge, then this is called before
+ * that bridge is pre-enabled (unless marked otherwise by
+ * @pre_enable_prev_first flag) via one of:
+ *
+ * - &drm_bridge_funcs.pre_enable
+ * - &drm_bridge_funcs.atomic_pre_enable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called before the CRTC is enabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.atomic_enable
+ * - &drm_crtc_helper_funcs.commit
+ *
+ * and the encoder is enabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_enable
+ * - &drm_encoder_helper_funcs.enable
+ * - &drm_encoder_helper_funcs.commit
*
* The @pre_enable callback is optional.
*
@@ -266,19 +311,31 @@ struct drm_bridge_funcs {
/**
* @enable:
*
- * This callback should enable the bridge. It is called right after
- * the preceding element in the display pipe is enabled. If the
- * preceding element is a bridge this means it's called after that
- * bridge's @enable function. If the preceding element is a
- * &drm_encoder it's called right after the encoder's
- * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or
- * &drm_encoder_helper_funcs.dpms hook.
+ * The @enable callback should enable the bridge.
*
* The bridge can assume that the display pipe (i.e. clocks and timing
* signals) feeding it is running when this callback is called. This
* callback must enable the display link feeding the next bridge in the
* chain if there is one.
*
+ * If the preceding element is a &drm_bridge, then this is called after
+ * that bridge is enabled via one of:
+ *
+ * - &drm_bridge_funcs.enable
+ * - &drm_bridge_funcs.atomic_enable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called after the CRTC is enabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.atomic_enable
+ * - &drm_crtc_helper_funcs.commit
+ *
+ * and the encoder is enabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_enable
+ * - &drm_encoder_helper_funcs.enable
+ * - drm_encoder_helper_funcs.commit
+ *
* The @enable callback is optional.
*
* NOTE:
@@ -291,17 +348,30 @@ struct drm_bridge_funcs {
/**
* @atomic_pre_enable:
*
- * This callback should enable the bridge. It is called right before
- * the preceding element in the display pipe is enabled. If the
- * preceding element is a bridge this means it's called before that
- * bridge's @atomic_pre_enable or @pre_enable function. If the preceding
- * element is a &drm_encoder it's called right before the encoder's
- * &drm_encoder_helper_funcs.atomic_enable hook.
- *
* The display pipe (i.e. clocks and timing signals) feeding this bridge
- * will not yet be running when this callback is called. The bridge must
- * not enable the display link feeding the next bridge in the chain (if
- * there is one) when this callback is called.
+ * will not yet be running when the @atomic_pre_enable is called.
+ *
+ * This callback should perform all the necessary actions to prepare the
+ * bridge to accept signals from the preceding element.
+ *
+ * If the preceding element is a &drm_bridge, then this is called before
+ * that bridge is pre-enabled (unless marked otherwise by
+ * @pre_enable_prev_first flag) via one of:
+ *
+ * - &drm_bridge_funcs.pre_enable
+ * - &drm_bridge_funcs.atomic_pre_enable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called before the CRTC is enabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.atomic_enable
+ * - &drm_crtc_helper_funcs.commit
+ *
+ * and the encoder is enabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_enable
+ * - &drm_encoder_helper_funcs.enable
+ * - &drm_encoder_helper_funcs.commit
*
* The @atomic_pre_enable callback is optional.
*/
@@ -311,18 +381,31 @@ struct drm_bridge_funcs {
/**
* @atomic_enable:
*
- * This callback should enable the bridge. It is called right after
- * the preceding element in the display pipe is enabled. If the
- * preceding element is a bridge this means it's called after that
- * bridge's @atomic_enable or @enable function. If the preceding element
- * is a &drm_encoder it's called right after the encoder's
- * &drm_encoder_helper_funcs.atomic_enable hook.
+ * The @atomic_enable callback should enable the bridge.
*
* The bridge can assume that the display pipe (i.e. clocks and timing
* signals) feeding it is running when this callback is called. This
* callback must enable the display link feeding the next bridge in the
* chain if there is one.
*
+ * If the preceding element is a &drm_bridge, then this is called after
+ * that bridge is enabled via one of:
+ *
+ * - &drm_bridge_funcs.enable
+ * - &drm_bridge_funcs.atomic_enable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called after the CRTC is enabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.atomic_enable
+ * - &drm_crtc_helper_funcs.commit
+ *
+ * and the encoder is enabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_enable
+ * - &drm_encoder_helper_funcs.enable
+ * - drm_encoder_helper_funcs.commit
+ *
* The @atomic_enable callback is optional.
*/
void (*atomic_enable)(struct drm_bridge *bridge,
@@ -330,16 +413,32 @@ struct drm_bridge_funcs {
/**
* @atomic_disable:
*
- * This callback should disable the bridge. It is called right before
- * the preceding element in the display pipe is disabled. If the
- * preceding element is a bridge this means it's called before that
- * bridge's @atomic_disable or @disable vfunc. If the preceding element
- * is a &drm_encoder it's called right before the
- * &drm_encoder_helper_funcs.atomic_disable hook.
+ * The @atomic_disable callback should disable the bridge.
*
* The bridge can assume that the display pipe (i.e. clocks and timing
* signals) feeding it is still running when this callback is called.
*
+ * If the preceding element is a &drm_bridge, then this is called before
+ * that bridge is disabled via one of:
+ *
+ * - &drm_bridge_funcs.disable
+ * - &drm_bridge_funcs.atomic_disable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called before the encoder is disabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_disable
+ * - &drm_encoder_helper_funcs.prepare
+ * - &drm_encoder_helper_funcs.disable
+ * - &drm_encoder_helper_funcs.dpms
+ *
+ * and the CRTC is disabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.prepare
+ * - &drm_crtc_helper_funcs.atomic_disable
+ * - &drm_crtc_helper_funcs.disable
+ * - &drm_crtc_helper_funcs.dpms.
+ *
* The @atomic_disable callback is optional.
*/
void (*atomic_disable)(struct drm_bridge *bridge,
@@ -348,16 +447,34 @@ struct drm_bridge_funcs {
/**
* @atomic_post_disable:
*
- * This callback should disable the bridge. It is called right after the
- * preceding element in the display pipe is disabled. If the preceding
- * element is a bridge this means it's called after that bridge's
- * @atomic_post_disable or @post_disable function. If the preceding
- * element is a &drm_encoder it's called right after the encoder's
- * &drm_encoder_helper_funcs.atomic_disable hook.
- *
* The bridge must assume that the display pipe (i.e. clocks and timing
- * signals) feeding it is no longer running when this callback is
- * called.
+ * signals) feeding this bridge is no longer running when the
+ * @atomic_post_disable is called.
+ *
+ * This callback should perform all the actions required by the hardware
+ * after it has stopped receiving signals from the preceding element.
+ *
+ * If the preceding element is a &drm_bridge, then this is called after
+ * that bridge is post-disabled (unless marked otherwise by the
+ * @pre_enable_prev_first flag) via one of:
+ *
+ * - &drm_bridge_funcs.post_disable
+ * - &drm_bridge_funcs.atomic_post_disable
+ *
+ * If the preceding element of the bridge is a display controller, then
+ * this callback is called after the encoder is disabled via one of:
+ *
+ * - &drm_encoder_helper_funcs.atomic_disable
+ * - &drm_encoder_helper_funcs.prepare
+ * - &drm_encoder_helper_funcs.disable
+ * - &drm_encoder_helper_funcs.dpms
+ *
+ * and the CRTC is disabled via one of:
+ *
+ * - &drm_crtc_helper_funcs.prepare
+ * - &drm_crtc_helper_funcs.atomic_disable
+ * - &drm_crtc_helper_funcs.disable
+ * - &drm_crtc_helper_funcs.dpms
*
* The @atomic_post_disable callback is optional.
*/
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-05 17:15 ` [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Aradhya Bhatia
@ 2025-06-11 10:45 ` Marek Szyprowski
2025-06-12 5:49 ` Tomi Valkeinen
2025-10-22 8:24 ` Linus Walleij
1 sibling, 1 reply; 17+ messages in thread
From: Marek Szyprowski @ 2025-06-11 10:45 UTC (permalink / raw)
To: Aradhya Bhatia, Tomi Valkeinen, Dmitry Baryshkov, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Alexander Sverdlin
Hi,
On 05.06.2025 19:15, Aradhya Bhatia wrote:
> From: Aradhya Bhatia <a-bhatia1@ti.com>
>
> Move the bridge pre_enable call before crtc enable, and the bridge
> post_disable call after the crtc disable.
>
> The sequence of enable after this patch will look like:
>
> bridge[n]_pre_enable
> ...
> bridge[1]_pre_enable
>
> crtc_enable
> encoder_enable
>
> bridge[1]_enable
> ...
> bridge[n]_enable
>
> And, the disable sequence for the display pipeline will look like:
>
> bridge[n]_disable
> ...
> bridge[1]_disable
>
> encoder_disable
> crtc_disable
>
> bridge[1]_post_disable
> ...
> bridge[n]_post_disable
>
> The definition of bridge pre_enable hook says that,
> "The display pipe (i.e. clocks and timing signals) feeding this bridge
> will not yet be running when this callback is called".
>
> Since CRTC is also a source feeding the bridge, it should not be enabled
> before the bridges in the pipeline are pre_enabled. Fix that by
> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>
> While at it, update the drm bridge API documentation as well.
>
> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
This patch landed in today's linux-next as commit c9b1150a68d9
("drm/atomic-helper: Re-order bridge chain pre-enable and
post-disable"). In my tests I found that it breaks booting of Samsung
Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
on minor 0' message. On the other hand, the Samsung Exynos5250 based
Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
lvds panel instead of edp panels. This looks like some sort of deadlock,
because if I disable FBDEV emulation, those boards boots fine and I'm
able to run modetest and enable the display. Also the DRM kernel logger
seems to be working fine, although I didn't check the screen output yet,
as I only have a remote access to those boards. I will investigate it
further and let You know.
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 +-
> include/drm/drm_bridge.h | 249 ++++++++++++++++++++--------
> 2 files changed, 187 insertions(+), 70 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 539b7f072c72..2fe6c91910a1 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1336,9 +1336,9 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *state)
> {
> encoder_bridge_disable(dev, state);
>
> - encoder_bridge_post_disable(dev, state);
> -
> crtc_disable(dev, state);
> +
> + encoder_bridge_post_disable(dev, state);
> }
>
> /**
> @@ -1674,10 +1674,10 @@ encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *state)
> void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
> struct drm_atomic_state *state)
> {
> - crtc_enable(dev, state);
> -
> encoder_bridge_pre_enable(dev, state);
>
> + crtc_enable(dev, state);
> +
> encoder_bridge_enable(dev, state);
>
> drm_atomic_helper_commit_writebacks(dev, state);
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 0af5db244db8..ecdeb90e5586 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -165,17 +165,33 @@ struct drm_bridge_funcs {
> /**
> * @disable:
> *
> - * This callback should disable the bridge. It is called right before
> - * the preceding element in the display pipe is disabled. If the
> - * preceding element is a bridge this means it's called before that
> - * bridge's @disable vfunc. If the preceding element is a &drm_encoder
> - * it's called right before the &drm_encoder_helper_funcs.disable,
> - * &drm_encoder_helper_funcs.prepare or &drm_encoder_helper_funcs.dpms
> - * hook.
> + * The @disable callback should disable the bridge.
> *
> * The bridge can assume that the display pipe (i.e. clocks and timing
> * signals) feeding it is still running when this callback is called.
> *
> + *
> + * If the preceding element is a &drm_bridge, then this is called before
> + * that bridge is disabled via one of:
> + *
> + * - &drm_bridge_funcs.disable
> + * - &drm_bridge_funcs.atomic_disable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called before the encoder is disabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_disable
> + * - &drm_encoder_helper_funcs.prepare
> + * - &drm_encoder_helper_funcs.disable
> + * - &drm_encoder_helper_funcs.dpms
> + *
> + * and the CRTC is disabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.prepare
> + * - &drm_crtc_helper_funcs.atomic_disable
> + * - &drm_crtc_helper_funcs.disable
> + * - &drm_crtc_helper_funcs.dpms.
> + *
> * The @disable callback is optional.
> *
> * NOTE:
> @@ -188,17 +204,34 @@ struct drm_bridge_funcs {
> /**
> * @post_disable:
> *
> - * This callback should disable the bridge. It is called right after the
> - * preceding element in the display pipe is disabled. If the preceding
> - * element is a bridge this means it's called after that bridge's
> - * @post_disable function. If the preceding element is a &drm_encoder
> - * it's called right after the encoder's
> - * &drm_encoder_helper_funcs.disable, &drm_encoder_helper_funcs.prepare
> - * or &drm_encoder_helper_funcs.dpms hook.
> - *
> * The bridge must assume that the display pipe (i.e. clocks and timing
> - * signals) feeding it is no longer running when this callback is
> - * called.
> + * signals) feeding this bridge is no longer running when the
> + * @post_disable is called.
> + *
> + * This callback should perform all the actions required by the hardware
> + * after it has stopped receiving signals from the preceding element.
> + *
> + * If the preceding element is a &drm_bridge, then this is called after
> + * that bridge is post-disabled (unless marked otherwise by the
> + * @pre_enable_prev_first flag) via one of:
> + *
> + * - &drm_bridge_funcs.post_disable
> + * - &drm_bridge_funcs.atomic_post_disable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called after the encoder is disabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_disable
> + * - &drm_encoder_helper_funcs.prepare
> + * - &drm_encoder_helper_funcs.disable
> + * - &drm_encoder_helper_funcs.dpms
> + *
> + * and the CRTC is disabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.prepare
> + * - &drm_crtc_helper_funcs.atomic_disable
> + * - &drm_crtc_helper_funcs.disable
> + * - &drm_crtc_helper_funcs.dpms
> *
> * The @post_disable callback is optional.
> *
> @@ -241,18 +274,30 @@ struct drm_bridge_funcs {
> /**
> * @pre_enable:
> *
> - * This callback should enable the bridge. It is called right before
> - * the preceding element in the display pipe is enabled. If the
> - * preceding element is a bridge this means it's called before that
> - * bridge's @pre_enable function. If the preceding element is a
> - * &drm_encoder it's called right before the encoder's
> - * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or
> - * &drm_encoder_helper_funcs.dpms hook.
> - *
> * The display pipe (i.e. clocks and timing signals) feeding this bridge
> - * will not yet be running when this callback is called. The bridge must
> - * not enable the display link feeding the next bridge in the chain (if
> - * there is one) when this callback is called.
> + * will not yet be running when the @pre_enable is called.
> + *
> + * This callback should perform all the necessary actions to prepare the
> + * bridge to accept signals from the preceding element.
> + *
> + * If the preceding element is a &drm_bridge, then this is called before
> + * that bridge is pre-enabled (unless marked otherwise by
> + * @pre_enable_prev_first flag) via one of:
> + *
> + * - &drm_bridge_funcs.pre_enable
> + * - &drm_bridge_funcs.atomic_pre_enable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called before the CRTC is enabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.atomic_enable
> + * - &drm_crtc_helper_funcs.commit
> + *
> + * and the encoder is enabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_enable
> + * - &drm_encoder_helper_funcs.enable
> + * - &drm_encoder_helper_funcs.commit
> *
> * The @pre_enable callback is optional.
> *
> @@ -266,19 +311,31 @@ struct drm_bridge_funcs {
> /**
> * @enable:
> *
> - * This callback should enable the bridge. It is called right after
> - * the preceding element in the display pipe is enabled. If the
> - * preceding element is a bridge this means it's called after that
> - * bridge's @enable function. If the preceding element is a
> - * &drm_encoder it's called right after the encoder's
> - * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or
> - * &drm_encoder_helper_funcs.dpms hook.
> + * The @enable callback should enable the bridge.
> *
> * The bridge can assume that the display pipe (i.e. clocks and timing
> * signals) feeding it is running when this callback is called. This
> * callback must enable the display link feeding the next bridge in the
> * chain if there is one.
> *
> + * If the preceding element is a &drm_bridge, then this is called after
> + * that bridge is enabled via one of:
> + *
> + * - &drm_bridge_funcs.enable
> + * - &drm_bridge_funcs.atomic_enable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called after the CRTC is enabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.atomic_enable
> + * - &drm_crtc_helper_funcs.commit
> + *
> + * and the encoder is enabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_enable
> + * - &drm_encoder_helper_funcs.enable
> + * - drm_encoder_helper_funcs.commit
> + *
> * The @enable callback is optional.
> *
> * NOTE:
> @@ -291,17 +348,30 @@ struct drm_bridge_funcs {
> /**
> * @atomic_pre_enable:
> *
> - * This callback should enable the bridge. It is called right before
> - * the preceding element in the display pipe is enabled. If the
> - * preceding element is a bridge this means it's called before that
> - * bridge's @atomic_pre_enable or @pre_enable function. If the preceding
> - * element is a &drm_encoder it's called right before the encoder's
> - * &drm_encoder_helper_funcs.atomic_enable hook.
> - *
> * The display pipe (i.e. clocks and timing signals) feeding this bridge
> - * will not yet be running when this callback is called. The bridge must
> - * not enable the display link feeding the next bridge in the chain (if
> - * there is one) when this callback is called.
> + * will not yet be running when the @atomic_pre_enable is called.
> + *
> + * This callback should perform all the necessary actions to prepare the
> + * bridge to accept signals from the preceding element.
> + *
> + * If the preceding element is a &drm_bridge, then this is called before
> + * that bridge is pre-enabled (unless marked otherwise by
> + * @pre_enable_prev_first flag) via one of:
> + *
> + * - &drm_bridge_funcs.pre_enable
> + * - &drm_bridge_funcs.atomic_pre_enable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called before the CRTC is enabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.atomic_enable
> + * - &drm_crtc_helper_funcs.commit
> + *
> + * and the encoder is enabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_enable
> + * - &drm_encoder_helper_funcs.enable
> + * - &drm_encoder_helper_funcs.commit
> *
> * The @atomic_pre_enable callback is optional.
> */
> @@ -311,18 +381,31 @@ struct drm_bridge_funcs {
> /**
> * @atomic_enable:
> *
> - * This callback should enable the bridge. It is called right after
> - * the preceding element in the display pipe is enabled. If the
> - * preceding element is a bridge this means it's called after that
> - * bridge's @atomic_enable or @enable function. If the preceding element
> - * is a &drm_encoder it's called right after the encoder's
> - * &drm_encoder_helper_funcs.atomic_enable hook.
> + * The @atomic_enable callback should enable the bridge.
> *
> * The bridge can assume that the display pipe (i.e. clocks and timing
> * signals) feeding it is running when this callback is called. This
> * callback must enable the display link feeding the next bridge in the
> * chain if there is one.
> *
> + * If the preceding element is a &drm_bridge, then this is called after
> + * that bridge is enabled via one of:
> + *
> + * - &drm_bridge_funcs.enable
> + * - &drm_bridge_funcs.atomic_enable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called after the CRTC is enabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.atomic_enable
> + * - &drm_crtc_helper_funcs.commit
> + *
> + * and the encoder is enabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_enable
> + * - &drm_encoder_helper_funcs.enable
> + * - drm_encoder_helper_funcs.commit
> + *
> * The @atomic_enable callback is optional.
> */
> void (*atomic_enable)(struct drm_bridge *bridge,
> @@ -330,16 +413,32 @@ struct drm_bridge_funcs {
> /**
> * @atomic_disable:
> *
> - * This callback should disable the bridge. It is called right before
> - * the preceding element in the display pipe is disabled. If the
> - * preceding element is a bridge this means it's called before that
> - * bridge's @atomic_disable or @disable vfunc. If the preceding element
> - * is a &drm_encoder it's called right before the
> - * &drm_encoder_helper_funcs.atomic_disable hook.
> + * The @atomic_disable callback should disable the bridge.
> *
> * The bridge can assume that the display pipe (i.e. clocks and timing
> * signals) feeding it is still running when this callback is called.
> *
> + * If the preceding element is a &drm_bridge, then this is called before
> + * that bridge is disabled via one of:
> + *
> + * - &drm_bridge_funcs.disable
> + * - &drm_bridge_funcs.atomic_disable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called before the encoder is disabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_disable
> + * - &drm_encoder_helper_funcs.prepare
> + * - &drm_encoder_helper_funcs.disable
> + * - &drm_encoder_helper_funcs.dpms
> + *
> + * and the CRTC is disabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.prepare
> + * - &drm_crtc_helper_funcs.atomic_disable
> + * - &drm_crtc_helper_funcs.disable
> + * - &drm_crtc_helper_funcs.dpms.
> + *
> * The @atomic_disable callback is optional.
> */
> void (*atomic_disable)(struct drm_bridge *bridge,
> @@ -348,16 +447,34 @@ struct drm_bridge_funcs {
> /**
> * @atomic_post_disable:
> *
> - * This callback should disable the bridge. It is called right after the
> - * preceding element in the display pipe is disabled. If the preceding
> - * element is a bridge this means it's called after that bridge's
> - * @atomic_post_disable or @post_disable function. If the preceding
> - * element is a &drm_encoder it's called right after the encoder's
> - * &drm_encoder_helper_funcs.atomic_disable hook.
> - *
> * The bridge must assume that the display pipe (i.e. clocks and timing
> - * signals) feeding it is no longer running when this callback is
> - * called.
> + * signals) feeding this bridge is no longer running when the
> + * @atomic_post_disable is called.
> + *
> + * This callback should perform all the actions required by the hardware
> + * after it has stopped receiving signals from the preceding element.
> + *
> + * If the preceding element is a &drm_bridge, then this is called after
> + * that bridge is post-disabled (unless marked otherwise by the
> + * @pre_enable_prev_first flag) via one of:
> + *
> + * - &drm_bridge_funcs.post_disable
> + * - &drm_bridge_funcs.atomic_post_disable
> + *
> + * If the preceding element of the bridge is a display controller, then
> + * this callback is called after the encoder is disabled via one of:
> + *
> + * - &drm_encoder_helper_funcs.atomic_disable
> + * - &drm_encoder_helper_funcs.prepare
> + * - &drm_encoder_helper_funcs.disable
> + * - &drm_encoder_helper_funcs.dpms
> + *
> + * and the CRTC is disabled via one of:
> + *
> + * - &drm_crtc_helper_funcs.prepare
> + * - &drm_crtc_helper_funcs.atomic_disable
> + * - &drm_crtc_helper_funcs.disable
> + * - &drm_crtc_helper_funcs.dpms
> *
> * The @atomic_post_disable callback is optional.
> */
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-11 10:45 ` Marek Szyprowski
@ 2025-06-12 5:49 ` Tomi Valkeinen
2025-06-12 6:31 ` Marek Szyprowski
0 siblings, 1 reply; 17+ messages in thread
From: Tomi Valkeinen @ 2025-06-12 5:49 UTC (permalink / raw)
To: Marek Szyprowski, Aradhya Bhatia
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Alexander Sverdlin, Dmitry Baryshkov, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On 11/06/2025 13:45, Marek Szyprowski wrote:
> Hi,
>
> On 05.06.2025 19:15, Aradhya Bhatia wrote:
>> From: Aradhya Bhatia <a-bhatia1@ti.com>
>>
>> Move the bridge pre_enable call before crtc enable, and the bridge
>> post_disable call after the crtc disable.
>>
>> The sequence of enable after this patch will look like:
>>
>> bridge[n]_pre_enable
>> ...
>> bridge[1]_pre_enable
>>
>> crtc_enable
>> encoder_enable
>>
>> bridge[1]_enable
>> ...
>> bridge[n]_enable
>>
>> And, the disable sequence for the display pipeline will look like:
>>
>> bridge[n]_disable
>> ...
>> bridge[1]_disable
>>
>> encoder_disable
>> crtc_disable
>>
>> bridge[1]_post_disable
>> ...
>> bridge[n]_post_disable
>>
>> The definition of bridge pre_enable hook says that,
>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
>> will not yet be running when this callback is called".
>>
>> Since CRTC is also a source feeding the bridge, it should not be enabled
>> before the bridges in the pipeline are pre_enabled. Fix that by
>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>>
>> While at it, update the drm bridge API documentation as well.
>>
>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
>
> This patch landed in today's linux-next as commit c9b1150a68d9
> ("drm/atomic-helper: Re-order bridge chain pre-enable and
> post-disable"). In my tests I found that it breaks booting of Samsung
> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
> on minor 0' message. On the other hand, the Samsung Exynos5250 based
> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
> lvds panel instead of edp panels. This looks like some sort of deadlock,
> because if I disable FBDEV emulation, those boards boots fine and I'm
> able to run modetest and enable the display. Also the DRM kernel logger
> seems to be working fine, although I didn't check the screen output yet,
> as I only have a remote access to those boards. I will investigate it
> further and let You know.
Thanks for the report. I was trying to understand the pipeline, but I'm
a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
panel.
Is the above correct? Do both Peach-Pi and Peach-Pit fail?
Tomi
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-12 5:49 ` Tomi Valkeinen
@ 2025-06-12 6:31 ` Marek Szyprowski
2025-06-16 15:40 ` Tomi Valkeinen
0 siblings, 1 reply; 17+ messages in thread
From: Marek Szyprowski @ 2025-06-12 6:31 UTC (permalink / raw)
To: Tomi Valkeinen, Aradhya Bhatia
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Alexander Sverdlin, Dmitry Baryshkov, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
On 12.06.2025 07:49, Tomi Valkeinen wrote:
> On 11/06/2025 13:45, Marek Szyprowski wrote:
>> On 05.06.2025 19:15, Aradhya Bhatia wrote:
>>> From: Aradhya Bhatia <a-bhatia1@ti.com>
>>>
>>> Move the bridge pre_enable call before crtc enable, and the bridge
>>> post_disable call after the crtc disable.
>>>
>>> The sequence of enable after this patch will look like:
>>>
>>> bridge[n]_pre_enable
>>> ...
>>> bridge[1]_pre_enable
>>>
>>> crtc_enable
>>> encoder_enable
>>>
>>> bridge[1]_enable
>>> ...
>>> bridge[n]_enable
>>>
>>> And, the disable sequence for the display pipeline will look like:
>>>
>>> bridge[n]_disable
>>> ...
>>> bridge[1]_disable
>>>
>>> encoder_disable
>>> crtc_disable
>>>
>>> bridge[1]_post_disable
>>> ...
>>> bridge[n]_post_disable
>>>
>>> The definition of bridge pre_enable hook says that,
>>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
>>> will not yet be running when this callback is called".
>>>
>>> Since CRTC is also a source feeding the bridge, it should not be enabled
>>> before the bridges in the pipeline are pre_enabled. Fix that by
>>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>>>
>>> While at it, update the drm bridge API documentation as well.
>>>
>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
>> This patch landed in today's linux-next as commit c9b1150a68d9
>> ("drm/atomic-helper: Re-order bridge chain pre-enable and
>> post-disable"). In my tests I found that it breaks booting of Samsung
>> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
>> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
>> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
>> on minor 0' message. On the other hand, the Samsung Exynos5250 based
>> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
>> lvds panel instead of edp panels. This looks like some sort of deadlock,
>> because if I disable FBDEV emulation, those boards boots fine and I'm
>> able to run modetest and enable the display. Also the DRM kernel logger
>> seems to be working fine, although I didn't check the screen output yet,
>> as I only have a remote access to those boards. I will investigate it
>> further and let You know.
> Thanks for the report. I was trying to understand the pipeline, but I'm
> a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
> look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
> a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
> panel.
>
> Is the above correct? Do both Peach-Pi and Peach-Pit fail?
Yes, sorry, my fault. I much have checked the same (peach-pi) dts 2
times. Both Peach-Pi and Peach-Pit fails, while Snow works fine. All
three use the same Exynos DP (based on analogix dp) driver. I will try
to play a bit more with those boards in the afternoon, hopefully getting
some more hints where the issue is.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-12 6:31 ` Marek Szyprowski
@ 2025-06-16 15:40 ` Tomi Valkeinen
2025-06-18 6:30 ` Marek Szyprowski
0 siblings, 1 reply; 17+ messages in thread
From: Tomi Valkeinen @ 2025-06-16 15:40 UTC (permalink / raw)
To: Marek Szyprowski, Aradhya Bhatia
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Alexander Sverdlin, Dmitry Baryshkov, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On 12/06/2025 09:31, Marek Szyprowski wrote:
> On 12.06.2025 07:49, Tomi Valkeinen wrote:
>> On 11/06/2025 13:45, Marek Szyprowski wrote:
>>> On 05.06.2025 19:15, Aradhya Bhatia wrote:
>>>> From: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>
>>>> Move the bridge pre_enable call before crtc enable, and the bridge
>>>> post_disable call after the crtc disable.
>>>>
>>>> The sequence of enable after this patch will look like:
>>>>
>>>> bridge[n]_pre_enable
>>>> ...
>>>> bridge[1]_pre_enable
>>>>
>>>> crtc_enable
>>>> encoder_enable
>>>>
>>>> bridge[1]_enable
>>>> ...
>>>> bridge[n]_enable
>>>>
>>>> And, the disable sequence for the display pipeline will look like:
>>>>
>>>> bridge[n]_disable
>>>> ...
>>>> bridge[1]_disable
>>>>
>>>> encoder_disable
>>>> crtc_disable
>>>>
>>>> bridge[1]_post_disable
>>>> ...
>>>> bridge[n]_post_disable
>>>>
>>>> The definition of bridge pre_enable hook says that,
>>>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
>>>> will not yet be running when this callback is called".
>>>>
>>>> Since CRTC is also a source feeding the bridge, it should not be enabled
>>>> before the bridges in the pipeline are pre_enabled. Fix that by
>>>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>>>>
>>>> While at it, update the drm bridge API documentation as well.
>>>>
>>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>>>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
>>> This patch landed in today's linux-next as commit c9b1150a68d9
>>> ("drm/atomic-helper: Re-order bridge chain pre-enable and
>>> post-disable"). In my tests I found that it breaks booting of Samsung
>>> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
>>> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
>>> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
>>> on minor 0' message. On the other hand, the Samsung Exynos5250 based
>>> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
>>> lvds panel instead of edp panels. This looks like some sort of deadlock,
>>> because if I disable FBDEV emulation, those boards boots fine and I'm
>>> able to run modetest and enable the display. Also the DRM kernel logger
>>> seems to be working fine, although I didn't check the screen output yet,
>>> as I only have a remote access to those boards. I will investigate it
>>> further and let You know.
>> Thanks for the report. I was trying to understand the pipeline, but I'm
>> a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
>> look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
>> a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
>> panel.
>>
>> Is the above correct? Do both Peach-Pi and Peach-Pit fail?
>
> Yes, sorry, my fault. I much have checked the same (peach-pi) dts 2
> times. Both Peach-Pi and Peach-Pit fails, while Snow works fine. All
> three use the same Exynos DP (based on analogix dp) driver. I will try
> to play a bit more with those boards in the afternoon, hopefully getting
> some more hints where the issue is.
Did you get a chance to test this more? Any hints what happens will help =)
Tomi
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-16 15:40 ` Tomi Valkeinen
@ 2025-06-18 6:30 ` Marek Szyprowski
2025-06-18 8:27 ` Maxime Ripard
0 siblings, 1 reply; 17+ messages in thread
From: Marek Szyprowski @ 2025-06-18 6:30 UTC (permalink / raw)
To: Tomi Valkeinen, Aradhya Bhatia
Cc: DRI Development List, Linux Kernel List, Nishanth Menon,
Vignesh Raghavendra, Devarsh Thakkar, Jayesh Choudhary,
Alexander Sverdlin, Dmitry Baryshkov, Andrzej Hajda,
Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
On 16.06.2025 17:40, Tomi Valkeinen wrote:
> On 12/06/2025 09:31, Marek Szyprowski wrote:
>> On 12.06.2025 07:49, Tomi Valkeinen wrote:
>>> On 11/06/2025 13:45, Marek Szyprowski wrote:
>>>> On 05.06.2025 19:15, Aradhya Bhatia wrote:
>>>>> From: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>>
>>>>> Move the bridge pre_enable call before crtc enable, and the bridge
>>>>> post_disable call after the crtc disable.
>>>>>
>>>>> The sequence of enable after this patch will look like:
>>>>>
>>>>> bridge[n]_pre_enable
>>>>> ...
>>>>> bridge[1]_pre_enable
>>>>>
>>>>> crtc_enable
>>>>> encoder_enable
>>>>>
>>>>> bridge[1]_enable
>>>>> ...
>>>>> bridge[n]_enable
>>>>>
>>>>> And, the disable sequence for the display pipeline will look like:
>>>>>
>>>>> bridge[n]_disable
>>>>> ...
>>>>> bridge[1]_disable
>>>>>
>>>>> encoder_disable
>>>>> crtc_disable
>>>>>
>>>>> bridge[1]_post_disable
>>>>> ...
>>>>> bridge[n]_post_disable
>>>>>
>>>>> The definition of bridge pre_enable hook says that,
>>>>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
>>>>> will not yet be running when this callback is called".
>>>>>
>>>>> Since CRTC is also a source feeding the bridge, it should not be enabled
>>>>> before the bridges in the pipeline are pre_enabled. Fix that by
>>>>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>>>>>
>>>>> While at it, update the drm bridge API documentation as well.
>>>>>
>>>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>>>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
>>>> This patch landed in today's linux-next as commit c9b1150a68d9
>>>> ("drm/atomic-helper: Re-order bridge chain pre-enable and
>>>> post-disable"). In my tests I found that it breaks booting of Samsung
>>>> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
>>>> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
>>>> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
>>>> on minor 0' message. On the other hand, the Samsung Exynos5250 based
>>>> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
>>>> lvds panel instead of edp panels. This looks like some sort of deadlock,
>>>> because if I disable FBDEV emulation, those boards boots fine and I'm
>>>> able to run modetest and enable the display. Also the DRM kernel logger
>>>> seems to be working fine, although I didn't check the screen output yet,
>>>> as I only have a remote access to those boards. I will investigate it
>>>> further and let You know.
>>> Thanks for the report. I was trying to understand the pipeline, but I'm
>>> a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
>>> look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
>>> a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
>>> panel.
>>>
>>> Is the above correct? Do both Peach-Pi and Peach-Pit fail?
>> Yes, sorry, my fault. I much have checked the same (peach-pi) dts 2
>> times. Both Peach-Pi and Peach-Pit fails, while Snow works fine. All
>> three use the same Exynos DP (based on analogix dp) driver. I will try
>> to play a bit more with those boards in the afternoon, hopefully getting
>> some more hints where the issue is.
> Did you get a chance to test this more? Any hints what happens will help =)
I've spent some time debugging this issue, but so far I only got
something I don't really understand. This issue is somehow related with
the DP clock enabling and disabling, what is being done from
exynos_dp_poweron() and exynos_dp_poweroff() functions, which are called
from analogix_dp_resume() and analogix_dp_suspend(). The lockup happens
somewhere while registering the fbdev console, with console lock held,
what makes debugging much harder.
I've did some experiments with pm runtime of the analogix_dp_core driver
and increased autosuspend delay to 200 msec. This magically fixed the
issue, but I still see no direct calls to analogix_dp without proper pm
runtime guards.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-18 6:30 ` Marek Szyprowski
@ 2025-06-18 8:27 ` Maxime Ripard
2025-06-18 10:01 ` Marek Szyprowski
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2025-06-18 8:27 UTC (permalink / raw)
To: Marek Szyprowski
Cc: Tomi Valkeinen, Aradhya Bhatia, DRI Development List,
Linux Kernel List, Nishanth Menon, Vignesh Raghavendra,
Devarsh Thakkar, Jayesh Choudhary, Alexander Sverdlin,
Dmitry Baryshkov, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
[-- Attachment #1: Type: text/plain, Size: 4628 bytes --]
On Wed, Jun 18, 2025 at 08:30:39AM +0200, Marek Szyprowski wrote:
> On 16.06.2025 17:40, Tomi Valkeinen wrote:
> > On 12/06/2025 09:31, Marek Szyprowski wrote:
> >> On 12.06.2025 07:49, Tomi Valkeinen wrote:
> >>> On 11/06/2025 13:45, Marek Szyprowski wrote:
> >>>> On 05.06.2025 19:15, Aradhya Bhatia wrote:
> >>>>> From: Aradhya Bhatia <a-bhatia1@ti.com>
> >>>>>
> >>>>> Move the bridge pre_enable call before crtc enable, and the bridge
> >>>>> post_disable call after the crtc disable.
> >>>>>
> >>>>> The sequence of enable after this patch will look like:
> >>>>>
> >>>>> bridge[n]_pre_enable
> >>>>> ...
> >>>>> bridge[1]_pre_enable
> >>>>>
> >>>>> crtc_enable
> >>>>> encoder_enable
> >>>>>
> >>>>> bridge[1]_enable
> >>>>> ...
> >>>>> bridge[n]_enable
> >>>>>
> >>>>> And, the disable sequence for the display pipeline will look like:
> >>>>>
> >>>>> bridge[n]_disable
> >>>>> ...
> >>>>> bridge[1]_disable
> >>>>>
> >>>>> encoder_disable
> >>>>> crtc_disable
> >>>>>
> >>>>> bridge[1]_post_disable
> >>>>> ...
> >>>>> bridge[n]_post_disable
> >>>>>
> >>>>> The definition of bridge pre_enable hook says that,
> >>>>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
> >>>>> will not yet be running when this callback is called".
> >>>>>
> >>>>> Since CRTC is also a source feeding the bridge, it should not be enabled
> >>>>> before the bridges in the pipeline are pre_enabled. Fix that by
> >>>>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
> >>>>>
> >>>>> While at it, update the drm bridge API documentation as well.
> >>>>>
> >>>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >>>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >>>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> >>>>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >>>>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> >>>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
> >>>>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
> >>>> This patch landed in today's linux-next as commit c9b1150a68d9
> >>>> ("drm/atomic-helper: Re-order bridge chain pre-enable and
> >>>> post-disable"). In my tests I found that it breaks booting of Samsung
> >>>> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
> >>>> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
> >>>> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
> >>>> on minor 0' message. On the other hand, the Samsung Exynos5250 based
> >>>> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
> >>>> lvds panel instead of edp panels. This looks like some sort of deadlock,
> >>>> because if I disable FBDEV emulation, those boards boots fine and I'm
> >>>> able to run modetest and enable the display. Also the DRM kernel logger
> >>>> seems to be working fine, although I didn't check the screen output yet,
> >>>> as I only have a remote access to those boards. I will investigate it
> >>>> further and let You know.
> >>> Thanks for the report. I was trying to understand the pipeline, but I'm
> >>> a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
> >>> look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
> >>> a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
> >>> panel.
> >>>
> >>> Is the above correct? Do both Peach-Pi and Peach-Pit fail?
> >> Yes, sorry, my fault. I much have checked the same (peach-pi) dts 2
> >> times. Both Peach-Pi and Peach-Pit fails, while Snow works fine. All
> >> three use the same Exynos DP (based on analogix dp) driver. I will try
> >> to play a bit more with those boards in the afternoon, hopefully getting
> >> some more hints where the issue is.
> > Did you get a chance to test this more? Any hints what happens will help =)
>
> I've spent some time debugging this issue, but so far I only got
> something I don't really understand. This issue is somehow related with
> the DP clock enabling and disabling, what is being done from
> exynos_dp_poweron() and exynos_dp_poweroff() functions, which are called
> from analogix_dp_resume() and analogix_dp_suspend(). The lockup happens
> somewhere while registering the fbdev console, with console lock held,
> what makes debugging much harder.
You can skip the locking part with the fb.lockless_register_fb=1 kernel
parameter. It's of course not meant for anything but debugging, but it's
useful :)
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-18 8:27 ` Maxime Ripard
@ 2025-06-18 10:01 ` Marek Szyprowski
2025-06-18 10:05 ` Tomi Valkeinen
2025-06-18 16:27 ` Tomi Valkeinen
0 siblings, 2 replies; 17+ messages in thread
From: Marek Szyprowski @ 2025-06-18 10:01 UTC (permalink / raw)
To: Maxime Ripard
Cc: Tomi Valkeinen, Aradhya Bhatia, DRI Development List,
Linux Kernel List, Nishanth Menon, Vignesh Raghavendra,
Devarsh Thakkar, Jayesh Choudhary, Alexander Sverdlin,
Dmitry Baryshkov, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
On 18.06.2025 10:27, Maxime Ripard wrote:
> On Wed, Jun 18, 2025 at 08:30:39AM +0200, Marek Szyprowski wrote:
>> On 16.06.2025 17:40, Tomi Valkeinen wrote:
>>> On 12/06/2025 09:31, Marek Szyprowski wrote:
>>>> On 12.06.2025 07:49, Tomi Valkeinen wrote:
>>>>> On 11/06/2025 13:45, Marek Szyprowski wrote:
>>>>>> On 05.06.2025 19:15, Aradhya Bhatia wrote:
>>>>>>> From: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>>>>
>>>>>>> Move the bridge pre_enable call before crtc enable, and the bridge
>>>>>>> post_disable call after the crtc disable.
>>>>>>>
>>>>>>> The sequence of enable after this patch will look like:
>>>>>>>
>>>>>>> bridge[n]_pre_enable
>>>>>>> ...
>>>>>>> bridge[1]_pre_enable
>>>>>>>
>>>>>>> crtc_enable
>>>>>>> encoder_enable
>>>>>>>
>>>>>>> bridge[1]_enable
>>>>>>> ...
>>>>>>> bridge[n]_enable
>>>>>>>
>>>>>>> And, the disable sequence for the display pipeline will look like:
>>>>>>>
>>>>>>> bridge[n]_disable
>>>>>>> ...
>>>>>>> bridge[1]_disable
>>>>>>>
>>>>>>> encoder_disable
>>>>>>> crtc_disable
>>>>>>>
>>>>>>> bridge[1]_post_disable
>>>>>>> ...
>>>>>>> bridge[n]_post_disable
>>>>>>>
>>>>>>> The definition of bridge pre_enable hook says that,
>>>>>>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
>>>>>>> will not yet be running when this callback is called".
>>>>>>>
>>>>>>> Since CRTC is also a source feeding the bridge, it should not be enabled
>>>>>>> before the bridges in the pipeline are pre_enabled. Fix that by
>>>>>>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>>>>>>>
>>>>>>> While at it, update the drm bridge API documentation as well.
>>>>>>>
>>>>>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>>>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>>>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>>>>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>>>>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>>>>>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>>>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
>>>>>> This patch landed in today's linux-next as commit c9b1150a68d9
>>>>>> ("drm/atomic-helper: Re-order bridge chain pre-enable and
>>>>>> post-disable"). In my tests I found that it breaks booting of Samsung
>>>>>> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
>>>>>> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
>>>>>> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
>>>>>> on minor 0' message. On the other hand, the Samsung Exynos5250 based
>>>>>> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
>>>>>> lvds panel instead of edp panels. This looks like some sort of deadlock,
>>>>>> because if I disable FBDEV emulation, those boards boots fine and I'm
>>>>>> able to run modetest and enable the display. Also the DRM kernel logger
>>>>>> seems to be working fine, although I didn't check the screen output yet,
>>>>>> as I only have a remote access to those boards. I will investigate it
>>>>>> further and let You know.
>>>>> Thanks for the report. I was trying to understand the pipeline, but I'm
>>>>> a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
>>>>> look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
>>>>> a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
>>>>> panel.
>>>>>
>>>>> Is the above correct? Do both Peach-Pi and Peach-Pit fail?
>>>> Yes, sorry, my fault. I much have checked the same (peach-pi) dts 2
>>>> times. Both Peach-Pi and Peach-Pit fails, while Snow works fine. All
>>>> three use the same Exynos DP (based on analogix dp) driver. I will try
>>>> to play a bit more with those boards in the afternoon, hopefully getting
>>>> some more hints where the issue is.
>>> Did you get a chance to test this more? Any hints what happens will help =)
>> I've spent some time debugging this issue, but so far I only got
>> something I don't really understand. This issue is somehow related with
>> the DP clock enabling and disabling, what is being done from
>> exynos_dp_poweron() and exynos_dp_poweroff() functions, which are called
>> from analogix_dp_resume() and analogix_dp_suspend(). The lockup happens
>> somewhere while registering the fbdev console, with console lock held,
>> what makes debugging much harder.
> You can skip the locking part with the fb.lockless_register_fb=1 kernel
> parameter. It's of course not meant for anything but debugging, but it's
> useful :)
I've finally found where is the problem! It turned out that the issue is
in the exynos_drm_fimd driver, in the code for enabling the display port
clock (fimd_dp_clock_enable()
function). It touches FIMD regs, but it was not guarded with FIMD's
runtime pm calls and after the $subject change it happened that
exynos_dp/analogix_dp code called the clock enable/disable when FIMD
driver (which implements the CRTC object) was not runtime resumed.
Previously all dp clock handling was done when CRTC was enabled, thus
the FIMD device was in the resumed runtime pm state.
I will send a patch fixing this soon.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-18 10:01 ` Marek Szyprowski
@ 2025-06-18 10:05 ` Tomi Valkeinen
2025-06-18 16:27 ` Tomi Valkeinen
1 sibling, 0 replies; 17+ messages in thread
From: Tomi Valkeinen @ 2025-06-18 10:05 UTC (permalink / raw)
To: Marek Szyprowski, Maxime Ripard
Cc: Aradhya Bhatia, DRI Development List, Linux Kernel List,
Nishanth Menon, Vignesh Raghavendra, Devarsh Thakkar,
Jayesh Choudhary, Alexander Sverdlin, Dmitry Baryshkov,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On 18/06/2025 13:01, Marek Szyprowski wrote:
> On 18.06.2025 10:27, Maxime Ripard wrote:
>> On Wed, Jun 18, 2025 at 08:30:39AM +0200, Marek Szyprowski wrote:
>>> On 16.06.2025 17:40, Tomi Valkeinen wrote:
>>>> On 12/06/2025 09:31, Marek Szyprowski wrote:
>>>>> On 12.06.2025 07:49, Tomi Valkeinen wrote:
>>>>>> On 11/06/2025 13:45, Marek Szyprowski wrote:
>>>>>>> On 05.06.2025 19:15, Aradhya Bhatia wrote:
>>>>>>>> From: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>>>>>
>>>>>>>> Move the bridge pre_enable call before crtc enable, and the bridge
>>>>>>>> post_disable call after the crtc disable.
>>>>>>>>
>>>>>>>> The sequence of enable after this patch will look like:
>>>>>>>>
>>>>>>>> bridge[n]_pre_enable
>>>>>>>> ...
>>>>>>>> bridge[1]_pre_enable
>>>>>>>>
>>>>>>>> crtc_enable
>>>>>>>> encoder_enable
>>>>>>>>
>>>>>>>> bridge[1]_enable
>>>>>>>> ...
>>>>>>>> bridge[n]_enable
>>>>>>>>
>>>>>>>> And, the disable sequence for the display pipeline will look like:
>>>>>>>>
>>>>>>>> bridge[n]_disable
>>>>>>>> ...
>>>>>>>> bridge[1]_disable
>>>>>>>>
>>>>>>>> encoder_disable
>>>>>>>> crtc_disable
>>>>>>>>
>>>>>>>> bridge[1]_post_disable
>>>>>>>> ...
>>>>>>>> bridge[n]_post_disable
>>>>>>>>
>>>>>>>> The definition of bridge pre_enable hook says that,
>>>>>>>> "The display pipe (i.e. clocks and timing signals) feeding this bridge
>>>>>>>> will not yet be running when this callback is called".
>>>>>>>>
>>>>>>>> Since CRTC is also a source feeding the bridge, it should not be enabled
>>>>>>>> before the bridges in the pipeline are pre_enabled. Fix that by
>>>>>>>> re-ordering the sequence of bridge pre_enable and bridge post_disable.
>>>>>>>>
>>>>>>>> While at it, update the drm bridge API documentation as well.
>>>>>>>>
>>>>>>>> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>>>>>>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>>>>>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>>>>>> Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>>>>>>> Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>>>>>>>> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
>>>>>>>> Signed-off-by: Aradhya Bhatia <aradhya.bhatia@linux.dev>
>>>>>>> This patch landed in today's linux-next as commit c9b1150a68d9
>>>>>>> ("drm/atomic-helper: Re-order bridge chain pre-enable and
>>>>>>> post-disable"). In my tests I found that it breaks booting of Samsung
>>>>>>> Exynos 5420/5800 based Chromebooks (Peach-Pit and Peach-Pi). Both of
>>>>>>> them use Exynos DRM with Exynos_DP sub-driver (Analogix DP) and EDP
>>>>>>> panel. Booting stops at '[drm] Initialized exynos 1.1.0 for exynos-drm
>>>>>>> on minor 0' message. On the other hand, the Samsung Exynos5250 based
>>>>>>> Snow Chromebook boots fine, but it uses dp-lvds nxp,ptn3460 bridge and
>>>>>>> lvds panel instead of edp panels. This looks like some sort of deadlock,
>>>>>>> because if I disable FBDEV emulation, those boards boots fine and I'm
>>>>>>> able to run modetest and enable the display. Also the DRM kernel logger
>>>>>>> seems to be working fine, although I didn't check the screen output yet,
>>>>>>> as I only have a remote access to those boards. I will investigate it
>>>>>>> further and let You know.
>>>>>> Thanks for the report. I was trying to understand the pipeline, but I'm
>>>>>> a bit confused. Above you say Peach-Pit uses DP and EDP panel, but if I
>>>>>> look at arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts, it connects
>>>>>> a dp->lvds bridge (parade,ps8625). Peach-Pi seems to connect to an eDP
>>>>>> panel.
>>>>>>
>>>>>> Is the above correct? Do both Peach-Pi and Peach-Pit fail?
>>>>> Yes, sorry, my fault. I much have checked the same (peach-pi) dts 2
>>>>> times. Both Peach-Pi and Peach-Pit fails, while Snow works fine. All
>>>>> three use the same Exynos DP (based on analogix dp) driver. I will try
>>>>> to play a bit more with those boards in the afternoon, hopefully getting
>>>>> some more hints where the issue is.
>>>> Did you get a chance to test this more? Any hints what happens will help =)
>>> I've spent some time debugging this issue, but so far I only got
>>> something I don't really understand. This issue is somehow related with
>>> the DP clock enabling and disabling, what is being done from
>>> exynos_dp_poweron() and exynos_dp_poweroff() functions, which are called
>>> from analogix_dp_resume() and analogix_dp_suspend(). The lockup happens
>>> somewhere while registering the fbdev console, with console lock held,
>>> what makes debugging much harder.
>> You can skip the locking part with the fb.lockless_register_fb=1 kernel
>> parameter. It's of course not meant for anything but debugging, but it's
>> useful :)
>
> I've finally found where is the problem! It turned out that the issue is
> in the exynos_drm_fimd driver, in the code for enabling the display port
> clock (fimd_dp_clock_enable()
> function). It touches FIMD regs, but it was not guarded with FIMD's
> runtime pm calls and after the $subject change it happened that
> exynos_dp/analogix_dp code called the clock enable/disable when FIMD
> driver (which implements the CRTC object) was not runtime resumed.
> Previously all dp clock handling was done when CRTC was enabled, thus
> the FIMD device was in the resumed runtime pm state.
>
> I will send a patch fixing this soon.
Alright, sounds like we don't need to revert the re-ordering patch after
all =). Thanks for debugging this.
Tomi
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-18 10:01 ` Marek Szyprowski
2025-06-18 10:05 ` Tomi Valkeinen
@ 2025-06-18 16:27 ` Tomi Valkeinen
1 sibling, 0 replies; 17+ messages in thread
From: Tomi Valkeinen @ 2025-06-18 16:27 UTC (permalink / raw)
To: Marek Szyprowski, Maxime Ripard
Cc: Aradhya Bhatia, DRI Development List, Linux Kernel List,
Nishanth Menon, Vignesh Raghavendra, Devarsh Thakkar,
Jayesh Choudhary, Alexander Sverdlin, Dmitry Baryshkov,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter
On 18/06/2025 13:01, Marek Szyprowski wrote:
> I've finally found where is the problem! It turned out that the issue is
> in the exynos_drm_fimd driver, in the code for enabling the display port
> clock (fimd_dp_clock_enable()
> function). It touches FIMD regs, but it was not guarded with FIMD's
> runtime pm calls and after the $subject change it happened that
> exynos_dp/analogix_dp code called the clock enable/disable when FIMD
> driver (which implements the CRTC object) was not runtime resumed.
> Previously all dp clock handling was done when CRTC was enabled, thus
> the FIMD device was in the resumed runtime pm state.
We have another issue the this patch: i.MX8MM (and MP) seem to have a
problem with DSI, which is using the samsung-dsim.c driver. For me, the
first time I run kmstest I get a black screen. The second time I get a
display, but it's horizontally in the wrong place.
Perhaps you have an idea about this if you're familiar with the
samsung-dsim?.
The issue seems to be that earlier the order was:
mxsfb_crtc_atomic_enable()
samsung_dsim_atomic_pre_enable()
samsung_dsim_atomic_enable()
now the order is:
samsung_dsim_atomic_pre_enable()
mxsfb_crtc_atomic_enable()
samsung_dsim_atomic_enable()
If I move the samsung_dsim_init() call from
samsung_dsim_atomic_pre_enable() to samsung_dsim_atomic_enable(), it
starts to work.
My guess is that the DSI init requires a pixel stream from the crtc, and
now that the (pre)init is done without the pixel stream, it goes wrong.
But this is purely a guess so far.
I also see that the samsung_dsim_init() call is behind
"!samsung_dsim_hw_is_exynos()", so you probably don't hit this issue...
Tomi
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable
2025-06-05 17:15 ` [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Aradhya Bhatia
2025-06-11 10:45 ` Marek Szyprowski
@ 2025-10-22 8:24 ` Linus Walleij
1 sibling, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2025-10-22 8:24 UTC (permalink / raw)
To: Aradhya Bhatia
Cc: Tomi Valkeinen, Dmitry Baryshkov, Andrzej Hajda, Neil Armstrong,
Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, DRI Development List, Linux Kernel List,
Nishanth Menon, Vignesh Raghavendra, Devarsh Thakkar,
Jayesh Choudhary, Alexander Sverdlin
On Thu, Jun 5, 2025 at 7:15 PM Aradhya Bhatia <aradhya.bhatia@linux.dev> wrote:
> From: Aradhya Bhatia <a-bhatia1@ti.com>
>
> Move the bridge pre_enable call before crtc enable, and the bridge
> post_disable call after the crtc disable.
This commit regresses the MCDE driver to a hard boot failure.
Reverting the patch fixes the issue.
I think it has something to do with the internal DSI bridge in
drivers/gpu/drm/mcde/mcde_dsi.c
Any hints to what needs to be fixed here?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2025-12-03 3:43 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10 15:17 [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Vicente Bergas
2025-09-11 8:01 ` Aradhya Bhatia
2025-10-06 15:30 ` Aradhya Bhatia
2025-12-01 19:34 ` Vicente Bergas
2025-12-02 6:29 ` Laurent Pinchart
2025-12-03 3:43 ` Chaoyi Chen
-- strict thread matches above, loose matches on Subject: below --
2025-06-05 17:15 [PATCH v13 0/4] drm/atomic-helper: Re-order CRTC and Bridge ops Aradhya Bhatia
2025-06-05 17:15 ` [PATCH v13 3/4] drm/atomic-helper: Re-order bridge chain pre-enable and post-disable Aradhya Bhatia
2025-06-11 10:45 ` Marek Szyprowski
2025-06-12 5:49 ` Tomi Valkeinen
2025-06-12 6:31 ` Marek Szyprowski
2025-06-16 15:40 ` Tomi Valkeinen
2025-06-18 6:30 ` Marek Szyprowski
2025-06-18 8:27 ` Maxime Ripard
2025-06-18 10:01 ` Marek Szyprowski
2025-06-18 10:05 ` Tomi Valkeinen
2025-06-18 16:27 ` Tomi Valkeinen
2025-10-22 8:24 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox