summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2017-09-21 14:57:24 -0700
committerKenneth Graunke <kenneth@whitecape.org>2017-09-21 15:01:45 -0700
commit7c2650a1ec9a2e9c036169a2acda584a692a7050 (patch)
tree58db287d73db3fa8ed62f57451d3390d29376cc8
parentf86dc17cfc81f53f3bf216009ffda1ac05208bcc (diff)
intel_aubdump: Support I915_EXEC_BATCH_FIRST.
The batch is now on the other end of the list. Fixes issues where modern Mesa and modern kernels together start putting the batch at the front of the list, and intel_aubdump looks for it at the end of the list, causing it to interpret some other buffer as the batch. Then AubLoad or aubinator see bogus data like 1.0 float as a GPU command and get grumpy.
-rw-r--r--tools/aubdump.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 4392e589..78d183f4 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -99,6 +99,10 @@ struct drm_i915_gem_userptr {
#define IS_USERPTR(p) ((uintptr_t) (p) & USERPTR_FLAG)
#define GET_PTR(p) ( (void *) ((uintptr_t) p & ~(uintptr_t) 1) )
+#ifndef I915_EXEC_BATCH_FIRST
+#define I915_EXEC_BATCH_FIRST (1 << 18)
+#endif
+
static void __attribute__ ((format(__printf__, 2, 3)))
fail_if(int cond, const char *format, ...)
{
@@ -449,7 +453,9 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
fail_if(bo->map == MAP_FAILED, "intel_aubdump: bo mmap failed\n");
}
- batch_bo = get_bo(exec_objects[execbuffer2->buffer_count - 1].handle);
+ int batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 :
+ execbuffer2->buffer_count - 1;
+ batch_bo = get_bo(exec_objects[batch_index].handle);
for (uint32_t i = 0; i < execbuffer2->buffer_count; i++) {
obj = &exec_objects[i];
bo = get_bo(obj->handle);