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/scdc-helper: Implement parsing and printing HDMI 2.1 fields
Date: Fri, 05 Jun 2026 06:21:29 +1000	[thread overview]
Message-ID: <review-patch4-20260604-scdc-link-health-v5-4-11173b0ac3de@collabora.com> (raw)
In-Reply-To: <20260604-scdc-link-health-v5-4-11173b0ac3de@collabora.com>

Patch Review

**Bug: Missing `else` for `rs_corrections` zeroing.**

```c
if (num_lanes == 4 && (buf[SCDC_ERR_DET_RS_H] & SCDC_CHANNEL_VALID))
    state->rs_corrections = (buf[SCDC_ERR_DET_RS_H] & ~SCDC_CHANNEL_VALID) << 8 |
                            buf[SCDC_ERR_DET_RS_L];
```

When the channel valid bit is not set, `rs_corrections` is left uninitialized (or carries the value from a prior read). Compare with `counter[3]` which correctly has an `else counter[3] = 0` clause. Should add:
```c
else
    state->rs_corrections = 0;
```

**Issue: Training pattern fields parsed but never displayed.**

`drm_scdc_parse_status1_2_flags()` populates `ln[0-3]_training_pattern` in the state, but `scdc_status_show()` never prints them. Either add the display or defer parsing these fields until a consumer exists.

**Style: Missing parentheses in one condition but present in the equivalent one.**

```c
if (num_lanes == 4 && scdc[SCDC_ERR_DET_3_H] & SCDC_CHANNEL_VALID)  // no parens
```
vs.
```c
if (num_lanes == 4 && (buf[SCDC_ERR_DET_RS_H] & SCDC_CHANNEL_VALID))  // has parens
```

Both are correct due to C precedence (`&` binds tighter than `&&`), but the inconsistency is confusing and likely to attract compiler warnings. Add parentheses to the first for clarity and consistency.

**Nit: `__pure` on `drm_scdc_num_frl_lanes`.**

```c
static inline __pure int drm_scdc_num_frl_lanes(enum drm_scdc_frl_rate rate)
```

The v4 changelog said "Drop the __pure attributes on static functions." For a static inline function that only switches on its argument, the compiler will determine purity on its own. This is harmless but unnecessary and inconsistent with the stated v4 cleanup.

**Nit: `enum drm_scdc_frl_rate rate : 4` uses an enum bitfield.** Storing an enum in a 4-bit bitfield is implementation-defined in C, though it works reliably with GCC/Clang which are the only compilers the kernel supports. Worth being aware of.

**Observation: Checksum coverage for 4 lanes.** For the 4-lane case, the checksum loop sums registers `0x50–0x58`, with the checksum byte itself at `0x56` (in the middle). This means the original 3-lane checksum byte must be recalculated by the sink to cover the two additional lane-3 registers. This is presumably correct per the HDMI 2.1 spec, but since I can't verify against the spec, flagging for the author to confirm.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-06-04 20:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 15:52 [PATCH v5 0/4] Add SCDC information to connector debugfs Nicolas Frattaroli
2026-06-04 15:52 ` [PATCH v5 1/4] drm/scdc-helper: Don't use ssize_t return type for scdc_read/write Nicolas Frattaroli
2026-06-04 20:21   ` Claude review: " Claude Code Review Bot
2026-06-04 15:52 ` [PATCH v5 2/4] drm/scdc-helper: Add scdc_status debugfs entry Nicolas Frattaroli
2026-06-04 20:21   ` Claude review: " Claude Code Review Bot
2026-06-04 15:52 ` [PATCH v5 3/4] drm/display: bridge_connector: init scdc debugfs for HDMI Nicolas Frattaroli
2026-06-04 20:21   ` Claude review: " Claude Code Review Bot
2026-06-04 15:52 ` [PATCH v5 4/4] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-06-04 20:21   ` Claude Code Review Bot [this message]
2026-06-04 20:21 ` Claude review: Add SCDC information to connector debugfs Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-27 14:03 [PATCH v4 0/4] " Nicolas Frattaroli
2026-05-27 14:03 ` [PATCH v4 4/4] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-05-28  2:16   ` Claude review: " Claude Code Review Bot
2026-05-26 10:19 [PATCH v3 0/4] Add SCDC information to connector debugfs Nicolas Frattaroli
2026-05-26 10:20 ` [PATCH v3 4/4] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-05-27  5:01   ` Claude review: " Claude Code Review Bot
2026-05-20 13:35 [PATCH v2 0/3] Add SCDC information to connector debugfs Nicolas Frattaroli
2026-05-20 13:35 ` [PATCH v2 3/3] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-05-25 11:49   ` 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-patch4-20260604-scdc-link-health-v5-4-11173b0ac3de@collabora.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