From d2f9346d9d5e5733b010b15129ae71dffe8d9367 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 10 May 2023 10:42:17 -0700 Subject: [PATCH] tu: Move queue deletion to last For zombie vma tracking, we'll need access to the queue at bo deletion time. This simplest way to make that work is just move queue deletion to late in device teardown. Signed-off-by: Rob Clark Part-of: --- src/freedreno/vulkan/tu_device.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index d2434cac5f6..cd138edd827 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -2486,13 +2486,6 @@ tu_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator) u_trace_context_fini(&device->trace_context); - for (unsigned i = 0; i < TU_MAX_QUEUE_FAMILIES; i++) { - for (unsigned q = 0; q < device->queue_count[i]; q++) - tu_queue_finish(&device->queues[i][q]); - if (device->queue_count[i]) - vk_free(&device->vk.alloc, device->queues[i]); - } - for (unsigned i = 0; i < ARRAY_SIZE(device->scratch_bos); i++) { if (device->scratch_bos[i].initialized) tu_bo_finish(device, device->scratch_bos[i].bo); @@ -2541,6 +2534,13 @@ tu_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator) util_sparse_array_finish(&device->bo_map); u_rwlock_destroy(&device->dma_bo_lock); + for (unsigned i = 0; i < TU_MAX_QUEUE_FAMILIES; i++) { + for (unsigned q = 0; q < device->queue_count[i]; q++) + tu_queue_finish(&device->queues[i][q]); + if (device->queue_count[i]) + vk_free(&device->vk.alloc, device->queues[i]); + } + pthread_cond_destroy(&device->timeline_cond); _mesa_hash_table_destroy(device->bo_sizes, NULL); vk_free(&device->vk.alloc, device->bo_list);