]> git.itanic.dy.fi Git - linux-stable/commit
drm/amd/display: Limit user regamma to a valid value
authorYao Wang1 <Yao.Wang1@amd.com>
Mon, 22 Aug 2022 10:30:31 +0000 (18:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:02:58 +0000 (11:02 +0200)
commit0b553f85c46054d75535a2f87a7a6582db732398
tree5e72b75437adbedbe1c31915e5c7caafe6f05f2e
parentc3f8c7e9865d1ef1ae71cd7bb5f9b57dc7970f71
drm/amd/display: Limit user regamma to a valid value

[ Upstream commit 3601d620f22e37740cf73f8278eabf9f2aa19eb7 ]

[Why]
For HDR mode, we get total 512 tf_point and after switching to SDR mode
we actually get 400 tf_point and the rest of points(401~512) still use
dirty value from HDR mode. We should limit the rest of the points to max
value.

[How]
Limit the value when coordinates_x.x > 1, just like what we do in
translate_from_linear_space for other re-gamma build paths.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Pavle Kotarac <Pavle.Kotarac@amd.com>
Signed-off-by: Yao Wang1 <Yao.Wang1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/modules/color/color_gamma.c