summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Wang <Qingqing.Wang@amd.com>2015-06-03 17:15:29 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-07-30 00:11:11 -0400
commitba5e52565f73c027b1c4b2ccfbe68749c04f5052 (patch)
tree1d0e66f95af04208aa5dead2056ab2a2e43c5cff
parent29fd8ff732a88c7e8991dcc021bf0e15f5bfb983 (diff)
amdgpu: add vram_type and vram_bit_width for interface query
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
-rw-r--r--amdgpu/amdgpu.h4
-rw-r--r--amdgpu/amdgpu_gpu_info.c2
-rw-r--r--include/drm/amdgpu_drm.h13
3 files changed, 19 insertions, 0 deletions
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 17e5c1ad..94fc647d 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -516,6 +516,10 @@ struct amdgpu_gpu_info {
uint32_t cu_active_number;
uint32_t cu_ao_mask;
uint32_t cu_bitmap[4][4];
+ /* video memory type info*/
+ uint32_t vram_type;
+ /* video memory bit width*/
+ uint32_t vram_bit_width;
};
diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
index 7811b53f..18cff4cb 100644
--- a/amdgpu/amdgpu_gpu_info.c
+++ b/amdgpu/amdgpu_gpu_info.c
@@ -158,6 +158,8 @@ int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
dev->info.num_shader_engines = dev->dev_info.num_shader_engines;
dev->info.num_shader_arrays_per_engine =
dev->dev_info.num_shader_arrays_per_engine;
+ dev->info.vram_type = dev->dev_info.vram_type;
+ dev->info.vram_bit_width = dev->dev_info.vram_bit_width;
for (i = 0; i < (int)dev->info.num_shader_engines; i++) {
unsigned instance = (i << AMDGPU_INFO_MMR_SE_INDEX_SHIFT) |
diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h
index 4d96bcf0..772f8032 100644
--- a/include/drm/amdgpu_drm.h
+++ b/include/drm/amdgpu_drm.h
@@ -540,6 +540,15 @@ struct drm_amdgpu_info_firmware {
uint32_t feature;
};
+#define AMDGPU_VRAM_TYPE_UNKNOWN 0
+#define AMDGPU_VRAM_TYPE_GDDR1 1
+#define AMDGPU_VRAM_TYPE_DDR2 2
+#define AMDGPU_VRAM_TYPE_GDDR3 3
+#define AMDGPU_VRAM_TYPE_GDDR4 4
+#define AMDGPU_VRAM_TYPE_GDDR5 5
+#define AMDGPU_VRAM_TYPE_HBM 6
+#define AMDGPU_VRAM_TYPE_DDR3 7
+
struct drm_amdgpu_info_device {
/** PCI Device ID */
uint32_t device_id;
@@ -573,6 +582,10 @@ struct drm_amdgpu_info_device {
/** Page table entry - fragment size */
uint32_t pte_fragment_size;
uint32_t gart_page_size;
+ /** video memory type information*/
+ uint32_t vram_type;
+ /** video memory bit width*/
+ uint32_t vram_bit_width;
};
struct drm_amdgpu_info_hw_ip {