From 133895574c97af369a26b6ab820c65347f7042a7 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 23 Jul 2020 17:11:12 +0200 Subject: [PATCH] radeonsi: disable primitive discard if tmz is in use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_gfx_cs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index d52a1e3e605..0243542eabe 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -387,7 +387,17 @@ void si_set_tracked_regs_to_clear_state(struct si_context *ctx) void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs) { - bool is_secure = ctx->ws->cs_is_secure(ctx->gfx_cs); + bool is_secure = false; + + if (unlikely(ctx->ws->ws_uses_secure_bo(ctx->ws))) { + /* Disable features that don't work with TMZ: + * - primitive discard + */ + ctx->prim_discard_vertex_count_threshold = UINT_MAX; + + is_secure = ctx->ws->cs_is_secure(ctx->gfx_cs); + } + if (ctx->is_debug) si_begin_gfx_cs_debug(ctx);