linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejas Vipin <tejasvipin76@gmail.com>
To: Brigham Campbell <me@brighamcampbell.com>,
	dianders@chromium.org, skhan@linuxfoundation.org,
	linux-kernel-mentees@lists.linux.dev,
	dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Jessica Zhang <jessica.zhang@oss.qualcomm.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>
Subject: Re: [PATCH 1/3] drm: panel: Replace usage of deprecated MIPI macro
Date: Mon, 7 Jul 2025 22:32:22 +0530	[thread overview]
Message-ID: <2529b1e4-390f-4459-b7f4-82a9cd005da3@gmail.com> (raw)
In-Reply-To: <20250707075659.75810-2-me@brighamcampbell.com>

Hi,

On 7/7/25 1:26 PM, Brigham Campbell wrote:
> Replace all usages of the deprecated mipi_dsi_generic_write_seq() with
> mipi_dsi_generic_write_seq_multi().
> 
> This patch's usage of the mipi_dsi_multi_context struct is not
> idiomatic. Rightfully, the struct wasn't designed to cater to the needs
> of panels with multiple MIPI DSI interfaces. This panel is an oddity
> which requires swapping the dsi pointer between calls to
> mipi_dsi_generic_write_seq_multi() in order to preserve the exact
> behavior implemented using the non-multi variant of the macro.
> 
> Signed-off-by: Brigham Campbell <me@brighamcampbell.com>
> ---
>  drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> index 5b5082efb282..777a8ab3a397 100644
> --- a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> +++ b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
> @@ -161,29 +161,35 @@ static int jdi_setup_symmetrical_split(struct mipi_dsi_device *left,
>  
>  static int jdi_write_dcdc_registers(struct jdi_panel *jdi)
>  {
> +	struct mipi_dsi_multi_context dsi_ctx;
> +
>  	/* Clear the manufacturer command access protection */
> -	mipi_dsi_generic_write_seq(jdi->link1, MCS_CMD_ACS_PROT,
> +	dsi_ctx.dsi = jdi->link1;
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx, MCS_CMD_ACS_PROT,
>  				   MCS_CMD_ACS_PROT_OFF);
> -	mipi_dsi_generic_write_seq(jdi->link2, MCS_CMD_ACS_PROT,
> +	dsi_ctx.dsi = jdi->link2;
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx, MCS_CMD_ACS_PROT,
>  				   MCS_CMD_ACS_PROT_OFF);
>  	/*
> -	 * Change the VGH/VGL divide rations to move the noise generated by the
> +	 * Change the VGH/VGL divide ratios 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,
> +	dsi_ctx.dsi = jdi->link1;
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx, 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,
> +	dsi_ctx.dsi = jdi->link2;
> +	mipi_dsi_generic_write_seq_multi(&dsi_ctx, 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);
>  
> -	return 0;
> +	return dsi_ctx.accum_err;
>  }
>  
>  static int jdi_panel_prepare(struct drm_panel *panel)

There's a lot more functions that should be replaced in this panel. You
can get a good idea of which ones by looking for the keyword
"deprecated" in drm_mipi_dsi.c . Here's a good reference for what a
conversion patch usually looks like:
https://lore.kernel.org/all/20250319183106.12613-1-tejasvipin76@gmail.com/

-- 
Tejas Vipin

  reply	other threads:[~2025-07-07 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07  7:56 [PATCH 0/3] drm: docs: Remove deprecated MIPI DSI macro Brigham Campbell
2025-07-07  7:56 ` [PATCH 1/3] drm: panel: Replace usage of deprecated MIPI macro Brigham Campbell
2025-07-07 17:02   ` Tejas Vipin [this message]
2025-07-07  7:56 ` [PATCH 2/3] drm: Remove unused MIPI write seq and chatty functions Brigham Campbell
2025-07-07  7:56 ` [PATCH 3/3] drm: docs: Remove completed task from drm TODO list Brigham Campbell
2025-07-07 17:05   ` Tejas Vipin

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=2529b1e4-390f-4459-b7f4-82a9cd005da3@gmail.com \
    --to=tejasvipin76@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=me@brighamcampbell.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.org \
    --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;
as well as URLs for NNTP newsgroup(s).