* [PATCH v2] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels
@ 2026-11-17 18:26 Roman Vivchar via B4 Relay
2026-11-18 3:14 ` CK Hu (胡俊光)
2026-11-18 20:09 ` Ryan Brue
0 siblings, 2 replies; 3+ messages in thread
From: Roman Vivchar via B4 Relay @ 2026-11-17 18:26 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
Matthias Brugger, AngeloGioacchino Del Regno, CK Hu, Gary Bisson
Cc: dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel, stable,
Roman Vivchar
From: Roman Vivchar <rva333@protonmail.com>
Commit 76255024cadb ("drm/mediatek: mtk_dsi: enable hs clock during
pre-enable") moved HS clock enablement from mtk_output_dsi_enable()
to mtk_dsi_poweron(). Later, the commit 3e191eddbdcb ("drm/mediatek:
mtk_dsi: Enable HS clock only at pre-enable") moved the call to the
mtk_dsi_bridge_atomic_pre_enable().
However, mtk_dsi_lane_ready() explicitly sets mtk_dsi_clk_hs_mode(dsi, 0)
so that DSI panels with MIPI_DSI_MODE_LPM can transmit initialization
commands in Low-Power mode during their prepare() callback. Enabling the
HS clock unconditionally in mtk_dsi_bridge_atomic_pre_enable() overrides
this before panel prepare() runs, causing command transmission to fail.
Only enable the HS clock in mtk_dsi_bridge_atomic_pre_enable(), when
MIPI_DSI_MODE_LPM is not set, and restore mtk_dsi_clk_hs_mode(dsi, 1) in
mtk_output_dsi_enable(). This is a no-op for non-LPM bridges.
Fixes: 76255024cadb ("drm/mediatek: mtk_dsi: enable hs clock during pre-enable")
Fixes: 3e191eddbdcb ("drm/mediatek: mtk_dsi: Enable HS clock only at pre-enable")
Cc: stable@vger.kernel.org
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
This fix was tested with the Tianma NT36672A panel on the mt6768 platform.
---
Changes in v2:
- Call mtk_dsi_clk_hs_mode in mtk_output_dsi_enable only for LPM bridges (CK Hu)
- Minor commit message grammar fixes
- Link to v1: https://patch.msgid.link/20261019-6768-dsi-fix-v1-1-3e5616b45a67@protonmail.com
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 7961139333ad..2108b2eeadd0 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -794,6 +794,8 @@ static void mtk_output_dsi_enable(struct mtk_dsi *dsi)
return;
mtk_dsi_set_mode(dsi);
+ if (dsi->mode_flags & MIPI_DSI_MODE_LPM)
+ mtk_dsi_clk_hs_mode(dsi, 1);
mtk_dsi_start(dsi);
dsi->enabled = true;
@@ -858,7 +860,8 @@ static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
drm_err(drm, "failed to power on dsi\n");
mtk_dsi_lane_ready(dsi);
- mtk_dsi_clk_hs_mode(dsi, 1);
+ if (!(dsi->mode_flags & MIPI_DSI_MODE_LPM))
+ mtk_dsi_clk_hs_mode(dsi, 1);
}
static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
---
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
change-id: 20261019-6768-dsi-fix-9f0c2ca2ba9f
Best regards,
--
rva3 <rva333@protonmail.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels
2026-11-17 18:26 [PATCH v2] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels Roman Vivchar via B4 Relay
@ 2026-11-18 3:14 ` CK Hu (胡俊光)
2026-11-18 20:09 ` Ryan Brue
1 sibling, 0 replies; 3+ messages in thread
From: CK Hu (胡俊光) @ 2026-11-18 3:14 UTC (permalink / raw)
To: chunkuang.hu@kernel.org, simona@ffwll.ch,
AngeloGioacchino Del Regno, airlied@gmail.com,
bisson.gary@gmail.com, rva333@protonmail.com,
p.zabel@pengutronix.de, matthias.bgg@gmail.com
Cc: dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org, stable@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
On Tue, 2026-11-17 at 20:26 +0200, Roman Vivchar via B4 Relay wrote:
> From: Roman Vivchar <rva333@protonmail.com>
>
> Commit 76255024cadb ("drm/mediatek: mtk_dsi: enable hs clock during
> pre-enable") moved HS clock enablement from mtk_output_dsi_enable()
> to mtk_dsi_poweron(). Later, the commit 3e191eddbdcb ("drm/mediatek:
> mtk_dsi: Enable HS clock only at pre-enable") moved the call to the
> mtk_dsi_bridge_atomic_pre_enable().
>
> However, mtk_dsi_lane_ready() explicitly sets mtk_dsi_clk_hs_mode(dsi, 0)
> so that DSI panels with MIPI_DSI_MODE_LPM can transmit initialization
> commands in Low-Power mode during their prepare() callback. Enabling the
> HS clock unconditionally in mtk_dsi_bridge_atomic_pre_enable() overrides
> this before panel prepare() runs, causing command transmission to fail.
>
> Only enable the HS clock in mtk_dsi_bridge_atomic_pre_enable(), when
> MIPI_DSI_MODE_LPM is not set, and restore mtk_dsi_clk_hs_mode(dsi, 1) in
> mtk_output_dsi_enable(). This is a no-op for non-LPM bridges.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Fixes: 76255024cadb ("drm/mediatek: mtk_dsi: enable hs clock during pre-enable")
> Fixes: 3e191eddbdcb ("drm/mediatek: mtk_dsi: Enable HS clock only at pre-enable")
> Cc: stable@vger.kernel.org
> Signed-off-by: Roman Vivchar <rva333@protonmail.com>
> ---
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels
2026-11-17 18:26 [PATCH v2] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels Roman Vivchar via B4 Relay
2026-11-18 3:14 ` CK Hu (胡俊光)
@ 2026-11-18 20:09 ` Ryan Brue
1 sibling, 0 replies; 3+ messages in thread
From: Ryan Brue @ 2026-11-18 20:09 UTC (permalink / raw)
To: rva333
Cc: airlied, angelogioacchino.delregno, bisson.gary, chunkuang.hu,
ck.hu, dri-devel, linux-arm-kernel, linux-kernel, linux-mediatek,
matthias.bgg, p.zabel, simona, stable
On Tue, Nov 17, 2026, Roman Vivchar wrote:
> Only enable the HS clock in mtk_dsi_bridge_atomic_pre_enable(), when
> MIPI_DSI_MODE_LPM is not set, and restore mtk_dsi_clk_hs_mode(dsi, 1) in
> mtk_output_dsi_enable(). This is a no-op for non-LPM bridges.
Tested on MT8173 (Amazon Fire HD 10 2017). The Novatek NT51021 panel on
this device sets MIPI_DSI_MODE_LPM, on v7.4-rc3. Tested with repeating
blank/unblank cycles, and verified the init commands complete and the
link ends up in HS video mode as before.
Tested-by: Ryan Brue <ryanbrue.dev@gmail.com> # MT8173, NT51021
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-18 20:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 18:26 [PATCH v2] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels Roman Vivchar via B4 Relay
2026-11-18 3:14 ` CK Hu (胡俊光)
2026-11-18 20:09 ` Ryan Brue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox