iris: Simplify iris_get_renderer_string()
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 17 Dec 2019 10:57:55 +0000 (02:57 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 14 Jan 2020 03:42:30 +0000 (19:42 -0800)
We use gen_get_device_name() instead of PCI ID list munging.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3371>

src/gallium/drivers/iris/iris_screen.c

index cbefa9dfb1367e5a42165869e709bfeb78f0b720..a566c58b05fc58c4c267b23dbe487debcd857462 100644 (file)
@@ -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;
 }