Claude review: drm/i915/color: Add YUV range correction to SDR plane pipeline

Claude Code Review Bot
2026-04-12T03:07:25Z

Patch Review

**Overall**: Simple one-liner adding `INTEL_PLANE_CB_YUV_RANGE_CORRECT` at the front of the SDR pipeline:
```c
static const enum intel_color_block sdr_plane_pipeline[] = {
INTEL_PLANE_CB_YUV_RANGE_CORRECT,
INTEL_PLANE_CB_PRE_CSC_LUT,
INTEL_PLANE_CB_CSC_FF,
INTEL_PLANE_CB_POST_CSC_LUT,
};
```

The ordering (range correction → pre-CSC LUT → CSC → post-CSC LUT) matches the hardware pipeline and is logically correct: limited-to-full range expansion must happen before the CSC that expects full-range input.

No issues.

---

**Summary of required fixes:**

1. **Must fix**: `glk_plane_color_ctl()` needs mutual exclusion between legacy and colorop-based CSC/range-correction paths. The colorop path should only apply when a color pipeline is active on the plane, and the legacy path should be skipped in that case. Without this, the series introduces a regression for existing YUV content on SDR planes and a corruption bug when both paths activate simultaneously.

2. **Should fix**: Replace `plane - 3` magic number with a derived value or named constant, and add a defensive WARN_ON.

3. **Should fix**: Kernel-doc `@DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB` → `@DRM_COLOROP_FM_YCBCR2020_FULL_RGB_NC`.

4. **Consider**: Move patch 5 (bug fix) to the beginning of the series and submit it independently for stable backport, separate from the feature patches.