From 28902b4746cf5b9decc40ae363daff02045de35a Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 16 Aug 2022 12:10:34 -0700 Subject: [PATCH] turnip: lower the queue priority to 1 To match the default priority of the gallium driver. Cc: mesa-stable Part-of: (cherry picked from commit 0c6fbfca0c91ef012e8ab767a317c07f1f6dc5e6) --- .pick_status.json | 2 +- src/freedreno/vulkan/tu_device.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 3b54be0ddbd..4b10edca476 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,7 @@ "description": "turnip: lower the queue priority to 1", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index ebaebf52bef..672881464c7 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -1474,6 +1474,20 @@ tu_queue_init(struct tu_device *device, int idx, const VkDeviceQueueCreateInfo *create_info) { + + /* Match the default priority of fd_context_init. We ignore + * pQueuePriorities because the spec says + * + * An implementation may allow a higher-priority queue to starve a + * lower-priority queue on the same VkDevice until the higher-priority + * queue has no further commands to execute. The relationship of queue + * priorities must not cause queues on one VkDevice to starve queues on + * another VkDevice. + * + * We cannot let one VkDevice starve another. + */ + const int priority = 1; + VkResult result = vk_queue_init(&queue->vk, &device->vk, create_info, idx); if (result != VK_SUCCESS) return result; @@ -1483,7 +1497,7 @@ tu_queue_init(struct tu_device *device, queue->vk.driver_submit = tu_queue_submit; #endif - int ret = tu_drm_submitqueue_new(device, 0, &queue->msm_queue_id); + int ret = tu_drm_submitqueue_new(device, priority, &queue->msm_queue_id); if (ret) return vk_startup_errorf(device->instance, VK_ERROR_INITIALIZATION_FAILED, "submitqueue create failed");