mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: "Guido Günther" <agx@sigxcpu.org>,
	"Jessica Zhang" <jesszhan0024@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	phone-devel@vger.kernel.org, David Heidelberg <david@ixit.cz>
Subject: Re: [PATCH 1/2] drm/panel: visionox-rm69299: Split DSI commands out into enable/disable
Date: Thu, 7 May 2026 09:11:47 +0200	[thread overview]
Message-ID: <d3f99285-1811-45f7-91be-5017438c2475@linaro.org> (raw)
In-Reply-To: <20260427-visionox-rm69299-enable-v1-1-fa7d62d26d87@sigxcpu.org>

On 4/27/26 15:56, Guido Günther wrote:
> It's when DSI commands should be sent and it also fixes these DSI errors
> on every screen blank/unblank on the SHIFT6mq:
> 
> dmesg:
>    msm_dsi ae94000.dsi: [drm:dsi_cmds2buf_tx] *ERROR* wait for video done timed out
>    dsi_cmds2buf_tx: cmd dma tx failed, type=0x5, data0=0x28, len=4, ret=-110
>    panel-visionox-rm69299 ae94000.dsi.0: sending DCS SET_DISPLAY_OFF failed: -110

This error is un unprepare, the link should be in LP11 so the command should still work,
but you can move them to disable(), but in the other way you should still keep the
power on commands in prepare() since the link is in LP11 and video is not flowing.

Neil

> 
> Signed-off-by: Guido Günther <agx@sigxcpu.org>
> ---
>   drivers/gpu/drm/panel/panel-visionox-rm69299.c | 77 +++++++++++++++-----------
>   1 file changed, 44 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> index f1430370ff94..3c92a6ceb8df 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> @@ -158,6 +158,46 @@ static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
>   	return container_of(panel, struct visionox_rm69299, panel);
>   }
>   
> +static int visionox_rm69299_enable(struct drm_panel *panel)
> +{
> +	struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> +	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> +
> +	ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> +
> +	for (int i = 0; i < ctx->desc->init_seq_len; i++)
> +		mipi_dsi_dcs_write_buffer_multi(&dsi_ctx, &ctx->desc->init_seq[i * 2], 2);
> +
> +	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
> +
> +	/* Per DSI spec wait 120ms after sending exit sleep DCS command */
> +	mipi_dsi_msleep(&dsi_ctx, 120);
> +
> +	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
> +
> +	/* Per DSI spec wait 120ms after sending set_display_on DCS command */
> +	mipi_dsi_msleep(&dsi_ctx, 120);
> +
> +	return dsi_ctx.accum_err;
> +}
> +
> +static int visionox_rm69299_disable(struct drm_panel *panel)
> +{
> +	struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> +	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> +
> +	ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
> +
> +	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
> +
> +	/* 120ms delay required here as per DCS spec */
> +	mipi_dsi_msleep(&dsi_ctx, 120);
> +
> +	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
> +
> +	return dsi_ctx.accum_err;
> +}
> +
>   static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
>   {
>   	int ret;
> @@ -193,16 +233,6 @@ static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
>   static int visionox_rm69299_unprepare(struct drm_panel *panel)
>   {
>   	struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> -	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> -
> -	ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
> -
> -	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
> -
> -	/* 120ms delay required here as per DCS spec */
> -	mipi_dsi_msleep(&dsi_ctx, 120);
> -
> -	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
>   
>   	return visionox_rm69299_power_off(ctx);
>   }
> @@ -210,29 +240,8 @@ static int visionox_rm69299_unprepare(struct drm_panel *panel)
>   static int visionox_rm69299_prepare(struct drm_panel *panel)
>   {
>   	struct visionox_rm69299 *ctx = panel_to_ctx(panel);
> -	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> -	int ret, i;
>   
> -	ret = visionox_rm69299_power_on(ctx);
> -	if (ret < 0)
> -		return ret;
> -
> -	ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> -
> -	for (i = 0; i < ctx->desc->init_seq_len; i++)
> -		mipi_dsi_dcs_write_buffer_multi(&dsi_ctx, &ctx->desc->init_seq[i * 2], 2);
> -
> -	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
> -
> -	/* Per DSI spec wait 120ms after sending exit sleep DCS command */
> -	mipi_dsi_msleep(&dsi_ctx, 120);
> -
> -	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
> -
> -	/* Per DSI spec wait 120ms after sending set_display_on DCS command */
> -	mipi_dsi_msleep(&dsi_ctx, 120);
> -
> -	return dsi_ctx.accum_err;
> +	return visionox_rm69299_power_on(ctx);
>   }
>   
>   static const struct drm_display_mode visionox_rm69299_1080x2248_60hz = {
> @@ -284,7 +293,9 @@ static int visionox_rm69299_get_modes(struct drm_panel *panel,
>   
>   static const struct drm_panel_funcs visionox_rm69299_drm_funcs = {
>   	.unprepare = visionox_rm69299_unprepare,
> -	.prepare = visionox_rm69299_prepare,
> +	.disable   = visionox_rm69299_disable,
> +	.prepare   = visionox_rm69299_prepare,
> +	.enable	   = visionox_rm69299_enable,
>   	.get_modes = visionox_rm69299_get_modes,
>   };
>   
> 


  parent reply	other threads:[~2026-05-07  7:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 13:56 [PATCH 0/2] drm/panel/visionox-rm69299: " Guido Günther
2026-04-27 13:56 ` [PATCH 1/2] drm/panel: visionox-rm69299: " Guido Günther
2026-05-01 14:51   ` David Heidelberg
2026-05-07  7:11   ` Neil Armstrong [this message]
2026-05-07  9:09   ` Dmitry Baryshkov
2026-04-27 13:56 ` [PATCH 2/2] drm/panel: visionox-rm69299: Move power_on/off into prepare/unprepare Guido Günther
2026-05-01 14:50   ` David Heidelberg
2026-05-07  7:12   ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3f99285-1811-45f7-91be-5017438c2475@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=agx@sigxcpu.org \
    --cc=airlied@gmail.com \
    --cc=david@ixit.cz \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®