From ec526d6ba0bdb996416b7479330a424ff737df81 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 26 Aug 2018 13:52:47 +0100 Subject: intel/decoders: add address space indicator to get BOs Some commands like MI_BATCH_BUFFER_START have this indicator. Signed-off-by: Lionel Landwerlin Reviewed-by: Rafael Antognolli --- src/intel/tools/aubinator.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/intel/tools/aubinator.c') diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c index fe63ff3b96b..1108604fdfe 100644 --- a/src/intel/tools/aubinator.c +++ b/src/intel/tools/aubinator.c @@ -129,6 +129,15 @@ aubinator_init(void *user_data, int aub_pci_id, const char *app_name) fprintf(outfile, "\n"); } +static struct gen_batch_decode_bo +get_bo(void *user_data, bool ppgtt, uint64_t addr) +{ + if (ppgtt) + return aub_mem_get_ppgtt_bo(user_data, addr); + else + return aub_mem_get_ggtt_bo(user_data, addr); +} + static void handle_execlist_write(void *user_data, enum drm_i915_gem_engine_class engine, uint64_t context_descriptor) { @@ -152,11 +161,7 @@ handle_execlist_write(void *user_data, enum drm_i915_gem_engine_class engine, ui assert(ring_bo.size > 0); 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; - } else { - batch_ctx.get_bo = aub_mem_get_ggtt_bo; - } + batch_ctx.get_bo = get_bo; batch_ctx.engine = engine; gen_print_batch(&batch_ctx, commands, @@ -165,12 +170,18 @@ handle_execlist_write(void *user_data, enum drm_i915_gem_engine_class engine, ui aub_mem_clear_bo_maps(&mem); } +static struct gen_batch_decode_bo +get_legacy_bo(void *user_data, bool ppgtt, uint64_t addr) +{ + return aub_mem_get_ggtt_bo(user_data, addr); +} + static void handle_ring_write(void *user_data, enum drm_i915_gem_engine_class engine, const void *data, uint32_t data_len) { batch_ctx.user_data = &mem; - batch_ctx.get_bo = aub_mem_get_ggtt_bo; + batch_ctx.get_bo = get_legacy_bo; batch_ctx.engine = engine; gen_print_batch(&batch_ctx, data, data_len, 0); -- cgit v1.2.3