va: support VA_RT_FORMAT_PROTECTED
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7006>
diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c
index 7a4fe3a..2d9c05c 100644
--- a/src/gallium/frontends/va/surface.c
+++ b/src/gallium/frontends/va/surface.c
@@ -680,6 +680,7 @@
int expected_fourcc;
VAStatus vaStatus;
vlVaSurface *surf;
+ bool protected;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
@@ -734,6 +735,9 @@
}
}
+ protected = format & VA_RT_FORMAT_PROTECTED;
+ format &= ~VA_RT_FORMAT_PROTECTED;
+
if (VA_RT_FORMAT_YUV420 != format &&
VA_RT_FORMAT_YUV422 != format &&
VA_RT_FORMAT_YUV444 != format &&
@@ -781,6 +785,8 @@
templat.width = width;
templat.height = height;
+ if (protected)
+ templat.bind |= PIPE_BIND_PROTECTED;
memset(surfaces, VA_INVALID_ID, num_surfaces * sizeof(VASurfaceID));