Hi Linus,
On Thu, 20 Nov 2025 at 23:56, Linus Walleij <[email protected]> wrote:
> commit c9b1150a68d9362a0827609fc0dc1664c0d8bfe1
> "drm/atomic-helper: Re-order bridge chain pre-enable and post-disable"
> caused regressions in all bridges that e.g. send DSI commands in
> their .prepare() and .unprepare() callbacks when used with R-Car DU.
>
> This is needed on R-Car DU, where the CRTC provides clock to LVDS
> and DSI, and has to be started before a bridge may call .prepare,
> which may trigger e.g. a DSI transfer.
>
> This specifically fixes the case where ILI9881C is connected to R-Car
> DU DSI. The ILI9881C panel driver does DSI command transfer in its
> struct drm_panel_funcs .prepare function, which is currently called
> before R-Car DU rcar_du_crtc_atomic_enable() rcar_mipi_dsi_pclk_enable()
> and the DSI command transfer times out.
>
> Fixes: c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable and
> post-disable")
> Link:
> https://lore.kernel.org/all/20251107230517.471894-1-marek.vasut%2Brenesas%40mailbox.org/
> Co-developed-by: Marek Vasut <[email protected]>
> Signed-off-by: Marek Vasut <[email protected]>
> Signed-off-by: Linus Walleij <[email protected]>
Thanks for your patch!
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
> @@ -540,11 +540,30 @@ static void rcar_du_atomic_commit_tail(struct
> drm_atomic_state *old_state)
> rcdu->dpad1_source = rcrtc->index;
> }
>
> - /* Apply the atomic update. */
> - drm_atomic_helper_commit_modeset_disables(dev, old_state);
> + /*
> + * Apply the atomic update.
> + *
> + * We need special ordering to make sure the CRTC disabled last
> + * and enabled first. We do this with modified versions of the
> + * common modeset_disables/enables functions.
> + */
> +
> + /* Variant of drm_atomic_helper_commit_modeset_disables() */
> + drm_encoder_bridge_disable(dev, state);
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c:555:41: error: ‘state’
undeclared (first use in this function); did you mean ‘statx’?
old_state (everywhere)?
After making that change, it still works on Koelsch (R-Car M2-W),
which was not affected by the breakage.
> + drm_encoder_bridge_post_disable(dev, state);
> + drm_crtc_disable(dev, state);
> + drm_atomic_helper_update_legacy_modeset_state(dev, state);
> + drm_atomic_helper_calc_timestamping_constants(state);
> + drm_crtc_set_mode(dev, state);
> +
> drm_atomic_helper_commit_planes(dev, old_state,
> DRM_PLANE_COMMIT_ACTIVE_ONLY);
> - drm_atomic_helper_commit_modeset_enables(dev, old_state);
> +
> + /* Variant of drm_atomic_helper_commit_modeset_enables() */
> + drm_crtc_enable(dev, state);
> + drm_encoder_bridge_pre_enable(dev, state);
> + drm_encoder_bridge_enable(dev, state);
> + drm_atomic_helper_commit_writebacks(dev, state);
>
> drm_atomic_helper_commit_hw_done(old_state);
> drm_atomic_helper_wait_for_flip_done(dev, old_state);
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds