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 halving distribution for PQ/sRGB linearizing LUT Date: Thu, 07 May 2026 13:11:57 +1000 Message-ID: In-Reply-To: <20260506191606.15022-6-mwen@igalia.com> References: <20260506191606.15022-1-mwen@igalia.com> <20260506191606.15022-6-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**: Replaces the uniform 12-region/16-points-per-region distributi= on with a 9-region halving distribution for PQ and sRGB EOTFs, concentratin= g samples in the bright end where these curves are steepest. **Segment distribution verification**: ``` seg_distr[0] =3D 0 =E2=86=92 2^0 =3D 1 point (region [2^-9, 2^-8]) seg_distr[1] =3D 0 =E2=86=92 2^0 =3D 1 point (region [2^-8, 2^-7]) seg_distr[2] =3D 1 =E2=86=92 2^1 =3D 2 points (region [2^-7, 2^-6]) seg_distr[3] =3D 2 =E2=86=92 2^2 =3D 4 points (region [2^-6, 2^-5]) seg_distr[4] =3D 3 =E2=86=92 2^3 =3D 8 points (region [2^-5, 2^-4]) seg_distr[5] =3D 4 =E2=86=92 2^4 =3D 16 points (region [2^-4, 2^-3]) seg_distr[6] =3D 5 =E2=86=92 2^5 =3D 32 points (region [2^-3, 2^-2]) seg_distr[7] =3D 6 =E2=86=92 2^6 =3D 64 points (region [2^-2, 2^-1]) seg_distr[8] =3D 7 =E2=86=92 2^7 =3D 128 points (region [2^-1, 2^0]) Total: 1+1+2+4+8+16+32+64+128 =3D 256 points =E2=9C=93 ``` This fits within `rgb_resulted[256+3]`. The maximum `seg_distr` value is 7,= requiring `increment =3D 256/128 =3D 2`, which is within patch 4's capabil= ity (up to seg_distr=3D8). **Bounds on tf_pts access**: For k=3D8 (brightest region), `start_index =3D= (-9+8+25)*16 =3D 384`. Max `i` =3D `(384<<4) + 256 =3D 6400`. Max `i >> 4 = =3D 400`, `(i>>4)+1 =3D 401 < 1025`. Safe. **Corner point `end_value =3D 125` for PQ**: With `region_end =3D 0`, corne= r_points[1].x =3D 2^0 =3D 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 r= easonable choice =E2=80=94 the halving distribution is specifically tuned f= or PQ/sRGB curvature. **Comment style nit**: Lines 352-354 use `//` comments while surrounding co= mments use `/* */`. This is a minor inconsistency; the kernel accepts both = styles but `/* */` is more traditional for multi-word comments in display c= ode. **Observation on the cover letter's candor**: The author notes no clear vis= ual improvement from patches 4-5. While the mathematical reasoning is sound= (more precision where curvature is steepest), the lack of visible improvem= ent suggests the banding was already adequately addressed by patches 1-3's = switch to the degamma helper with 192 points. These patches are still worth= while as future-proofing for higher-precision displays. --- **Summary**: Patches 1-3 are the substantive fix for gradient banding and l= ook correct. Patches 4-5 are a clean precision enhancement. The only action= able item is the whitespace fix in patch 1 (tab+spaces vs double-tab for co= mment indentation). The series is in good shape overall. --- Generated by Claude Code Patch Reviewer