From 137907945f332caa7a2876ce954e2aec52b9b4d5 Mon Sep 17 00:00:00 2001 From: Yogesh Mohan Marimuthu Date: Mon, 5 May 2025 09:53:01 +0530 Subject: [PATCH] ac: add AMD_USERQ env var to enable user queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit user queue is enabled only if AMD_USERQ env var is set and Kernel supports user queue. Reviewed-by: Marek Olšák Part-of: --- src/amd/common/ac_gpu_info.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index d3c102fdcac..a1982054ef9 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -572,7 +572,7 @@ ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, return AC_QUERY_GPU_INFO_FAIL; } - info->userq_ip_mask = device_info.userq_ip_mask; + info->userq_ip_mask = debug_get_bool_option("AMD_USERQ", false) ? device_info.userq_ip_mask : 0; for (unsigned ip_type = 0; ip_type < AMD_NUM_IP_TYPES; ip_type++) { struct drm_amdgpu_info_hw_ip ip_info = {0}; @@ -581,15 +581,13 @@ ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, if (r) continue; - if (ip_info.available_rings) { - info->ip[ip_type].num_queues = util_bitcount(ip_info.available_rings); - /* Kernel can set both available_rings and userq_ip_mask. Clear userq_ip_mask. */ - info->userq_ip_mask &= ~BITFIELD_BIT(ip_type); - } else if (info->userq_ip_mask & BITFIELD_BIT(ip_type)) { + if (info->userq_ip_mask & BITFIELD_BIT(ip_type)) { /* info[ip_type].num_queues variable is also used to describe if that ip_type is * supported or not. Setting this variable to 1 for userqueues. */ info->ip[ip_type].num_queues = 1; + } else if (ip_info.available_rings) { + info->ip[ip_type].num_queues = util_bitcount(ip_info.available_rings); } else { continue; }