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/i915/color: Program fixed-function CSC on SDR planes Date: Mon, 09 Mar 2026 08:26:52 +1000 Message-ID: In-Reply-To: <20260306165307.3233194-4-chaitanya.kumar.borah@intel.com> References: <20260306165307.3233194-1-chaitanya.kumar.borah@intel.com> <20260306165307.3233194-4-chaitanya.kumar.borah@intel.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 **BUG (Critical) =E2=80=94 CSC mode register corruption for YUV formats on = SDR planes.** In `glk_plane_color_ctl()`, the existing code for SDR planes with YUV forma= ts already sets `PLANE_COLOR_CSC_MODE_MASK` (bits 19:17): ```c if (fb->format->is_yuv && !icl_is_hdr_plane(display, plane->id)) { switch (plane_state->hw.color_encoding) { case DRM_COLOR_YCBCR_BT709: plane_color_ctl |=3D PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709; // set= s bits 19:17 break; ... } } ``` Then the new code unconditionally OR's in another CSC mode for non-HDR plan= es: ```c if (!icl_is_hdr_plane(display, plane->id)) plane_color_ctl |=3D intel_csc_ff_type_to_csc_mode(plane_state->hw.csc_= ff_type, plane_state->hw.csc_f= f_enable); ``` Since both use the same `PLANE_COLOR_CSC_MODE_MASK` bitfield (bits 19:17, d= efined via `REG_GENMASK(19, 17)`), OR-ing two non-zero CSC mode values will= produce a corrupted value. For example, if the YUV path sets mode 2 (`0b01= 0`) and CSC_FF sets mode 1 (`0b001`), the result is mode 3 (`0b011`), which= is the wrong conversion. This needs to either: 1. Make the two paths mutually exclusive (the CSC_FF colorop should take pr= ecedence when enabled, replacing the legacy `color_encoding` path), or 2. Use a mask-and-set pattern to clear the field before writing. --- Generated by Claude Code Patch Reviewer