Commit 0738906a authored by Joshua Ashton's avatar Joshua Ashton Committed by sanglipeng
Browse files

drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix

stable inclusion
from stable-v5.10.165
commit bf1d287c14139d399fbbfcb7dbdd7a7e1286bfea
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bf1d287c14139d399fbbfcb7dbdd7a7e1286bfea



--------------------------------

commit 973a9c81 upstream.

The YCC conversion matrix for RGB -> COLOR_SPACE_YCBCR2020_TYPE is
missing the values for the fourth column of the matrix.

The fourth column of the matrix is essentially just a value that is
added given that the color is 3 components in size.
These values are needed to bias the chroma from the [-1, 1] -> [0, 1]
range.

This fixes color being very green when using Gamescope HDR on HDMI
output which prefers YCC 4:4:4.

Fixes: 40df2f80 ("drm/amd/display: color space ycbcr709 support")
Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
Signed-off-by: default avatarJoshua Ashton <joshua@froggi.es>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 52ad33c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ static const struct out_csc_color_matrix_type output_csc_matrix[] = {
		{ 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3,
				0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} },
	{ COLOR_SPACE_YCBCR2020_TYPE,
		{ 0x1000, 0xF149, 0xFEB7, 0x0000, 0x0868, 0x15B2,
				0x01E6, 0x0000, 0xFB88, 0xF478, 0x1000, 0x0000} },
		{ 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2,
				0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} },
	{ COLOR_SPACE_YCBCR709_BLACK_TYPE,
		{ 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000,
				0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x1000} },