Skip to content

Commit fe61a2f

Browse files
Mikita Lipskialexdeucher
authored andcommitted
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>
1 parent 87e3f13 commit fe61a2f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,7 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream,
21842184
const struct drm_connector *connector)
21852185
{
21862186
struct dc_crtc_timing *timing_out = &stream->timing;
2187+
const struct drm_display_info *info = &connector->display_info;
21872188

21882189
memset(timing_out, 0, sizeof(struct dc_crtc_timing));
21892190

@@ -2192,8 +2193,10 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream,
21922193
timing_out->v_border_top = 0;
21932194
timing_out->v_border_bottom = 0;
21942195
/* TODO: un-hardcode */
2195-
2196-
if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444)
2196+
if (drm_mode_is_420_only(info, mode_in)
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)
21972200
&& stream->sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A)
21982201
timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
21992202
else

0 commit comments

Comments
 (0)