radeonsi: honor PIPE_BIND_PROTECTED

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5096>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2020-10-06 16:21:53 +02:00
parent a653504549
commit 9698a222a6
2 changed files with 6 additions and 3 deletions

View file

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

View file

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