radeonsi: use radeon_info::name
authorMarek Olšák <marek.olsak@amd.com>
Fri, 10 Aug 2018 18:31:15 +0000 (14:31 -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/gallium/drivers/radeonsi/si_get.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h

index e316703bbe35648fdcee2310c527c260734a579f..14bd5c11e4f2a5377e89954102a07d528ec2fd06 100644 (file)
@@ -54,36 +54,6 @@ static const char *si_get_marketing_name(struct radeon_winsys *ws)
        return ws->get_chip_name(ws);
 }
 
-const char *si_get_family_name(const struct si_screen *sscreen)
-{
-       switch (sscreen->info.family) {
-       case CHIP_TAHITI: return "AMD TAHITI";
-       case CHIP_PITCAIRN: return "AMD PITCAIRN";
-       case CHIP_VERDE: return "AMD CAPE VERDE";
-       case CHIP_OLAND: return "AMD OLAND";
-       case CHIP_HAINAN: return "AMD HAINAN";
-       case CHIP_BONAIRE: return "AMD BONAIRE";
-       case CHIP_KAVERI: return "AMD KAVERI";
-       case CHIP_KABINI: return "AMD KABINI";
-       case CHIP_HAWAII: return "AMD HAWAII";
-       case CHIP_MULLINS: return "AMD MULLINS";
-       case CHIP_TONGA: return "AMD TONGA";
-       case CHIP_ICELAND: return "AMD ICELAND";
-       case CHIP_CARRIZO: return "AMD CARRIZO";
-       case CHIP_FIJI: return "AMD FIJI";
-       case CHIP_STONEY: return "AMD STONEY";
-       case CHIP_POLARIS10: return "AMD POLARIS10";
-       case CHIP_POLARIS11: return "AMD POLARIS11";
-       case CHIP_POLARIS12: return "AMD POLARIS12";
-       case CHIP_VEGAM: return "AMD VEGAM";
-       case CHIP_VEGA10: return "AMD VEGA10";
-       case CHIP_VEGA12: return "AMD VEGA12";
-       case CHIP_VEGA20: return "AMD VEGA20";
-       case CHIP_RAVEN: return "AMD RAVEN";
-       default: return "AMD unknown";
-       }
-}
-
 static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
 {
        struct si_screen *sscreen = (struct si_screen *)pscreen;
@@ -956,16 +926,19 @@ static struct disk_cache *si_get_disk_shader_cache(struct pipe_screen *pscreen)
 static void si_init_renderer_string(struct si_screen *sscreen)
 {
        struct radeon_winsys *ws = sscreen->ws;
-       char family_name[32] = {}, kernel_version[128] = {};
+       char first_name[256], second_name[32] = {}, kernel_version[128] = {};
        struct utsname uname_data;
 
-       const char *chip_name = si_get_marketing_name(ws);
+       const char *marketing_name = si_get_marketing_name(ws);
 
-       if (chip_name)
-               snprintf(family_name, sizeof(family_name), "%s, ",
-                        si_get_family_name(sscreen) + 4);
-       else
-               chip_name = si_get_family_name(sscreen);
+       if (marketing_name) {
+               snprintf(first_name, sizeof(first_name), "%s", marketing_name);
+               snprintf(second_name, sizeof(second_name), "%s, ",
+                        sscreen->info.name);
+       } else {
+               snprintf(first_name, sizeof(first_name), "AMD %s",
+                        sscreen->info.name);
+       }
 
        if (uname(&uname_data) == 0)
                snprintf(kernel_version, sizeof(kernel_version),
@@ -973,7 +946,7 @@ static void si_init_renderer_string(struct si_screen *sscreen)
 
        snprintf(sscreen->renderer_string, sizeof(sscreen->renderer_string),
                 "%s (%sDRM %i.%i.%i%s, LLVM %i.%i.%i)",
-                chip_name, family_name, sscreen->info.drm_major,
+                first_name, second_name, sscreen->info.drm_major,
                 sscreen->info.drm_minor, sscreen->info.drm_patchlevel,
                 kernel_version,
                 (HAVE_LLVM >> 8) & 0xff,
index 3ca53dfed7cc6c6ab71b2594c19c2274b94e7f96..13fcf1f3aeaac27e94f187a989854839f1cf6d85 100644 (file)
@@ -782,7 +782,7 @@ static void si_disk_cache_create(struct si_screen *sscreen)
                        shader_debug_flags |= (uint64_t)sscreen->info.address32_hi << 32;
 
                        sscreen->disk_shader_cache =
-                               disk_cache_create(si_get_family_name(sscreen),
+                               disk_cache_create(sscreen->info.name,
                                                  timestamp_str,
                                                  shader_debug_flags);
                        free(timestamp_str);
index 7773cb02d7c50704714617c9e18bda3880833d65..5fa8c33f6cbfb76113b15bd9ccf37893dc913216 100644 (file)
@@ -1176,7 +1176,6 @@ struct pipe_fence_handle *si_create_fence(struct pipe_context *ctx,
                                          struct tc_unflushed_batch_token *tc_token);
 
 /* si_get.c */
-const char *si_get_family_name(const struct si_screen *sscreen);
 void si_init_screen_get_functions(struct si_screen *sscreen);
 
 /* si_gfx_cs.c */