diff options
author | Scott D Phillips <scott.d.phillips@intel.com> | 2017-12-06 15:11:21 -0800 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2017-12-07 10:47:08 -0800 |
commit | a08db1f0124a5bb64e0af070fa0800a19eff8583 (patch) | |
tree | 071b7f0fd651bdfe421d5f18bf75a6d6dc165c60 /tools | |
parent | 539a86ec60351329c534d5862a26a1060619841e (diff) |
tools/intel_aubdump: Set addr_bits before write_header
write_header() uses addr_bits, so do the initialization earlier.
Also set the gen to a non-zero value in case of unknown device,
for use by a later patch.
Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/aubdump.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/aubdump.c b/tools/aubdump.c index 6ba3cb66..5def6947 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -417,6 +417,15 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) } if (gen == 0) { gen = intel_gen(device); + + /* If we don't know the device gen, then it probably is a + * newer device. Set gen to some arbitrarily high number. + */ + if (gen == 0) + gen = 9999; + + addr_bits = gen >= 8 ? 48 : 32; + write_header(); if (verbose) @@ -425,11 +434,6 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) filename, device, gen); } - /* If we don't know the device gen, then it probably is a - * newer device which uses 48-bit addresses. - */ - addr_bits = (gen >= 8 || gen == 0) ? 48 : 32; - if (verbose) printf("Dumping execbuffer2:\n"); |