]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amd/display: Surface Validation Fixes + Audio Mask
authorLeon Elazar <leon.elazar@amd.com>
Thu, 23 Feb 2017 21:10:43 +0000 (16:10 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:16:14 +0000 (17:16 -0400)
1. dc: Adding missing mask for audio register DCCG_AUDIO_DTO_SOURCE
2. Changing the surface validation to check the limits of the clip rect instead of the source rect.

Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_audio.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c

index b98ee2d2a9c74f4265ae6268ee9f6c99af9a019f..0dc5ff137c7a83001d2e8e304e8f851b99ee0b28 100644 (file)
@@ -48,6 +48,7 @@
 #define AUD_COMMON_MASK_SH_LIST_BASE(mask_sh)\
                SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO0_SOURCE_SEL, mask_sh),\
                SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO_SEL, mask_sh),\
+               SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO2_USE_512FBR_DTO, mask_sh),\
                SF(DCCG_AUDIO_DTO0_MODULE, DCCG_AUDIO_DTO0_MODULE, mask_sh),\
                SF(DCCG_AUDIO_DTO0_PHASE, DCCG_AUDIO_DTO0_PHASE, mask_sh),\
                SF(DCCG_AUDIO_DTO1_MODULE, DCCG_AUDIO_DTO1_MODULE, mask_sh),\
index cd3942df70a7b9affdfb3d34e84a5796505b3f4b..80b2359a3cb46e4abab9658384002bcd58c2bbd5 100644 (file)
@@ -1009,10 +1009,10 @@ static bool dce110_validate_surface_sets(
                if (set[i].surface_count > 2)
                        return false;
 
-               if (set[i].surfaces[0]->src_rect.width
-                               < set[i].stream->src.width
-                               || set[i].surfaces[0]->src_rect.height
-                               < set[i].stream->src.height)
+               if (set[i].surfaces[0]->clip_rect.width
+                               > set[i].stream->src.width
+                               || set[i].surfaces[0]->clip_rect.height
+                               > set[i].stream->src.height)
                        return false;
                if (set[i].surfaces[0]->format
                                >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
index 526c106f6ebf5397a060fd8fbcaf2286721964f7..ce6c69fd1041ababbff7cdcee222449bb629d8e7 100644 (file)
@@ -975,9 +975,9 @@ static bool dce112_validate_surface_sets(
                        return false;
 
                if (set[i].surfaces[0]->clip_rect.width
-                               < set[i].stream->src.width
+                               > set[i].stream->src.width
                                || set[i].surfaces[0]->clip_rect.height
-                               < set[i].stream->src.height)
+                               > set[i].stream->src.height)
                        return false;
                if (set[i].surfaces[0]->format
                                >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)
index 272c7fc3140688496541ca043065e9f36b39f953..fbbdd0ee2d4cbb74cee016a4939abbbfb505a4a4 100644 (file)
@@ -805,9 +805,9 @@ static bool dce80_validate_surface_sets(
                        return false;
 
                if (set[i].surfaces[0]->clip_rect.width
-                               != set[i].stream->src.width
+                               > set[i].stream->src.width
                                || set[i].surfaces[0]->clip_rect.height
-                               != set[i].stream->src.height)
+                               > set[i].stream->src.height)
                        return false;
                if (set[i].surfaces[0]->format
                                >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN)