mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 20:10:24 +01:00
venus: fix the queue init failure path
The prior behavior can ignore certain failure result, and might also clean up queues that are never initialized. Fixes:ddd7533055("venus: initial support for queue/fence/semaphore") Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Ryan Neph <ryanneph@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16731> (cherry picked from commitcb8dfa4966)
This commit is contained in:
parent
e4c8e591cc
commit
0e3d908eb2
2 changed files with 10 additions and 12 deletions
|
|
@ -553,7 +553,7 @@
|
|||
"description": "venus: fix the queue init failure path",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "ddd753305598c8ac097542c0366508c47b423dce"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -89,28 +89,26 @@ vn_device_init_queues(struct vn_device *dev,
|
|||
if (!queues)
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
|
||||
VkResult result = VK_SUCCESS;
|
||||
count = 0;
|
||||
for (uint32_t i = 0; i < create_info->queueCreateInfoCount; i++) {
|
||||
VkResult result;
|
||||
|
||||
const VkDeviceQueueCreateInfo *queue_info =
|
||||
&create_info->pQueueCreateInfos[i];
|
||||
for (uint32_t j = 0; j < queue_info->queueCount; j++) {
|
||||
result = vn_queue_init(dev, &queues[count], queue_info, j);
|
||||
if (result != VK_SUCCESS)
|
||||
break;
|
||||
if (result != VK_SUCCESS) {
|
||||
for (uint32_t k = 0; k < count; k++)
|
||||
vn_queue_fini(&queues[k]);
|
||||
vk_free(alloc, queues);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != VK_SUCCESS) {
|
||||
for (uint32_t i = 0; i < count; i++)
|
||||
vn_queue_fini(&queues[i]);
|
||||
vk_free(alloc, queues);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
dev->queues = queues;
|
||||
dev->queue_count = count;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue