From 958ea2ec2a328e5797eed9898995a04dd82e5f0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Thu, 6 Apr 2023 00:13:34 +0200 Subject: [PATCH] radv: Split submission in winsys instead of radv_queue. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will still make it so that RADV_DEBUG=hang will only submit one command buffer at a time, but otherwise let's pass all CS objects into one submission and let the winsys split them if necessary. The winsys can do a better job at splitting them because radv_queue has no knowledge of IBs and ignores chaining in the splitting logic. Signed-off-by: Timur Kristóf Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_queue.c | 9 +-------- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/amd/vulkan/radv_queue.c b/src/amd/vulkan/radv_queue.c index 4523add..7b62e4d 100644 --- a/src/amd/vulkan/radv_queue.c +++ b/src/amd/vulkan/radv_queue.c @@ -31,13 +31,6 @@ #include "vk_sync.h" #include "vk_semaphore.h" -/* The number of IBs per submit isn't infinite, it depends on the IP type - * (ie. some initial setup needed for a submit) and the number of IBs (4 DW). - * This limit is arbitrary but should be safe for now. Ideally, we should get - * this limit from the KMD. - */ -#define RADV_MAX_IBS_PER_SUBMIT 192 - enum radeon_ctx_priority radv_get_queue_global_priority(const VkDeviceQueueGlobalPriorityCreateInfoKHR *pObj) { @@ -1588,8 +1581,8 @@ radv_queue_submit_normal(struct radv_queue *queue, struct vk_queue_submit *submi const unsigned num_perfctr_cs = use_perf_counters ? 2 : 0; const unsigned num_gang_wait_cs = use_ace ? 4 : 0; - const unsigned max_cs_submission = queue->device->trace_bo ? 1 : RADV_MAX_IBS_PER_SUBMIT; const unsigned cmd_buffer_count = submission->command_buffer_count; + const unsigned max_cs_submission = queue->device->trace_bo ? 1 : cmd_buffer_count; const unsigned cs_array_size = (use_ace ? 2 : 1) * MIN2(max_cs_submission, cmd_buffer_count) + num_perfctr_cs + num_gang_wait_cs; diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c index 3fed599..d74f0da 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c @@ -45,8 +45,8 @@ #define GFX6_MAX_CS_SIZE 0xffff8 /* in dwords */ -/* TODO: change this to a suitable number. */ -#define RADV_MAX_IBS_PER_SUBMIT 256 +/* Maximum allowed total number of submitted IBs. */ +#define RADV_MAX_IBS_PER_SUBMIT 192 enum { VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024 }; -- 2.7.4