[Mesa-dev] [PATCH 5/5] radv: use the marketing name in the deviceName string

Fredrik Höglund fredrik at kde.org
Wed Nov 23 22:05:02 UTC 2016


This bumps the libdrm requirement to 2.4.72.
---
 configure.ac                                      |  2 +-
 src/amd/vulkan/radv_radeon_winsys.h               |  2 +-
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 43 +++++++++++++----------
 3 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5f30ae8..e1ea1cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,7 @@ AC_SUBST([OPENCL_VERSION])
 dnl Versions for external dependencies
 LIBDRM_REQUIRED=2.4.66
 LIBDRM_RADEON_REQUIRED=2.4.56
-LIBDRM_AMDGPU_REQUIRED=2.4.63
+LIBDRM_AMDGPU_REQUIRED=2.4.72
 LIBDRM_INTEL_REQUIRED=2.4.61
 LIBDRM_NVVIEUX_REQUIRED=2.4.66
 LIBDRM_NOUVEAU_REQUIRED=2.4.66
diff --git a/src/amd/vulkan/radv_radeon_winsys.h b/src/amd/vulkan/radv_radeon_winsys.h
index 76363a3..2596597 100644
--- a/src/amd/vulkan/radv_radeon_winsys.h
+++ b/src/amd/vulkan/radv_radeon_winsys.h
@@ -80,7 +80,7 @@ struct radeon_info {
 	/* Device info. */
 	uint32_t                    pci_id;
 	enum radeon_family          family;
-	const char                  *name;
+	char                        name[256];
 	enum chip_class             chip_class;
 	uint32_t                    gart_page_size;
 	uint64_t                    gart_size;
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
index b2e171a..816ee16 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c
@@ -90,24 +90,24 @@ static const char *
 get_chip_name(enum radeon_family family)
 {
 	switch (family) {
-	case CHIP_TAHITI: return "AMD RADV TAHITI";
-	case CHIP_PITCAIRN: return "AMD RADV PITCAIRN";
-	case CHIP_VERDE: return "AMD RADV CAPE VERDE";
-	case CHIP_OLAND: return "AMD RADV OLAND";
-	case CHIP_HAINAN: return "AMD RADV HAINAN";
-	case CHIP_BONAIRE: return "AMD RADV BONAIRE";
-	case CHIP_KAVERI: return "AMD RADV KAVERI";
-	case CHIP_KABINI: return "AMD RADV KABINI";
-	case CHIP_HAWAII: return "AMD RADV HAWAII";
-	case CHIP_MULLINS: return "AMD RADV MULLINS";
-	case CHIP_TONGA: return "AMD RADV TONGA";
-	case CHIP_ICELAND: return "AMD RADV ICELAND";
-	case CHIP_CARRIZO: return "AMD RADV CARRIZO";
-	case CHIP_FIJI: return "AMD RADV FIJI";
-	case CHIP_POLARIS10: return "AMD RADV POLARIS10";
-	case CHIP_POLARIS11: return "AMD RADV POLARIS11";
-	case CHIP_STONEY: return "AMD RADV STONEY";
-	default: return "AMD RADV unknown";
+	case CHIP_TAHITI: return "RADV TAHITI";
+	case CHIP_PITCAIRN: return "RADV PITCAIRN";
+	case CHIP_VERDE: return "RADV CAPE VERDE";
+	case CHIP_OLAND: return "RADV OLAND";
+	case CHIP_HAINAN: return "RADV HAINAN";
+	case CHIP_BONAIRE: return "RADV BONAIRE";
+	case CHIP_KAVERI: return "RADV KAVERI";
+	case CHIP_KABINI: return "RADV KABINI";
+	case CHIP_HAWAII: return "RADV HAWAII";
+	case CHIP_MULLINS: return "RADV MULLINS";
+	case CHIP_TONGA: return "RADV TONGA";
+	case CHIP_ICELAND: return "RADV ICELAND";
+	case CHIP_CARRIZO: return "RADV CARRIZO";
+	case CHIP_FIJI: return "RADV FIJI";
+	case CHIP_POLARIS10: return "RADV POLARIS10";
+	case CHIP_POLARIS11: return "RADV POLARIS11";
+	case CHIP_STONEY: return "RADV STONEY";
+	default: return "RADV unknown";
 	}
 }
 
@@ -118,6 +118,7 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
 	struct amdgpu_buffer_size_alignments alignment_info = {};
 	struct amdgpu_heap_info vram, visible_vram, gtt;
 	struct drm_amdgpu_info_hw_ip dma = {};
+	const char *marketing_name;
 	drmDevicePtr devinfo;
 	int r;
 	int i, j;
@@ -274,7 +275,11 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
 		goto fail;
 	}
 	/* Set hardware information. */
-	ws->info.name = get_chip_name(ws->info.family);
+	if ((marketing_name = amdgpu_get_marketing_name(ws->dev))) {
+		snprintf(ws->info.name, sizeof(ws->info.name), "%s (%s)", marketing_name, get_chip_name(ws->info.family));
+	} else {
+		snprintf(ws->info.name, sizeof(ws->info.name), "AMD %s", get_chip_name(ws->info.family));
+	}
 	ws->info.gart_size = gtt.heap_size;
 	ws->info.vram_size = vram.heap_size;
 	ws->info.visible_vram_size = visible_vram.heap_size;
-- 
2.1.4



More information about the mesa-dev mailing list