[Intel-gfx] [PATCH] Add a flag to signal possible origin of the gpu hang.

Eugeni Dodonov eugeni.dodonov at intel.com
Mon Oct 17 18:25:01 CEST 2011


This adds a hint on where the call trace originated from. This is more of
a guess, but still, it seems to be quite accurate on the traces I tested.

So it appears in the output like:

...
0x06c470c8:      0x780e0002: 3DSTATE_CC_STATE_POINTERS
0x06c470cc:      0x00007f81:    blend change 1
0x06c470d0:      0x00007f01:    depth stencil change 1
0x06c470d4:      0x00007f41:    cc change 1
0x06c470d8:      0x78021302: 3DSTATE_SAMPLER_STATE_POINTERS: VS mod 1, GS
mod 1, PS mod 1
0x06c470dc:      0x00000000:    VS sampler state
0x06c470e0:      0x00000000:    GS sampler state
0x06c470e4:      0x00007e00:    WM sampler state
0x06c470e8:      0x78150003: Possible origin: mesa
0x06c470e8:      0x78150003: 3DSTATE_CONSTANT_VS_STATE
0x06c470ec:      0x00000000:    dword 1
0x06c470f0:      0x00000000:    dword 2
0x06c470f4:      0x00000000:    dword 3
0x06c470f8:      0x00000000:    dword 4
...

Signed-off-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
---
 tools/intel_decode.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/intel_decode.c b/tools/intel_decode.c
index d1218cd..14dc25c 100644
--- a/tools/intel_decode.c
+++ b/tools/intel_decode.c
@@ -94,6 +94,7 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
 	int min_len;
 	int max_len;
 	char *name;
+	char *possible_origin;
     } opcodes_mi[] = {
 	{ 0x08, 0, 1, 1, "MI_ARB_ON_OFF" },
 	{ 0x0a, 0, 1, 1, "MI_BATCH_BUFFER_END" },
@@ -223,6 +224,7 @@ decode_2d(uint32_t *data, int count, uint32_t hw_offset, int *failures)
 	int min_len;
 	int max_len;
 	char *name;
+	char *possible_origin;
     } opcodes_2d[] = {
 	{ 0x40, 5, 5, "COLOR_BLT" },
 	{ 0x43, 6, 6, "SRC_COPY_BLT" },
@@ -993,6 +995,7 @@ decode_3d_1d(uint32_t *data, int count,
 	int min_len;
 	int max_len;
 	char *name;
+	char *possible_origin;
     } opcodes_3d_1d[] = {
 	{ 0x86, 0, 4, 4, "3DSTATE_CHROMA_KEY" },
 	{ 0x88, 0, 2, 2, "3DSTATE_CONSTANT_BLEND_COLOR" },
@@ -1836,6 +1839,7 @@ decode_3d(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid, int *fa
 	int min_len;
 	int max_len;
 	char *name;
+	char *possible_origin;
     } opcodes_3d[] = {
 	{ 0x06, 1, 1, "3DSTATE_ANTI_ALIASING" },
 	{ 0x08, 1, 1, "3DSTATE_BACKFACE_STENCIL_OPS" },
@@ -2061,6 +2065,7 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid, int
 	int min_len;
 	int max_len;
 	char *name;
+	char *possible_origin;
     } opcodes_3d[] = {
 	{ 0x6000, 3, 3, "URB_FENCE" },
 	{ 0x6001, 2, 2, "CS_URB_STATE" },
@@ -2094,12 +2099,12 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid, int
 	{ 0x780d, 4, 4, "3DSTATE_VIEWPORT_STATE_POINTERS" },
 	{ 0x780e, 4, 4, "3DSTATE_CC_STATE_POINTERS" },
 	{ 0x780f, 2, 2, "3DSTATE_SCISSOR_STATE_POINTERS" },
-	{ 0x7810, 6, 6, "3DSTATE_VS_STATE" },
+	{ 0x7810, 6, 6, "3DSTATE_VS_STATE", "mesa" },
 	{ 0x7811, 7, 7, "3DSTATE_GS_STATE" },
 	{ 0x7812, 4, 4, "3DSTATE_CLIP_STATE" },
 	{ 0x7813, 20, 20, "3DSTATE_SF_STATE" },
 	{ 0x7814, 9, 9, "3DSTATE_WM_STATE" },
-	{ 0x7815, 5, 5, "3DSTATE_CONSTANT_VS_STATE" },
+	{ 0x7815, 5, 5, "3DSTATE_CONSTANT_VS_STATE", "mesa" },
 	{ 0x7816, 5, 5, "3DSTATE_CONSTANT_GS_STATE" },
 	{ 0x7817, 5, 5, "3DSTATE_CONSTANT_PS_STATE" },
 	{ 0x7818, 2, 2, "3DSTATE_SAMPLE_MASK" },
@@ -2108,6 +2113,12 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid, int
     len = (data[0] & 0x0000ffff) + 2;
 
     opcode = (data[0] & 0xffff0000) >> 16;
+	/* Try to guess where the issue comes from */
+	for (idx = 0; idx < ARRAY_SIZE(opcodes_3d); idx++) {
+		if (opcode == opcodes_3d[idx].opcode)
+			if (opcodes_3d[idx].possible_origin)
+				instr_out(data, hw_offset, 0, "Possible origin: %s\n", opcodes_3d[idx].possible_origin);
+	}
     switch (opcode) {
     case 0x6000:
 	len = (data[0] & 0x000000ff) + 2;
@@ -2710,6 +2721,7 @@ decode_3d_i830(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid, in
 	int min_len;
 	int max_len;
 	char *name;
+	char *possible_origin;
     } opcodes_3d[] = {
 	{ 0x02, 1, 1, "3DSTATE_MODES_3" },
 	{ 0x03, 1, 1, "3DSTATE_ENABLES_1"},
-- 
1.7.7




More information about the Intel-gfx mailing list