From f5c706e438f5227599bba5f0e790346ad2091a12 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sat, 16 Sep 2023 22:25:23 +0000 Subject: [PATCH] venus: use more common vk_queue related implementations This change uses common impl for below: - GetDeviceQueue2 - DeviceWaitIdle Signed-off-by: Yiwei Zhang Part-of: --- src/virtio/vulkan/vn_device.c | 16 ---------------- src/virtio/vulkan/vn_queue.c | 19 ------------------- 2 files changed, 35 deletions(-) diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c index 52fac1a622b..d352825408d 100644 --- a/src/virtio/vulkan/vn_device.c +++ b/src/virtio/vulkan/vn_device.c @@ -650,22 +650,6 @@ vn_GetDeviceGroupPeerMemoryFeatures( pPeerMemoryFeatures); } -VkResult -vn_DeviceWaitIdle(VkDevice device) -{ - VN_TRACE_FUNC(); - struct vn_device *dev = vn_device_from_handle(device); - - for (uint32_t i = 0; i < dev->queue_count; i++) { - struct vn_queue *queue = &dev->queues[i]; - VkResult result = vn_QueueWaitIdle(vn_queue_to_handle(queue)); - if (result != VK_SUCCESS) - return vn_error(dev->instance, result); - } - - return VK_SUCCESS; -} - VkResult vn_GetCalibratedTimestampsEXT( VkDevice device, diff --git a/src/virtio/vulkan/vn_queue.c b/src/virtio/vulkan/vn_queue.c index 9371c4b26e7..c255d0d0b1c 100644 --- a/src/virtio/vulkan/vn_queue.c +++ b/src/virtio/vulkan/vn_queue.c @@ -25,25 +25,6 @@ /* queue commands */ -void -vn_GetDeviceQueue2(VkDevice device, - const VkDeviceQueueInfo2 *pQueueInfo, - VkQueue *pQueue) -{ - struct vn_device *dev = vn_device_from_handle(device); - - for (uint32_t i = 0; i < dev->queue_count; i++) { - struct vn_queue *queue = &dev->queues[i]; - if (queue->family == pQueueInfo->queueFamilyIndex && - queue->index == pQueueInfo->queueIndex && - queue->flags == pQueueInfo->flags) { - *pQueue = vn_queue_to_handle(queue); - return; - } - } - unreachable("bad queue family/index"); -} - static bool vn_semaphore_wait_external(struct vn_device *dev, struct vn_semaphore *sem);