Mesa (master): intel/tools/aub_dump: fix crash when using the default legacy context

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 25 19:19:28 UTC 2020


Module: Mesa
Branch: master
Commit: 31461e2379321cb0d4eeb28fb74fd78d2fd0bff6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=31461e2379321cb0d4eeb28fb74fd78d2fd0bff6

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Sat Jan 11 17:05:46 2020 +0200

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 <lionel.g.landwerlin at intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3705>

---

 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



More information about the mesa-commit mailing list