summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-11-09 16:49:11 +0000
committerLionel Landwerlin <[email protected]>2018-11-16 11:39:54 +0000
commit59c1059528bcbc339743104b486fc4aadd959017 (patch)
tree31b9e6a33a982ec299b7c793797263f2c4b09e8a
parent25443cbb72048900f3ff06fdb7a68aef6eea39ff (diff)
intel/aubinator: fix ring buffer pointer
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]> Reviewed-by: Toni Lönnberg <[email protected]>
-rw-r--r--src/intel/tools/aubinator.c4
-rw-r--r--src/intel/tools/aubinator_viewer.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 4dc1fefaa5a..fe63ff3b96b 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -150,7 +150,7 @@ handle_execlist_write(void *user_data, enum drm_i915_gem_engine_class engine, ui
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;
if (context_descriptor & 0x100 /* ppgtt */) {
batch_ctx.get_bo = aub_mem_get_ppgtt_bo;
@@ -161,7 +161,7 @@ handle_execlist_write(void *user_data, enum drm_i915_gem_engine_class engine, ui
batch_ctx.engine = engine;
gen_print_batch(&batch_ctx, commands,
MIN2(ring_buffer_tail - ring_buffer_head, ring_buffer_length),
- 0);
+ ring_bo.addr + ring_buffer_head);
aub_mem_clear_bo_maps(&mem);
}
diff --git a/src/intel/tools/aubinator_viewer.cpp b/src/intel/tools/aubinator_viewer.cpp
index e7034fa8892..085ef75555c 100644
--- a/src/intel/tools/aubinator_viewer.cpp
+++ b/src/intel/tools/aubinator_viewer.cpp
@@ -730,14 +730,14 @@ display_batch_execlist_write(void *user_data,
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;
window->decode_ctx.engine = engine;
aub_viewer_render_batch(&window->decode_ctx, commands,
MIN2(ring_buffer_tail - ring_buffer_head, ring_buffer_length),
- ring_buffer_start);
+ ring_buffer_start + ring_buffer_head);
}
static void