From: Jason Ekstrand Date: Wed, 13 Dec 2017 07:26:51 +0000 (-0800) Subject: intel/disasm: Take a devinfo in gen_disasm_create X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=79269e8f4bc37ab31975cae0d5db4b85eaafe0d8;p=mesa.git intel/disasm: Take a devinfo in gen_disasm_create Reviewed-by: Lionel Landwerlin --- 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);