radv: Add submit locking with trace bo.
Otherwise cmdbuffers from different queues can override the trace id from each other, making for a very confusing hang report. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14868>
This commit is contained in:
committed by
Marge Bot
parent
e3cbc328e0
commit
8d5be0a2b3
@@ -3038,6 +3038,7 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
|
||||
|
||||
device->instance = physical_device->instance;
|
||||
device->physical_device = physical_device;
|
||||
simple_mtx_init(&device->trace_mtx, mtx_plain);
|
||||
|
||||
device->ws = physical_device->ws;
|
||||
device->vk.create_sync_for_memory = radv_create_sync_for_memory;
|
||||
@@ -3307,6 +3308,7 @@ fail:
|
||||
device->ws->ctx_destroy(device->hw_ctx[i]);
|
||||
}
|
||||
|
||||
simple_mtx_destroy(&device->trace_mtx);
|
||||
mtx_destroy(&device->overallocation_mutex);
|
||||
|
||||
vk_device_finish(&device->vk);
|
||||
@@ -3346,6 +3348,7 @@ radv_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator)
|
||||
}
|
||||
|
||||
mtx_destroy(&device->overallocation_mutex);
|
||||
simple_mtx_destroy(&device->trace_mtx);
|
||||
|
||||
radv_device_finish_meta(device);
|
||||
|
||||
@@ -4370,6 +4373,9 @@ radv_queue_submit(struct vk_queue *vqueue, struct vk_queue_submit *submission)
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
} else {
|
||||
if (queue->device->trace_bo)
|
||||
simple_mtx_lock(&queue->device->trace_mtx);
|
||||
|
||||
struct radeon_cmdbuf **cs_array =
|
||||
malloc(sizeof(struct radeon_cmdbuf *) * (submission->command_buffer_count));
|
||||
|
||||
@@ -4401,6 +4407,8 @@ radv_queue_submit(struct vk_queue *vqueue, struct vk_queue_submit *submission)
|
||||
can_patch);
|
||||
if (result != VK_SUCCESS) {
|
||||
free(cs_array);
|
||||
if (queue->device->trace_bo)
|
||||
simple_mtx_unlock(&queue->device->trace_mtx);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -4414,6 +4422,8 @@ radv_queue_submit(struct vk_queue *vqueue, struct vk_queue_submit *submission)
|
||||
}
|
||||
|
||||
free(cs_array);
|
||||
if (queue->device->trace_bo)
|
||||
simple_mtx_unlock(&queue->device->trace_mtx);
|
||||
}
|
||||
|
||||
fail:
|
||||
|
||||
@@ -865,6 +865,8 @@ struct radv_device {
|
||||
|
||||
struct radv_shader_prolog *simple_vs_prologs[MAX_VERTEX_ATTRIBS];
|
||||
struct radv_shader_prolog *instance_rate_vs_prologs[816];
|
||||
|
||||
simple_mtx_t trace_mtx;
|
||||
};
|
||||
|
||||
struct radv_device_memory {
|
||||
|
||||
Reference in New Issue
Block a user