From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260311-link-bpc-v4-2-51775e964720@collabora.com> References: <20260311-link-bpc-v4-0-51775e964720@collabora.com> <20260311-link-bpc-v4-2-51775e964720@collabora.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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` beha= vior. The return value of `drm_connector_attach_link_bpc_property` is silen= tly ignored here, unlike in `drmm_connector_hdmi_init` where it's checked. = This is inconsistent =E2=80=94 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 =3D=3D DM_COMMIT= _ACTION_DPMS_ON || action =3D=3D DM_COMMIT_ACTION_SET`. When a connector is= disabled (`DPMS_OFF`), `link_bpc` is not reset to 0 or any sentinel, so th= e 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_stat= e, enum dc_color_depth depth) { /* 6 bpc is an experimental internal format only, use 8 as minimum */ conn_state->link_bpc =3D 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()`, ma= king 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 unexpe= cted `dc_color_depth` enum value, the function returns 0. After clamping wi= th min=3D8, this would become 8, which is a reasonable fallback. However, i= t might be worth adding a `drm_dbg` when the conversion returns 0, as it wo= uld indicate an unexpected hardware state. --- Generated by Claude Code Patch Reviewer