panvk: Switch to common GetDeviceQueue and DeviceWaitIdle

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13003>
This commit is contained in:
Jason Ekstrand 2021-09-23 12:49:09 -05:00 committed by Marge Bot
parent 06ac3b1bea
commit 0793b259b0
1 changed files with 0 additions and 56 deletions

View File

@ -1070,46 +1070,6 @@ panvk_EnumerateInstanceLayerProperties(uint32_t *pPropertyCount,
return VK_SUCCESS;
}
void
panvk_GetDeviceQueue2(VkDevice _device,
const VkDeviceQueueInfo2 *pQueueInfo,
VkQueue *pQueue)
{
VK_FROM_HANDLE(panvk_device, device, _device);
struct panvk_queue *queue;
queue = &device->queues[pQueueInfo->queueFamilyIndex][pQueueInfo->queueIndex];
if (pQueueInfo->flags != queue->vk.flags) {
/* From the Vulkan 1.1.70 spec:
*
* "The queue returned by vkGetDeviceQueue2 must have the same
* flags value from this structure as that used at device
* creation time in a VkDeviceQueueCreateInfo instance. If no
* matching flags were specified at device creation time then
* pQueue will return VK_NULL_HANDLE."
*/
*pQueue = VK_NULL_HANDLE;
return;
}
*pQueue = panvk_queue_to_handle(queue);
}
void
panvk_GetDeviceQueue(VkDevice _device,
uint32_t queueFamilyIndex,
uint32_t queueIndex,
VkQueue *pQueue)
{
const VkDeviceQueueInfo2 info = (VkDeviceQueueInfo2) {
.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
.queueFamilyIndex = queueFamilyIndex,
.queueIndex = queueIndex
};
panvk_GetDeviceQueue2(_device, &info, pQueue);
}
VkResult
panvk_QueueWaitIdle(VkQueue _queue)
{
@ -1133,22 +1093,6 @@ panvk_QueueWaitIdle(VkQueue _queue)
return VK_SUCCESS;
}
VkResult
panvk_DeviceWaitIdle(VkDevice _device)
{
VK_FROM_HANDLE(panvk_device, device, _device);
if (panvk_device_is_lost(device))
return VK_ERROR_DEVICE_LOST;
for (unsigned i = 0; i < PANVK_MAX_QUEUE_FAMILIES; i++) {
for (unsigned q = 0; q < device->queue_count[i]; q++) {
panvk_QueueWaitIdle(panvk_queue_to_handle(&device->queues[i][q]));
}
}
return VK_SUCCESS;
}
VkResult
panvk_EnumerateInstanceExtensionProperties(const char *pLayerName,
uint32_t *pPropertyCount,