mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
@ 2026-01-13  9:14 Avinal Kumar
  2026-01-13  9:14 ` [PATCH v3 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Avinal Kumar
  2026-01-13  9:14 ` [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
  0 siblings, 2 replies; 5+ messages in thread
From: Avinal Kumar @ 2026-01-13  9:14 UTC (permalink / raw)
  To: dri-devel, linux-kernel, neil.armstrong
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, simona

Apologies, I did use the checkpatch script but I attached the unfixed patch file by mistake.
I have fixed it now. Will take care from next time.

Thanks a lot.

Changes from v2:
  Fixed typo

Avinal Kumar (2):
  drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi
  drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped
    functions

 drivers/gpu/drm/drm_mipi_dsi.c                | 28 +++++++++++++++++++
 .../drm/panel/panel-panasonic-vvx10f034n00.c  | 14 ++++++++--
 include/drm/drm_mipi_dsi.h                    |  1 +
 3 files changed, 41 insertions(+), 2 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi
  2026-01-13  9:14 [PATCH v3 0/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
@ 2026-01-13  9:14 ` Avinal Kumar
  2026-01-13  9:14 ` [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
  1 sibling, 0 replies; 5+ messages in thread
From: Avinal Kumar @ 2026-01-13  9:14 UTC (permalink / raw)
  To: dri-devel, linux-kernel, neil.armstrong
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, simona

Add mipi_dsi_shutdown_peripheral_multi function and mark
mipi_dsi_shutdown_peripheral function as deprecated.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
---
 drivers/gpu/drm/drm_mipi_dsi.c | 28 ++++++++++++++++++++++++++++
 include/drm/drm_mipi_dsi.h     |  1 +
 2 files changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index a712e177b350..2fed50172a44 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -587,6 +587,9 @@ EXPORT_SYMBOL(mipi_dsi_create_packet);
  * mipi_dsi_shutdown_peripheral() - sends a Shutdown Peripheral command
  * @dsi: DSI peripheral device
  *
+ * This function is deprecated. Use mipi_dsi_shutdown_peripheral_multi()
+ * instead.
+ *
  * Return: 0 on success or a negative error code on failure.
  */
 int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi)
@@ -1980,6 +1983,31 @@ void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx,
 }
 EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_scanline_multi);
 
