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/amd/display: use GAMCOR for degamma private props in subsampled format Date: Thu, 07 May 2026 13:11:56 +1000 Message-ID: In-Reply-To: <20260506191606.15022-2-mwen@igalia.com> References: <20260506191606.15022-1-mwen@igalia.com> <20260506191606.15022-2-mwen@igalia.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 **Purpose**: When using subsampled video formats (4:2:0/4:2:2), the PRE_DEG= AM hardware block (ROM curves) cannot be used because it would affect scale= r linearity. This patch detects subsampled formats and passes that flag to = `mod_color_calculate_degamma_params` so it computes distributed points for = GAMCOR (RAM) instead. **Correctness of the `map_user_ramp` repurposing**: Passing `is_subsampled_= format` as the `map_user_ramp` parameter is semantically imprecise but func= tionally correct. When `true`, it prevents early returns at `color_gamma.c:= 1693-1696` that would keep `TF_TYPE_PREDEFINED`, forcing the function to fa= ll through to `TF_TYPE_DISTRIBUTED_POINTS` computation. The `ramp=3DNULL` p= ath is safe =E2=80=94 all ramp accesses are guarded: ```c // color_gamma.c:1718 =E2=80=94 guards ramp dereference if (map_user_ramp && ramp && ramp->type =3D=3D GAMMA_RGB_256) { ``` ```c // color_gamma.c:1803 =E2=80=94 same pattern map_user_ramp && ramp && ramp->type =3D=3D GAMMA_RGB_256, ``` **Whitespace issue**: Line 1457 of `amdgpu_dm_color.c` uses a tab + 7 space= s for the comment indentation, while surrounding code uses double-tabs. Thi= s is visible in the applied source: ```c } else { /* Check if format requires ... */ =E2=86=90 tab + 7 spaces is_subsampled_format =3D ... =E2=86=90 two tabs ``` The `} else {` at line 1456 also has space-based indentation, but that's a = pre-existing issue. **Error logging**: Adding `drm_err()` before returning `-ENOMEM` is a good = improvement over the silent return in the original code. **Nit**: The `is_subsampled_format` variable is declared at function scope = but only used in the `else` branch. Declaring it inside the `else` block wo= uld be cleaner and make the scope explicit. --- Generated by Claude Code Patch Reviewer