drm/amd/display: check surface size is at least as large as stream
authorLeon Elazar <leon.elazar@amd.com>
Tue, 17 Jan 2017 21:16:04 +0000 (16:16 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:11:38 +0000 (17:11 -0400)
Signed-off-by: Leon Elazar <leon.elazar@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c

index 82cddb6..0b8f892 100644 (file)
@@ -967,9 +967,9 @@ static bool dce110_validate_surface_sets(
                        return false;
 
                if (set[i].surfaces[0]->src_rect.width
-                               != set[i].stream->src.width
+                               < set[i].stream->src.width
                                || set[i].surfaces[0]->src_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 fa8699d..7c12185 100644 (file)
@@ -966,9 +966,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)