[PATCH] drm/mediatek: mtk_dsi: do not enable HS clock in pre-enable for LPM panels

CK Hu (胡俊光) ck.hu at mediatek.com
Tue Nov 10 18:19:43 PST 2026


On Mon, 2026-10-19 at 16:23 +0300, Roman Vivchar via B4 Relay wrote:
> From: Roman Vivchar <rva333 at protonmail.com>
> 
> Commit 76255024cadb ("drm/mediatek: mtk_dsi: enable hs clock during
> pre-enable") moved HS clock enablement from the 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 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 at vger.kernel.org
> Signed-off-by: Roman Vivchar <rva333 at protonmail.com>
> ---
> This fix was tested with the Tianma NT36672A panel on the mt6768 platform.
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 7961139333ad..e5b433f353d5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -794,6 +794,7 @@ static void mtk_output_dsi_enable(struct mtk_dsi *dsi)
>  		return;
>  
>  	mtk_dsi_set_mode(dsi);
> +	mtk_dsi_clk_hs_mode(dsi, 1);

Even this is no-op for non-LPM bridges, but I would like

        if (dsi->mode_flags & MIPI_DSI_MODE_LPM)
                mtk_dsi_clk_hs_mode(dsi, 1);

This make clear that do this just for LPM.

Regards,
CK

>  	mtk_dsi_start(dsi);
>  
>  	dsi->enabled = true;
> @@ -858,7 +859,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,
> --  
> Roman Vivchar <rva333 at protonmail.com>
> 
> 
> 



More information about the Linux-mediatek mailing list