From 5aec9e84a86f578d0babae1d5c1800578c1c1b53 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 6 Feb 2020 04:31:27 -0600 Subject: [PATCH] anv: No-op submit and wait calls when no_hw is set Reviewed-by: Lionel Landwerlin Tested-by: Marge Bot Part-of: --- src/intel/vulkan/anv_queue.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c index b93d070711d..b9e19617d8a 100644 --- a/src/intel/vulkan/anv_queue.c +++ b/src/intel/vulkan/anv_queue.c @@ -564,6 +564,9 @@ VkResult anv_queue_submit_simple_batch(struct anv_queue *queue, struct anv_batch *batch) { + if (queue->device->no_hw) + return VK_SUCCESS; + struct anv_device *device = queue->device; struct anv_queue_submit *submit = anv_queue_submit_alloc(device); if (!submit) @@ -947,6 +950,9 @@ VkResult anv_QueueSubmit( { ANV_FROM_HANDLE(anv_queue, queue, _queue); + if (queue->device->no_hw) + return VK_SUCCESS; + /* Query for device status prior to submitting. Technically, we don't need * to do this. However, if we have a client that's submitting piles of * garbage, we would rather break as early as possible to keep the GPU @@ -1537,6 +1543,9 @@ VkResult anv_WaitForFences( { ANV_FROM_HANDLE(anv_device, device, _device); + if (device->no_hw) + return VK_SUCCESS; + if (anv_device_is_lost(device)) return VK_ERROR_DEVICE_LOST; @@ -2282,6 +2291,9 @@ VkResult anv_WaitSemaphores( { ANV_FROM_HANDLE(anv_device, device, _device); + if (device->no_hw) + return VK_SUCCESS; + struct anv_timeline **timelines = vk_alloc(&device->alloc, pWaitInfo->semaphoreCount * sizeof(*timelines), -- 2.30.2