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/color: Program fixed-function CSC on SDR planes
Date: Sun, 12 Apr 2026 13:07:23 +1000	[thread overview]
Message-ID: <review-patch3-20260408051514.608781-4-chaitanya.kumar.borah@intel.com> (raw)
In-Reply-To: <20260408051514.608781-4-chaitanya.kumar.borah@intel.com>

Patch Review

**Critical bug**: The new SDR colorop-based CSC programming in `glk_plane_color_ctl()` conflicts with the existing legacy YUV handling.

For SDR planes with YUV framebuffers, the existing code (lines 1279-1293) sets the CSC mode and YUV range correction based on legacy `color_encoding` and `color_range` properties. The new code (lines 1300-1305) then ORs in *additional* CSC mode and range correction bits:

```c
// EXISTING (line 1279): for YUV on SDR planes
if (fb->format->is_yuv && !icl_is_hdr_plane(display, plane->id)) {
    // Sets CSC mode based on color_encoding (e.g., YUV601_TO_RGB601 = 1)
    ...
}

// NEW (line 1300): for ALL SDR planes
if (!icl_is_hdr_plane(display, plane->id)) {
    plane_color_ctl |= intel_csc_ff_type_to_csc_mode(...);
    // May OR a DIFFERENT CSC mode value
}
```

The CSC mode field is `GENMASK(19, 17)` — ORing two different encoded values (e.g., `FIELD_PREP(MASK, 1) | FIELD_PREP(MASK, 2)` = `FIELD_PREP(MASK, 3)`) corrupts the field and selects the wrong conversion.

**Additional regression**: Line 1303-1304 unconditionally ORs `PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE` when `yuv_range_correct` is false (the default). This means that even without using the color pipeline, **all SDR planes now have YUV range correction force-disabled**, breaking existing limited-range YUV content.

The fix should gate the new colorop-based path on whether a color pipeline is actually active, or disable the legacy path when colorops are in use.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-04-12  3:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  5:15 [PATCH v2 00/13] drm/i915/color: Enable SDR plane color pipeline Chaitanya Kumar Borah
2026-04-08  5:15 ` [PATCH v2 01/13] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 02/13] drm/i915/color: Add CSC on SDR plane color pipeline Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 03/13] drm/i915/color: Program fixed-function CSC on SDR planes Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude Code Review Bot [this message]
2026-04-08  5:15 ` [PATCH v2 04/13] drm/i915/color: Add support for 1D LUT in " Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 05/13] drm/i915/color: Fix HDR pre-CSC LUT programming loop Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 06/13] drm/i915/color: Extract HDR pre-CSC LUT programming to helper function Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 07/13] drm/i915/color: Program Pre-CSC registers for SDR Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 08/13] drm/i915/color: Extract HDR post-CSC LUT programming to helper function Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 09/13] drm/i915/color: Program Plane Post CSC registers for SDR planes Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 10/13] drm/i915/color: Add color pipeline support " Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 11/13] drm/i915/color: Add YCbCr limited-to-full range color block support Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 12/13] drm/i915/color: Program plane YUV range correction colorop Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-08  5:15 ` [PATCH v2 13/13] drm/i915/color: Add YUV range correction to SDR plane pipeline Chaitanya Kumar Borah
2026-04-12  3:07   ` Claude review: " Claude Code Review Bot
2026-04-12  3:07 ` Claude review: drm/i915/color: Enable SDR plane color pipeline Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-06 16:52 [PATCH 00/10] " Chaitanya Kumar Borah
2026-03-06 16:53 ` [PATCH 03/10] drm/i915/color: Program fixed-function CSC on SDR planes Chaitanya Kumar Borah
2026-03-08 22:26   ` 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-patch3-20260408051514.608781-4-chaitanya.kumar.borah@intel.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