summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-10-12 10:32:12 +0200
committerThierry Reding <treding@nvidia.com>2017-11-06 15:58:39 +0100
commit7d2758f25d9c94e8a597718535857c586c3ca21c (patch)
tree90494313032fffc937d27909fddb31290ff3146f /tools
parentf301482bb413a937779080d7f6d828bf4b99cbe9 (diff)
tools/aubdump: Avoid ISO C90 warning
GCC will warn about ISO C90 forbidding to mix declarations and code. Declare the variable at the beginning of the function to suppress the warning. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/aubdump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 1aeff5f4..6ba3cb66 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,7 +461,7 @@ 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 :
+ 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++) {