Mesa (master): radeonsi: honor PIPE_BIND_PROTECTED
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 2 09:38:49 UTC 2020
Module: Mesa
Branch: master
Commit: 9698a222a6c26e998d9efe6d940e11772aa8610c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9698a222a6c26e998d9efe6d940e11772aa8610c
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Tue Oct 6 16:21:53 2020 +0200
radeonsi: honor PIPE_BIND_PROTECTED
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5096>
---
src/gallium/drivers/radeonsi/si_buffer.c | 7 ++++---
src/gallium/drivers/radeonsi/si_texture.c | 2 ++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c
index 31f1318542d..f44f3fd2e32 100644
--- a/src/gallium/drivers/radeonsi/si_buffer.c
+++ b/src/gallium/drivers/radeonsi/si_buffer.c
@@ -166,9 +166,10 @@ void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res,
else
res->flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
- /* Force scanout/depth/stencil buffer allocation to be encrypted */
- if (sscreen->debug_flags & DBG(TMZ) &&
- res->b.b.bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DEPTH_STENCIL))
+ if (res->b.b.bind & PIPE_BIND_PROTECTED ||
+ /* Force scanout/depth/stencil buffer allocation to be encrypted */
+ (sscreen->debug_flags & DBG(TMZ) &&
+ res->b.b.bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DEPTH_STENCIL)))
res->flags |= RADEON_FLAG_ENCRYPTED;
if (res->b.b.flags & PIPE_RESOURCE_FLAG_ENCRYPTED)
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index 25b6c380e3d..6aaf9ebfd04 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -1437,6 +1437,8 @@ static struct pipe_resource *si_texture_from_winsys_buffer(struct si_screen *ssc
tex->buffer.b.is_shared = true;
tex->buffer.external_usage = usage;
tex->num_planes = 1;
+ if (tex->buffer.flags & RADEON_FLAG_ENCRYPTED)
+ tex->buffer.b.b.bind |= PIPE_BIND_PROTECTED;
/* Account for multiple planes with lowered yuv import. */
struct pipe_resource *next_plane = tex->buffer.b.b.next;
More information about the mesa-commit
mailing list