diff options
author | Kenneth Graunke <[email protected]> | 2017-05-03 22:07:16 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-05-10 11:58:20 -0700 |
commit | 32f0dc3a2919f8d8ba01fab811b2d63e4c6823e8 (patch) | |
tree | f9376a7ccd7a653c7d8be5aa94ab9207e12a4bb9 | |
parent | 0f34b674ed597dcaf9e6e3af8c074b9cd62bde06 (diff) |
i965: Make INTEL_DEBUG=bat decode VS/CLIP/GS/SF/WM/CC_STATE on Gen4-5.
This is something the original decoder did, but I didn't bother with
until now. I recently had to debug an Ironlake issue, and wanted to
inspect VS_STATE. So, now it's back.
The other packets in the switch statement are all Gen6/7+, where we
use offsets from dynamic state base address, so we don't need the
gtt_offset subtraction introduced here. We might want to make a
helper for this hack at some point - perhaps when we introduce the
next occurance.
Acked-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_batchbuffer.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 154c095aa9f..2818458384d 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -275,7 +275,27 @@ do_batch_dump(struct brw_context *brw) switch (gen_group_get_opcode(inst) >> 16) { case _3DSTATE_PIPELINED_POINTERS: - /* TODO: Decode Gen4-5 pipelined pointers */ + /* Note: these Gen4-5 pointers are full relocations rather than + * offsets from the start of the batch. So we need to subtract + * gtt_offset (the start of the batch) to obtain an offset we + * can add to the map and get at the data. + */ + decode_struct(brw, spec, "VS_STATE", data, gtt_offset, + (p[1] & ~0x1fu) - gtt_offset, color); + if (p[2] & 1) { + decode_struct(brw, spec, "GS_STATE", data, gtt_offset, + (p[2] & ~0x1fu) - gtt_offset, color); + } + if (p[3] & 1) { + decode_struct(brw, spec, "CLIP_STATE", data, gtt_offset, + (p[3] & ~0x1fu) - gtt_offset, color); + } + decode_struct(brw, spec, "SF_STATE", data, gtt_offset, + (p[4] & ~0x1fu) - gtt_offset, color); + decode_struct(brw, spec, "WM_STATE", data, gtt_offset, + (p[5] & ~0x1fu) - gtt_offset, color); + decode_struct(brw, spec, "COLOR_CALC_STATE", data, gtt_offset, + (p[6] & ~0x3fu) - gtt_offset, color); break; case _3DSTATE_BINDING_TABLE_POINTERS_VS: case _3DSTATE_BINDING_TABLE_POINTERS_HS: |