public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: panel: add support for the Renesas R63419 based dual-DSI video mode Display Panels
Date: Mon, 25 May 2026 20:36:17 +1000	[thread overview]
Message-ID: <review-patch2-20260521-topic-sm8650-ayaneo-pocket-s2-r63419-v5-2-dd5700299390@linaro.org> (raw)
In-Reply-To: <20260521-topic-sm8650-ayaneo-pocket-s2-r63419-v5-2-dd5700299390@linaro.org>

Patch Review

**Bug: `mipi_dsi_multi_context` not initialized**

In both `renesas_r63419_on()` and `renesas_r63419_disable()`, the `dsi_ctx` is declared on the stack without an initializer:

```c
static int renesas_r63419_on(struct renesas_r63419_panel *ctx)
{
	struct mipi_dsi_multi_context dsi_ctx;

	dsi_link_switch(ctx, &dsi_ctx, 0);
```

and:

```c
static int renesas_r63419_disable(struct drm_panel *panel)
{
	struct renesas_r63419_panel *ctx = to_renesas_r63419_panel(panel);
	struct mipi_dsi_multi_context dsi_ctx;

	dsi_link_switch(ctx, &dsi_ctx, 0);
```

The `dsi_link_switch()` helper only sets `dsi_ctx->dsi` — it does not initialize `accum_err`. The `mipi_dsi_multi_context` documentation explicitly states `accum_err` must be "Init to 0", and all `_multi` functions are no-ops if `accum_err` is non-zero. Without `CONFIG_INIT_STACK_ALL_ZERO`, `accum_err` contains indeterminate stack data, and if it happens to be non-zero, the entire init/disable sequence silently does nothing.

Fix: either zero-initialize the struct (`struct mipi_dsi_multi_context dsi_ctx = { };`) or use designated initializers (`= { .dsi = ctx->dsi[0] }`).

**Style: `panel_desc` structs should be `const`**

```c
static struct panel_desc wt0600_desc = {
```
and
```c
static struct panel_desc wt0630_desc = {
```

These are never modified and are used as read-only match data. They should be `static const struct panel_desc`.

**Observation: DCS command ordering**

The `renesas_r63419_on()` function sends `set_display_on` before `exit_sleep_mode`:

```c
	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
	/* ... */
	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
```

The standard MIPI DCS sequence is sleep-out first, then display-on (per MIPI DCS spec section 9.15/9.28). This is likely intentional per the R63419 vendor datasheet — but since it's unusual, a brief comment noting this is the vendor-specified sequence would prevent future "fix" attempts.

**Observation: `dsi_link_switch` pattern vs established dual-DSI patterns**

The existing in-tree dual-DSI driver (`panel-jdi-lpm102a188a.c`) uses two separate `mipi_dsi_multi_context` variables, each properly initialized with `= { .dsi = ... }`. The `dsi_link_switch` pattern introduced here is a reasonable idea for reducing boilerplate when both links share error accumulation, but it's novel. If it becomes a common pattern, it might be worth promoting to a helper in the DSI core, but for now a single driver introducing it is fine — once the initialization bug above is fixed.

**Minor: regulator bulk get lacks `dev_err_probe` wrapping**

```c
	ret = devm_regulator_bulk_get_const(&dsi->dev,
					    ARRAY_SIZE(renesas_r63419_vdd_supplies),
					    renesas_r63419_vdd_supplies, &ctx->vdd_supplies);
	if (ret < 0)
		return ret;
```

Other error paths in probe use `dev_err_probe()` consistently. These two regulator calls return bare `ret`. While the regulator subsystem may log internally, using `dev_err_probe()` would be consistent with the rest of the function and properly handles `-EPROBE_DEFER` logging.

**Everything else looks good:**
- `devm_drm_panel_alloc` / `devm_drm_panel_add` / `devm_mipi_dsi_attach` usage is correct and eliminates the need for a `remove` callback.
- The dual-mode clock calculation (`2 * (720 + 100 + 8 + 40) * (2560 + 15 + 2 + 8) * 60 / 1000`) is consistent across both modes, with only physical dimensions differing.
- The `prepare_prev_first = true` setting is appropriate for a panel that needs the CRTC pipeline prepared before the panel powers on.
- GPIO is requested as `GPIOD_OUT_HIGH` (reset asserted at probe), then deasserted in `prepare` — correct active-low reset handling.
- OF match table properly maps board-specific compatibles to per-panel descriptors.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-25 10:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  8:14 [PATCH v5 0/2] drm: panel: support the R63419 based dual-DSI video mode Display Panels Neil Armstrong
2026-05-21  8:14 ` [PATCH v5 1/2] dt-bindings: display: panel: document the Renesas " Neil Armstrong
2026-05-21 19:55   ` Conor Dooley
2026-05-25 10:36   ` Claude review: " Claude Code Review Bot
2026-05-21  8:14 ` [PATCH v5 2/2] drm: panel: add support for " Neil Armstrong
2026-05-25 10:36   ` Claude Code Review Bot [this message]
2026-05-25 10:36 ` Claude review: drm: panel: support the " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-22 12:51 [PATCH v6 0/2] " Neil Armstrong
2026-05-22 12:51 ` [PATCH v6 2/2] drm: panel: add support for the Renesas " Neil Armstrong
2026-05-25  8:37   ` Claude review: " Claude Code Review Bot
2026-05-04  8:02 [PATCH v3 0/2] drm: panel: support the " Neil Armstrong
2026-05-04  8:02 ` [PATCH v3 2/2] drm: panel: add support for the Renesas " Neil Armstrong
2026-05-04 22:29   ` Claude review: " Claude Code Review Bot
2026-04-30 12:22 [PATCH v2 0/2] drm: panel: support the " Neil Armstrong
2026-04-30 12:22 ` [PATCH v2 2/2] drm: panel: add support for the Renesas " Neil Armstrong
2026-05-05  0:27   ` Claude review: " Claude Code Review Bot

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=review-patch2-20260521-topic-sm8650-ayaneo-pocket-s2-r63419-v5-2-dd5700299390@linaro.org \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /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