Commit 52ad33c4 authored by Joshua Ashton's avatar Joshua Ashton Committed by sanglipeng
Browse files

drm/amd/display: Calculate output_color_space after pixel encoding adjustment

stable inclusion
from stable-v5.10.165
commit 75105d943d7a9de70856eb729c39ee73b3e541ec
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=75105d943d7a9de70856eb729c39ee73b3e541ec



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

commit 79601b89 upstream.

Code in get_output_color_space depends on knowing the pixel encoding to
determine whether to pick between eg. COLOR_SPACE_SRGB or
COLOR_SPACE_YCBCR709 for transparent RGB -> YCbCr 4:4:4 in the driver.

v2: Fixed patch being accidentally based on a personal feature branch, oops!

Fixes: ea117312 ("drm/amd/display: Reduce HDMI pixel encoding if max clock is exceeded")
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 98dea099
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4567,8 +4567,6 @@ static void fill_stream_properties_from_drm_display_mode(
	timing_out->pix_clk_100hz = mode_in->crtc_clock * 10;
	timing_out->aspect_ratio = get_aspect_ratio(mode_in);

	stream->output_color_space = get_output_color_space(timing_out);

	stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
	stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
	if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
@@ -4579,6 +4577,8 @@ static void fill_stream_properties_from_drm_display_mode(
			adjust_colour_depth_from_display_info(timing_out, info);
		}
	}

	stream->output_color_space = get_output_color_space(timing_out);
}

static void fill_audio_info(struct audio_info *audio_info,