Mesa (master): i965: Add debugging code to dump the validation list.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Mar 1 23:46:24 UTC 2018


Module: Mesa
Branch: master
Commit: b04c5cece7764967e834f4ca0ce5d650df5f8893
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b04c5cece7764967e834f4ca0ce5d650df5f8893

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Nov 28 10:07:43 2017 -0800

i965: Add debugging code to dump the validation list.

When anything goes wrong with this code, dumping the validation list
is a useful way to figure out what's happening.

---

 src/mesa/drivers/dri/i965/intel_batchbuffer.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 5385347dba..c16f7c4d74 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -55,6 +55,28 @@
 static void
 intel_batchbuffer_reset(struct brw_context *brw);
 
+UNUSED static void
+dump_validation_list(struct intel_batchbuffer *batch)
+{
+   fprintf(stderr, "Validation list (length %d):\n", batch->exec_count);
+
+   for (int i = 0; i < batch->exec_count; i++) {
+      uint64_t flags = batch->validation_list[i].flags;
+      assert(batch->validation_list[i].handle ==
+             batch->exec_bos[i]->gem_handle);
+      fprintf(stderr, "[%2d]: %2d %-14s %p %s%-7s @ 0x%016llu%s (%"PRIu64"B)\n",
+              i,
+              batch->validation_list[i].handle,
+              batch->exec_bos[i]->name,
+              batch->exec_bos[i],
+              (flags & EXEC_OBJECT_SUPPORTS_48B_ADDRESS) ? "(48b" : "(32b",
+              (flags & EXEC_OBJECT_WRITE) ? " write)" : ")",
+              batch->validation_list[i].offset,
+              (flags & EXEC_OBJECT_PINNED) ? " (pinned)" : "",
+              batch->exec_bos[i]->size);
+   }
+}
+
 static bool
 uint_key_compare(const void *a, const void *b)
 {




More information about the mesa-commit mailing list