* [PATCH RESEND] drm/mediatek: dsi: force command mode in mtk_dsi_poweron()
@ 2026-10-04 20:48 Ryan Brue
2026-10-12 8:27 ` CK Hu (胡俊光)
0 siblings, 1 reply; 2+ messages in thread
From: Ryan Brue @ 2026-10-04 20:48 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel, Ryan Brue
mtk_dsi_reset_engine() does not touch DSI_MODE_CTRL, so whatever the
bootloader left there survives power-on. On boards where the bootloader
lights the panel for a boot logo and hands the DSI over still running, the
leftover value is a video mode, and the first mtk_dsi_host_transfer() then
takes the "already streaming" path: it stops the stream and waits for
VM_DONE, which never arrives, because the engine reset has already stopped
the stream. The panel's very first command fails and it is never
initialised:
[drm] Wait DSI IRQ(0x00000008) Timeout
*ERROR* failed to switch cmd mode
sending dcs data 8f a5 failed: -62
Set command mode right after the engine reset, so DSI_MODE_CTRL describes
the state the reset leaves the engine in. The video mode is programmed by
mtk_dsi_set_mode() when the stream is actually started, exactly as today.
Seen on the Amazon Fire HD 10 (2017), whose LK bootloader draws its logo
over DSI in video mode and never stops the stream before jumping to the
kernel.
Assisted-by: LLM
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
---
The board this was found on, an Amazon Fire HD 10 (2017), is not upstream
yet, so no in-tree board regresses without this. It is a state-consistency
fix either way: mtk_dsi_reset_engine() stops the stream but leaves
DSI_MODE_CTRL still describing the mode the bootloader was driving, and
nothing writes that register again until mtk_dsi_set_mode() at stream start.
This touches the same lines as "drm/mediatek: mtk_dsi: Transfer register
offsets to per-SoC const" from the MT8196 series; I will rebase on top of
that if it lands first.
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 7961139333ad..4cb486f54653 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -737,6 +737,15 @@ static int mtk_dsi_poweron(struct mtk_dsi *dsi)
dsi->regs + dsi->driver_data->reg_shadow_dbg_off);
mtk_dsi_reset_engine(dsi);
+
+ /*
+ * mtk_dsi_reset_engine() leaves DSI_MODE_CTRL alone, so a video mode
+ * left there by a bootloader that handed the panel over still running
+ * would make the first command wait for a VM_DONE that never arrives.
+ * mtk_dsi_set_mode() programs the real mode when the stream starts.
+ */
+ mtk_dsi_set_cmd_mode(dsi);
+
mtk_dsi_phy_timconfig(dsi);
mtk_dsi_ps_control(dsi, true);
---
base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
change-id: 20260916-rbrue-suez-upstreaming-mtk-dsi-cmd-mode-d834c029f4b8
Best regards,
--
Ryan Brue <ryanbrue.dev@gmail.com>
--
Ryan Brue <ryanbrue.dev@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] drm/mediatek: dsi: force command mode in mtk_dsi_poweron()
2026-10-04 20:48 [PATCH RESEND] drm/mediatek: dsi: force command mode in mtk_dsi_poweron() Ryan Brue
@ 2026-10-12 8:27 ` CK Hu (胡俊光)
0 siblings, 0 replies; 2+ messages in thread
From: CK Hu (胡俊光) @ 2026-10-12 8:27 UTC (permalink / raw)
To: p.zabel, AngeloGioacchino Del Regno, chunkuang.hu, ryanbrue.dev,
airlied, matthias.bgg, simona
Cc: dri-devel, linux-mediatek, linux-arm-kernel, linux-kernel
On Sun, 2026-10-04 at 15:48 -0500, Ryan Brue wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> mtk_dsi_reset_engine() does not touch DSI_MODE_CTRL, so whatever the
> bootloader left there survives power-on. On boards where the bootloader
> lights the panel for a boot logo and hands the DSI over still running, the
> leftover value is a video mode, and the first mtk_dsi_host_transfer() then
> takes the "already streaming" path: it stops the stream and waits for
> VM_DONE, which never arrives, because the engine reset has already stopped
> the stream. The panel's very first command fails and it is never
> initialised:
>
> [drm] Wait DSI IRQ(0x00000008) Timeout
> *ERROR* failed to switch cmd mode
> sending dcs data 8f a5 failed: -62
>
> Set command mode right after the engine reset, so DSI_MODE_CTRL describes
> the state the reset leaves the engine in. The video mode is programmed by
> mtk_dsi_set_mode() when the stream is actually started, exactly as today.
>
> Seen on the Amazon Fire HD 10 (2017), whose LK bootloader draws its logo
> over DSI in video mode and never stops the stream before jumping to the
> kernel.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Assisted-by: LLM
> Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
> ---
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-12 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04 20:48 [PATCH RESEND] drm/mediatek: dsi: force command mode in mtk_dsi_poweron() Ryan Brue
2026-10-12 8:27 ` CK Hu (胡俊光)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®