]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/libdrm.git/blobdiff - intel/intel_decode.c
intel: Correct the word decoding for gen2 3DSTATE_LOAD_STATE_IMMEDIATE_1
[glsdk/libdrm.git] / intel / intel_decode.c
index 74dd530ddd608e802a0b127ff64810e1f155da47..a4b045ac4aed33a018da088382124a011e6e27f6 100644 (file)
@@ -138,6 +138,22 @@ instr_out(struct drm_intel_decode *ctx, unsigned int index,
        va_end(va);
 }
 
+static int
+decode_MI_SET_CONTEXT(struct drm_intel_decode *ctx)
+{
+       uint32_t data = ctx->data[1];
+       if (ctx->gen > 7)
+               return 1;
+
+       instr_out(ctx, 0, "MI_SET_CONTEXT\n");
+       instr_out(ctx, 1, "gtt offset = 0x%x%s%s\n",
+                 data & ~0xfff,
+                 data & (1<<1)? ", Force Restore": "",
+                 data & (1<<0)? ", Restore Inhibit": "");
+
+       return 2;
+}
+
 static int
 decode_MI_WAIT_FOR_EVENT(struct drm_intel_decode *ctx)
 {
@@ -233,7 +249,7 @@ decode_mi(struct drm_intel_decode *ctx)
                { 0x00, 0, 1, 1, "MI_NOOP" },
                { 0x11, 0x3f, 2, 2, "MI_OVERLAY_FLIP" },
                { 0x07, 0, 1, 1, "MI_REPORT_HEAD" },
-               { 0x18, 0x3f, 2, 2, "MI_SET_CONTEXT" },
+               { 0x18, 0x3f, 2, 2, "MI_SET_CONTEXT", decode_MI_SET_CONTEXT },
                { 0x20, 0x3f, 3, 4, "MI_STORE_DATA_IMM" },
                { 0x21, 0x3f, 3, 4, "MI_STORE_DATA_INDEX" },
                { 0x24, 0x3f, 3, 3, "MI_STORE_REGISTER_MEM" },
@@ -1698,7 +1714,7 @@ decode_3d_1d(struct drm_intel_decode *ctx)
                                        }
                                } else {
                                        instr_out(ctx, i,
-                                                 "S%d: 0x%08x\n", i, data[i]);
+                                                 "S%d: 0x%08x\n", word, data[i]);
                                }
                                i++;
                        }
@@ -3390,9 +3406,9 @@ decode_3d_965(struct drm_intel_decode *ctx)
                        instr_out(ctx, i,
                                  "buffer %d: %svalid, type 0x%04x, "
                                  "src offset 0x%04x bytes\n",
-                                 data[i] >> (IS_GEN6(devid) ? 26 : 27),
-                                 data[i] & (1 << (IS_GEN6(devid) ? 25 : 26)) ?
-                                 "in" : "", (data[i] >> 16) & 0x1ff,
+                                 data[i] >> ((IS_GEN6(devid) || IS_GEN7(devid)) ? 26 : 27),
+                                 data[i] & (1 << ((IS_GEN6(devid) || IS_GEN7(devid)) ? 25 : 26)) ?
+                                 "" : "in", (data[i] >> 16) & 0x1ff,
                                  data[i] & 0x07ff);
                        i++;
                        instr_out(ctx, i, "(%s, %s, %s, %s), "