From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260501-fp6-panel-v1-2-e09cb05651cc@fairphone.com> References: <20260501-fp6-panel-v1-0-e09cb05651cc@fairphone.com> <20260501-fp6-panel-v1-2-e09cb05651cc@fairphone.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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 `` and `` 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