summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Cencora <[email protected]>2009-02-04 13:37:57 +0100
committerNicolai Haehnle <[email protected]>2009-03-06 22:19:43 +0100
commit3fa6a6df755849c2fa84df5f02756967bdf8ca0d (patch)
tree9c0e05783fe4cd038472ede4705834985eee8e0b
parent185ff38895cfc1376f21d892b122235ed0563922 (diff)
r300: Print reg address when debugging is enabled
Signed-off-by: Nicolai Haehnle <[email protected]>
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index c9e1dfe9774..3eb2dc8f5a0 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -130,16 +130,26 @@ int r300FlushCmdBuf(r300ContextPtr r300, const char *caller)
static void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *state)
{
- int i;
+ int i, j, reg;
int dwords = (*state->check) (r300, state);
+ drm_r300_cmd_header_t cmd;
fprintf(stderr, " emit %s %d/%d\n", state->name, dwords,
state->cmd_size);
if (RADEON_DEBUG & DEBUG_VERBOSE) {
- for (i = 0; i < dwords; i++) {
- fprintf(stderr, " %s[%d]: %08x\n",
- state->name, i, state->cmd[i]);
+ for (i = 0; i < dwords;) {
+ cmd = (drm_r300_cmd_header_t) state->cmd[i];
+ reg = (cmd.packet0.reghi << 8) | cmd.packet0.reglo;
+ fprintf(stderr, " %s[%d]: cmdpacket0 (first reg=0x%04x, count=%d)\n",
+ state->name, i, reg, cmd.packet0.count);
+ ++i;
+ for (j = 0; j < cmd.packet0.count; j++) {
+ fprintf(stderr, " %s[%d]: 0x%04x = %08x\n",
+ state->name, i, reg, state->cmd[i]);
+ reg += 4;
+ ++i;
+ }
}
}
}