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/amd/display: Add support for 'link bpc' property
Date: Thu, 12 Mar 2026 06:57:50 +1000	[thread overview]
Message-ID: <review-patch2-20260311-link-bpc-v4-2-51775e964720@collabora.com> (raw)
In-Reply-To: <20260311-link-bpc-v4-2-51775e964720@collabora.com>

Patch Review

**MST exclusion** (correct):

```c
if (!aconnector->mst_root) {
    drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16);
    drm_connector_attach_link_bpc_property(&aconnector->base, 16);
}
```

MST connectors are correctly excluded, matching the existing `max_bpc` behavior. The return value of `drm_connector_attach_link_bpc_property` is silently ignored here, unlike in `drmm_connector_hdmi_init` where it's checked. This is inconsistent — if the property creation fails (e.g. ENOMEM), this silently continues. Consider adding error handling.

**link_bpc set only on stream creation path** (potential gap):

```c
amdgpu_dm_update_link_bpc(drm_new_conn_state,
                          new_stream->timing.display_color_depth);
```

This is called in `dm_update_crtc_state` only when `action == DM_COMMIT_ACTION_DPMS_ON || action == DM_COMMIT_ACTION_SET`. When a connector is disabled (`DPMS_OFF`), `link_bpc` is not reset to 0 or any sentinel, so the property will retain the last active value. This might confuse userspace checking the property on a disconnected output.

**Redundant clamping** (nit):

```c
static void amdgpu_dm_update_link_bpc(struct drm_connector_state *conn_state,
                                      enum dc_color_depth depth)
{
    /* 6 bpc is an experimental internal format only, use 8 as minimum */
    conn_state->link_bpc = clamp(convert_dc_color_depth_into_bpc(depth), 8,
                                 conn_state->max_bpc);
}
```

The clamping is also done in `drm_connector_update_link_bpc_property()`, making this double-clamped. While not harmful, it's worth noting. The comment about 6 bpc being experimental is helpful though.

**`convert_dc_color_depth_into_bpc` can return 0**: If `depth` is an unexpected `dc_color_depth` enum value, the function returns 0. After clamping with min=8, this would become 8, which is a reasonable fallback. However, it might be worth adding a `drm_dbg` when the conversion returns 0, as it would indicate an unexpected hardware state.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-11 20:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 11:30 [PATCH v4 0/2] Add "link bpc" DRM property Nicolas Frattaroli
2026-03-11 11:30 ` [PATCH v4 1/2] drm/connector: hdmi: Add a 'link bpc' property Nicolas Frattaroli
2026-03-11 20:57   ` Claude review: " Claude Code Review Bot
2026-03-11 11:30 ` [PATCH v4 2/2] drm/amd/display: Add support for " Nicolas Frattaroli
2026-03-11 20:57   ` Claude Code Review Bot [this message]
2026-03-11 20:57 ` 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 3/3] drm/amd/display: 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-20260311-link-bpc-v4-2-51775e964720@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