anv: Fix output of INTEL_DEBUG=bat for chained batches
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Mon, 28 Oct 2019 21:46:23 +0000 (14:46 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 29 Oct 2019 02:34:54 +0000 (19:34 -0700)
The anv_batch_bo contents are linked one to another, and when printing
we have to start with the first of those.  Since in `u_vector` new
elements are added to the head, to get the first element we need the
vector's tail.

Fixes: 32ffd90002b ("anv: add support for INTEL_DEBUG=bat")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_batch_chain.c

index 0d4da389da1b23c2c677d6ede821cf90ae17d5a7..0e1a2e496ecb570a7e9ed56ecad247208fbc66b6 100644 (file)
@@ -1732,7 +1732,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
 
    if (cmd_buffer) {
       if (unlikely(INTEL_DEBUG & DEBUG_BATCH)) {
-         struct anv_batch_bo **bo = u_vector_head(&cmd_buffer->seen_bbos);
+         struct anv_batch_bo **bo = u_vector_tail(&cmd_buffer->seen_bbos);
 
          device->cmd_buffer_being_decoded = cmd_buffer;
          gen_print_batch(&device->decoder_ctx, (*bo)->bo.map,