From 31461e2379321cb0d4eeb28fb74fd78d2fd0bff6 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 11 Jan 2020 17:05:46 +0200 Subject: [PATCH] intel/tools/aub_dump: fix crash when using the default legacy context When execbuffer->rsvd1 == 0, the legacy context is used. Ensure we have context created for this. Signed-off-by: Lionel Landwerlin Reviewed-by: Rafael Antognolli Part-of: --- src/intel/tools/aub_write.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/intel/tools/aub_write.c b/src/intel/tools/aub_write.c index b6d96fc88a3..70ec195a7cb 100644 --- a/src/intel/tools/aub_write.c +++ b/src/intel/tools/aub_write.c @@ -51,10 +51,10 @@ _a > _b ? _a : _b; \ }) -static void -mem_trace_memory_write_header_out(struct aub_file *aub, uint64_t addr, - uint32_t len, uint32_t addr_space, - const char *desc); +static struct aub_context *aub_context_new(struct aub_file *aub, uint32_t new_id); +static void mem_trace_memory_write_header_out(struct aub_file *aub, uint64_t addr, + uint32_t len, uint32_t addr_space, + const char *desc); static void __attribute__ ((format(__printf__, 2, 3))) fail_if(int cond, const char *format, ...) @@ -190,6 +190,7 @@ aub_file_init(struct aub_file *aub, FILE *file, FILE *debug, uint16_t pci_id, co dword_out(aub, 0); aub->next_context_handle = 1; + aub_context_new(aub, 0); /* Default context */ } void -- 2.30.2