Claude review: drm/i915/color: Program fixed-function CSC on SDR planes

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

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.