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 driver for Novatek NT37705 panel
Date: Tue, 05 May 2026 09:22:46 +1000	[thread overview]
Message-ID: <review-patch2-20260501-fp6-panel-v1-2-e09cb05651cc@fairphone.com> (raw)
In-Reply-To: <20260501-fp6-panel-v1-2-e09cb05651cc@fairphone.com>

Patch Review

This is the main patch. It's a typical DSI panel driver with DSC support. Several issues:

**Issue 1 (build failure): Missing `DRM_DISPLAY_DSC_HELPER` in Kconfig**

```
+config DRM_PANEL_NOVATEK_NT37705
+	tristate "Novatek NT37705-based DSI panel"
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	select DRM_KMS_HELPER
```

The driver includes `<drm/display/drm_dsc.h>` and `<drm/display/drm_dsc_helper.h>` and calls `drm_dsc_pps_payload_pack()`. This requires `DRM_DISPLAY_DSC_HELPER`. Without it, the build will fail with an undefined symbol for `drm_dsc_pps_payload_pack`. Compare with the NT37801 Kconfig entry which has:
```
	select DRM_DISPLAY_DSC_HELPER
	select DRM_DISPLAY_HELPER
```

This needs to be:
```
	select DRM_DISPLAY_DSC_HELPER
	select DRM_DISPLAY_HELPER
	select DRM_KMS_HELPER
```

**Issue 2 (resource leak): Incomplete error cleanup in `nt37705_prepare()`**

After PPS or compression_mode failure, the function returns without cleaning up:
```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;
	}
```

At this point regulators are enabled, the reset GPIO is deasserted, and the panel has been initialized via `nt37705_on()`. Returning without cleanup leaks the regulators and leaves the panel in an inconsistent state. The NT37801 driver handles this correctly with a `goto err` pattern that deasserts reset and disables regulators. This should follow the same pattern, using a common error label.

**Minor: Standard DCS commands sent with extra `0x00` parameter**

```c
	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x11, 0x00);
	mipi_dsi_msleep(&dsi_ctx, 120);
	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x29, 0x00);
```

`0x11` is `MIPI_DCS_EXIT_SLEEP_MODE` and `0x29` is `MIPI_DCS_SET_DISPLAY_ON` -- both are defined as zero-parameter commands in the MIPI DCS spec. The extra `0x00` byte is non-standard. Similarly in `nt37705_off()`:
```c
	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x28, 0x00);
	...
	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x10, 0x00);
```

Since this is generated from vendor device tree, the extra byte may be intentional for this IC. But ideally these should use the dedicated multi helpers (`mipi_dsi_dcs_exit_sleep_mode_multi`, `mipi_dsi_dcs_set_display_on_multi`, etc.) or at least use the named `MIPI_DCS_*` constants.

**Minor: Tear enable without named constant**

```c
	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x35);
```

`0x35` is `MIPI_DCS_SET_TEAR_ON`. Consider using the named constant for readability, or the dedicated helper if one exists.

**Minor: Kconfig help text has a doubled "the"**

```
+	  display panels, such as the one found in the The Fairphone (Gen. 6)
```

Should be "the Fairphone (Gen. 6)".

**Observation: TODOs in probe()**

Two TODO comments are left in the code:
```c
	/* TODO: Pass slice_per_pkt = 2 */
	...
	/*
	 * TODO: hdisplay should be read from the selected mode once
	 * it is passed back to drm_panel (in prepare?)
	 */
```

These are pre-existing framework limitations also present in NT37801, so they're acceptable for now, but worth tracking.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-04 23:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 13:52 [PATCH 0/4] Add Novatek NT37705 panel driver for Fairphone (Gen. 6) Luca Weiss
2026-05-01 13:52 ` [PATCH 1/4] dt-bindings: display: panel: Add Novatek NT37705 Luca Weiss
2026-05-01 15:51   ` Conor Dooley
2026-05-04 13:36     ` Luca Weiss
2026-05-04 20:45       ` Krzysztof Kozlowski
2026-05-04 20:47         ` Krzysztof Kozlowski
2026-05-04 23:22   ` Claude review: " Claude Code Review Bot
2026-05-01 13:52 ` [PATCH 2/4] drm/panel: Add driver for Novatek NT37705 panel Luca Weiss
2026-05-01 18:17   ` David Heidelberg
2026-05-04 23:22   ` Claude Code Review Bot [this message]
2026-05-01 13:52 ` [PATCH 3/4] arm64: defconfig: Enable " Luca Weiss
2026-05-04 22:41   ` Dmitry Baryshkov
2026-05-04 23:22   ` Claude review: " Claude Code Review Bot
2026-05-01 13:52 ` [PATCH 4/4] arm64: dts: qcom: milos-fairphone-fp6: Enable display Luca Weiss
2026-05-04 22:40   ` Dmitry Baryshkov
2026-05-04 23:22   ` Claude review: " Claude Code Review Bot
2026-05-04 23:22 ` Claude review: Add Novatek NT37705 panel driver for Fairphone (Gen. 6) 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-20260501-fp6-panel-v1-2-e09cb05651cc@fairphone.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