mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 22:20:14 +01:00
anv: implement DEBUG_SYNC
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15950>
This commit is contained in:
parent
317512e038
commit
3684012770
3 changed files with 32 additions and 0 deletions
|
|
@ -2143,6 +2143,15 @@ anv_queue_exec_locked(struct anv_queue *queue,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (queue->sync) {
|
||||
result = anv_execbuf_add_sync(device, &execbuf,
|
||||
queue->sync,
|
||||
true /* is_signal */,
|
||||
0 /* signal_value */);
|
||||
if (result != VK_SUCCESS)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (cmd_buffer_count) {
|
||||
result = setup_execbuf_for_cmd_buffers(&execbuf, queue,
|
||||
cmd_buffers,
|
||||
|
|
@ -2258,6 +2267,15 @@ anv_queue_exec_locked(struct anv_queue *queue,
|
|||
if (ret)
|
||||
result = vk_queue_set_lost(&queue->vk, "execbuf2 failed: %m");
|
||||
|
||||
if (queue->sync) {
|
||||
VkResult 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");
|
||||
}
|
||||
|
||||
struct drm_i915_gem_exec_object2 *objects = execbuf.objects;
|
||||
for (uint32_t k = 0; k < execbuf.bo_count; k++) {
|
||||
if (anv_bo_is_pinned(execbuf.bos[k]))
|
||||
|
|
|
|||
|
|
@ -1098,6 +1098,9 @@ struct anv_queue {
|
|||
|
||||
uint32_t exec_flags;
|
||||
|
||||
/** Synchronization object for debug purposes (DEBUG_SYNC) */
|
||||
struct vk_sync *sync;
|
||||
|
||||
struct intel_ds_queue * ds;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,14 @@ anv_queue_init(struct anv_device *device, struct anv_queue *queue,
|
|||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
if (INTEL_DEBUG(DEBUG_SYNC)) {
|
||||
result = vk_sync_create(&device->vk,
|
||||
&device->physical->sync_syncobj_type,
|
||||
0, 0, &queue->sync);
|
||||
vk_queue_finish(&queue->vk);
|
||||
return result;
|
||||
}
|
||||
|
||||
queue->vk.driver_submit = anv_queue_submit;
|
||||
|
||||
queue->device = device;
|
||||
|
|
@ -58,5 +66,8 @@ anv_queue_init(struct anv_device *device, struct anv_queue *queue,
|
|||
void
|
||||
anv_queue_finish(struct anv_queue *queue)
|
||||
{
|
||||
if (queue->sync)
|
||||
vk_sync_destroy(&queue->device->vk, queue->sync);
|
||||
|
||||
vk_queue_finish(&queue->vk);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue