From 7dec49e7733e7b2237e63648fa3f43ab419b7d33 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Wed, 21 Jun 2023 15:43:46 +0000 Subject: [PATCH] Remove vkDeviceWaitIdle call when destroying VulkanSurface vkDeviceWaitIdle requires external synchronization of all queues created from the VkDevice, which would mean that we would need to add locking to the AHB uploader queue for this to be thread-safe. However, we should not need to wait for queue submissions for the AHB uploader at all for destroying the output surface, because the AHB uploader queue is meant for swizzling bitmaps - there's no dependency on the output surface. So, it is just sufficient to wait on submission of the graphics queue, which is currently thread-safe as all graphics queue operations occur only on renderthread. Bug: 288201932 Change-Id: Ia3ca1600f22941d9900b2e5451f7572a79abf049 Test: builds Test: com.android.launcher3.ui.TaplTestsLauncher3#testDragShortcutToWorkspaceCell 99 times --- libs/hwui/renderthread/VulkanManager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp index d4e919fefbbd2..31a92ac5ab239 100644 --- a/libs/hwui/renderthread/VulkanManager.cpp +++ b/libs/hwui/renderthread/VulkanManager.cpp @@ -657,7 +657,6 @@ void VulkanManager::destroySurface(VulkanSurface* surface) { if (VK_NULL_HANDLE != mGraphicsQueue) { mQueueWaitIdle(mGraphicsQueue); } - mDeviceWaitIdle(mDevice); delete surface; }