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 Novatek/Tianma NT37700F panel
Date: Tue, 10 Mar 2026 11:42:23 +1000	[thread overview]
Message-ID: <review-patch3-20260310002606.16413-4-mailingradian@gmail.com> (raw)
In-Reply-To: <20260310002606.16413-4-mailingradian@gmail.com>

Patch Review

**Status: Mostly good, minor observations.**

The driver is well-structured and uses modern APIs (`mipi_dsi_multi_context`, `drm_connector_helper_get_modes_fixed`). A few observations:

1. **Includes**: `<linux/of.h>` is included but not directly needed — the OF match table works through `<linux/module.h>` and the `MODULE_DEVICE_TABLE` macro. This is very minor and cosmetic.

2. **`prepare` error path missing regulator disable**: In `nt37700f_tianma_prepare()`:
   ```c
   ret = nt37700f_tianma_on(ctx);
   if (ret < 0) {
       dev_err(dev, "Failed to initialize panel: %d\n", ret);
       gpiod_set_value_cansleep(ctx->reset_gpio, 1);
       return ret;
   }
   ```
   When `nt37700f_tianma_on()` fails, the reset GPIO is asserted but the regulator is **not** disabled. This will leave the `power` supply enabled after a failed prepare. The error path should call `regulator_disable(ctx->supply)` as well to match what `unprepare` does.

3. **Backlight mode flag toggling**: The backlight `update_status` and `get_brightness` callbacks toggle `MIPI_DSI_MODE_LPM`:
   ```c
   dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
   ret = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
   ...
   dsi->mode_flags |= MIPI_DSI_MODE_LPM;
   ```
   This is not thread-safe — if backlight updates could race with other DSI operations, the mode flags could be corrupted. This is a pattern seen in generated drivers, and in practice it may be fine for this single-panel setup, but it's worth noting.

4. **`MIPI_DSI_MODE_VIDEO_BURST` without `MIPI_DSI_MODE_VIDEO`**: The mode flags are:
   ```c
   dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST |
                     MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM;
   ```
   `MODE_VIDEO_BURST` implies video mode, but `MIPI_DSI_MODE_VIDEO` itself is not set. This means the panel operates in **command mode** (since `MODE_VIDEO` is not set), and `MODE_VIDEO_BURST` has no effect. The MODULE_DESCRIPTION says "cmd mode" which is consistent, but having `MODE_VIDEO_BURST` set when not in video mode is misleading/unnecessary. Consider removing `MIPI_DSI_MODE_VIDEO_BURST` if this is indeed a command-mode panel.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-10  1:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10  0:26 [PATCH v3 0/5] Support for the Pixel 3a XL with the Tianma panel Richard Acayan
2026-03-10  0:26 ` [PATCH v3 1/5] dt-bindings: arm: qcom: document google, bonito-tianma board Richard Acayan
2026-03-10  1:42   ` Claude review: " Claude Code Review Bot
2026-03-10  0:26 ` [PATCH v3 2/5] dt-bindings: panel-simple-dsi: add nt37700f compatible Richard Acayan
2026-03-10  1:42   ` Claude review: " Claude Code Review Bot
2026-03-10  0:26 ` [PATCH v3 3/5] drm/panel: Add Novatek/Tianma NT37700F panel Richard Acayan
2026-03-10  1:42   ` Claude Code Review Bot [this message]
2026-03-10  0:26 ` [PATCH v3 4/5] arm64: dts: qcom: sdm670-google: add common device tree include Richard Acayan
2026-03-10  1:42   ` Claude review: " Claude Code Review Bot
2026-03-10  0:26 ` [PATCH v3 5/5] arm64: dts: qcom: add support for pixel 3a xl with the tianma panel Richard Acayan
2026-03-10  1:42   ` Claude review: " Claude Code Review Bot
2026-03-10  1:42 ` Claude review: Support for the Pixel 3a XL with the Tianma panel Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-02-17  0:08 [PATCH v2 0/6] " Richard Acayan
2026-02-17  0:08 ` [PATCH v2 3/6] drm/panel: Add Novatek/Tianma NT37700F panel Richard Acayan
2026-02-17  5:51   ` Claude review: " Claude Code Review Bot
2026-02-10  2:32 [PATCH 0/6] Support for the Pixel 3a XL with the Tianma panel Richard Acayan
2026-02-10  2:32 ` [PATCH 3/6] drm/panel: Add Novatek/Tianma NT37700F panel Richard Acayan
2026-02-11  6:47   ` 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-patch3-20260310002606.16413-4-mailingradian@gmail.com \
    --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