From 84652721b987d892d743e3847b26b075fd3fa916 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 2 Aug 2018 22:21:02 -0400 Subject: [PATCH] ac: add radeon_info::name Reviewed-by: Timothy Arceri --- src/amd/common/ac_gpu_info.c | 6 +++++- src/amd/common/ac_gpu_info.h | 1 + src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index 40441ec0c67..8705d878f9a 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -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 diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h index f6e09d2e13c..a897496da48 100644 --- a/src/amd/common/ac_gpu_info.h +++ b/src/amd/common/ac_gpu_info.h @@ -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; diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index 491e8e159f4..f8702e7c601 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -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 -- 2.30.2