vkr: properly retire signaled_syncs and pending_syncs

Merged Yiwei Zhang requested to merge zzyiwei/virglrenderer:sync-retire into master

When a guest app crashes or calls vkDestroyInstance, !501 (closed) sets those remaining syncs belonging to the destroyed context to signal in the timeline, so that the syncs will later be retired known by crosvm.

When a guest app holds the instance but destroys the device and create new ones afterwards, both the signaled_syncs and pending_syncs tied to the prior device need to be retired properly.

  1. If ASYNC_FENCE_CB is set, we can retire those directly at vkr_queue_destroy.
  2. If ASYNC_FENCE_CB is not set, we destroy the VkFence at vkr_queue_destroy and move the queue sync to the context to be retired and freed in the next vkr_context_retire_fences call.

/cc @olv @ryanneph

Edited by Yiwei Zhang

Merge request reports