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/amd/display: use GAMCOR for degamma private props in subsampled format
Date: Thu, 07 May 2026 13:11:56 +1000	[thread overview]
Message-ID: <review-patch1-20260506191606.15022-2-mwen@igalia.com> (raw)
In-Reply-To: <20260506191606.15022-2-mwen@igalia.com>

Patch Review

**Purpose**: When using subsampled video formats (4:2:0/4:2:2), the PRE_DEGAM hardware block (ROM curves) cannot be used because it would affect scaler 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 functionally correct. When `true`, it prevents early returns at `color_gamma.c:1693-1696` that would keep `TF_TYPE_PREDEFINED`, forcing the function to fall through to `TF_TYPE_DISTRIBUTED_POINTS` computation. The `ramp=NULL` path is safe — all ramp accesses are guarded:

```c
// color_gamma.c:1718 — guards ramp dereference
if (map_user_ramp && ramp && ramp->type == GAMMA_RGB_256) {
```

```c
// color_gamma.c:1803 — same pattern
map_user_ramp && ramp && ramp->type == GAMMA_RGB_256,
```

**Whitespace issue**: Line 1457 of `amdgpu_dm_color.c` uses a tab + 7 spaces for the comment indentation, while surrounding code uses double-tabs. This is visible in the applied source:

```c
       } else {
	       /* Check if format requires ... */  ← tab + 7 spaces
		is_subsampled_format = ...             ← 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 would be cleaner and make the scope explicit.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-07  3:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 19:11 [PATCH v2 0/5] better LUT segmentation for EOTFs Melissa Wen
2026-05-06 19:11 ` [PATCH v2 1/5] drm/amd/display: use GAMCOR for degamma private props in subsampled format Melissa Wen
2026-05-07  3:11   ` Claude Code Review Bot [this message]
2026-05-06 19:11 ` [PATCH v2 2/5] Revert "drm/amd/display: Remove unused cm3_helper_translate_curve_to_degamma_hw_format" Melissa Wen
2026-05-07  3:11   ` Claude review: " Claude Code Review Bot
2026-05-06 19:11 ` [PATCH v2 3/5] drm/amd/display: use a separate helper to translate degamma curves Melissa Wen
2026-05-07  3:11   ` Claude review: " Claude Code Review Bot
2026-05-06 19:11 ` [PATCH v2 4/5] drm/amd/display: support up to 256 samples per region in degamma/blend LUT Melissa Wen
2026-05-07  3:11   ` Claude review: " Claude Code Review Bot
2026-05-06 19:11 ` [PATCH v2 5/5] drm/amd/display: use halving distribution for PQ/sRGB linearizing LUT Melissa Wen
2026-05-07  3:11   ` Claude review: " Claude Code Review Bot
2026-05-07  3:11 ` Claude review: better LUT segmentation for EOTFs 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-patch1-20260506191606.15022-2-mwen@igalia.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