summaryrefslogtreecommitdiffstats
path: root/src/intel/tools/aubinator.c
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2018-02-09 19:06:43 -0800
committerJordan Justen <[email protected]>2018-02-27 11:15:10 -0800
commit9f223d860b6fed0ae296bcd1b8ae14dca66a7986 (patch)
tree56dc78b4ba5797fd723f453ba2fec72a8fc07bba /src/intel/tools/aubinator.c
parent8ff89250ffc24ef908f0c1b8b0b96820c49a492f (diff)
intel/tools: Use gen_device_name_to_pci_device_id in aubinator
Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/tools/aubinator.c')
-rw-r--r--src/intel/tools/aubinator.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 92aa208a61b..77bad29051e 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -549,22 +549,6 @@ int main(int argc, char *argv[])
struct aub_file *file;
int c, i;
bool help = false, pager = true;
- const struct {
- const char *name;
- int pci_id;
- } gens[] = {
- { "ilk", 0x0046 }, /* Intel(R) Ironlake Mobile */
- { "snb", 0x0126 }, /* Intel(R) Sandybridge Mobile GT2 */
- { "ivb", 0x0166 }, /* Intel(R) Ivybridge Mobile GT2 */
- { "hsw", 0x0416 }, /* Intel(R) Haswell Mobile GT2 */
- { "byt", 0x0155 }, /* Intel(R) Bay Trail */
- { "bdw", 0x1616 }, /* Intel(R) HD Graphics 5500 (Broadwell GT2) */
- { "chv", 0x22B3 }, /* Intel(R) HD Graphics (Cherryview) */
- { "skl", 0x1912 }, /* Intel(R) HD Graphics 530 (Skylake GT2) */
- { "kbl", 0x591D }, /* Intel(R) Kabylake GT2 */
- { "bxt", 0x0A84 }, /* Intel(R) HD Graphics (Broxton) */
- { "cnl", 0x5A52 }, /* Intel(R) HD Graphics (Cannonlake) */
- };
const struct option aubinator_opts[] = {
{ "help", no_argument, (int *) &help, true },
{ "no-pager", no_argument, (int *) &pager, false },
@@ -581,19 +565,17 @@ int main(int argc, char *argv[])
i = 0;
while ((c = getopt_long(argc, argv, "", aubinator_opts, &i)) != -1) {
switch (c) {
- case 'g':
- for (i = 0; i < ARRAY_SIZE(gens); i++) {
- if (!strcmp(optarg, gens[i].name)) {
- pci_id = gens[i].pci_id;
- break;
- }
- }
- if (i == ARRAY_SIZE(gens)) {
+ case 'g': {
+ const int id = gen_device_name_to_pci_device_id(optarg);
+ if (id < 0) {
fprintf(stderr, "can't parse gen: '%s', expected ivb, byt, hsw, "
"bdw, chv, skl, kbl or bxt\n", optarg);
exit(EXIT_FAILURE);
+ } else {
+ pci_id = id;
}
break;
+ }
case 'c':
if (optarg == NULL || strcmp(optarg, "always") == 0)
option_color = COLOR_ALWAYS;