drm/amd/display: validate plane format on primary plane
authorShirish S <shirish.s@amd.com>
Wed, 7 Mar 2018 07:06:11 +0000 (12:36 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 Mar 2018 21:11:36 +0000 (16:11 -0500)
In dce110, the plane configuration is such that plane 0
or the primary plane should be rendered with only RGB data.

This patch adds the validation to ensure that no video data
is rendered on plane 0.

Signed-off-by: Shirish S <shirish.s@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/dce110/dce110_resource.c

index 830cbbc4adeb71f466c80840ced0a6f28516fdb9..b1f14be20fdff2a83af0155289c203aa85c51243 100644 (file)
@@ -879,6 +879,13 @@ static bool dce110_validate_surface_sets(
                                        plane->src_rect.height > 1080))
                                        return false;
 
+                               /* we don't have the logic to support underlay
+                                * only yet so block the use case where we get
+                                * NV12 plane as top layer
+                                */
+                               if (j == 0)
+                                       return false;
+
                                /* irrespective of plane format,
                                 * stream should be RGB encoded
                                 */