[Mesa-dev] [PATCH 2/7] intel: common: print out all dword with field spanning multiple dwords

Lionel Landwerlin lionel.g.landwerlin at intel.com
Thu Aug 3 14:37:40 UTC 2017


For example, we were skipping Dword 3 in this PIPE_CONTROL :

0x000ce130:  0x7a000004:  PIPE_CONTROL
    DWord Length: 4
0x000ce134:  0x00000010 : Dword 1
    Flush LLC: false
    Destination Address Type: 0 (PPGTT)
    LRI Post Sync Operation: 0 (No LRI Operation)
    Store Data Index: 0
    Command Streamer Stall Enable: false
    Global Snapshot Count Reset: false
    TLB Invalidate: false
    Generic Media State Clear: false
    Post Sync Operation: 0 (No Write)
    Depth Stall Enable: false
    Render Target Cache Flush Enable: false
    Instruction Cache Invalidate Enable: false
    Texture Cache Invalidation Enable: false
    Indirect State Pointers Disable: false
    Notify Enable: false
    Pipe Control Flush Enable: false
    DC Flush Enable: false
    VF Cache Invalidation Enable: true
    Constant Cache Invalidation Enable: false
    State Cache Invalidation Enable: false
    Stall At Pixel Scoreboard: false
    Depth Cache Flush Enable: false
0x000ce138:  0x00000000 : Dword 2
    Address: 0x00000000
0x000ce140:  0x00000000 : Dword 4
    Immediate Data: 0

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/common/gen_decoder.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 9b3588baed2..e32d4190235 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -952,10 +952,11 @@ gen_field_iterator_next(struct gen_field_iterator *iter)
 
 static void
 print_dword_header(FILE *outfile,
-                   struct gen_field_iterator *iter, uint64_t offset)
+                   struct gen_field_iterator *iter,
+                   uint64_t offset, uint32_t dword)
 {
    fprintf(outfile, "0x%08"PRIx64":  0x%08x : Dword %d\n",
-           offset + 4 * iter->dword, iter->p[iter->dword], iter->dword);
+           offset + 4 * dword, iter->p[dword], dword);
 }
 
 static bool
@@ -977,12 +978,13 @@ gen_print_group(FILE *outfile, struct gen_group *group,
                 uint64_t offset, const uint32_t *p, bool color)
 {
    struct gen_field_iterator iter;
-   int last_dword = 0;
+   int last_dword = -1;
 
    gen_field_iterator_init(&iter, group, p, color);
    while (gen_field_iterator_next(&iter)) {
       if (last_dword != iter.dword) {
-         print_dword_header(outfile, &iter, offset);
+         for (int i = last_dword + 1; i <= iter.dword; i++)
+            print_dword_header(outfile, &iter, offset, i);
          last_dword = iter.dword;
       }
       if (!is_header_field(group, iter.field)) {
-- 
2.13.3



More information about the mesa-dev mailing list