summaryrefslogtreecommitdiff
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-07-30 00:11:12 -0400
commitabd68bca05e11398553b95c5bf69eaaa4eb26799 (patch)
treec2d3232e23b15914d49e8e00b4d4df9088541e45
parent74e1d9b195b7fb5a2ced6561f3d836f2d446d890 (diff)
amdgpu: add amdgpu_query_gds_info
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-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;
+}