[Intel-gfx] [PATCH i-g-t 2/5] aubdump: Avoid mixing declarations and code
Tvrtko Ursulin
tursulin at ursulin.net
Wed Nov 8 12:06:51 UTC 2017
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Avoids the build warning about ISO C90 forbiding mixing the two.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
tools/aubdump.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 1aeff5f4532c..27709a17abbc 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -407,6 +407,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
uint32_t offset = gtt_size();
struct drm_i915_gem_exec_object2 *obj;
struct bo *bo, *batch_bo;
+ int batch_index;
void *data;
/* We can't do this at open time as we're not yet authenticated. */
@@ -460,8 +461,8 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
fail_if(bo->map == MAP_FAILED, "intel_aubdump: bo mmap failed\n");
}
- int batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 :
- execbuffer2->buffer_count - 1;
+ 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];
--
2.14.1
More information about the Intel-gfx
mailing list