summaryrefslogtreecommitdiff
path: root/tools/intel_error_decode.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-08 11:56:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-08 12:17:31 +0100
commit95374225e865da3a30153f73e8bb536700d15459 (patch)
treeab8797a6f255a0d76e5d8e7439b8fe4a9b34ca90 /tools/intel_error_decode.c
parentcd64e193299be4b9733a5e804cedd99e2072830f (diff)
Enable compilation on non-Intel, non-DRM systems.
A few of the tools can be performed post-mortem from a different system, so it is useful to be able to compile those tools on those foreign systems. Obviously, any program to interact with the PCI device or talk to GEM will fail on a non-Intel system. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools/intel_error_decode.c')
-rw-r--r--tools/intel_error_decode.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index d4bf8bcf..af205dc3 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -55,9 +55,15 @@
#include "instdone.h"
static void
-print_instdone (unsigned int instdone, unsigned int instdone1)
+print_instdone (uint32_t devid, unsigned int instdone, unsigned int instdone1)
{
int i;
+ static int once;
+
+ if (!once) {
+ init_instdone_definitions(devid);
+ once = 1;
+ }
for (i = 0; i < num_instdone_bits; i++) {
int busy = 0;
@@ -190,11 +196,11 @@ read_data_file (const char * filename)
matched = sscanf (line, " INSTDONE: 0x%08x\n", &reg);
if (matched)
- print_instdone (reg, -1);
+ print_instdone (devid, reg, -1);
matched = sscanf (line, " INSTDONE1: 0x%08x\n", &reg);
if (matched)
- print_instdone (-1, reg);
+ print_instdone (devid, -1, reg);
continue;
}
@@ -247,8 +253,6 @@ main (int argc, char *argv[])
return 1;
}
- init_instdone_definitions();
-
if (argc == 1) {
path = "/debug/dri/0";
err = stat (path, &st);