From 22a8b7f589c0ad5905c323103fda29729db14d8a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 5 Aug 2022 11:41:55 +0200 Subject: [PATCH] radeonsi: allocate BIND_RENDER_TARGET as tmz instead of SCANOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using AMD_DEBUG=tmz to enable tmz without the application asking for it is useful for testing. Since SCANOUT isn't set on Wayland, use RENDER_TARGET instead as a heuristic to try to allocate color framebuffer as tmz. With this change we can enable tmz in x11 and wayland. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index d07cb330cea..fb93eff6f82 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -109,7 +109,7 @@ void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res, 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->b.b.bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL))) res->flags |= RADEON_FLAG_ENCRYPTED; if (res->b.b.flags & PIPE_RESOURCE_FLAG_ENCRYPTED)