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: support up to 256 samples per region in degamma/blend LUT
Date: Thu, 07 May 2026 13:11:57 +1000	[thread overview]
Message-ID: <review-patch4-20260506191606.15022-5-mwen@igalia.com> (raw)
In-Reply-To: <20260506191606.15022-5-mwen@igalia.com>

Patch Review

**Purpose**: Extends the degamma helper to support more than 16 samples per region by introducing 4-bit sub-sample interpolation between adjacent `tf_pts` entries.

**The `interp_tf_pts` helper** (lines 309-321): Clean linear interpolation. When `t = i & 0xf` is 0 (which is always the case for `seg_distr[k] <= 4`), `value = in + 0 = in`, reducing to a direct lookup. The formula `in + (in_plus_one - in) * t / 16` is mathematically correct.

**Bounds safety for higher seg_distr values**: For `seg_distr[k] = 8` (max supported):
- `increment = (16 << 4) / (1 << 8) = 256 / 256 = 1`
- Per-region: 256 iterations, accessing tf_pts indices from `start_index` to `start_index + 16`, with fractional sub-positions 0/16 through 15/16.
- The `(i >> 4) + 1 >= TRANSFER_FUNC_POINTS` guard correctly checks the +1 for interpolation access.

**Potential concern with `i` type**: `i` is declared as `int32_t`. After the shift, `start_index << 4` has a maximum value of `400 * 16 = 6400`, well within `int32_t` range. No overflow risk.

**Style nit**: The blank line between the `#define NUM_DEGAMMA_REGIONS` removal and the `interp_tf_pts` comment creates slightly inconsistent spacing, but this is trivial.

**No functional issues found.**

---
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 Code Review Bot [this message]
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-patch4-20260506191606.15022-5-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