drm/amd/display: PQ regamma end point
authorKrunoslav Kovac <krunoslav.kovac@amd.com>
Tue, 8 Aug 2023 20:38:56 +0000 (16:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Aug 2023 18:58:38 +0000 (14:58 -0400)
commit959d2fc47f14f7f5ab3f74530e80c9407ced91f2
tree0d8c76b603ccb05de0edd4a78c2cfc0aa0102062
parent4d5fd3d08ea9926fb2031ff7cfb4d72b7c950301
drm/amd/display: PQ regamma end point

[WHY & HOW]
PQ has a fixed range of 0-10,000 nits.
Using 1=80 nits normalization, PQ should map to 1.0 for X=125.0
HW LUT used for interpolation does not have X=125 so it's interpolated.
However, we cap Y to 1 for all X>=125.

The closest larger HW point is 128.
What we want is Y(128) such that interpolation through 125 gives 1.0.
Such value is ~1.00256.
Another change is to hardcode PQ table, we pretty much always have 1=80
normalization so the table can be static.

Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Krunoslav Kovac <krunoslav.kovac@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/color/color_gamma.c