ac: add radeon_info::name
authorMarek Olšák <marek.olsak@amd.com>
Fri, 3 Aug 2018 02:21:02 +0000 (22:21 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 15 Aug 2018 01:20:31 +0000 (21:20 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c

index 40441ec0c6735fbb77f3d7142fb94bdcf314d4c4..8705d878f9a97730bbe48656a7a5bfdeeaee9c97 100644 (file)
@@ -301,7 +301,11 @@ bool ac_query_gpu_info(int fd, amdgpu_device_handle dev,
        info->vce_harvest_config = amdinfo->vce_harvest_config;
 
        switch (info->pci_id) {
-#define CHIPSET(pci_id, cfamily) case pci_id: info->family = CHIP_##cfamily; break;
+#define CHIPSET(pci_id, cfamily) \
+       case pci_id: \
+               info->family = CHIP_##cfamily; \
+               info->name = #cfamily; \
+               break;
 #include "pci_ids/radeonsi_pci_ids.h"
 #undef CHIPSET
 
index f6e09d2e13c9a3faab17ec13b1b9ffd419b4374c..a897496da487153b4a08ad4476bebd68bfc9ede2 100644 (file)
@@ -47,6 +47,7 @@ struct radeon_info {
        uint32_t                    pci_func;
 
        /* Device info. */
+       const char                  *name;
        uint32_t                    pci_id;
        enum radeon_family          family;
        enum chip_class             chip_class;
index 491e8e159f496189138a956e927279c2b21044f9..f8702e7c6015b2ea15a6335cf65dd093abdc72ad 100644 (file)
@@ -182,7 +182,12 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
 #include "pci_ids/r600_pci_ids.h"
 #undef CHIPSET
 
-#define CHIPSET(pci_id, cfamily) case pci_id: ws->info.family = CHIP_##cfamily; ws->gen = DRV_SI; break;
+#define CHIPSET(pci_id, cfamily) \
+    case pci_id: \
+        ws->info.family = CHIP_##cfamily; \
+        ws->info.name = #cfamily; \
+        ws->gen = DRV_SI; \
+        break;
 #include "pci_ids/radeonsi_pci_ids.h"
 #undef CHIPSET