From 199728af15fd0fddc18054b03234ee4372e90225 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 19 Aug 2015 11:45:45 -0400 Subject: [PATCH 1/2] drm/radeon: set the colorspace in the AVI infoframe If the user selects a YUV color space in the output_csc property. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_audio.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c index fbc8d88..4e0d2ef 100644 --- a/drivers/gpu/drm/radeon/radeon_audio.c +++ b/drivers/gpu/drm/radeon/radeon_audio.c @@ -530,6 +530,20 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder, } else { frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; } + if (connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444) { + if ((radeon_encoder->output_csc == RADEON_OUTPUT_CSC_YCBCR601) || + (radeon_encoder->output_csc == RADEON_OUTPUT_CSC_YCBCR709)) + frame.colorspace = HDMI_COLORSPACE_YUV444; + else + frame.colorspace = HDMI_COLORSPACE_RGB; + } + if (connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB422) { + if ((radeon_encoder->output_csc == RADEON_OUTPUT_CSC_YCBCR601) || + (radeon_encoder->output_csc == RADEON_OUTPUT_CSC_YCBCR709)) + frame.colorspace = HDMI_COLORSPACE_YUV422; + else + frame.colorspace = HDMI_COLORSPACE_RGB; + } err = hdmi_avi_infoframe_pack(&frame, buffer, sizeof(buffer)); if (err < 0) { -- 1.8.3.1