drm/amd/display: Add regamma/degamma coefficients and set sRGB when TF is BT709
authorJaehyun Chung <jaehyun.chung@amd.com>
Tue, 24 Aug 2021 18:05:48 +0000 (14:05 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Sep 2021 19:57:10 +0000 (15:57 -0400)
commitd020970959169627d59a711769f8c4b87bf5f90c
treeb3bc95426941b0a015acb2667084e5ee60a198e8
parent1131cadfd7563975f3a4efcc6f7c1fdc872db38b
drm/amd/display: Add regamma/degamma coefficients and set sRGB when TF is BT709

[Why]
In YUV case, need to set the input TF to sRGB instead of BT709,
even though the input TF type is distributed. SRGB was not
being used because pixel format was not being set in the
surface update sequence.
Also, we were using the same coefficients for degamma and
regamma formula, causing the cutoff point of the linear
section of the curve to be incorrect.

[How]
Set pixel format in the surface update sequence. Add separate
coefficient arrays for regamma and degamma.

Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Mikita Lipski <mikita.lipski@amd.com>
Signed-off-by: Jaehyun Chung <jaehyun.chung@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