The struct drm_panel_funcs are offering a prepare() and an enable() entrypoint for panels. According to drm/panel.h: "The .prepare() function is typically called before the display controller starts to transmit video data." and "After the display controller has started transmitting video data, it's safe to call the .enable() function." The st7701 driver currently does not respect this, queing DSI control commands during enable. While generally fine this can lead to a fillup of the transmission queue before the transmission is set up on certain dsi bridges. This issue can also be seen on downstream imx8m* kernels. By moving the init sequence into the enable function we not only circumvent the issue but also properly soft-reset the panel on enable(). Signed-off-by: Mimoja <git@xxxxxxxxx> Cc: Marek Vasut <marex@xxxxxxx> Cc: Guido Günther <agx@xxxxxxxxxxx> Cc: Jagan Teki <jagan@xxxxxxxxxxxxxxxxxxxx> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx> Cc: Thierry Reding <thierry.reding@xxxxxxxxx> --- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c index 7eae83aa0ea1..18c5a8d97cc8 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c @@ -439,6 +439,13 @@ static int st7701_prepare(struct drm_panel *panel) gpiod_set_value(st7701->reset, 1); msleep(150); + return 0; +} + +static int st7701_enable(struct drm_panel *panel) +{ + struct st7701 *st7701 = panel_to_st7701(panel); + st7701_init_sequence(st7701); if (st7701->desc->gip_sequence) @@ -447,13 +454,6 @@ static int st7701_prepare(struct drm_panel *panel) /* Disable Command2 */ st7701_switch_cmd_bkx(st7701, false, 0); - return 0; -} - -static int st7701_enable(struct drm_panel *panel) -{ - struct st7701 *st7701 = panel_to_st7701(panel); - ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); return 0; -- 2.39.2