]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amd/display: Use requested HDMI aspect ratio
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>
Thu, 19 Jul 2018 12:22:16 +0000 (08:22 -0400)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:47:13 +0000 (19:47 -0600)
BugLink: https://bugs.launchpad.net/bugs/1835972
commit e11d41472a50742c16d53c968e143fb498fa482f upstream.

[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=107153
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Mikita Lipski <Mikita.Lipski@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 416ae05f4b8b2f4265ca913c8e30b6dba27780dd..cd32c81d1ad82874e778ccdf347a5fd29f2fbebf 100644 (file)
@@ -2116,13 +2116,8 @@ convert_color_depth_from_display_info(const struct drm_connector *connector)
 static enum dc_aspect_ratio
 get_aspect_ratio(const struct drm_display_mode *mode_in)
 {
-       int32_t width = mode_in->crtc_hdisplay * 9;
-       int32_t height = mode_in->crtc_vdisplay * 16;
-
-       if ((width - height) < 10 && (width - height) > -10)
-               return ASPECT_RATIO_16_9;
-       else
-               return ASPECT_RATIO_4_3;
+       /* 1-1 mapping, since both enums follow the HDMI spec. */
+       return (enum dc_aspect_ratio) mode_in->picture_aspect_ratio;
 }
 
 static enum dc_color_space