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/connector: hdmi: Add support for 'link bpc' property
Date: Tue, 31 Mar 2026 17:31:19 +1000	[thread overview]
Message-ID: <review-patch2-20260330-link-bpc-v6-2-ff124af93e48@collabora.com> (raw)
In-Reply-To: <20260330-link-bpc-v6-2-ff124af93e48@collabora.com>

Patch Review

**Issue 1 (bug): `link_bpc` only set when output_bpc changes, not on initial modeset**

```c
if (old_conn_state->hdmi.broadcast_rgb != new_conn_state->hdmi.broadcast_rgb ||
    old_conn_state->hdmi.output_bpc != new_conn_state->hdmi.output_bpc ||
    old_conn_state->hdmi.output_format != new_conn_state->hdmi.output_format) {
        struct drm_crtc *crtc = new_conn_state->crtc;
        struct drm_crtc_state *crtc_state;

        new_conn_state->link_bpc = new_conn_state->hdmi.output_bpc;
```

The `link_bpc` assignment is **inside** the `if` block that only triggers when broadcast_rgb, output_bpc, or output_format have changed from the old state. On the **first** modeset (or any modeset where these values happen to be the same as previous), `link_bpc` will remain at its default of 0 (zero-initialized connector state), which is below the range minimum of 8.

The `commit_tail` code will then see `old_conn_state->link_bpc (0) != new_conn_state->link_bpc (0)` — actually they'd be equal so it wouldn't fire, but the property would remain stale at its initial `max_bpc` value rather than reflecting the actual output_bpc.

The assignment should be moved **outside** the if block, to unconditionally set `link_bpc` to `hdmi.output_bpc`:

```c
new_conn_state->link_bpc = new_conn_state->hdmi.output_bpc;

if (old_conn_state->hdmi.broadcast_rgb != new_conn_state->hdmi.broadcast_rgb ||
    ...
```

This was actually what the cover letter's diff stat area suggests (the `+` line before the `crtc_state` block), but in the actual diff the assignment ended up inside the conditional. Looking at the diff more carefully, the `+` lines show it placed right after the opening brace of the if block. This is a real bug — on initial enable the link_bpc won't be set to the actual value.

**Patch 2 otherwise looks correct:** The `drmm_connector_hdmi_init` integration properly attaches the property after `max_bpc` is set up, and the error return is properly wired.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-31  7:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  8:33 [PATCH v6 0/2] Add "link bpc" DRM property Nicolas Frattaroli
2026-03-30  8:33 ` [PATCH v6 1/2] drm/connector: Add a 'link bpc' property Nicolas Frattaroli
2026-03-31  7:31   ` Claude review: " Claude Code Review Bot
2026-03-30  8:33 ` [PATCH v6 2/2] drm/connector: hdmi: Add support for " Nicolas Frattaroli
2026-03-31  7:31   ` Claude Code Review Bot [this message]
2026-03-31  7:31 ` Claude review: Add "link bpc" DRM property Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-19 12:28 [PATCH v5 0/3] " Nicolas Frattaroli
2026-03-19 12:28 ` [PATCH v5 2/3] drm/connector: hdmi: Add support for 'link bpc' property Nicolas Frattaroli
2026-03-21 18:19   ` 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-patch2-20260330-link-bpc-v6-2-ff124af93e48@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