From: Kenneth Graunke Date: Tue, 17 Dec 2019 10:57:55 +0000 (-0800) Subject: iris: Simplify iris_get_renderer_string() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f63d6260d1b570e936c7da587b0028f10368116b;p=mesa.git iris: Simplify iris_get_renderer_string() We use gen_get_device_name() instead of PCI ID list munging. Reviewed-by: Matt Turner Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Jordan Justen Part-of: --- diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index cbefa9dfb13..a566c58b05f 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -80,19 +80,12 @@ iris_get_name(struct pipe_screen *pscreen) { struct iris_screen *screen = (struct iris_screen *)pscreen; static char buf[128]; - const char *chipset; + const char *name = gen_get_device_name(screen->pci_id); - switch (screen->pci_id) { -#undef CHIPSET -#define CHIPSET(id, symbol, str) case id: chipset = str; break; -#include "pci_ids/i965_pci_ids.h" -#include "pci_ids/iris_pci_ids.h" - default: - chipset = "Unknown Intel Chipset"; - break; - } + if (!name) + name = "Intel Unknown"; - snprintf(buf, sizeof(buf), "Mesa %s", chipset); + snprintf(buf, sizeof(buf), "Mesa %s", name); return buf; }