[Mesa-dev] [PATCH 05/17] radeonsi: simplify generating the renderer string

Marek Olšák maraeo at gmail.com
Wed Apr 4 01:59:10 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

HAVE_LLVM > 0 is a tautology.
---
 src/gallium/drivers/radeonsi/si_get.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index f75c97685ce..b47b22709f2 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -938,46 +938,43 @@ static void si_query_memory_info(struct pipe_screen *screen,
 static struct disk_cache *si_get_disk_shader_cache(struct pipe_screen *pscreen)
 {
 	struct si_screen *sscreen = (struct si_screen*)pscreen;
 
 	return sscreen->disk_shader_cache;
 }
 
 static void si_init_renderer_string(struct si_screen *sscreen)
 {
 	struct radeon_winsys *ws = sscreen->ws;
-	char family_name[32] = {}, llvm_string[32] = {}, kernel_version[128] = {};
+	char family_name[32] = {}, kernel_version[128] = {};
 	struct utsname uname_data;
 
 	const char *chip_name = si_get_marketing_name(ws);
 
 	if (chip_name)
-		snprintf(family_name, sizeof(family_name), "%s / ",
+		snprintf(family_name, sizeof(family_name), "%s, ",
 			 si_get_family_name(sscreen) + 4);
 	else
 		chip_name = si_get_family_name(sscreen);
 
 	if (uname(&uname_data) == 0)
 		snprintf(kernel_version, sizeof(kernel_version),
-			 " / %s", uname_data.release);
-
-	if (HAVE_LLVM > 0) {
-		snprintf(llvm_string, sizeof(llvm_string),
-			 ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,
-			 HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH);
-	}
+			 ", %s", uname_data.release);
 
 	snprintf(sscreen->renderer_string, sizeof(sscreen->renderer_string),
-		 "%s (%sDRM %i.%i.%i%s%s)",
+		 "%s (%sDRM %i.%i.%i%s, LLVM %i.%i.%i)",
 		 chip_name, family_name, sscreen->info.drm_major,
 		 sscreen->info.drm_minor, sscreen->info.drm_patchlevel,
-		 kernel_version, llvm_string);
+		 kernel_version,
+		 (HAVE_LLVM >> 8) & 0xff,
+		 HAVE_LLVM & 0xff,
+		 MESA_LLVM_VERSION_PATCH);
 }
 
 void si_init_screen_get_functions(struct si_screen *sscreen)
 {
 	sscreen->b.get_name = si_get_name;
 	sscreen->b.get_vendor = si_get_vendor;
 	sscreen->b.get_device_vendor = si_get_device_vendor;
 	sscreen->b.get_param = si_get_param;
 	sscreen->b.get_paramf = si_get_paramf;
 	sscreen->b.get_compute_param = si_get_compute_param;
-- 
2.15.1



More information about the mesa-dev mailing list