From aa07d8a04c4b02ddd57d1a00aebb8b95134fe0a3 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Wed, 28 Feb 2024 13:00:26 -0800 Subject: [PATCH] anv/sparse: don't issue a single bind operation per vm_bind ioctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The xe.ko driver finally fixed bug 746, which means we can finally pass multiple bind operations in a single ioctl. There's a dEQP test that issues 960 bind operations in a single call, so our gains here have potential, although most real-world apps are not even remotely close to this. Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/746 Reviewed-by: José Roberto de Souza Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_sparse.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index 83758f7f901..09002fe8117 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -624,24 +624,9 @@ anv_sparse_bind_vm_bind(struct anv_device *device, if (result != VK_SUCCESS) return vk_queue_set_lost(&queue->vk, "vk_sync_wait failed"); - /* FIXME: here we were supposed to issue a single vm_bind ioctl by calling - * vm_bind(device, num_binds, binds), but for an unknown reason some - * shader-related tests fail when we do that, so work around it for now. - * See: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/746 - */ - for (int b = 0; b < submit->binds_len; b++) { - struct anv_sparse_submission s = { - .queue = submit->queue, - .binds = &submit->binds[b], - .binds_len = 1, - .binds_capacity = 1, - .wait_count = 0, - .signal_count = 0, - }; - int rc = device->kmd_backend->vm_bind(device, &s); - if (rc) - return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY); - } + int rc = device->kmd_backend->vm_bind(device, submit); + if (rc) + return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY); for (uint32_t i = 0; i < submit->signal_count; i++) { struct vk_sync_signal *s = &submit->signals[i];