Module: Mesa
Branch: main
Commit: c14a13d40ddeceaf64c982a54b164b8b88977d17
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c14a13d40ddeceaf64c982a54b164b8b88977d17

Author: Rob Clark <[email protected]>
Date:   Thu Jun  8 12:59:48 2023 -0700

tu: close submitqueues before device_finish()

Otherwise we would have already closed the device.

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>

---

 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 452c9529311..1767f5ed537 100644
--- a/src/freedreno/vulkan/tu_device.cc
+++ b/src/freedreno/vulkan/tu_device.cc
@@ -2390,6 +2390,13 @@ tu_DestroyDevice(VkDevice _device, const 
VkAllocationCallbacks *pAllocator)
    tu_bo_suballocator_finish(&device->pipeline_suballoc);
    tu_bo_suballocator_finish(&device->autotune_suballoc);
 
+   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]);
+   }
+
    tu_drm_device_finish(device);
 
    if (device->physical_device->has_set_iova)
@@ -2400,13 +2407,6 @@ tu_DestroyDevice(VkDevice _device, const 
VkAllocationCallbacks *pAllocator)
 
    u_vector_finish(&device->zombie_vmas);
 
-   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);

Reply via email to