From 7d3df69914d015ffd397ec1349b06aaa0cf03973 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 27 Oct 2020 21:33:44 +0100 Subject: [PATCH] va: support VA_RT_FORMAT_PROTECTED Reviewed-by: Boyuan Zhang Part-of: --- src/gallium/frontends/va/surface.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index 7a4fe3a3495..2d9c05cefed 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -680,6 +680,7 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format, int expected_fourcc; VAStatus vaStatus; vlVaSurface *surf; + bool protected; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; @@ -734,6 +735,9 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format, } } + 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 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format, templat.width = width; templat.height = height; + if (protected) + templat.bind |= PIPE_BIND_PROTECTED; memset(surfaces, VA_INVALID_ID, num_surfaces * sizeof(VASurfaceID));