summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-05-19 16:32:39 -0700
committerEric Anholt <eric@anholt.net>2009-05-19 16:32:39 -0700
commit3365c8563a3e0ac0d86d01f956301a23a7d8dc92 (patch)
tree89267c836d4d9e85abdd0006437075989a4e01a4
parent652d5518d6901f4ebe0f696b8d7e18b8edfc76ec (diff)
intel_gpu_dump: Stop decoding batchbuffers after MI_BATCH_BUFFER_END.
-rw-r--r--tools/intel_gpu_dump.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/intel_gpu_dump.c b/tools/intel_gpu_dump.c
index 205cf4898..58ec3151c 100644
--- a/tools/intel_gpu_dump.c
+++ b/tools/intel_gpu_dump.c
@@ -130,6 +130,11 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
{ 0x03, 0, 1, 1, "MI_WAIT_FOR_EVENT" },
};
+ switch ((data[0] & 0x1f800000) >> 23) {
+ case 0x0a:
+ instr_out(data, hw_offset, 0, "MI_BATCH_BUFFER_END\n");
+ return -1;
+ }
for (opcode = 0; opcode < sizeof(opcodes_mi) / sizeof(opcodes_mi[0]);
opcode++) {
@@ -1785,6 +1790,7 @@ decode_3d_i830(uint32_t *data, int count, uint32_t hw_offset, int *failures)
int
intel_decode(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid)
{
+ int ret;
int index = 0;
int failures = 0;
@@ -1793,8 +1799,19 @@ intel_decode(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid)
while (index < count) {
switch ((data[index] & 0xe0000000) >> 29) {
case 0x0:
- index += decode_mi(data + index, count - index,
+ ret = decode_mi(data + index, count - index,
hw_offset + index * 4, &failures);
+
+ /* If MI_BATCHBUFFER_END happened, then dump the rest of the
+ * output in case we some day want it in debugging, but don't
+ * decode it since it'll just confuse in the common case.
+ */
+ if (ret == -1) {
+ for (index = index + 1; index < count; index++) {
+ instr_out(data, hw_offset, index, "\n");
+ }
+ } else
+ index += ret;
break;
case 0x2:
index += decode_2d(data + index, count - index,