* [PATCH 0/2] drm: Fix rm68200 panel shutdown on nwl-dsi
@ 2026-11-25 7:54 Stefan Ghetu
2026-11-25 7:54 ` [PATCH 1/2] drm/bridge: nwl-dsi: Move DSI host disablement to ->atomic_post_disable() Stefan Ghetu
2026-11-25 7:54 ` [PATCH 2/2] drm/panel: raydium-rm68200: Set prepare_prev_first Stefan Ghetu
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Ghetu @ 2026-11-25 7:54 UTC (permalink / raw)
To: dri-devel
Cc: linux-arm-kernel, linux-kernel, linux-stm32, devicetree,
Alexandre Torgue, Andrzej Hajda, Conor Dooley, David Airlie,
Fabio Estevam, Guido Günther, Jernej Skrabec, Jessica Zhang,
Jonas Karlman, Krzysztof Kozlowski, Laurent Pinchart,
Luca Ceresoli, Maarten Lankhorst, Maxime Coquelin, Maxime Ripard,
Neil Armstrong, Philippe Cornu, Raphael Gallais-Pou,
Robert Chiras, Robert Foss, Rob Herring, Sam Ravnborg,
Simona Vetter, Thomas Zimmermann, Yannick Fertre, Stefan Ghetu
The Raydium RM68200 panel sends MIPI_DCS_SET_DISPLAY_OFF and
MIPI_DCS_ENTER_SLEEP_MODE from its unprepare() callback. On i.MX8MQ
with the nwl-dsi host, those commands never reach the panel, because
nwl-dsi has already shut down the DSI controller and PHY by then.
Two changes are needed, one on each side of the link:
Patch 1 moves the nwl-dsi shutdown from ->atomic_disable() to
->atomic_post_disable(). On its own this does not change the outcome,
since the default bridge ordering still runs the host's post_disable
before the panel's.
Patch 2 sets prepare_prev_first on the RM68200 panel, so that the
panel is unprepared before the DSI host bridge's post_disable. On its
own this does not help on nwl-dsi either, since the link is torn down
earlier, in ->atomic_disable().
With both applied, the panel sends its shutdown commands while the
link is still up. Neither patch is expected to regress anything on
its own, and they touch separate drivers, so they can be applied
independently.
Patch 2 also changes the prepare/unprepare ordering on the only
upstream user of this panel, stm32mp157c-ev1 with the STM32 DSI host.
That host enables the link in ->atomic_pre_enable() and disables it in
->atomic_post_disable(), so the new ordering should be correct there
as well, but I have not been able to test it on that board.
Liu Ying (1):
drm/bridge: nwl-dsi: Move DSI host disablement to
->atomic_post_disable()
Stefan Ghetu (1):
drm/panel: raydium-rm68200: Set prepare_prev_first
drivers/gpu/drm/bridge/nwl-dsi.c | 6 +++---
drivers/gpu/drm/panel/panel-raydium-rm68200.c | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] drm/bridge: nwl-dsi: Move DSI host disablement to ->atomic_post_disable()
2026-11-25 7:54 [PATCH 0/2] drm: Fix rm68200 panel shutdown on nwl-dsi Stefan Ghetu
@ 2026-11-25 7:54 ` Stefan Ghetu
2026-11-25 7:54 ` [PATCH 2/2] drm/panel: raydium-rm68200: Set prepare_prev_first Stefan Ghetu
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Ghetu @ 2026-11-25 7:54 UTC (permalink / raw)
To: dri-devel
Cc: linux-arm-kernel, linux-kernel, linux-stm32, devicetree,
Alexandre Torgue, Andrzej Hajda, Conor Dooley, David Airlie,
Fabio Estevam, Guido Günther, Jernej Skrabec, Jessica Zhang,
Jonas Karlman, Krzysztof Kozlowski, Laurent Pinchart,
Luca Ceresoli, Maarten Lankhorst, Maxime Coquelin, Maxime Ripard,
Neil Armstrong, Philippe Cornu, Raphael Gallais-Pou,
Robert Chiras, Robert Foss, Rob Herring, Sam Ravnborg,
Simona Vetter, Thomas Zimmermann, Yannick Fertre, Liu Ying,
Stefan Ghetu
From: Liu Ying <victor.liu@nxp.com>
Some MIPI DSI panels, like the Raydium RM68200, send DCS commands such
as MIPI_DCS_SET_DISPLAY_OFF and MIPI_DCS_ENTER_SLEEP_MODE from their
drm_panel_funcs::unprepare() callback. For those commands to reach the
panel, the DSI host controller and its PHY must still be running.
The panel bridge calls drm_panel_unprepare() from its post_disable
hook, while nwl-dsi currently shuts down the controller, the PHY and
the clocks from ->atomic_disable(). Since all ->atomic_disable() hooks
in a bridge chain run before any ->atomic_post_disable() hook, the DSI
link is already down by the time the panel tries to talk to it.
Move the disablement to ->atomic_post_disable(), so that a downstream
panel bridge that sets pre_enable_prev_first gets a chance to send its
shutdown commands first. The enable side is unaffected: the controller
is brought out of reset in ->mode_set(), which runs before any
pre_enable hook.
Fixes: 44cfc6233447 ("drm/bridge: Add NWL MIPI DSI host controller support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Stefan Ghetu <stefan.ghetu@nxp.com>
---
drivers/gpu/drm/bridge/nwl-dsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 09992529f3d85..5c82f0986eabb 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -736,8 +736,8 @@ static int nwl_dsi_disable(struct nwl_dsi *dsi)
return 0;
}
-static void nwl_dsi_bridge_atomic_disable(struct drm_bridge *bridge,
- struct drm_atomic_commit *state)
+static void nwl_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
+ struct drm_atomic_commit *state)
{
struct nwl_dsi *dsi = bridge_to_dsi(bridge);
int ret;
@@ -963,7 +963,7 @@ static const struct drm_bridge_funcs nwl_dsi_bridge_funcs = {
.atomic_create_state = drm_atomic_helper_bridge_create_state,
.atomic_check = nwl_dsi_bridge_atomic_check,
.atomic_enable = nwl_dsi_bridge_atomic_enable,
- .atomic_disable = nwl_dsi_bridge_atomic_disable,
+ .atomic_post_disable = nwl_dsi_bridge_atomic_post_disable,
.atomic_get_input_bus_fmts = nwl_bridge_atomic_get_input_bus_fmts,
.mode_set = nwl_dsi_bridge_mode_set,
.mode_valid = nwl_dsi_bridge_mode_valid,
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] drm/panel: raydium-rm68200: Set prepare_prev_first
2026-11-25 7:54 [PATCH 0/2] drm: Fix rm68200 panel shutdown on nwl-dsi Stefan Ghetu
2026-11-25 7:54 ` [PATCH 1/2] drm/bridge: nwl-dsi: Move DSI host disablement to ->atomic_post_disable() Stefan Ghetu
@ 2026-11-25 7:54 ` Stefan Ghetu
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Ghetu @ 2026-11-25 7:54 UTC (permalink / raw)
To: dri-devel
Cc: linux-arm-kernel, linux-kernel, linux-stm32, devicetree,
Alexandre Torgue, Andrzej Hajda, Conor Dooley, David Airlie,
Fabio Estevam, Guido Günther, Jernej Skrabec, Jessica Zhang,
Jonas Karlman, Krzysztof Kozlowski, Laurent Pinchart,
Luca Ceresoli, Maarten Lankhorst, Maxime Coquelin, Maxime Ripard,
Neil Armstrong, Philippe Cornu, Raphael Gallais-Pou,
Robert Chiras, Robert Foss, Rob Herring, Sam Ravnborg,
Simona Vetter, Thomas Zimmermann, Yannick Fertre, Stefan Ghetu
rm68200_unprepare() sends MIPI_DCS_SET_DISPLAY_OFF and
MIPI_DCS_ENTER_SLEEP_MODE, and rm68200_prepare() sends the init
sequence followed by MIPI_DCS_EXIT_SLEEP_MODE and
MIPI_DCS_SET_DISPLAY_ON. All of these need a working DSI link.
By default, the panel bridge is prepared before the upstream DSI host
bridge's ->atomic_pre_enable() and unprepared after the DSI host
bridge's ->atomic_post_disable(). A DSI host that tears down the link
in ->atomic_post_disable() therefore does so before the panel has sent
its shutdown commands.
Set prepare_prev_first so the panel is prepared after, and unprepared
before, the DSI host bridge, which is what a panel driven by DCS
commands from its prepare/unprepare callbacks requires.
Signed-off-by: Stefan Ghetu <stefan.ghetu@nxp.com>
---
drivers/gpu/drm/panel/panel-raydium-rm68200.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c b/drivers/gpu/drm/panel/panel-raydium-rm68200.c
index c535dc931903e..cc87f587ca78f 100644
--- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c
+++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c
@@ -360,6 +360,8 @@ static int rm68200_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;
+ ctx->panel.prepare_prev_first = true;
+
drm_panel_add(&ctx->panel);
ret = mipi_dsi_attach(dsi);
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-25 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 7:54 [PATCH 0/2] drm: Fix rm68200 panel shutdown on nwl-dsi Stefan Ghetu
2026-11-25 7:54 ` [PATCH 1/2] drm/bridge: nwl-dsi: Move DSI host disablement to ->atomic_post_disable() Stefan Ghetu
2026-11-25 7:54 ` [PATCH 2/2] drm/panel: raydium-rm68200: Set prepare_prev_first Stefan Ghetu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox