public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions
@ 2026-03-28 12:03 YoungAndSure
  2026-03-31  7:44 ` Claude review: " Claude Code Review Bot
  2026-03-31  7:44 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: YoungAndSure @ 2026-03-28 12:03 UTC (permalink / raw)
  To: dri-devel; +Cc: neil.armstrong, dianders, YoungAndSure

Replace deprecated mipi_dsi_generic_write() and mipi_dsi_dcs_*()
functions with their *_multi() variants in jdi_panel_init() for better
error handling.  The multi versions handle errors automatically and
accumulate them in mipi_dsi_multi_context, removing the need for
repetitive error checking code.

Signed-off-by: YoungAndSure <yangshuorex@foxmail.com>
---
 .../gpu/drm/panel/panel-jdi-lt070me05000.c    | 71 ++++---------------
 1 file changed, 13 insertions(+), 58 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
index 3513e5c4dd..e5deb39e75 100644
--- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
+++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
@@ -48,34 +48,17 @@ static inline struct jdi_panel *to_jdi_panel(struct drm_panel *panel)
 static int jdi_panel_init(struct jdi_panel *jdi)
 {
 	struct mipi_dsi_device *dsi = jdi->dsi;
-	struct device *dev = &jdi->dsi->dev;
-	int ret;
+	struct mipi_dsi_multi_context ctx = { .dsi = dsi };
 
 	dsi->mode_flags |= MIPI_DSI_MODE_LPM;
 
-	ret = mipi_dsi_dcs_soft_reset(dsi);
-	if (ret < 0)
-		return ret;
+	mipi_dsi_dcs_soft_reset_multi(&ctx);
 
 	usleep_range(10000, 20000);
 
-	ret = mipi_dsi_dcs_set_pixel_format(dsi, MIPI_DCS_PIXEL_FMT_24BIT << 4);
-	if (ret < 0) {
-		dev_err(dev, "failed to set pixel format: %d\n", ret);
-		return ret;
-	}
-
-	ret = mipi_dsi_dcs_set_column_address(dsi, 0, jdi->mode->hdisplay - 1);
-	if (ret < 0) {
-		dev_err(dev, "failed to set column address: %d\n", ret);
-		return ret;
-	}
-
-	ret = mipi_dsi_dcs_set_page_address(dsi, 0, jdi->mode->vdisplay - 1);
-	if (ret < 0) {
-		dev_err(dev, "failed to set page address: %d\n", ret);
-		return ret;
-	}
+	mipi_dsi_dcs_set_pixel_format_multi(&ctx, MIPI_DCS_PIXEL_FMT_24BIT << 4);
+	mipi_dsi_dcs_set_column_address_multi(&ctx, 0, jdi->mode->hdisplay - 1);
+	mipi_dsi_dcs_set_page_address_multi(&ctx, 0, jdi->mode->vdisplay - 1);
 
 	/*
 	 * BIT(5) BCTRL = 1 Backlight Control Block On, Brightness registers
@@ -83,56 +66,28 @@ static int jdi_panel_init(struct jdi_panel *jdi)
 	 * BIT(3) BL = 1    Backlight Control On
 	 * BIT(2) DD = 0    Display Dimming is Off
 	 */
-	ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
-				 (u8[]){ 0x24 }, 1);
-	if (ret < 0) {
-		dev_err(dev, "failed to write control display: %d\n", ret);
-		return ret;
-	}
+	mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x24);
 
 	/* CABC off */
-	ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_POWER_SAVE,
-				 (u8[]){ 0x00 }, 1);
-	if (ret < 0) {
-		dev_err(dev, "failed to set cabc off: %d\n", ret);
-		return ret;
-	}
+	mipi_dsi_dcs_write_seq_multi(&ctx, MIPI_DCS_WRITE_POWER_SAVE, 0x00);
 
-	ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
-	if (ret < 0) {
-		dev_err(dev, "failed to set exit sleep mode: %d\n", ret);
-		return ret;
-	}
+	mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
 
 	msleep(120);
 
-	ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x00}, 2);
-	if (ret < 0) {
-		dev_err(dev, "failed to set mcap: %d\n", ret);
-		return ret;
-	}
+	mipi_dsi_generic_write_multi(&ctx, (u8[]){0xB0, 0x00}, 2);
 
 	mdelay(10);
 
 	/* Interface setting, video mode */
-	ret = mipi_dsi_generic_write(dsi, (u8[])
-				     {0xB3, 0x26, 0x08, 0x00, 0x20, 0x00}, 6);
-	if (ret < 0) {
-		dev_err(dev, "failed to set display interface setting: %d\n"
-			, ret);
-		return ret;
-	}
+	mipi_dsi_generic_write_multi(&ctx,
+				     (u8[]){0xB3, 0x26, 0x08, 0x00, 0x20, 0x00}, 6);
 
 	mdelay(20);
 
-	ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x03}, 2);
-	if (ret < 0) {
-		dev_err(dev, "failed to set default values for mcap: %d\n"
-			, ret);
-		return ret;
-	}
+	mipi_dsi_generic_write_multi(&ctx, (u8[]){0xB0, 0x03}, 2);
 
-	return 0;
+	return ctx.accum_err;
 }
 
 static int jdi_panel_on(struct jdi_panel *jdi)
-- 
2.34.1


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

* Claude review: drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions
  2026-03-28 12:03 [PATCH] drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions YoungAndSure
  2026-03-31  7:44 ` Claude review: " Claude Code Review Bot