+/**
+ * mipi_dsi_shutdown_peripheral_multi() - sends a Shutdown Peripheral command
+ * @ctx: Context for multiple DSI transactions
+ *
+ * Like mipi_dsi_shutdown_peripheral() but deals with errors in a way that
+ * makes it convenient to make several calls in a row.
+ */
+void mipi_dsi_shutdown_peripheral_multi(struct mipi_dsi_multi_context *ctx)
+{
+	struct mipi_dsi_device *dsi = ctx->dsi;
+	struct device *dev = &dsi->dev;
+	int ret;
+
+	if (ctx->accum_err)
+		return;
+
+	ret = mipi_dsi_shutdown_peripheral(dsi);
+	if (ret < 0) {
+		ctx->accum_err = ret;
+		dev_err(dev, "Failed to shutdown peripheral: %d\n",
+			ctx->accum_err);
+	}
+}
+EXPORT_SYMBOL(mipi_dsi_shutdown_peripheral_multi);
+
 static int mipi_dsi_drv_probe(struct device *dev)
 {
 	struct mipi_dsi_driver *drv = to_mipi_dsi_driver(dev->driver);
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 3aba7b380c8d..19ccdf5eeb5f 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -389,6 +389,7 @@ void mipi_dsi_dcs_set_page_address_multi(struct mipi_dsi_multi_context *ctx,
 void mipi_dsi_dcs_set_tear_scanline_multi(struct mipi_dsi_multi_context *ctx,
 					  u16 scanline);
 void mipi_dsi_dcs_set_tear_off_multi(struct mipi_dsi_multi_context *ctx);
+void mipi_dsi_shutdown_peripheral_multi(struct mipi_dsi_multi_context *ctx);
 
 /**
  * mipi_dsi_generic_write_seq_multi - transmit data using a generic write packet
-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
  2026-01-13  9:14 [PATCH v3 0/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
  2026-01-13  9:14 ` [PATCH v3 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Avinal Kumar
@ 2026-01-13  9:14 ` Avinal Kumar
  2026-04-13  8:06   ` neil.armstrong
  1 sibling, 1 reply; 5+ messages in thread
From: Avinal Kumar @ 2026-01-13  9:14 UTC (permalink / raw)
  To: dri-devel, linux-kernel, neil.armstrong
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, simona

Changes the panasonic-vvx10f034n00 panel to multi
style functions for improved error handling.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
---
 .../gpu/drm/panel/panel-panasonic-vvx10f034n00.c   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
index 3c3308fc55df..73c5827a15a4 100644
--- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
+++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
@@ -44,14 +44,24 @@ static inline struct wuxga_nt_panel *to_wuxga_nt_panel(struct drm_panel *panel)
 
 static int wuxga_nt_panel_on(struct wuxga_nt_panel *wuxga_nt)
 {
-	return mipi_dsi_turn_on_peripheral(wuxga_nt->dsi);
+	struct mipi_dsi_multi_context dsi_ctx = {
+		.dsi = wuxga_nt->dsi
+	};
+
+	mipi_dsi_turn_on_peripheral_multi(&dsi_ctx);
+	return dsi_ctx.accum_err;
 }
 
 static int wuxga_nt_panel_disable(struct drm_panel *panel)
 {
 	struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel);
 
-	return mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
+	struct mipi_dsi_multi_context dsi_ctx = {
+		.dsi = wuxga_nt->dsi
+	};
+
+	mipi_dsi_shutdown_peripheral_multi(&dsi_ctx);
+	return dsi_ctx.accum_err;
 }
 
 static int wuxga_nt_panel_unprepare(struct drm_panel *panel)
-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
  2026-01-13  9:14 ` [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
@ 2026-04-13  8:06   ` neil.armstrong
  2026-04-13 16:07     ` Doug Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: neil.armstrong @ 2026-04-13  8:06 UTC (permalink / raw)
  To: Avinal Kumar, dri-devel, linux-kernel, Douglas Anderson,
	Dmitry Baryshkov
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, simona

On 1/13/26 10:14, Avinal Kumar wrote:
> Changes the panasonic-vvx10f034n00 panel to multi
> style functions for improved error handling.
> 
> Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
> ---
>   .../gpu/drm/panel/panel-panasonic-vvx10f034n00.c   | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
> index 3c3308fc55df..73c5827a15a4 100644
> --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
> +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
> @@ -44,14 +44,24 @@ static inline struct wuxga_nt_panel *to_wuxga_nt_panel(struct drm_panel *panel)
>   
>   static int wuxga_nt_panel_on(struct wuxga_nt_panel *wuxga_nt)
>   {
> -	return mipi_dsi_turn_on_peripheral(wuxga_nt->dsi);
> +	struct mipi_dsi_multi_context dsi_ctx = {
> +		.dsi = wuxga_nt->dsi
> +	};
> +
> +	mipi_dsi_turn_on_peripheral_multi(&dsi_ctx);
> +	return dsi_ctx.accum_err;
>   }
>   
>   static int wuxga_nt_panel_disable(struct drm_panel *panel)
>   {
>   	struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel);
>   
> -	return mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
> +	struct mipi_dsi_multi_context dsi_ctx = {
> +		.dsi = wuxga_nt->dsi
> +	};
> +
> +	mipi_dsi_shutdown_peripheral_multi(&dsi_ctx);
> +	return dsi_ctx.accum_err;
>   }
>   
>   static int wuxga_nt_panel_unprepare(struct drm_panel *panel)

So yeah we want to use multi functions but in this case I don't think it's appropriate
when a since dsi function is called in a callback.

Dmitry ? Doug ?

Neil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
  2026-04-13  8:06   ` neil.armstrong
@ 2026-04-13 16:07     ` Doug Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2026-04-13 16:07 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Avinal Kumar, dri-devel, linux-kernel, Dmitry Baryshkov,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona

Hi,

On Mon, Apr 13, 2026 at 1:07 AM <neil.armstrong@linaro.org> wrote:
>
> On 1/13/26 10:14, Avinal Kumar wrote:
> > Changes the panasonic-vvx10f034n00 panel to multi
> > style functions for improved error handling.
> >
> > Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
> > ---
> >   .../gpu/drm/panel/panel-panasonic-vvx10f034n00.c   | 14 ++++++++++++--
> >   1 file changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
> > index 3c3308fc55df..73c5827a15a4 100644
> > --- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
> > +++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
> > @@ -44,14 +44,24 @@ static inline struct wuxga_nt_panel *to_wuxga_nt_panel(struct drm_panel *panel)
> >
> >   static int wuxga_nt_panel_on(struct wuxga_nt_panel *wuxga_nt)
> >   {
> > -     return mipi_dsi_turn_on_peripheral(wuxga_nt->dsi);
> > +     struct mipi_dsi_multi_context dsi_ctx = {
> > +             .dsi = wuxga_nt->dsi
> > +     };
> > +
> > +     mipi_dsi_turn_on_peripheral_multi(&dsi_ctx);
> > +     return dsi_ctx.accum_err;
> >   }
> >  u
> >   static int wuxga_nt_panel_disable(struct drm_panel *panel)
> >   {
> >       struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel);
> >
> > -     return mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
> > +     struct mipi_dsi_multi_context dsi_ctx = {
> > +             .dsi = wuxga_nt->dsi
> > +     };

nit: get rid of the blank line between the two variable declarations.


> > +
> > +     mipi_dsi_shutdown_peripheral_multi(&dsi_ctx);
> > +     return dsi_ctx.accum_err;
> >   }
> >
> >   static int wuxga_nt_panel_unprepare(struct drm_panel *panel)
>
> So yeah we want to use multi functions but in this case I don't think it's appropriate
> when a since dsi function is called in a callback.
>
> Dmitry ? Doug ?

It's a little weird, but I think the official stance is that we _do_
want to transition even when only a single DSI function is used, as
this patch does. I can spend some time trying to find the original
discussoins if need be, but as I recall:

* The "multi" functions do still have the advantage of giving you an
error printout. Previously the "disable" function here wouldn't have
printed an error. Speaking of which, we probably want a v2 of this
patch that gets rid of the (now extra) "failed to set panel on: %d\n"
error printout since we can now rely on the error printout in
mipi_dsi_turn_on_peripheral_multi().

* We talked about having a variant function with the error printout
but not the "multi" calling style, but I think we decided that it was
better to have fewer functions to worry about.


-Doug

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-13 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-13  9:14 [PATCH v3 0/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
2026-01-13  9:14 ` [PATCH v3 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Avinal Kumar
2026-01-13  9:14 ` [PATCH v3 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
2026-04-13  8:06   ` neil.armstrong
2026-04-13 16:07     ` Doug Anderson

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®