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: Revert "drm/amd/display: Remove unused cm3_helper_translate_curve_to_degamma_hw_format"
Date: Thu, 07 May 2026 13:11:57 +1000	[thread overview]
Message-ID: <review-patch2-20260506191606.15022-3-mwen@igalia.com> (raw)
In-Reply-To: <20260506191606.15022-3-mwen@igalia.com>

Patch Review

**Purpose**: Re-introduces `cm3_helper_translate_curve_to_degamma_hw_format()` which was previously removed as unused. It will be wired up in patch 3.

**Code review of the reverted function**: This is a straightforward revert of removal. The function uses 12 regions from 2^-12 to 2^0, with 16 samples per region (seg_distr[k]=4), totaling 192 hw_points. Key differences from the regamma helper:

- **Corner point slopes**: Non-zero for PQ (extrapolates to 1.0 at 10000 nits / 125 normalized), zero for everything else. The regamma helper uses zero slopes unconditionally.
- **Region range**: [2^-12, 1] for encoded input domain vs the regamma helper's much wider range for linear-light input.

**Bounds check**: `rgb_resulted` has 259 entries (`256+3`), 192 hw_points fits. The `arr_curve_points` loop at lines 449-458 iterates `k` from 0 to `MAX_REGIONS_NUMBER-1` (33), which fits the 34-entry array. The `(i >> 4) + 1 < TRANSFER_FUNC_POINTS` check at the original seg_distr=4: max index = start_index + 16 = at most 400+16 = 416 < 1025.

**Stale pointer after memset**: Lines 339-340 save `corner_points` and `rgb_resulted` as pointers into `lut_params`, then line 343 zeroes the struct. The pointers remain valid (they address fields within the struct, not separate allocations), so this is correct.

The function declaration in `dcn30_cm_common.h` is properly added. No issues.

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