anv: factor out post submit queue debug code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26797>
This commit is contained in:

committed by
Marge Bot

parent
67f3fa896e
commit
c517088cf1
@@ -2056,6 +2056,23 @@ anv_trtt_batch_bo_free(struct anv_device *device,
|
||||
void anv_queue_trace(struct anv_queue *queue, const char *label,
|
||||
bool frame, bool begin);
|
||||
|
||||
static inline VkResult
|
||||
anv_queue_post_submit(struct anv_queue *queue, VkResult submit_result)
|
||||
{
|
||||
if (submit_result != VK_SUCCESS)
|
||||
return submit_result;
|
||||
|
||||
VkResult result = VK_SUCCESS;
|
||||
if (queue->sync) {
|
||||
result = vk_sync_wait(&queue->device->vk, queue->sync, 0,
|
||||
VK_SYNC_WAIT_COMPLETE, UINT64_MAX);
|
||||
if (result != VK_SUCCESS)
|
||||
result = vk_queue_set_lost(&queue->vk, "sync wait failed");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void *
|
||||
anv_gem_mmap(struct anv_device *device, struct anv_bo *bo, uint64_t offset,
|
||||
uint64_t size);
|
||||
|
@@ -918,12 +918,7 @@ i915_queue_exec_locked(struct anv_queue *queue,
|
||||
waits);
|
||||
}
|
||||
|
||||
if (result == VK_SUCCESS && queue->sync) {
|
||||
result = vk_sync_wait(&device->vk, queue->sync, 0,
|
||||
VK_SYNC_WAIT_COMPLETE, UINT64_MAX);
|
||||
if (result != VK_SUCCESS)
|
||||
result = vk_queue_set_lost(&queue->vk, "sync wait failed");
|
||||
}
|
||||
result = anv_queue_post_submit(queue, result);
|
||||
|
||||
error:
|
||||
anv_execbuf_finish(&execbuf);
|
||||
|
@@ -411,12 +411,7 @@ xe_queue_exec_locked(struct anv_queue *queue,
|
||||
wait_count, waits);
|
||||
}
|
||||
|
||||
if (result == VK_SUCCESS && queue->sync) {
|
||||
result = vk_sync_wait(&device->vk, queue->sync, 0,
|
||||
VK_SYNC_WAIT_COMPLETE, UINT64_MAX);
|
||||
if (result != VK_SUCCESS)
|
||||
result = vk_queue_set_lost(&queue->vk, "sync wait failed");
|
||||
}
|
||||
result = anv_queue_post_submit(queue, result);
|
||||
|
||||
if (result == VK_SUCCESS && utrace_submit)
|
||||
result = xe_queue_exec_utrace_locked(queue, utrace_submit);
|
||||
|
Reference in New Issue
Block a user