[Mesa-dev] [PATCH 2/3] radeonsi: use radeon_info::name
Marek Olšák
maraeo at gmail.com
Fri Aug 10 18:32:49 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_get.c | 49 ++++++--------------------
src/gallium/drivers/radeonsi/si_pipe.c | 2 +-
src/gallium/drivers/radeonsi/si_pipe.h | 1 -
3 files changed, 12 insertions(+), 40 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index 6e804797bab..d9b3a31356c 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -47,50 +47,20 @@ static const char *si_get_device_vendor(struct pipe_screen *pscreen)
return "AMD";
}
static const char *si_get_marketing_name(struct radeon_winsys *ws)
{
if (!ws->get_chip_name)
return NULL;
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;
switch (param) {
/* Supported features (boolean caps). */
case PIPE_CAP_ACCELERATED:
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
case PIPE_CAP_ANISOTROPIC_FILTER:
case PIPE_CAP_POINT_SPRITE:
@@ -949,38 +919,41 @@ 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] = {}, 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),
", %s", uname_data.release);
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,
HAVE_LLVM & 0xff,
MESA_LLVM_VERSION_PATCH);
}
void si_init_screen_get_functions(struct si_screen *sscreen)
{
sscreen->b.get_name = si_get_name;
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 3ca53dfed7c..13fcf1f3aea 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -775,21 +775,21 @@ static void si_disk_cache_create(struct si_screen *sscreen)
uint64_t shader_debug_flags = sscreen->debug_flags &
ALL_FLAGS;
/* Add the high bits of 32-bit addresses, which affects
* how 32-bit addresses are expanded to 64 bits.
*/
STATIC_ASSERT(ALL_FLAGS <= UINT_MAX);
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);
}
}
}
struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
const struct pipe_screen_config *config)
{
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index acdc0d11f2c..7bce4eeab66 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1166,21 +1166,20 @@ void si_gfx_write_event_eop(struct si_context *ctx,
uint32_t new_fence, unsigned query_type);
unsigned si_gfx_write_fence_dwords(struct si_screen *screen);
void si_gfx_wait_fence(struct si_context *ctx,
uint64_t va, uint32_t ref, uint32_t mask);
void si_init_fence_functions(struct si_context *ctx);
void si_init_screen_fence_functions(struct si_screen *screen);
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 */
void si_flush_gfx_cs(struct si_context *ctx, unsigned flags,
struct pipe_fence_handle **fence);
void si_begin_new_gfx_cs(struct si_context *ctx);
void si_need_gfx_cs_space(struct si_context *ctx);
/* r600_gpu_load.c */
void si_gpu_load_kill_thread(struct si_screen *sscreen);
--
2.17.1
More information about the mesa-dev
mailing list