summaryrefslogtreecommitdiffstats
path: root/src/intel/tools/aubinator.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2016-10-04 16:19:43 +0100
committerLionel Landwerlin <[email protected]>2016-10-08 02:17:03 +0100
commit63a366a8813fec3836213cfd5ab006add332ec84 (patch)
tree1a063ce5fcdaa7bb449c05bedb02ed6ec3894cab /src/intel/tools/aubinator.c
parent4d7d9825f34a31368e63c493c28d57c8f84a984c (diff)
intel: aubinator: generate a standalone binary
Embed the xml files into the binary, so aubinator can be used from any location. v2: Split generation packing into another patch (Jason) Check for xxd (Jason) v3: Fix out of tree builds (Jason) Generate custom variable name rather than names generated by xxd (Lionel) v4: Move generated _xml.h files to genxml/ (Sirisha) v5: Remove newline from makefile (Jason) v6: Add comment on gen*_xml.h creation (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/tools/aubinator.c')
-rw-r--r--src/intel/tools/aubinator.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 44a6bb2aa7b..8be7580c2b1 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -1048,21 +1048,19 @@ int main(int argc, char *argv[])
int c, i;
bool help = false, pager = true;
const char *input_file = NULL;
- char gen_file[256], gen_val[24];
+ char gen_val[24];
const struct {
const char *name;
int pci_id;
- int major;
- int minor;
} gens[] = {
- { "ivb", 0x0166, 7, 0 }, /* Intel(R) Ivybridge Mobile GT2 */
- { "hsw", 0x0416, 7, 5 }, /* Intel(R) Haswell Mobile GT2 */
- { "byt", 0x0155, 7, 5 }, /* Intel(R) Bay Trail */
- { "bdw", 0x1616, 8, 0 }, /* Intel(R) HD Graphics 5500 (Broadwell GT2) */
- { "chv", 0x22B3, 8, 0 }, /* Intel(R) HD Graphics (Cherryview) */
- { "skl", 0x1912, 9, 0 }, /* Intel(R) HD Graphics 530 (Skylake GT2) */
- { "kbl", 0x591D, 9, 0 }, /* Intel(R) Kabylake GT2 */
- { "bxt", 0x0A84, 9, 0 } /* Intel(R) HD Graphics (Broxton) */
+ { "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) */
}, *gen = NULL;
const struct option aubinator_opts[] = {
{ "help", no_argument, (int *) &help, true },
@@ -1073,6 +1071,7 @@ int main(int argc, char *argv[])
{ "color", required_argument, NULL, 'c' },
{ NULL, 0, NULL, 0 }
};
+ struct gen_device_info devinfo;
i = 0;
while ((c = getopt_long(argc, argv, "", aubinator_opts, &i)) != -1) {
@@ -1118,6 +1117,13 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ if (!gen_get_device_info(gen->pci_id, &devinfo)) {
+ fprintf(stderr, "can't find device information: pci_id=0x%x name=%s\n",
+ gen->pci_id, gen->name);
+ exit(EXIT_FAILURE);
+ }
+
+
/* Do this before we redirect stdout to pager. */
if (option_color == COLOR_AUTO)
option_color = isatty(1) ? COLOR_ALWAYS : COLOR_NEVER;
@@ -1125,14 +1131,7 @@ int main(int argc, char *argv[])
if (isatty(1) && pager)
setup_pager();
- if (gen->minor > 0) {
- snprintf(gen_file, sizeof(gen_file), "../genxml/gen%d%d.xml",
- gen->major, gen->minor);
- } else {
- snprintf(gen_file, sizeof(gen_file), "../genxml/gen%d.xml", gen->major);
- }
-
- spec = gen_spec_load(gen_file);
+ spec = gen_spec_load(&devinfo);
disasm = gen_disasm_create(gen->pci_id);
if (input_file == NULL) {