Mesa (master): anv: No-op submit and wait calls when no_hw is set

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 6 11:22:46 UTC 2020


Module: Mesa
Branch: master
Commit: 5aec9e84a86f578d0babae1d5c1800578c1c1b53
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5aec9e84a86f578d0babae1d5c1800578c1c1b53

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Feb  6 04:31:27 2020 -0600

anv: No-op submit and wait calls when no_hw is set

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at 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 | 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),



More information about the mesa-commit mailing list