aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunwei Zhang2016-09-12 10:14:11 -0500
committerMichel Dänzer2016-11-07 02:44:27 -0600
commit670f1e4fdadc197599cdc61d3104f8c27234765e (patch)
tree953a0a9e5d0fb78ee2ca7a09f01e7272dce76299 /amdgpu/amdgpu_device.c
parente9eb44b45b8d4a2f06ef83365b28eca55c0f3fb4 (diff)
downloadexternal-libdrm-670f1e4fdadc197599cdc61d3104f8c27234765e.tar.gz
external-libdrm-670f1e4fdadc197599cdc61d3104f8c27234765e.tar.xz
external-libdrm-670f1e4fdadc197599cdc61d3104f8c27234765e.zip
amdgpu: add the function to get the marketing name (v4)
This function is used to look up the marking name for a specific board. v2: agd: Squash in subsequent updates to the table. v3: [Michel Dänzer] * Make amdgpu_asic_id_table static, so it's not exported from libdrm_amdgpu.so.1 * Add amdgpu_get_marketing_name to amdgpu-symbols-check * Fix indentation of second line of if statement * Squash in another change removing redundant entries * Change spelling of "RADEON" -> "Radeon" * Remove "(TM)" from a minority of entries v4: [Michel Dänzer] * Use const char* instead of fixed size array for marketing_name (Emil Velikov) Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Flora Cui <Flora.Cui@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_device.c')
-rw-r--r--amdgpu/amdgpu_device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index e5a923e6..f4ede031 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -44,6 +44,7 @@
44#include "amdgpu_internal.h" 44#include "amdgpu_internal.h"
45#include "util_hash_table.h" 45#include "util_hash_table.h"
46#include "util_math.h" 46#include "util_math.h"
47#include "amdgpu_asic_id.h"
47 48
48#define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) 49#define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x)))
49#define UINT_TO_PTR(x) ((void *)((intptr_t)(x))) 50#define UINT_TO_PTR(x) ((void *)((intptr_t)(x)))
@@ -303,3 +304,17 @@ int amdgpu_device_deinitialize(amdgpu_device_handle dev)
303 amdgpu_device_reference(&dev, NULL); 304 amdgpu_device_reference(&dev, NULL);
304 return 0; 305 return 0;
305} 306}
307
308const char *amdgpu_get_marketing_name(amdgpu_device_handle dev)
309{
310 const struct amdgpu_asic_id_table_t *t = amdgpu_asic_id_table;
311
312 while (t->did) {
313 if ((t->did == dev->info.asic_id) &&
314 (t->rid == dev->info.pci_rev_id))
315 return t->marketing_name;
316 t++;
317 }
318
319 return NULL;
320}