diff options
authorXiaojie Yuan2017-05-31 15:22:50 -0500
committerMichel Dänzer2017-06-12 20:21:39 -0500
commit7e6bf88cac315a9fa41818cf72a7b5d18a2cb1fc (patch)
treeb9d9c516ea93037df1d9d248939ca8d26a524e3e /amdgpu/amdgpu_internal.h
parent87dac00db38fa962c2fd6aa66c8482a9d7464903 (diff)
amdgpu: move asic id table to a separate file
v2: fix an off by one error and leading white spaces v3: use thread safe strtok_r(); initialize len before calling getline(); change printf() to drmMsg(); add initial amdgpu.ids v4: integrate some recent internal changes, including format changes v5: fix line number for empty/commented lines; realloc to save memory; indentation changes v6: remove a line error v7: [Michel Dänzer] * Move amdgpu.ids to new data directory * Remove placeholder entries from amdgpu.ids * Set libdrmdatadir variable in configure.ac instead of Makefile.am [Emil Velikov] * Use isblank() instead of open-coding it [Emil Velikov] * Don't leak asic_id_table memory if realloc fails [Emil Velikov] * Check and bump table_max_size at the beginning of the while loop [Emil Velikov] * Initialize table_max_size to the number of entries in data/amdgpu.ids v8: [Michel Dänzer] * Make sure amdgpu_asic_id.c gets rebuilt when amdgpu.ids changes Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Samuel Li <Samuel.Li@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_internal.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index cf119a53..e68246bf 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -69,6 +69,12 @@ struct amdgpu_va {
69 struct amdgpu_bo_va_mgr *vamgr; 69 struct amdgpu_bo_va_mgr *vamgr;
70}; 70};
71 71
72struct amdgpu_asic_id {
73 uint32_t did;
74 uint32_t rid;
75 char *marketing_name;
72struct amdgpu_device { 78struct amdgpu_device {
73 atomic_t refcount; 79 atomic_t refcount;
74 int fd; 80 int fd;
@@ -76,6 +82,8 @@ struct amdgpu_device {
76 unsigned major_version; 82 unsigned major_version;
77 unsigned minor_version; 83 unsigned minor_version;
78 84
85 /** Lookup table of asic device id, revision id and marketing name */
86 struct amdgpu_asic_id *asic_ids;
79 /** List of buffer handles. Protected by bo_table_mutex. */ 87 /** List of buffer handles. Protected by bo_table_mutex. */
80 struct util_hash_table *bo_handles; 88 struct util_hash_table *bo_handles;
81 /** List of buffer GEM flink names. Protected by bo_table_mutex. */ 89 /** List of buffer GEM flink names. Protected by bo_table_mutex. */
@@ -149,6 +157,8 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
149drm_private void 157drm_private void
150amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size); 158amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size);
151 159
160drm_private int amdgpu_parse_asic_ids(struct amdgpu_asic_id **asic_ids);
152drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev); 162drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev);
153 163
154drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout); 164drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout);