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;