Module: Mesa
Branch: main
Commit: 22a8b7f589c0ad5905c323103fda29729db14d8a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=22a8b7f589c0ad5905c323103fda29729db14d8a

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Fri Aug  5 11:41:55 2022 +0200

radeonsi: allocate BIND_RENDER_TARGET as tmz instead of SCANOUT

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11449>

---

 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)

Reply via email to