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 <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11449>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2022-08-05 11:41:55 +02:00
committed by Marge Bot
parent a693fbf64b
commit 22a8b7f589
+1 -1
View File
@@ -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)