From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: ti-sn65dsi83: two fixes + add test pattern
Date: Tue, 10 Mar 2026 11:48:29 +1000 [thread overview]
Message-ID: <review-patch1-20260309-ti-sn65dsi83-dual-lvds-fixes-and-test-pattern-v2-0-e6aaa7e1d181@bootlin.com> (raw)
In-Reply-To: <20260309-ti-sn65dsi83-dual-lvds-fixes-and-test-pattern-v2-0-e6aaa7e1d181@bootlin.com>
Patch Review
**Functionality**: The patch adds a `test_pattern` module parameter (bool, 0644) that, when set, enables the chip's built-in test pattern generator and halves the active line length for dual LVDS mode compatibility.
**Issues and observations:**
1. **The hdisplay halving is not conditional on dual-link mode (medium concern).**
```c
le16val = cpu_to_le16(mode->hdisplay / (test_pattern ? 2 : 1));
```
The comment says:
```
/* Active line length needs to be halved for test pattern
* generation in dual LVDS output. */
```
But the code halves `hdisplay` whenever `test_pattern` is true, regardless of whether `ctx->lvds_dual_link` is set. For single-LVDS configurations with test pattern enabled, this would incorrectly halve the active line length. This should likely be:
```c
le16val = cpu_to_le16(mode->hdisplay / ((test_pattern && ctx->lvds_dual_link) ? 2 : 1));
```
2. **Module parameter is a global static, shared across all instances (minor concern).** If there are multiple SN65DSI83 chips in a system, the test pattern is all-or-nothing. For a debug/bringup tool this is acceptable, but it's worth noting. The v2 changelog mentions a local variable copy to avoid race conditions:
```c
bool test_pattern = sn65dsi83_test_pattern;
```
This is a reasonable approach — it snapshots the value at the start of `sn65dsi83_atomic_pre_enable` so both the hdisplay division and the test pattern register write use a consistent value.
3. **Missing MODULE_PARM_DESC (minor).** The module parameter has no description string, which means `modinfo` won't show any help text for it. Adding:
```c
MODULE_PARM_DESC(test_pattern, "Enable test pattern output for debugging");
```
would improve usability.
4. **Module parameter vs. debugfs (design question).** Module parameters are persistent and affect all instances. For a debug feature like this, a per-bridge debugfs file might be more appropriate, especially since the parameter is writable at runtime (0644). However, module parameters are simpler to implement and the existing driver doesn't use debugfs, so this is a reasonable choice for a debug tool.
5. **The test pattern register define looks correct.** Cross-referencing with the datasheet convention used in the driver, `REG_VID_CHA_TEST_PATTERN_EN` at `BIT(4)` of register `0x3c` is consistent with the TI SN65DSI83/SN65DSI84 documentation.
**Summary**: The patch is clean and well-motivated. The main issue is **#1** — the hdisplay halving should be conditional on dual-link mode, not just on test pattern being enabled, otherwise single-link LVDS setups would get an incorrect active line length when using the test pattern.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-10 1:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 22:06 [PATCH v2] drm/bridge: ti-sn65dsi83: two fixes + add test pattern Luca Ceresoli
2026-03-09 22:06 ` [PATCH v2] drm/bridge: ti-sn65dsi83: add test pattern generation support Luca Ceresoli
2026-03-10 1:48 ` Claude Code Review Bot [this message]
2026-03-10 1:48 ` Claude review: drm/bridge: ti-sn65dsi83: two fixes + add test pattern Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-02-26 16:16 [PATCH 0/3] " Luca Ceresoli
2026-02-27 1:46 ` 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-patch1-20260309-ti-sn65dsi83-dual-lvds-fixes-and-test-pattern-v2-0-e6aaa7e1d181@bootlin.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