aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorMikita Lipski <mikita.lipski@amd.com>2018-07-04 09:27:02 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-07-05 17:40:04 -0400
commitfe61a2f1a57fea5d7b3d27d019fa67e1bc5b7079 (patch)
tree33102852708da14aa169475ac09b04a8df138708 /drivers/gpu/drm/amd
parent87e3f1366eaa82c78b826b38008987406470b03d (diff)
drm/amd/display: adding ycbcr420 pixel encoding for hdmi
[why] HDMI EDID's VSDB contains spectial timings for specifically YCbCr 4:2:0 colour space. In those cases we need to verify if the mode provided is one of the special ones has to use YCbCr 4:2:0 pixel encoding for display info. [how] Verify if the mode is using specific ycbcr420 colour space with the help of DRM helper function and assign the mode to use ycbcr420 pixel encoding. Signed-off-by: Mikita Lipski <mikita.lipski@amd.com> Tested-by: Mike Lothian <mike@fireburn.co.uk> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 74683071fa81..1386c857546d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2184,6 +2184,7 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream,
2184 const struct drm_connector *connector) 2184 const struct drm_connector *connector)
2185{ 2185{
2186 struct dc_crtc_timing *timing_out = &stream->timing; 2186 struct dc_crtc_timing *timing_out = &stream->timing;
2187 const struct drm_display_info *info = &connector->display_info;
2187 2188
2188 memset(timing_out, 0, sizeof(struct dc_crtc_timing)); 2189 memset(timing_out, 0, sizeof(struct dc_crtc_timing));
2189 2190
@@ -2192,8 +2193,10 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream,
2192 timing_out->v_border_top = 0; 2193 timing_out->v_border_top = 0;
2193 timing_out->v_border_bottom = 0; 2194 timing_out->v_border_bottom = 0;
2194 /* TODO: un-hardcode */ 2195 /* TODO: un-hardcode */
2195 2196 if (drm_mode_is_420_only(info, mode_in)
2196 if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444) 2197 && stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A)
2198 timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
2199 else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444)
2197 && stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) 2200 && stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A)
2198 timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444; 2201 timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
2199 else 2202 else