summaryrefslogtreecommitdiffstats
path: root/src/intel/tools/aubinator.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-08-26 13:52:47 +0100
committerLionel Landwerlin <[email protected]>2019-03-07 15:08:31 +0000
commitec526d6ba0bdb996416b7479330a424ff737df81 (patch)
tree6b8787d8b6a816dfc818228b40128b316457ddb6 /src/intel/tools/aubinator.c
parent3e8d5b5ed48aaa37d8b83c2203f45ce55d557351 (diff)
intel/decoders: add address space indicator to get BOs
Some commands like MI_BATCH_BUFFER_START have this indicator. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
Diffstat (limited to 'src/intel/tools/aubinator.c')
-rw-r--r--src/intel/tools/aubinator.c23
1 files changed, 17 insertions, 6 deletions
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);