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/i915: Implement the "color format" DRM property
Date: Wed, 25 Mar 2026 06:44:27 +1000	[thread overview]
Message-ID: <review-patch8-20260324-color-format-v11-8-605559af4fb4@collabora.com> (raw)
In-Reply-To: <20260324-color-format-v11-8-605559af4fb4@collabora.com>

Patch Review

1. **Dropped `has_hdmi_sink` check in HDMI fallback path:** The existing code checks `!crtc_state->has_hdmi_sink` before falling back to YCbCr420, but the new code drops this:
```c
-		if (crtc_state->sink_format == INTEL_OUTPUT_FORMAT_YCBCR420 ||
-		    !crtc_state->has_hdmi_sink ||
-		    !connector->base.ycbcr_420_allowed ||
-		    !drm_mode_is_420_also(info, adjusted_mode))
+		if (!connector->base.ycbcr_420_allowed)
+			return ret;
```
DVI sinks (non-HDMI) cannot do YCbCr420, but the `ycbcr_420_allowed` flag should already prevent this. However, the original code had the `has_hdmi_sink` check as an additional safety guard. Removing it is probably fine since `ycbcr_420_allowed` should never be set for DVI, but worth double-checking.

2. **`drm_mode_is_420_also` changed to `drm_mode_is_420`:** In the HDMI fallback, the old code checks `drm_mode_is_420_also()` and the new code uses `drm_mode_is_420()` (which includes both 420-only and 420-also). Since we already check `crtc_state->sink_format == INTEL_OUTPUT_FORMAT_YCBCR420` (i.e., we're not already in 420 mode), this is a semantic change but correct — if the mode is 420-only and we're somehow not already in 420, it's still valid to fall back to 420.

3. **Implicit reliance on `!req_fmt` meaning AUTO (value 0):** Throughout the i915 HDMI path, `!req_fmt` and `if (req_fmt)` are used to test for AUTO vs non-AUTO. Since `DRM_CONNECTOR_COLOR_FORMAT_AUTO = 0`, this works, but it's fragile if the enum ever changes. Recommend using explicit comparison: `req_fmt == DRM_CONNECTOR_COLOR_FORMAT_AUTO`.

4. **i915 DP-MST: `actual_format` potentially uninitialized:** In `mst_stream_compute_config`, the switch on `pipe_config->output_format`:
```c
+		switch (pipe_config->output_format) {
+		case INTEL_OUTPUT_FORMAT_RGB:
+			actual_format = DRM_CONNECTOR_COLOR_FORMAT_RGB444;
+			break;
+		case INTEL_OUTPUT_FORMAT_YCBCR444:
+			actual_format = DRM_CONNECTOR_COLOR_FORMAT_YCBCR444;
+			break;
+		case INTEL_OUTPUT_FORMAT_YCBCR420:
+			actual_format = DRM_CONNECTOR_COLOR_FORMAT_YCBCR420;
+			break;
+		}
```
There is no `default:` case. If `pipe_config->output_format` is an unexpected value, `actual_format` will be used uninitialized. The compiler will likely warn about this. Add a `default: return -EINVAL;` case.

5. **No YCbCr422 support in i915:** The `supported_colorformats` bitmask in `intel_connector.c` omits `YCBCR422`. This is correct since i915 doesn't support YCbCr422 output, and the property will correctly not list it.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-24 20:44 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 16:01 [PATCH v11 00/22] Add new general DRM property "color format" Nicolas Frattaroli
2026-03-24 16:01 ` [PATCH v11 01/22] drm/amd/display: Remove unnecessary SIGNAL_TYPE_HDMI_TYPE_A check Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 02/22] drm/display: hdmi-state-helper: Use default case for unsupported formats Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 03/22] drm: Add new general DRM property "color format" Nicolas Frattaroli
2026-03-24 17:00   ` Ville Syrjälä
2026-03-24 19:10     ` Nicolas Frattaroli
2026-03-24 19:53       ` Ville Syrjälä
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 04/22] drm/bridge: Act on the DRM color format property Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 05/22] drm/atomic-helper: Add HDMI bridge output bus formats helper Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 06/22] drm/display: hdmi-state-helper: Act on color format DRM property Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 07/22] drm/display: hdmi-state-helper: Try subsampling in mode_valid Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 08/22] drm/i915: Implement the "color format" DRM property Nicolas Frattaroli
2026-03-24 20:44   ` Claude Code Review Bot [this message]
2026-03-24 16:01 ` [PATCH v11 09/22] drm/amdgpu: Implement " Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 10/22] drm/rockchip: Add YUV422 output mode constants for VOP2 Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 11/22] drm/rockchip: vop2: Add RK3576 to the RG swap special case Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 12/22] drm/rockchip: vop2: Recognise 10-bit YUV422 as YUV format Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 13/22] drm/rockchip: vop2: Set correct output format for RK3576 YUV422 Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 14/22] drm/bridge: dw-hdmi-qp: Use common HDMI output bus fmts helper Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 15/22] drm/rockchip: dw_hdmi_qp: Implement "color format" DRM property Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 16/22] drm/rockchip: dw_hdmi_qp: Set supported_formats platdata Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 17/22] drm/connector: Register color format property on HDMI connectors Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 18/22] drm/tests: hdmi: Add tests for the color_format property Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 19/22] drm/tests: hdmi: Add tests for HDMI helper's mode_valid Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 20/22] drm/tests: bridge: Add KUnit tests for bridge chain format selection Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 21/22] drm/tests: bridge: Add test for HDMI output bus formats helper Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 16:01 ` [PATCH v11 22/22] drm/bridge: Document bridge chain format selection Nicolas Frattaroli
2026-03-24 20:44   ` Claude review: " Claude Code Review Bot
2026-03-24 20:44 ` Claude review: Add new general DRM property "color format" 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-patch8-20260324-color-format-v11-8-605559af4fb4@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