@ 2026-03-31  7:44 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-31  7:44 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions
Author: YoungAndSure <yangshuorex@foxmail.com>
Patches: 1
Reviewed: 2026-03-31T17:44:36.598171

---

**Status: Already superseded / NAK**

This is a single patch converting `panel-jdi-lt070me05000.c` from the old `mipi_dsi_dcs_*()` / `mipi_dsi_generic_write()` API to the `*_multi()` variants. However, **this conversion has already been done** in the current drm-next tree. The existing code is actually a *more complete* conversion than what this patch proposes.

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions
  2026-03-28 12:03 [PATCH] drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions YoungAndSure
@ 2026-03-31  7:44 ` Claude Code Review Bot
  2026-03-31  7:44 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-03-31  7:44 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Verdict: Already applied (superseded), with several issues compared to the existing conversion.**

The drm-next tree already contains this conversion (done more thoroughly). Comparing the patch against the current tree reveals several shortcomings:

1. **Context variable naming**: The patch uses `ctx` while the tree uses `dsi_ctx`. Minor style difference, but indicates the patch was developed against a stale base.

2. **Sleep calls not converted**: The patch keeps bare `usleep_range()` and `mdelay()`/`msleep()` calls:
   ```c
   usleep_range(10000, 20000);
   ...
   msleep(120);
   ...
   mdelay(10);
   ...
   mdelay(20);
   ```
   The tree converts these to `mipi_dsi_usleep_range()` and `mipi_dsi_msleep()`, which properly short-circuit when `accum_err` is set, avoiding unnecessary delays after a failure.

3. **`mipi_dsi_generic_write_multi()` vs `mipi_dsi_generic_write_seq_multi()`**: The patch uses `mipi_dsi_generic_write_multi()` with explicit casts and length parameters:
   ```c
   mipi_dsi_generic_write_multi(&ctx, (u8[]){0xB0, 0x00}, 2);
   ```
   The tree uses the cleaner `mipi_dsi_generic_write_seq_multi()` macro which infers the length automatically:
   ```c
   mipi_dsi_generic_write_seq_multi(&dsi_ctx, 0xb0, 0x00);
   ```
   This is both more readable and less error-prone (no risk of length mismatch).

4. **Unused `dev` variable removal**: The patch removes `struct device *dev = &jdi->dsi->dev;` which is correct since the `dev_err()` calls are removed, but the existing tree also handles this properly.

5. **`jdi_panel_on()` and `jdi_panel_off()` not converted**: The patch only converts `jdi_panel_init()`. The existing tree also converts `jdi_panel_on()` and `jdi_panel_off()` to use the multi context pattern, making it a more complete conversion.

**Summary**: This patch is redundant — the work has already been merged in a better form. If it were being reviewed on its own merits, the feedback would be: use `mipi_dsi_*_seq_multi()` macros instead of raw `mipi_dsi_generic_write_multi()`, convert the sleep calls to `mipi_dsi_msleep()`/`mipi_dsi_usleep_range()`, and extend the conversion to `jdi_panel_on()` and `jdi_panel_off()` as well.

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-03-31  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 12:03 [PATCH] drm/panel: jdi-lt070me05000: Transition to mipi_dsi *_multi() functions YoungAndSure
2026-03-31  7:44 ` Claude review: " Claude Code Review Bot
2026-03-31  7:44 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox