* [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 (胡俊光)
` (2 more replies)
0 siblings, 3 replies; 6+ 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] 6+ 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 (胡俊光)
2026-10-16 16:58 ` Roman Vivchar
2026-11-11 2:26 ` Ryan Brue
2 siblings, 0 replies; 6+ 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] 6+ 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 (胡俊光)
@ 2026-10-16 16:58 ` Roman Vivchar
2026-11-11 2:26 ` Ryan Brue
2 siblings, 0 replies; 6+ messages in thread
From: Roman Vivchar @ 2026-10-16 16:58 UTC (permalink / raw)
To: Ryan Brue
Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
Matthias Brugger, AngeloGioacchino Del Regno, dri-devel,
linux-mediatek, linux-kernel, linux-arm-kernel
On Sunday, October 4th, 2026 at 11:49 PM, Ryan Brue <ryanbrue.dev@gmail.com> wrote:
> 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>
This is useful for quite lot of mobile SoCs, at least mt6572 and 6768.
Acked-by: Roman Vivchar <rva333@protonmail.com>
Best regards,
Roman
^ permalink raw reply [flat|nested] 6+ 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 (胡俊光)
2026-10-16 16:58 ` Roman Vivchar
@ 2026-11-11 2:26 ` Ryan Brue
2026-11-11 2:43 ` CK Hu (胡俊光)
2 siblings, 1 reply; 6+ messages in thread
From: Ryan Brue @ 2026-11-11 2:26 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
Hi Chun-Kuang,
Gentle ping on this one for mediatek-drm-next now that 7.4-rc1 is out.
It has CK's Reviewed-by and Roman's Acked-by, and it still applies
cleanly to v7.4-rc2 and mediatek-drm-next. I can resend it with the tags
if that's easier.
Thanks,
Ryan Brue
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND] drm/mediatek: dsi: force command mode in mtk_dsi_poweron()
2026-11-11 2:26 ` Ryan Brue
@ 2026-11-11 2:43 ` CK Hu (胡俊光)
2026-11-11 2:47 ` Ryan Brue
0 siblings, 1 reply; 6+ messages in thread
From: CK Hu (胡俊光) @ 2026-11-11 2:43 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 Tue, 2026-11-10 at 20:26 -0600, Ryan Brue wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> Hi Chun-Kuang,
>
> Gentle ping on this one for mediatek-drm-next now that 7.4-rc1 is out.
> It has CK's Reviewed-by and Roman's Acked-by, and it still applies
> cleanly to v7.4-rc2 and mediatek-drm-next. I can resend it with the tags
> if that's easier.
Hi, I'm Chun-Kuang [1].
It's not necessary to resend.
I would apply this patch later.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93e97f715b24114169d18654e09c646fd9e14979
Chun-Kuang.
>
> Thanks,
> Ryan Brue
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND] drm/mediatek: dsi: force command mode in mtk_dsi_poweron()
2026-11-11 2:43 ` CK Hu (胡俊光)
@ 2026-11-11 2:47 ` Ryan Brue
0 siblings, 0 replies; 6+ messages in thread
From: Ryan Brue @ 2026-11-11 2:47 UTC (permalink / raw)
To: CK Hu (胡俊光),
p.zabel, AngeloGioacchino Del Regno, chunkuang.hu, airlied,
matthias.bgg, simona
Cc: dri-devel, linux-mediatek, linux-arm-kernel, linux-kernel
On 11/10/26 8:43 PM, CK Hu (胡俊光) wrote:
> Hi, I'm Chun-Kuang [1].
> It's not necessary to resend.
> I would apply this patch later.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93e97f715b24114169d18654e09c646fd9e14979
>
> Chun-Kuang.
Hi Chun-Kuang,
I'm so sorry, my brain must be taking a day off :p thank you for the
response!
Best Regards,
Ryan Brue
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-11 2:47 UTC | newest]
Thread overview: 6+ 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 (胡俊光)
2026-10-16 16:58 ` Roman Vivchar
2026-11-11 2:26 ` Ryan Brue
2026-11-11 2:43 ` CK Hu (胡俊光)
2026-11-11 2:47 ` Ryan Brue
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®