From 4e455c198f1d6a801292ffeb2f81885ce4ee15ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 13 Jun 2024 02:28:11 -0400 Subject: [PATCH] Revert "radeonsi: fix initialization of occlusion query buffers for disabled RBs" This reverts commit dab4295cd520caf069bfbd299fb51e29ee6fd7ce. The commit causes hangs on Navi21 with 3 SEs. Fixes: dab4295cd520 - radeonsi: fix initialization of occlusion query buffers for disabled RBs Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_query.c | 30 ++++++++----------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_query.c b/src/gallium/drivers/radeonsi/si_query.c index 3392f1a1f58..bf4c1f24187 100644 --- a/src/gallium/drivers/radeonsi/si_query.c +++ b/src/gallium/drivers/radeonsi/si_query.c @@ -596,32 +596,20 @@ static bool si_query_hw_prepare_buffer(struct si_context *sctx, struct si_query_ query->b.type == PIPE_QUERY_OCCLUSION_PREDICATE || query->b.type == PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE) { unsigned max_rbs = screen->info.max_render_backends; - unsigned num_results = qbuf->buf->b.b.width0 / query->result_size; + uint64_t enabled_rb_mask = screen->info.enabled_rb_mask; + unsigned num_results; + unsigned i, j; - if (screen->info.gfx_level >= GFX9) { - unsigned num_rbs = screen->info.num_rb; - - for (unsigned j = 0; j < num_results; j++) { - /* Results of enabled RBs are packed, so the disabled ones are always at the end. */ - for (unsigned i = num_rbs; i < max_rbs; i++) { + /* Set top bits for unused backends. */ + num_results = qbuf->buf->b.b.width0 / query->result_size; + for (j = 0; j < num_results; j++) { + for (i = 0; i < max_rbs; i++) { + if (!(enabled_rb_mask & (1ull << i))) { results[(i * 4) + 1] = 0x80000000; results[(i * 4) + 3] = 0x80000000; } - results += 4 * max_rbs; - } - } else { - uint64_t enabled_rb_mask = screen->info.enabled_rb_mask; - - /* Set top bits for unused backends. */ - for (unsigned j = 0; j < num_results; j++) { - for (unsigned i = 0; i < max_rbs; i++) { - if (!(enabled_rb_mask & (1ull << i))) { - results[(i * 4) + 1] = 0x80000000; - results[(i * 4) + 3] = 0x80000000; - } - } - results += 4 * max_rbs; } + results += 4 * max_rbs; } }