intel/dev: print out error when platform is not found by name
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 16 Apr 2020 18:45:23 +0000 (21:45 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 30 Apr 2020 08:32:54 +0000 (11:32 +0300)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4594>

src/intel/dev/gen_device_info.c

index 299d33f9501b0ffa5183e9c53ad4daebe741e21f..742c17f64c8cc771463730cfbc01b9deb02803ac 100644 (file)
@@ -76,6 +76,12 @@ gen_device_name_to_pci_device_id(const char *name)
          return name_map[i].pci_id;
    }
 
+   fprintf(stderr, "Unknown platform '%s'. Supported names: %s",
+           name, name_map[0].name);
+   for (unsigned i = 1; i < ARRAY_SIZE(name_map); i++)
+      fprintf(stderr, ", %s", name_map[i].name);
+   fprintf(stderr, "\n");
+
    return -1;
 }