From 59b267dea4510d4b828711acb08979222be20955 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 23 Sep 2020 15:15:41 +0200 Subject: [PATCH] radeonsi/tmz: use secure job if using an encrypted z/s buffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_descriptors.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index 7e859ea..76c35ca 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -2720,9 +2720,15 @@ bool si_gfx_resources_check_encrypted(struct si_context *sctx) } } - /* TODO: we should assert that either use_encrypted_bo is false, - * or all writable buffers are encrypted. - */ + if (sctx->framebuffer.state.zsbuf) { + struct si_texture* zs = (struct si_texture *)sctx->framebuffer.state.zsbuf->texture; + if (zs && + (zs->buffer.flags & RADEON_FLAG_ENCRYPTED)) { + /* TODO: This isn't needed if depth.func is PIPE_FUNC_NEVER or PIPE_FUNC_ALWAYS */ + use_encrypted_bo = true; + } + } + return use_encrypted_bo; } -- 2.7.4