[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b2b440e6-bb77-42ae-9f71-4635b17b230e@quicinc.com>
Date: Fri, 9 May 2025 15:46:28 -0700
From: Jessica Zhang <quic_jesszhan@...cinc.com>
To: Neil Armstrong <neil.armstrong@...aro.org>,
David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Maarten Lankhorst
<maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Abhinav Kumar <quic_abhinavk@...cinc.com>
CC: <dri-devel@...ts.freedesktop.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
Casey Connolly <casey.connolly@...aro.org>
Subject: Re: [PATCH v2 3/6] drm/panel: visionox-rm69299: switch to _multi
variants
On 5/9/2025 1:59 AM, Neil Armstrong wrote:
> Switch to the DSI _multi variants to simplify error handling.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@...aro.org>
Reviewed-by: Jessica Zhang <quic_jesszhan@...cinc.com>
> ---
> drivers/gpu/drm/panel/panel-visionox-rm69299.c | 48 +++++++-------------------
> 1 file changed, 13 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> index 156bca0197481b470fa85b2eab7c979b76e489b6..c3c14150a5546512151fb15c8e9a91269ca21c65 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> @@ -72,30 +72,24 @@ 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);
> - int ret;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
>
> ctx->dsi->mode_flags = 0;
>
> - ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
> - if (ret < 0)
> - dev_err(ctx->panel.dev, "set_display_off cmd failed ret = %d\n", ret);
> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
>
> /* 120ms delay required here as per DCS spec */
> - msleep(120);
> + mipi_dsi_msleep(&dsi_ctx, 120);
>
> - ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
> - if (ret < 0) {
> - dev_err(ctx->panel.dev, "enter_sleep cmd failed ret = %d\n", ret);
> - }
> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
>
> - ret = visionox_rm69299_power_off(ctx);
> -
> - return ret;
> + return visionox_rm69299_power_off(ctx);
> }
>
> 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);
> @@ -104,36 +98,20 @@ static int visionox_rm69299_prepare(struct drm_panel *panel)
>
> ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
>
> - for (i = 0; i < ctx->desc->init_seq_len; i++) {
> - ret = mipi_dsi_dcs_write_buffer(ctx->dsi, &ctx->desc->init_seq[i * 2], 2);
> - if (ret < 0) {
> - dev_err(ctx->panel.dev, "cmd tx failed, ret = %d\n", ret);
> - return ret;
> - }
> - }
> + 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);
>
> - ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0);
> - if (ret < 0) {
> - dev_err(ctx->panel.dev, "exit_sleep_mode cmd failed ret = %d\n", ret);
> - goto power_off;
> - }
> + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
>
> /* Per DSI spec wait 120ms after sending exit sleep DCS command */
> - msleep(120);
> + mipi_dsi_msleep(&dsi_ctx, 120);
>
> - ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0);
> - if (ret < 0) {
> - dev_err(ctx->panel.dev, "set_display_on cmd failed ret = %d\n", ret);
> - goto power_off;
> - }
> + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
>
> /* Per DSI spec wait 120ms after sending set_display_on DCS command */
> - msleep(120);
> + mipi_dsi_msleep(&dsi_ctx, 120);
>
> - return 0;
> -
> -power_off:
> - return ret;
> + return dsi_ctx.accum_err;
> }
>
> static const struct drm_display_mode visionox_rm69299_1080x2248_60hz = {
>
Powered by blists - more mailing lists