[Mesa-dev] [PATCH 1/4] ac/debug: handle index field in SET_*_REG correctly

Nicolai Hähnle nhaehnle at gmail.com
Mon May 15 09:18:35 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/amd/common/ac_debug.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
index 9d051f9..a8f81bf 100644
--- a/src/amd/common/ac_debug.c
+++ b/src/amd/common/ac_debug.c
@@ -125,23 +125,29 @@ void ac_dump_reg(FILE *file, unsigned offset, uint32_t value,
 		}
 	}
 
 	print_spaces(file, INDENT_PKT);
 	fprintf(file, COLOR_YELLOW "0x%05x" COLOR_RESET " <- 0x%08x\n", offset, value);
 }
 
 static void ac_parse_set_reg_packet(FILE *f, uint32_t *ib, unsigned count,
 				    unsigned reg_offset)
 {
-	unsigned reg = (ib[1] << 2) + reg_offset;
+	unsigned reg = ((ib[1] & 0xFFFF) << 2) + reg_offset;
+	unsigned index = ib[1] >> 28;
 	int i;
 
+	if (index != 0) {
+		print_spaces(f, INDENT_PKT);
+		fprintf(f, "INDEX = %u\n", index);
+	}
+
 	for (i = 0; i < count; i++)
 		ac_dump_reg(f, reg + i*4, ib[2+i], ~0);
 }
 
 static uint32_t *ac_parse_packet3(FILE *f, uint32_t *ib, int *num_dw,
 				  int trace_id, enum chip_class chip_class,
 				  ac_debug_addr_callback addr_callback,
 				  void *addr_callback_data)
 {
 	unsigned count = PKT_COUNT_G(ib[0]);
-- 
2.9.3



More information about the mesa-dev mailing list