Commit e11d4147 authored by Leo (Sunpeng) Li's avatar Leo (Sunpeng) Li Committed by Alex Deucher

drm/amd/display: Use requested HDMI aspect ratio

[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.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107153Signed-off-by: default avatarLeo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: default avatarMikita Lipski <Mikita.Lipski@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 16196776
...@@ -2109,13 +2109,8 @@ convert_color_depth_from_display_info(const struct drm_connector *connector) ...@@ -2109,13 +2109,8 @@ convert_color_depth_from_display_info(const struct drm_connector *connector)
static enum dc_aspect_ratio static enum dc_aspect_ratio
get_aspect_ratio(const struct drm_display_mode *mode_in) get_aspect_ratio(const struct drm_display_mode *mode_in)
{ {
int32_t width = mode_in->crtc_hdisplay * 9; /* 1-1 mapping, since both enums follow the HDMI spec. */
int32_t height = mode_in->crtc_vdisplay * 16; return (enum dc_aspect_ratio) mode_in->picture_aspect_ratio;
if ((width - height) < 10 && (width - height) > -10)
return ASPECT_RATIO_16_9;
else
return ASPECT_RATIO_4_3;
} }
static enum dc_color_space static enum dc_color_space
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment