summaryrefslogtreecommitdiff
path: root/amdgpu
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-06-06 05:00:36 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-08-05 13:47:51 -0400
commit657245f7a3394063e3b25e86e314d2cf001f97d2 (patch)
treea574625adf845dec7cddf71485883c0d966742f2 /amdgpu
parent201b09a443e752429e9f69eafbd70123ce409cb0 (diff)
amdgpu: add amdgpu_query_gds_info
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r--amdgpu/amdgpu.h5
-rw-r--r--amdgpu/amdgpu_gpu_info.c25
2 files changed, 27 insertions, 3 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 70b488e3..44b9d17f 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -777,9 +777,8 @@ int amdgpu_bo_list_update(amdgpu_bo_list_handle handle,
* <0 - Negative POSIX Error code
*
*/
-int amdgpu_gpu_resource_query_gds_info(amdgpu_device_handle dev,
- struct amdgpu_gds_resource_info *
- gds_info);
+int amdgpu_query_gds_info(amdgpu_device_handle dev,
+ struct amdgpu_gds_resource_info *gds_info);
/**
diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
index df193ee2..515ee78a 100644
--- a/amdgpu/amdgpu_gpu_info.c
+++ b/amdgpu/amdgpu_gpu_info.c
@@ -276,3 +276,28 @@ int amdgpu_query_heap_info(amdgpu_device_handle dev,
return 0;
}
+
+int amdgpu_query_gds_info(amdgpu_device_handle dev,
+ struct amdgpu_gds_resource_info *gds_info)
+{
+ struct drm_amdgpu_info_gds gds_config = {};
+ int r;
+
+ if (gds_info == NULL)
+ return -EINVAL;
+
+ r = amdgpu_query_info(dev, AMDGPU_INFO_GDS_CONFIG,
+ sizeof(gds_config), &gds_config);
+ if (r)
+ return r;
+
+ gds_info->gds_gfx_partition_size = gds_config.gds_gfx_partition_size;
+ gds_info->compute_partition_size = gds_config.compute_partition_size;
+ gds_info->gds_total_size = gds_config.gds_total_size;
+ gds_info->gws_per_gfx_partition = gds_config.gws_per_gfx_partition;
+ gds_info->gws_per_compute_partition = gds_config.gws_per_compute_partition;
+ gds_info->oa_per_gfx_partition = gds_config.oa_per_gfx_partition;
+ gds_info->oa_per_compute_partition = gds_config.oa_per_compute_partition;
+
+ return 0;
+}