From a1e039dd35b6519dba804ddc7456302c7941dff1 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Mon, 20 Jan 2025 16:05:51 +0800 Subject: [PATCH] r600: init compute caps without ir_type param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only clover caps use different value. Acked-by: Alyssa Rosenzweig Acked-by: Marek Olšák Part-of: --- src/gallium/drivers/r600/r600_pipe_common.c | 32 ++++++++++++--------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index 2c8c89a3734..9d3cee9f27c 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -849,17 +849,6 @@ const char *r600_get_llvm_processor_name(enum radeon_family family) } } -static unsigned get_max_threads_per_block(struct r600_common_screen *screen, - enum pipe_shader_ir ir_type) -{ - if (ir_type != PIPE_SHADER_IR_TGSI && - ir_type != PIPE_SHADER_IR_NIR) - return 256; - if (screen->gfx_level >= EVERGREEN) - return 1024; - return 256; -} - static int r600_get_compute_param(struct pipe_screen *screen, enum pipe_shader_ir ir_type, enum pipe_compute_cap param, @@ -896,23 +885,38 @@ static int r600_get_compute_param(struct pipe_screen *screen, return 3 * sizeof(uint64_t) ; case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE: - case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER: if (ret) { uint64_t *block_size = ret; - unsigned threads_per_block = get_max_threads_per_block(rscreen, ir_type); + unsigned threads_per_block = rscreen->gfx_level >= EVERGREEN ? 1024 : 256; block_size[0] = threads_per_block; block_size[1] = threads_per_block; block_size[2] = threads_per_block; } return 3 * sizeof(uint64_t); + case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER: + if (ret) { + uint64_t *block_size = ret; + block_size[0] = 256; + block_size[1] = 256; + block_size[2] = 256; + } + return 3 * sizeof(uint64_t); + case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK: + if (ret) { + uint64_t *max_threads_per_block = ret; + *max_threads_per_block = rscreen->gfx_level >= EVERGREEN ? 1024 : 256; + } + return sizeof(uint64_t); + case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK_CLOVER: if (ret) { uint64_t *max_threads_per_block = ret; - *max_threads_per_block = get_max_threads_per_block(rscreen, ir_type); + *max_threads_per_block = 256; } return sizeof(uint64_t); + case PIPE_COMPUTE_CAP_ADDRESS_BITS: if (ret) { uint32_t *address_bits = ret;