mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-17 22:38:06 +02:00
... as this can lead to a deadlock with the following sequence:
Time1: guest-thread-1: vkDestroyImageView() called
Time2: VkEncoder grabs seqno 1
Time3: guest-thread-2: vkQueueSubmit() called
Time4: ResourceTracker::on_vkQueueSubmitTemplate() locks
mLock for using `info_VkFence`
Time5: ResourceTracker::on_vkQueueSubmitTemplate() calls
enc->vkQueueWaitIdle()
Time6: VkEncoder grabs seqno 2
Time7: VkEncoder sends the vkQueueWaitIdle with seqno
2 via ASG to host
Time8: VkEncoder waits for the `VkResult` from the
host via `stream->read()`
Time9: guest-thread-1: VkEncoder calls sResourceTracker->destroyMapping()
->mapHandles_VkImageView((VkBuffer*)&buffer);
which calls
ResourceTracker::unregister_VkImageView()
ResourceTracker::unregister_VkImageView() tries to
lock mLock to erase the info struct
!!! DEADLOCKED HERE !!!
guest-thread-1 is stuck waiting on mLock (currently locked by
guest-thread-2) before it would `stream->flush();` to finishing
sending the vkDestroyImageView() command to the host and potentially
ping its corresponding host-render-thread-1.
guest-thread-2 is stuck waiting on the result from host-render-thread-2
but host-render-thread-2 won't progress until host-render-thread-1
finishes seqno 1 which needs guest-thread-1 to finish sending/pinging.
Android equivalent change ag/39258728 for b/498964194
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
open maps
pan/zoom/etc for a couple minutes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40767>
|
||
|---|---|---|
| .. | ||
| aemu | ||
| codegen | ||
| guest | ||
| .clang-format | ||
| meson.build | ||