mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: rtapadia730@gmail.com, maarten.lankhorst@linux.intel.com
Cc: mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, jessica.zhang@oss.qualcomm.com,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, corbet@lwn.net
Subject: Re: [PATCH 1/4] drm/panel/lpm102a188a: Switch to mipi_dsi_generic_write_seq_multi()
Date: Wed, 29 Oct 2025 21:35:23 +0100	[thread overview]
Message-ID: <ecb7d7de-d674-49d2-b373-39041b363167@linaro.org> (raw)
In-Reply-To: <20250921183720.237761-2-rtapadia730@gmail.com>

On 9/21/25 20:37, rtapadia730@gmail.com wrote:
> From: Rajeev Tapadia <rtapadia730@gmail.com>
> 
> Replace deprecated mipi_dsi_generic_write_seq() calls with
> mipi_dsi_generic_write_seq_multi(). This avoids hidden early returns
> and matches the direction of other panel drivers.
> 
> No functional change intended.
> 
> Signed-off-by: Rajeev Tapadia <rtapadia730@gmail.com>
> ---
> 
> Question for reviewers:
> In this patch, I switched to using mipi_dsi_generic_write_seq_multi().
> Currently, if both link1 and link2 return errors, only one error is
> reported via accum_err. How should this ideally be handled? Should we
> report the first error, the last, or combine them somehow?

No it's fine, the first error is catched and reported.

The good way to do this is via this macro:

#define mipi_dsi_dual_dcs_write_seq_multi(dsi_ctx, dsi0, dsi1, cmd, seq...)	\
		do {								\
			dsi_ctx.dsi = dsi0;					\
			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, cmd, seq);	\
			dsi_ctx.dsi = dsi1;					\
			mipi_dsi_dcs_write_seq_multi(&dsi_ctx, cmd, seq);	\
		} while (0)

with a single context. The mipi_dsi_dcs_write_seq_multi will print the
error from the proper DSI and the context will have the appropriate error.

Neil

> 
>   drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 15 +++++++++++----
>   1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> index 5f897e143758..982cb61849a0 100644
> --- a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> +++ b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> @@ -162,27 +162,34 @@ static int jdi_setup_symmetrical_split(struct mipi_dsi_device *left,
>   static int jdi_write_dcdc_registers(struct jdi_panel *jdi)
>   {
>   	/* Clear the manufacturer command access protection */
> -	mipi_dsi_generic_write_seq(jdi->link1, MCS_CMD_ACS_PROT,
> +	struct mipi_dsi_multi_context dsi_ctx1 = {.dsi = jdi->link1};
> +	struct mipi_dsi_multi_context dsi_ctx2 = {.dsi = jdi->link2};
> +
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx1, MCS_CMD_ACS_PROT,
>   				   MCS_CMD_ACS_PROT_OFF);
> -	mipi_dsi_generic_write_seq(jdi->link2, MCS_CMD_ACS_PROT,
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx2, MCS_CMD_ACS_PROT,
>   				   MCS_CMD_ACS_PROT_OFF);
>   	/*
>   	 * Change the VGH/VGL divide rations to move the noise generated by the
>   	 * TCONN. This should hopefully avoid interaction with the backlight
>   	 * controller.
>   	 */
> -	mipi_dsi_generic_write_seq(jdi->link1, MCS_PWR_CTRL_FUNC,
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx1, MCS_PWR_CTRL_FUNC,
>   				   MCS_PWR_CTRL_PARAM1_VGH_330_DIV |
>   				   MCS_PWR_CTRL_PARAM1_DEFAULT,
>   				   MCS_PWR_CTRL_PARAM2_VGL_410_DIV |
>   				   MCS_PWR_CTRL_PARAM2_DEFAULT);
>   
> -	mipi_dsi_generic_write_seq(jdi->link2, MCS_PWR_CTRL_FUNC,
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx2, MCS_PWR_CTRL_FUNC,
>   				   MCS_PWR_CTRL_PARAM1_VGH_330_DIV |
>   				   MCS_PWR_CTRL_PARAM1_DEFAULT,
>   				   MCS_PWR_CTRL_PARAM2_VGL_410_DIV |
>   				   MCS_PWR_CTRL_PARAM2_DEFAULT);
>   
> +	if (dsi_ctx1.accum_err < 0)
> +		return dsi_ctx1.accum_err;
> +	if (dsi_ctx2.accum_err < 0)
> +		return dsi_ctx2.accum_err;
>   	return 0;
>   }
>   


      parent reply	other threads:[~2025-10-29 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-21 18:37 rtapadia730
2025-09-21 18:37 ` [PATCH 2/4] drm/mipi-dsi: remove deprecated write_seq macro and chatty helper rtapadia730
2025-09-21 18:37 ` [PATCH 3/4] drm/mipi-dsi: remove deprecated mipi_dsi_dcs_write_buffer_chatty rtapadia730
2025-09-21 18:37 ` [PATCH 4/4] drm/todo: remove todo entry for deprecated mipi_dsi_*_write_seq() rtapadia730
2025-10-29 20:35 ` neil.armstrong [this message]

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=ecb7d7de-d674-49d2-b373-39041b363167@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=airlied@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=rtapadia730@gmail.com \
    --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®