drivers/gpu/drm/panel/panel-raydium-rm67200.c | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-)
From: Andy Yan <andy.yan@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@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,
};
--
2.43.0
base-commit: 082174f76c95dd503de64f182537c89b49771491
branch: rk356x_rk3588_rk3576_dsi
Hi, On Wed, 18 Jun 2025 17:15:20 +0800, Andy Yan wrote: > 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. > > [...] Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next) [1/1] drm/panel: raydium-rm67200: Move initialization from enable() to prepare stage https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/691674a282bdbf8f8bce4094369a2d1e4b5645e9 -- Neil
On 18/06/2025 11:15, Andy Yan wrote: > From: Andy Yan <andy.yan@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@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@linaro.org>
© 2016 - 2025 Red Hat, Inc.