Mesa (master): va: support VA_RT_FORMAT_PROTECTED

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 4 09:57:52 UTC 2020


Module: Mesa
Branch: master
Commit: 7d3df69914d015ffd397ec1349b06aaa0cf03973
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d3df69914d015ffd397ec1349b06aaa0cf03973

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Tue Oct 27 21:33:44 2020 +0100

va: support VA_RT_FORMAT_PROTECTED

Reviewed-by: Boyuan Zhang <boyuan.zhang at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7006>

---

 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));
 



More information about the mesa-commit mailing list