anv: No-op submit and wait calls when no_hw is set
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 6 Feb 2020 10:31:27 +0000 (04:31 -0600)
committerMarge Bot <eric+marge@anholt.net>
Thu, 6 Feb 2020 10:48:33 +0000 (10:48 +0000)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3734>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3734>

src/intel/vulkan/anv_queue.c

index b93d070711de22c2027b46fb1aea167cdf6418c0..b9e19617d8a5febfcd7af13ee61d038c171a067c 100644 (file)
@@ -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),