diff options
author | Jason Ekstrand <[email protected]> | 2017-12-12 23:26:51 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-12-14 13:27:06 -0800 |
commit | 79269e8f4bc37ab31975cae0d5db4b85eaafe0d8 (patch) | |
tree | 429fa3cc5c0c4a1df1ec6a69b2cbd5452cbe3703 /src | |
parent | a7ae72032f550d9680673b67b1e81452d0b74fed (diff) |
intel/disasm: Take a devinfo in gen_disasm_create
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/tools/aubinator.c | 2 | ||||
-rw-r--r-- | src/intel/tools/aubinator_error_decode.c | 2 | ||||
-rw-r--r-- | src/intel/tools/disasm.c | 7 | ||||
-rw-r--r-- | src/intel/tools/gen_disasm.h | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c index 45b9566ecec..4ae70ad4fbc 100644 --- a/src/intel/tools/aubinator.c +++ b/src/intel/tools/aubinator.c @@ -846,7 +846,7 @@ handle_trace_header(uint32_t *p) spec = gen_spec_load(&devinfo); else spec = gen_spec_load_from_path(&devinfo, xml_path); - disasm = gen_disasm_create(pci_id); + disasm = gen_disasm_create(&devinfo); if (spec == NULL || disasm == NULL) exit(EXIT_FAILURE); diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c index ecc01b55e7f..47acda49024 100644 --- a/src/intel/tools/aubinator_error_decode.c +++ b/src/intel/tools/aubinator_error_decode.c @@ -603,7 +603,7 @@ read_data_file(FILE *file) exit(EXIT_FAILURE); } - disasm = gen_disasm_create(reg); + disasm = gen_disasm_create(&devinfo); printf("Detected GEN%i chipset\n", devinfo.gen); diff --git a/src/intel/tools/disasm.c b/src/intel/tools/disasm.c index 50915795224..1de20f576d4 100644 --- a/src/intel/tools/disasm.c +++ b/src/intel/tools/disasm.c @@ -108,7 +108,7 @@ gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly, } struct gen_disasm * -gen_disasm_create(int pciid) +gen_disasm_create(const struct gen_device_info *devinfo) { struct gen_disasm *gd; @@ -116,10 +116,7 @@ gen_disasm_create(int pciid) if (gd == NULL) return NULL; - if (!gen_get_device_info(pciid, &gd->devinfo)) { - free(gd); - return NULL; - } + gd->devinfo = *devinfo; brw_init_compaction_tables(&gd->devinfo); diff --git a/src/intel/tools/gen_disasm.h b/src/intel/tools/gen_disasm.h index d2764bb90b7..52601cb2864 100644 --- a/src/intel/tools/gen_disasm.h +++ b/src/intel/tools/gen_disasm.h @@ -24,13 +24,15 @@ #ifndef GEN_DISASM_H #define GEN_DISASM_H +#include "intel/common/gen_device_info.h" + #ifdef __cplusplus extern "C" { #endif struct gen_disasm; -struct gen_disasm *gen_disasm_create(int pciid); +struct gen_disasm *gen_disasm_create(const struct gen_device_info *devinfo); void gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly, int start, FILE *out); |