Module: Mesa
Branch: main
Commit: 1f0fdcb6194b1d8e223488ca44b7a149ba8d88de
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f0fdcb6194b1d8e223488ca44b7a149ba8d88de

Author: Dave Airlie <[email protected]>
Date:   Thu Feb  9 06:36:59 2023 +1000

anv: always pick graphics queue to execute prime blits on.

This will change when we get transfer queues but this should avoid
video queues being picked by accident.

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21204>

---

 src/intel/vulkan/anv_wsi.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 8260b130879..b8177924530 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -36,6 +36,19 @@ anv_wsi_proc_addr(VkPhysicalDevice physicalDevice, const 
char *pName)
    return vk_instance_get_proc_addr_unchecked(&pdevice->instance->vk, pName);
 }
 
+static VkQueue
+anv_wsi_get_prime_blit_queue(VkDevice _device)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+
+   vk_foreach_queue(_queue, &device->vk) {
+      struct anv_queue *queue = (struct anv_queue *)_queue;
+      if (queue->family->queueFlags & (VK_QUEUE_GRAPHICS_BIT | 
VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT))
+         return vk_queue_to_handle(_queue);
+   }
+   return NULL;
+}
+
 VkResult
 anv_init_wsi(struct anv_physical_device *physical_device)
 {
@@ -54,6 +67,7 @@ anv_init_wsi(struct anv_physical_device *physical_device)
    physical_device->wsi_device.supports_modifiers = true;
    physical_device->wsi_device.signal_semaphore_with_memory = true;
    physical_device->wsi_device.signal_fence_with_memory = true;
+   physical_device->wsi_device.get_blit_queue = anv_wsi_get_prime_blit_queue;
 
    physical_device->vk.wsi_device = &physical_device->wsi_device;
 

Reply via email to