[PATCH 2/3] tools/intel_error_decode: Add decodings for FAULT_REG

Mika Kuoppala
2015-03-25T13:42:13Z

Add decodings for FAULT_REG

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
tools/intel_error_decode.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index fb4a2a4..553307f 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -380,6 +380,27 @@ print_fence(unsigned int devid, uint64_t fence)
}
}

+static void
+print_fault_reg(unsigned devid, uint32_t reg)
+{
+ const char *type[] = { "Page", "Invalid PD",
+ "Unloaded PD", "Invalid and Unloaded PD" };
+ const char *engine[] = { "GFX", "MFX0", "MFX1", "VEBX", "BLT" };
+
+ if (reg & (1 << 0))
+ printf(" Valid\n");
+ else
+ return;
+
+ printf(" %s (%s)\n", type[reg >> 1 & 0x3],
+ reg & (1 << 11) ? "GGTT" : "PPGTT");
+ printf(" Engine %s (Source ID %d)\n", engine[reg >> 12 & 0x3],
+ reg >> 3 & 0xff);
+
+ if (intel_gen(devid) < 8)
+ printf(" Address 0x%08x\n", reg & ~((1 << 12)-1));
+}
+
#define MAX_RINGS 10 /* I really hope this never... */
uint32_t head[MAX_RINGS];
int head_ndx = 0;
@@ -520,6 +541,10 @@ read_data_file(FILE *file)
if (matched == 2)
print_fence(devid, fence);

+ matched = sscanf(line, " FAULT_REG: 0x%08x\n", &reg);
+ if (matched == 1 && reg)
+ print_fault_reg(devid, reg);
+
continue;