[PATCH] drm/panel: raydium-rm67200: Move initialization from enable() to prepare stage

neil.armstrong at linaro.org neil.armstrong at linaro.org
Mon Jun 30 15:32:38 UTC 2025


On 18/06/2025 11:15, Andy Yan wrote:
> From: Andy Yan <andy.yan at rock-chips.com>
> 
> The DSI host has different modes in prepare() and enable() functions,
> prepare() is in LP command mode and enable() is in HS video mode.
> 
>  From our experience, generally the initialization sequence needs to be
> sent in the LP command mode.
> 
> Move the setup init function from enable() to prepare() to fix a display
> shift on rk3568 evb.
> 
> Tested on rk3568/rk3576/rk3588 EVB.
> 
> Signed-off-by: Andy Yan <andy.yan at rock-chips.com>
> ---
> 
>   drivers/gpu/drm/panel/panel-raydium-rm67200.c | 22 ++++++-------------
>   1 file changed, 7 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-raydium-rm67200.c b/drivers/gpu/drm/panel/panel-raydium-rm67200.c
> index df6c1727237b5..459381d53847f 100644
> --- a/drivers/gpu/drm/panel/panel-raydium-rm67200.c
> +++ b/drivers/gpu/drm/panel/panel-raydium-rm67200.c
> @@ -320,6 +320,7 @@ static void w552793baa_setup(struct mipi_dsi_multi_context *ctx)
>   static int raydium_rm67200_prepare(struct drm_panel *panel)
>   {
>   	struct raydium_rm67200 *ctx = to_raydium_rm67200(panel);
> +	struct mipi_dsi_multi_context mctx = { .dsi = ctx->dsi };
>   	int ret;
>   
>   	ret = regulator_bulk_enable(ctx->num_supplies, ctx->supplies);
> @@ -330,6 +331,12 @@ static int raydium_rm67200_prepare(struct drm_panel *panel)
>   
>   	msleep(60);
>   
> +	ctx->panel_info->panel_setup(&mctx);
> +	mipi_dsi_dcs_exit_sleep_mode_multi(&mctx);
> +	mipi_dsi_msleep(&mctx, 120);
> +	mipi_dsi_dcs_set_display_on_multi(&mctx);
> +	mipi_dsi_msleep(&mctx, 30);
> +
>   	return 0;
>   }
>   
> @@ -345,20 +352,6 @@ static int raydium_rm67200_unprepare(struct drm_panel *panel)
>   	return 0;
>   }
>   
> -static int raydium_rm67200_enable(struct drm_panel *panel)
> -{
> -	struct raydium_rm67200 *rm67200 = to_raydium_rm67200(panel);
> -	struct mipi_dsi_multi_context ctx = { .dsi = rm67200->dsi };
> -
> -	rm67200->panel_info->panel_setup(&ctx);
> -	mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
> -	mipi_dsi_msleep(&ctx, 120);
> -	mipi_dsi_dcs_set_display_on_multi(&ctx);
> -	mipi_dsi_msleep(&ctx, 30);
> -
> -	return ctx.accum_err;
> -}
> -
>   static int raydium_rm67200_disable(struct drm_panel *panel)
>   {
>   	struct raydium_rm67200 *rm67200 = to_raydium_rm67200(panel);
> @@ -383,7 +376,6 @@ static const struct drm_panel_funcs raydium_rm67200_funcs = {
>   	.prepare = raydium_rm67200_prepare,
>   	.unprepare = raydium_rm67200_unprepare,
>   	.get_modes = raydium_rm67200_get_modes,
> -	.enable = raydium_rm67200_enable,
>   	.disable = raydium_rm67200_disable,
>   };
>   

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>


More information about the dri-devel mailing list