radeonsi: add support for PIPE_RESOURCE_FLAG_ENCRYPTED
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 6 Dec 2019 09:33:56 +0000 (10:33 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 11 May 2020 08:25:53 +0000 (10:25 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4401>

src/gallium/drivers/radeonsi/si_buffer.c

index f59fd1ac4068d0cc11bbf9218e091e49ac01e769..72d5b37dccab71deb9fe88c84cc8d54c05fff3c1 100644 (file)
@@ -166,9 +166,12 @@ void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res,
    else
       res->flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
 
-   if (sscreen->ws->ws_is_secure(sscreen->ws) &&
-       (res->b.b.bind & PIPE_BIND_SCANOUT))
-      res->flags |= RADEON_FLAG_ENCRYPTED;
+   if (sscreen->ws->ws_is_secure(sscreen->ws)) {
+      if (res->b.b.bind & PIPE_BIND_SCANOUT)
+         res->flags |= RADEON_FLAG_ENCRYPTED;
+      if (res->b.b.flags & PIPE_RESOURCE_FLAG_ENCRYPTED)
+         res->flags |= RADEON_FLAG_ENCRYPTED;
+   }
 
    if (sscreen->debug_flags & DBG(NO_WC))
       res->flags &= ~RADEON_FLAG_GTT_WC;