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

Changes from v3:
  - fixed code style issues
  - removed redundant error printout

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, 40 insertions(+), 3 deletions(-)

-- 
2.53.0


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

* [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi
  2026-04-16  7:37 [PATCH v4 0/2] drm/panel: drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
@ 2026-04-16  7:37 ` Avinal Kumar
  2026-04-17  2:51   ` Doug Anderson
  2026-04-16  7:37 ` [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
  1 sibling, 1 reply; 6+ messages in thread
From: Avinal Kumar @ 2026-04-16  7:37 UTC (permalink / raw)
  To: dri-devel, linux-kernel, neil.armstrong, dianders
  Cc: lumag, 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 0390e14d3157..911e7ca5b9d5 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 serial 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 2ab651a36115..b429acde4f71 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -393,6 +393,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.53.0


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

* [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
  2026-04-16  7:37 [PATCH v4 0/2] drm/panel: drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
  2026-04-16  7:37 ` [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Avinal Kumar
@ 2026-04-16  7:37 ` Avinal Kumar
  2026-04-17  2:51   ` Doug Anderson
  1 sibling, 1 reply; 6+ messages in thread
From: Avinal Kumar @ 2026-04-16  7:37 UTC (permalink / raw)
  To: dri-devel, linux-kernel, neil.armstrong, dianders
  Cc: lumag, maarten.lankhorst, mripard, tzimmermann, airlied, simona

Changes the panasonic-vvx10f034n00 panel to multi
style functions for improved error handling and
removes redundant error printout.

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

diff --git a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
index 3c3308fc55df..f9e547c8b1b8 100644
--- a/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
+++ b/drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
@@ -44,14 +44,23 @@ 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);
+	struct mipi_dsi_multi_context dsi_ctx = {
+		.dsi = wuxga_nt->dsi
+	};
 
-	return mipi_dsi_shutdown_peripheral(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)
@@ -95,7 +104,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel)
 
 	ret = wuxga_nt_panel_on(wuxga_nt);
 	if (ret < 0) {
-		dev_err(panel->dev, "failed to set panel on: %d\n", ret);
 		goto poweroff;
 	}
 
-- 
2.53.0


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

* Re: [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi
  2026-04-16  7:37 ` [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Avinal Kumar
@ 2026-04-17  2:51   ` Doug Anderson
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Anderson @ 2026-04-17  2:51 UTC (permalink / raw)
  To: Avinal Kumar
  Cc: dri-devel, linux-kernel, neil.armstrong, lumag,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona

Hi,

On Thu, Apr 16, 2026 at 12:39 AM Avinal Kumar <avinal.xlvii@gmail.com> wrote:
>
> @@ -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 serial calls in a row.

Between v3 and v4, you changed:

  make several calls in a row
to
  make serial calls in a row

Is there a reason why? Not that it matters a whole lot, but the old
wording seemed fine and it matches the wording in the description of
all of the other _multi functions.

Other than that weird nit, this looks OK to me:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

I'm pretty curious why you changed it between v3 and v4, though.

-Doug

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

* Re: [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
  2026-04-16  7:37 ` [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
@ 2026-04-17  2:51   ` Doug Anderson
  2026-04-17  3:21     ` Doug Anderson
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Anderson @ 2026-04-17  2:51 UTC (permalink / raw)
  To: Avinal Kumar
  Cc: dri-devel, linux-kernel, neil.armstrong, lumag,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona

Hi,

On Thu, Apr 16, 2026 at 12:39 AM Avinal Kumar <avinal.xlvii@gmail.com> wrote:
>
> Changes the panasonic-vvx10f034n00 panel to multi
> style functions for improved error handling and
> removes redundant error printout.

nit: Linux folks generally like the "imperative" statements. So the
above would be better as:

Change the panasonic-vvx10f034n00 panel to multi style functions for
improved error handling and remove redundant error printout.

In other words, use "change" not "changes" and "remove" not "removes".


> @@ -95,7 +104,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel)
>
>         ret = wuxga_nt_panel_on(wuxga_nt);
>         if (ret < 0) {
> -               dev_err(panel->dev, "failed to set panel on: %d\n", ret);
>                 goto poweroff;
>         }

Now that you've removed the error printout (and thus it's a one-liner
inside the "if" test), you need to remove the braces. Linux style
guidelines are pretty strict about this. Hopefully it's pretty easy to
spin a v5 with that? Otherwise, this looks fine to me.


-Doug

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

* Re: [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions
  2026-04-17  2:51   ` Doug Anderson
@ 2026-04-17  3:21     ` Doug Anderson
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Anderson @ 2026-04-17  3:21 UTC (permalink / raw)
  To: Avinal Kumar
  Cc: dri-devel, linux-kernel, neil.armstrong, lumag,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona

Hi,

On Thu, Apr 16, 2026 at 7:51 PM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Thu, Apr 16, 2026 at 12:39 AM Avinal Kumar <avinal.xlvii@gmail.com> wrote:
> >
> > Changes the panasonic-vvx10f034n00 panel to multi
> > style functions for improved error handling and
> > removes redundant error printout.
>
> nit: Linux folks generally like the "imperative" statements. So the
> above would be better as:
>
> Change the panasonic-vvx10f034n00 panel to multi style functions for
> improved error handling and remove redundant error printout.
>
> In other words, use "change" not "changes" and "remove" not "removes".
>
>
> > @@ -95,7 +104,6 @@ static int wuxga_nt_panel_prepare(struct drm_panel *panel)
> >
> >         ret = wuxga_nt_panel_on(wuxga_nt);
> >         if (ret < 0) {
> > -               dev_err(panel->dev, "failed to set panel on: %d\n", ret);
> >                 goto poweroff;
> >         }
>
> Now that you've removed the error printout (and thus it's a one-liner
> inside the "if" test), you need to remove the braces. Linux style
> guidelines are pretty strict about this. Hopefully it's pretty easy to
> spin a v5 with that? Otherwise, this looks fine to me.

Actually, looking at it one more time, the code should probably just look like:

ret = wuxga_nt_panel_on(wuxga_nt);
if (ret < 0)
  regulator_disable(wuxga_nt->supply);

return ret;

The "goto" is pretty overkill here.

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

end of thread, other threads:[~2026-04-17  3:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-16  7:37 [PATCH v4 0/2] drm/panel: drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
2026-04-16  7:37 ` [PATCH v4 1/2] drm/mipi-dsi: add mipi_dsi_shutdown_peripheral_multi Avinal Kumar
2026-04-17  2:51   ` Doug Anderson
2026-04-16  7:37 ` [PATCH v4 2/2] drm/panel: panasonic-vvx10f034n00: transition to mipi_dsi wrapped functions Avinal Kumar
2026-04-17  2:51   ` Doug Anderson
2026-04-17  3:21     ` 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®