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 Tianma TA066VVHM03 panel
Date: Tue, 10 Mar 2026 12:50:31 +1000	[thread overview]
Message-ID: <review-patch2-20260308-tianma-ta066vvhm03-v2-2-5f2344685133@pm.me> (raw)
In-Reply-To: <20260308-tianma-ta066vvhm03-v2-2-5f2344685133@pm.me>

Patch Review

**Issue 1 (medium): Missing cleanup in `prepare()` error paths after PPS/compression failures.**

```c
ret = mipi_dsi_picture_parameter_set(ctx->dsi, &pps);
if (ret < 0) {
    dev_err(panel->dev, "failed to transmit PPS: %d\n", ret);
    return ret;
}

ret = mipi_dsi_compression_mode(ctx->dsi, true);
if (ret < 0) {
    dev_err(dev, "failed to enable compression mode: %d\n", ret);
    return ret;
}
```

Both of these error paths return without disabling regulators, deasserting the enable GPIO, or asserting reset. Compare with the earlier error path after `tianma_ta066vvhm03_on()` which properly cleans up. These should do the same cleanup (or better yet, use `goto` labels for a unified error path).

Additionally, note the inconsistency: the `_on()` error path uses `dev` from `&ctx->dsi->dev`, but the PPS error path uses `panel->dev`. Should be consistent — prefer `dev` since it's already a local variable.

**Issue 2 (minor): Questionable LPM flag handling in `_off()`.**

```c
static int tianma_ta066vvhm03_off(struct tianma_ta066vvhm03 *ctx)
{
    ...
    ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;

    mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
    mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
```

This clears LPM mode before sending display-off and enter-sleep DCS commands, meaning they'll be sent in HS mode. This is unusual — most panel drivers send these in LP mode. In `_on()`, LPM is explicitly set. While this may match the vendor downstream driver behavior, it's worth double-checking whether this is intentional and required by the panel.

**Issue 3 (minor): `dsc_slice_per_pkt` dependency.**

```c
dsi->dsc_slice_per_pkt = 2;
```

As noted in the cover letter, this depends on an out-of-tree patch. This field doesn't exist in mainline `struct mipi_dsi_device`. The driver cannot be merged until that dependency lands. This should be clearly noted (it is in the cover letter, which is fine).

**Issue 4 (minor): 160 Hz pixel clock.**

```c
.clock = (1080 + 24 + 4 + 10) * (2340 + 12 + 1 + 4) * 160 / 1000,
```

This computes to `(1118 * 2357 * 160) / 1000 = 421,502` (approximately). A 160 Hz refresh rate is unusual for a phone panel — most are 60, 90, or 120 Hz. This may be correct (the ROG Phone 3 could support high refresh rates), but worth confirming this matches the actual panel specification. The `.clock` evaluates to ~421502 kHz.

**Issue 5 (nit): Consider using `mipi_dsi_picture_parameter_set_multi` for consistency.**

The `_on()` function uses the `_multi` pattern throughout, but `prepare()` switches to non-multi `mipi_dsi_picture_parameter_set()` and `mipi_dsi_compression_mode()`. Some newer DSC panel drivers (e.g., `panel-lg-sw43408.c`) use `mipi_dsi_picture_parameter_set_multi()` to keep the error handling pattern consistent. This would also help with the error path cleanup issue.

**Positive observations:**
- Correctly uses `devm_drm_panel_alloc()` (modern API).
- Uses `mipi_dsi_multi_context` pattern for init sequences — good.
- Uses `drm_connector_helper_get_modes_fixed()` — correct for single-mode panels.
- Uses `devm_regulator_bulk_get_const()` — correct since the supply array is `const`.
- DSC config looks reasonable (DSC 1.1, 10 bpc, 8 bpp, 540px slices).
- `prepare_prev_first = true` is set appropriately for DSI panels.
- The `WARN_ON(1080 % ctx->dsc.slice_width)` is a nice sanity check.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-10  2:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 21:08 [PATCH v2 0/2] Add support for Tianma TA066VVHM03 DSI panel Alexander Koskovich
2026-03-08 21:09 ` [PATCH v2 1/2] dt-bindings: display: panel: Document Tianma TA066VVHM03 Alexander Koskovich
2026-03-09  7:35   ` Krzysztof Kozlowski
2026-03-09  7:41     ` Alexander Koskovich
2026-03-09  7:54       ` Krzysztof Kozlowski
2026-03-09  7:59         ` Alexander Koskovich
2026-03-10  2:50     ` Claude review: " Claude Code Review Bot
2026-03-08 21:09 ` [PATCH v2 2/2] drm/panel: Add support for Tianma TA066VVHM03 panel Alexander Koskovich
2026-03-10  2:50   ` Claude Code Review Bot [this message]
2026-03-10  2:50 ` Claude review: Add support for Tianma TA066VVHM03 DSI panel Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-10  4:36 [PATCH v3 0/2] " Alexander Koskovich
2026-03-10  4:36 ` [PATCH v3 2/2] drm/panel: Add support for Tianma TA066VVHM03 panel Alexander Koskovich
2026-03-11  3:40   ` Claude review: " Claude Code Review Bot
2026-03-08  6:03 [PATCH 0/2] Add support for Tianma TA066VVHM03 DSI panel Alexander Koskovich
2026-03-08  6:03 ` [PATCH 2/2] drm/panel: Add support for Tianma TA066VVHM03 panel Alexander Koskovich
2026-03-08 21:59   ` 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-20260308-tianma-ta066vvhm03-v2-2-5f2344685133@pm.me \
    --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