summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-04-12 17:04:31 -0700
committerEric Anholt <eric@anholt.net>2009-04-12 17:04:31 -0700
commitd69042dde69ca4a04f5e949130026447b8890cfc (patch)
tree27b10f97adbbe9fd856bd40e0f9140b4de51ea96
parent593a47f00e3c9cb3f748daae7d3fe04427c7e0c2 (diff)
intel_gpu_dump: Decode the GTT offset of batchbuffers.
-rw-r--r--tools/intel_gpu_dump.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/intel_gpu_dump.c b/tools/intel_gpu_dump.c
index 3caa2b337..2e584bec3 100644
--- a/tools/intel_gpu_dump.c
+++ b/tools/intel_gpu_dump.c
@@ -1788,6 +1788,7 @@ read_data_file (const char * filename, uint32_t **data_ret, int *count_ret)
char *line = NULL;
size_t line_size;
uint32_t offset, value;
+ uint32_t gtt_offset = 0, new_gtt_offset;
file = fopen (filename, "r");
if (file == NULL) {
@@ -1799,6 +1800,17 @@ read_data_file (const char * filename, uint32_t **data_ret, int *count_ret)
while (getline (&line, &line_size, file) > 0) {
line_number++;
+ matched = sscanf (line, "--- gtt_offset = 0x%08x\n", &new_gtt_offset);
+ if (matched == 1) {
+ if (count) {
+ printf("buffer at 0x%08x:\n", gtt_offset);
+ intel_decode (data, count, gtt_offset, devid);
+ count = 0;
+ }
+ gtt_offset = new_gtt_offset;
+ continue;
+ }
+
matched = sscanf (line, "%08x : %08x", &offset, &value);
if (matched !=2 ) {
fprintf (stderr, "Warning: Ignoring unrecognized line at %s:%d:\n%s",
@@ -1820,12 +1832,15 @@ read_data_file (const char * filename, uint32_t **data_ret, int *count_ret)
data[count-1] = value;
}
+ if (count) {
+ printf("Batchbuffer at 0x%08x:\n", gtt_offset);
+ intel_decode (data, count, gtt_offset, devid);
+ }
+
+ free (data);
free (line);
fclose (file);
-
- *data_ret = data;
- *count_ret = count;
}
/* By default, we'll want to grab the state of the current hardware
@@ -1864,9 +1879,5 @@ main (int argc, char *argv[])
read_data_file (filename, &data, &count);
- intel_decode (data, count, 0, devid);
-
- free (data);
-
return 0;
}