From 36b4d12f02586aa6a227f47d4f5d9edce68da07e Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 10 Nov 2021 09:33:57 -0600 Subject: [PATCH] anv: Simplify submit_simple_batch() BO waits aren't going away any time soon so using a syncobj here doesn't really gain us anything. It just makes it more complicated. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_batch_chain.c | 37 ++++-------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 465486f2eae..8fc51e03b30 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -2308,48 +2308,21 @@ anv_queue_submit_simple_batch(struct anv_queue *queue, .rsvd2 = 0, }; - struct drm_i915_gem_exec_fence fence = {}; - if (device->physical->has_syncobj_wait) { - err = drmSyncobjCreate(device->fd, 0, &fence.handle); - if (err != 0) { - result = vk_errorf(queue, VK_ERROR_OUT_OF_DEVICE_MEMORY, - "drmSyncobjCreate failed: %m"); - goto fail; - } - - fence.flags = I915_EXEC_FENCE_SIGNAL; - - execbuf.execbuf.flags |= I915_EXEC_FENCE_ARRAY; - execbuf.execbuf.num_cliprects = 1; - execbuf.execbuf.cliprects_ptr = (uintptr_t)&fence; - } - err = anv_gem_execbuffer(device, &execbuf.execbuf); if (err) { result = vk_device_set_lost(&device->vk, "anv_gem_execbuffer failed: %m"); goto fail; } - if (fence.handle) { - err = drmSyncobjWait(device->fd, &fence.handle, 1, INT64_MAX, 0, NULL); - if (err) { - result = vk_device_set_lost(&device->vk, - "drmSyncobjWait failed: %m"); - goto fail; - } - } else { - result = anv_device_wait(device, batch_bo, INT64_MAX); - if (result != VK_SUCCESS) { - result = vk_device_set_lost(&device->vk, - "anv_device_wait failed: %m"); - goto fail; - } + result = anv_device_wait(device, batch_bo, INT64_MAX); + if (result != VK_SUCCESS) { + result = vk_device_set_lost(&device->vk, + "anv_device_wait failed: %m"); + goto fail; } fail: anv_execbuf_finish(&execbuf); - if (fence.handle) - drmSyncobjDestroy(device->fd, fence.handle); anv_bo_pool_free(&device->batch_bo_pool, batch_bo); return result;