We can only start parsing commands from the head pointer. This was
working fine up to now because we only dealt with a "made up" ring
buffer (generated by aub_write) which always had its head at 0.

Signed-off-by: Lionel Landwerlin <[email protected]>
---
 src/intel/tools/aubinator.c          | 4 ++--
 src/intel/tools/aubinator_viewer.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 59c30a7e810..7c171193c5a 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -148,14 +148,14 @@ handle_execlist_write(void *user_data, enum gen_engine 
engine, uint64_t context_
    struct gen_batch_decode_bo ring_bo = aub_mem_get_ggtt_bo(&mem,
                                                             ring_buffer_start);
    assert(ring_bo.size > 0);
-   void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - 
ring_bo.addr);
+   void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - 
ring_bo.addr) + ring_buffer_head;
 
    batch_ctx.get_bo = get_bo;
 
    (void)engine; /* TODO */
    gen_print_batch(&batch_ctx, commands,
                    MIN2(ring_buffer_tail - ring_buffer_head, 
ring_buffer_length),
-                   0, true);
+                   ring_bo.addr + ring_buffer_head, true);
    aub_mem_clear_bo_maps(&mem);
 }
 
diff --git a/src/intel/tools/aubinator_viewer.cpp 
b/src/intel/tools/aubinator_viewer.cpp
index 09e3bf37dd5..bd46e0c8530 100644
--- a/src/intel/tools/aubinator_viewer.cpp
+++ b/src/intel/tools/aubinator_viewer.cpp
@@ -729,13 +729,13 @@ display_batch_execlist_write(void *user_data, enum 
gen_engine engine,
    struct gen_batch_decode_bo ring_bo =
       aub_mem_get_ggtt_bo(&window->mem, ring_buffer_start);
    assert(ring_bo.size > 0);
-   void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - 
ring_bo.addr);
+   void *commands = (uint8_t *)ring_bo.map + (ring_buffer_start - 
ring_bo.addr) + ring_buffer_head;
 
    window->uses_ppgtt = true;
 
    aub_viewer_render_batch(&window->decode_ctx, commands,
                            MIN2(ring_buffer_tail - ring_buffer_head, 
ring_buffer_length),
-                           ring_buffer_start, true);
+                           ring_buffer_start + ring_buffer_head, true);
 }
 
 static void
-- 
2.19.0.rc1

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to