vkr: properly check the last pending sync

sync->head.next after list_del(&sync->head) is constantly NULL.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Yiwei Zhang 3 years ago
parent 92b083bb29
commit 8b9ae3bbb6
  1. 5
      src/venus/vkr_queue.c

@ -108,9 +108,10 @@ vkr_queue_retire_syncs(struct vkr_queue *queue,
if (result == VK_NOT_READY)
break;
bool is_last_sync = sync->head.next == &queue->pending_syncs;
list_del(&sync->head);
if (sync->head.next == &queue->pending_syncs ||
!(sync->flags & VIRGL_RENDERER_FENCE_FLAG_MERGEABLE))
if (is_last_sync || !(sync->flags & VIRGL_RENDERER_FENCE_FLAG_MERGEABLE))
list_addtail(&sync->head, retired_syncs);
else
vkr_device_free_queue_sync(dev, sync);

Loading…
Cancel
Save