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 halving distribution for PQ/sRGB linearizing LUT
Date: Thu, 07 May 2026 13:11:57 +1000	[thread overview]
Message-ID: <review-patch5-20260506191606.15022-6-mwen@igalia.com> (raw)
In-Reply-To: <20260506191606.15022-6-mwen@igalia.com>

Patch Review

**Purpose**: Replaces the uniform 12-region/16-points-per-region distribution with a 9-region halving distribution for PQ and sRGB EOTFs, concentrating samples in the bright end where these curves are steepest.

**Segment distribution verification**:
```
seg_distr[0] = 0  →  2^0 = 1 point    (region [2^-9, 2^-8])
seg_distr[1] = 0  →  2^0 = 1 point    (region [2^-8, 2^-7])
seg_distr[2] = 1  →  2^1 = 2 points   (region [2^-7, 2^-6])
seg_distr[3] = 2  →  2^2 = 4 points   (region [2^-6, 2^-5])
seg_distr[4] = 3  →  2^3 = 8 points   (region [2^-5, 2^-4])
seg_distr[5] = 4  →  2^4 = 16 points  (region [2^-4, 2^-3])
seg_distr[6] = 5  →  2^5 = 32 points  (region [2^-3, 2^-2])
seg_distr[7] = 6  →  2^6 = 64 points  (region [2^-2, 2^-1])
seg_distr[8] = 7  →  2^7 = 128 points (region [2^-1, 2^0])
Total: 1+1+2+4+8+16+32+64+128 = 256 points ✓
```

This fits within `rgb_resulted[256+3]`. The maximum `seg_distr` value is 7, requiring `increment = 256/128 = 2`, which is within patch 4's capability (up to seg_distr=8).

**Bounds on tf_pts access**: For k=8 (brightest region), `start_index = (-9+8+25)*16 = 384`. Max `i` = `(384<<4) + 256 = 6400`. Max `i >> 4 = 400`, `(i>>4)+1 = 401 < 1025`. Safe.

**Corner point `end_value = 125` for PQ**: With `region_end = 0`, corner_points[1].x = 2^0 = 1.0. The PQ slope computation `(1.0 - Y(1.0)) / (125 - 1.0)` extrapolates from the last sample to the 10000-nit point. This is unchanged from the original function and remains correct.

**Non-PQ/non-sRGB fallback**: Transfer functions other than PQ and sRGB (e.g., GAMMA22, HLG) still use the 12-region uniform distribution. This is a reasonable choice — the halving distribution is specifically tuned for PQ/sRGB curvature.

**Comment style nit**: Lines 352-354 use `//` comments while surrounding comments use `/* */`. This is a minor inconsistency; the kernel accepts both styles but `/* */` is more traditional for multi-word comments in display code.

**Observation on the cover letter's candor**: The author notes no clear visual improvement from patches 4-5. While the mathematical reasoning is sound (more precision where curvature is steepest), the lack of visible improvement suggests the banding was already adequately addressed by patches 1-3's switch to the degamma helper with 192 points. These patches are still worthwhile as future-proofing for higher-precision displays.

---

**Summary**: Patches 1-3 are the substantive fix for gradient banding and look correct. Patches 4-5 are a clean precision enhancement. The only actionable item is the whitespace fix in patch 1 (tab+spaces vs double-tab for comment indentation). The series is in good shape overall.

---
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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-patch5-20260506191606.15022-6-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