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 Synaptics R63455 DSI panel
Date: Mon, 25 May 2026 20:00:02 +1000	[thread overview]
Message-ID: <review-patch5-20260521-sm8650-7-1-bonded-dsi-v4-5-a4dd5e0850f1@linaro.org> (raw)
In-Reply-To: <20260521-sm8650-7-1-bonded-dsi-v4-5-a4dd5e0850f1@linaro.org>

Patch Review

**Concept**: Panel driver managing two R63455-based panels as a single logical display for VR.

**Issues:**

1. **Build breakage — `pulse_offset_rows` does not exist**: The code uses:
   ```c
   ctx->backlight->props.pulse_offset_rows = GPO1_TES1;
   ```
   and in `r63455_bl_update_status`:
   ```c
   bl->props.pulse_offset_rows
   ```
   The field `pulse_offset_rows` does not exist in `struct backlight_properties` in the kernel. This will not compile. It appears to be a custom extension that was never submitted upstream, or a leftover from an out-of-tree tree. The brightness-related pulse timing should likely be handled within the panel driver directly rather than via backlight properties.

2. **Deprecated API — `of_device_get_match_data`**: Line:
   ```c
   ctx->dsi_init_seq = of_device_get_match_data(dev);
   ```
   Should use `device_get_match_data(dev)` instead. `of_device_get_match_data` is deprecated in favor of the bus-agnostic version.

3. **Missing `IS_ERR` check after `devm_drm_panel_alloc`**: The probe function does:
   ```c
   ctx = devm_drm_panel_alloc(&dsi->dev, __typeof(*ctx), panel,
                               &r63455_drm_funcs, DRM_MODE_CONNECTOR_DSI);
   ctx->dsi_init_seq = of_device_get_match_data(dev);
   ```
   There's no `IS_ERR(ctx)` check. `devm_drm_panel_alloc` can return `ERR_PTR(-ENOMEM)`, which would cause a NULL-pointer dereference on the next line.

4. **Unused header**: `#include <linux/of_device.h>` — with the switch to `device_get_match_data()`, this would be unnecessary. Even with `of_device_get_match_data`, this header is largely deprecated in favor of `<linux/property.h>`.

5. **Unused header**: `#include <linux/pinctrl/consumer.h>` — the driver doesn't use any pinctrl APIs.

6. **`LE16_BYTE0`/`LE16_BYTE1` and `BE16_BYTE0`/`BE16_BYTE1` macros are confusing**: These macros take a `val` that is a plain integer constant (e.g., `VBP = 100`), then call `le16_to_cpu()` or `be16_to_cpu()` on it. Since the input is a host-endian constant (not actually little- or big-endian data), this is incorrect usage of endian conversion functions. On little-endian ARM, `le16_to_cpu(100)` happens to be a no-op and `be16_to_cpu(100)` byte-swaps, but the semantic is wrong. These should just use plain shift/mask operations: `(val & 0xff)` and `((val >> 8) & 0xff)`.

7. **Error handling in `r63455_unprepare`**: The function continues disabling regulators even after errors, which is reasonable for cleanup, but it only returns the *last* error code. If `reg_lcd_bias_neg` disable fails but `reg_bl` disable succeeds, the error from `reg_lcd_bias_neg` is lost.

8. **No `remove` or cleanup for `dsi1_device`**: In probe, `mipi_dsi_device_register_full()` is called to create `dsi1_device`, but there's no corresponding `mipi_dsi_device_unregister()` in an error path or remove callback. Since only `devm_mipi_dsi_attach` is used (which handles detach), the device registration itself leaks on driver unbind. Consider using `devm_mipi_dsi_device_register_full()` if available, or adding cleanup.

9. **Function name typo**: `r63455_panel_on_boe_vs026c4m_n52_26000` — the compatible string is `boe,vs026c4m-n52-6000`, but the function name has `26000` (an extra `2`).

10. **`of_graph_get_remote_node` returns a reference**: Line:
    ```c
    dsi1 = of_graph_get_remote_node(dsi->dev.of_node, 1, -1);
    ```
    The `of_node_put(dsi1)` is correctly called a few lines later, but if `of_find_mipi_dsi_host_by_node` fails and returns `-EPROBE_DEFER`, the function returns without any issue. This is fine. However, `dsi1` is used as the node to find the host, but the host's node is the *parent* of the endpoint — `of_graph_get_remote_node` returns the remote port's parent device node, which should be correct for `of_find_mipi_dsi_host_by_node`. This looks correct.

11. **Mode `.clock` computation**: The clock calculation:
    ```c
    .clock = (2160 + 24 + 20 + 20) * (2160 + 404 + 1 + 20) * 120 * 2 / 1000,
    ```
    The `* 2` is for the doubled horizontal resolution. The result is `(2224) * (2585) * 120 * 2 / 1000 = 1,380,787.2` → truncated to `1380787` kHz (~1.38 GHz pixel clock). This seems extremely high for a DSI link but may be correct for a compressed/DSC mode. Worth double-checking.

---
Generated by Claude Code Patch Reviewer

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

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 14:46 [PATCH v4 0/5] Add support to 2 panels in bonded-DSI mode Jun Nie
2026-05-21 14:46 ` [PATCH v4 1/5] drm/msm/dsi: support DSC configurations with slice_per_pkt > 1 Jun Nie
2026-05-25 10:00   ` Claude review: " Claude Code Review Bot
2026-05-21 14:46 ` [PATCH v4 2/5] drm/mipi-dsi: Add flag to support dual-panel configurations Jun Nie
2026-05-25 10:00   ` Claude review: " Claude Code Review Bot
2026-05-21 14:46 ` [PATCH v4 3/5] drm/msm/dsi: Support dual panel use case with single CRTC Jun Nie
2026-05-25 10:00   ` Claude review: " Claude Code Review Bot
2026-05-21 14:46 ` [PATCH v4 4/5] dt-bindings: display: Add Synaptics R63455 panel support Jun Nie
2026-05-21 19:45   ` Conor Dooley
2026-05-21 20:24   ` Dmitry Baryshkov
2026-05-22  6:32     ` Neil Armstrong
2026-05-21 20:46   ` Rob Herring (Arm)
2026-05-25 10:00   ` Claude review: " Claude Code Review Bot
2026-05-21 14:46 ` [PATCH v4 5/5] drm/panel: Add driver for Synaptics R63455 DSI panel Jun Nie
2026-05-25 10:00   ` Claude Code Review Bot [this message]
2026-05-25 10:00 ` Claude review: Add support to 2 panels in bonded-DSI mode 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-patch5-20260521-sm8650-7-1-bonded-dsi-v4-5-a4dd5e0850f1@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