[Mesa-dev] [PATCH 5/5] aubinator: Remove bogus "end" parameter in gen_disasm_disassemble()
Sirisha Gandikota
sirisha.gandikota at intel.com
Thu Sep 8 23:15:22 UTC 2016
From: Sirisha Gandikota <Sirisha.Gandikota at intel.com>
Earlier, the loop pretends to loop over instructions from "start" to "end",
but the callers always pass 8192 for end, which is some huge bogus
value. The real loop termination condition is send-with-EOT or 0. (Ken)
Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota at intel.com>
---
src/intel/tools/aubinator.c | 12 ++++++------
src/intel/tools/disasm.c | 8 +++++---
src/intel/tools/gen_disasm.h | 2 +-
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index d147225..fffb1b6 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -304,7 +304,7 @@ handle_media_interface_descriptor_load(struct gen_spec *spec, uint32_t *p)
}
insns = (struct brw_instruction *) (gtt + start);
- gen_disasm_disassemble(disasm, insns, 0, 8192, stdout);
+ gen_disasm_disassemble(disasm, insns, 0, stdout);
dump_samplers(spec, descriptors[3] & ~0x1f);
dump_binding_table(spec, descriptors[4] & ~0x1f);
@@ -402,7 +402,7 @@ handle_3dstate_vs(struct gen_spec *spec, uint32_t *p)
instruction_base, start);
insns = (struct brw_instruction *) (gtt + instruction_base + start);
- gen_disasm_disassemble(disasm, insns, 0, 8192, stdout);
+ gen_disasm_disassemble(disasm, insns, 0, stdout);
}
}
@@ -426,7 +426,7 @@ handle_3dstate_hs(struct gen_spec *spec, uint32_t *p)
instruction_base, start);
insns = (struct brw_instruction *) (gtt + instruction_base + start);
- gen_disasm_disassemble(disasm, insns, 0, 8192, stdout);
+ gen_disasm_disassemble(disasm, insns, 0, stdout);
}
}
@@ -520,21 +520,21 @@ handle_3dstate_ps(struct gen_spec *spec, uint32_t *p)
printf(" Kernel[0] %s\n", k0);
if (k0 != unused) {
insns = (struct brw_instruction *) (gtt + start);
- gen_disasm_disassemble(disasm, insns, 0, 8192, stdout);
+ gen_disasm_disassemble(disasm, insns, 0, stdout);
}
start = instruction_base + (p[k1_offset] & mask);
printf(" Kernel[1] %s\n", k1);
if (k1 != unused) {
insns = (struct brw_instruction *) (gtt + start);
- gen_disasm_disassemble(disasm, insns, 0, 8192, stdout);
+ gen_disasm_disassemble(disasm, insns, 0, stdout);
}
start = instruction_base + (p[k2_offset] & mask);
printf(" Kernel[2] %s\n", k2);
if (k2 != unused) {
insns = (struct brw_instruction *) (gtt + start);
- gen_disasm_disassemble(disasm, insns, 0, 8192, stdout);
+ gen_disasm_disassemble(disasm, insns, 0, stdout);
}
}
diff --git a/src/intel/tools/disasm.c b/src/intel/tools/disasm.c
index 13e4ce2..7b8bf69 100644
--- a/src/intel/tools/disasm.c
+++ b/src/intel/tools/disasm.c
@@ -48,14 +48,16 @@ is_send(uint32_t opcode)
}
void
-gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly, int start,
- int end, FILE *out)
+gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly,
+ int start, FILE *out)
{
struct gen_device_info *devinfo = &disasm->devinfo;
bool dump_hex = false;
uint32_t opcode = 0;
+ int offset = start;
- for (int offset = start; offset < end;) {
+ /* This loop exits when send-with-EOT or when opcode is 0 */
+ while (true) {
brw_inst *insn = assembly + offset;
brw_inst uncompacted;
bool compacted = brw_inst_cmpt_control(devinfo, insn);
diff --git a/src/intel/tools/gen_disasm.h b/src/intel/tools/gen_disasm.h
index af6654f..24b56c9 100644
--- a/src/intel/tools/gen_disasm.h
+++ b/src/intel/tools/gen_disasm.h
@@ -28,7 +28,7 @@ struct gen_disasm;
struct gen_disasm *gen_disasm_create(int pciid);
void gen_disasm_disassemble(struct gen_disasm *disasm,
- void *assembly, int start, int end, FILE *out);
+ void *assembly, int start, FILE *out);
void gen_disasm_destroy(struct gen_disasm *disasm);
--
2.7.4
More information about the mesa-dev
mailing list