summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_gpu_info.c15
-rw-r--r--src/amd/common/ac_gpu_info.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index d1cd0c15572..cf5d6e1d8ca 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -88,7 +88,7 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
{
struct amdgpu_buffer_size_alignments alignment_info = {};
struct amdgpu_heap_info vram, vram_vis, gtt;
- struct drm_amdgpu_info_hw_ip dma = {}, uvd = {}, vce = {};
+ struct drm_amdgpu_info_hw_ip dma = {}, compute = {}, uvd = {}, vce = {};
uint32_t vce_version = 0, vce_feature = 0, uvd_version = 0, uvd_feature = 0;
uint32_t unused_feature;
int r, i, j;
@@ -145,6 +145,12 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
return false;
}
+ r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_COMPUTE, 0, &compute);
+ if (r) {
+ fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(compute) failed.\n");
+ return false;
+ }
+
r = amdgpu_query_hw_ip_info(dev, AMDGPU_HW_IP_UVD, 0, &uvd);
if (r) {
fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(uvd) failed.\n");
@@ -254,7 +260,12 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
256 << G_0098F8_PIPE_INTERLEAVE_SIZE_GFX6(amdinfo->gb_addr_cfg);
}
info->has_virtual_memory = true;
- info->has_sdma = dma.available_rings != 0;
+
+ assert(util_is_power_of_two(dma.available_rings + 1));
+ assert(util_is_power_of_two(compute.available_rings + 1));
+
+ info->num_sdma_rings = util_bitcount(dma.available_rings);
+ info->num_compute_rings = util_bitcount(compute.available_rings);
/* Get the number of good compute units. */
info->num_good_compute_units = 0;
diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h
index 0dd7dc7b16d..9bf2b84d851 100644
--- a/src/amd/common/ac_gpu_info.h
+++ b/src/amd/common/ac_gpu_info.h
@@ -50,8 +50,9 @@ struct radeon_info {
bool has_dedicated_vram;
bool has_virtual_memory;
bool gfx_ib_pad_with_type2;
- bool has_sdma;
bool has_uvd;
+ uint32_t num_sdma_rings;
+ uint32_t num_compute_rings;
uint32_t uvd_fw_version;
uint32_t vce_fw_version;
uint32_t me_fw_version;