From c043f4bdaecc8ac8493fb16335a32d075f78cd3d Mon Sep 17 00:00:00 2001 From: "Leo (Sunpeng) Li" Date: Thu, 19 Jul 2018 08:22:16 -0400 Subject: [PATCH] drm/amd/display: Consider HDMI aspect ratio when comparing streams [Why] The DRM mode's HDMI picture aspect ratio field was never saved in dc_stream's timing struct. This causes us to mistake a new stream to have the same timings as the old, even though the user has requested a different aspect ratio. [How] Save DRM's aspect ratio field within dc_stream's timing struct. Signed-off-by: Leo (Sunpeng) Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 770c6b2..62d929e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2217,6 +2217,13 @@ static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_ } /*****************************************************************************/ +static enum dc_aspect_ratio dm_get_hdmi_aspect_ratio( + enum hdmi_picture_aspect hdmi_aspect_ratio) +{ + /* DRM enum is a 1-1 mapping to dc aspect ratio enum */ + return (enum dc_aspect_ratio)hdmi_aspect_ratio; +} + static void fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, const struct drm_display_mode *mode_in, @@ -2267,6 +2274,9 @@ fill_stream_properties_from_drm_display_mode(struct dc_stream_state *stream, if (mode_in->flags & DRM_MODE_FLAG_PVSYNC) timing_out->flags.VSYNC_POSITIVE_POLARITY = 1; + timing_out->aspect_ratio = + dm_get_hdmi_aspect_ratio(mode_in->picture_aspect_ratio); + stream->output_color_space = get_output_color_space(timing_out); stream->out_transfer_func->type = TF_TYPE_PREDEFINED; -- 2.7.4