diff --git a/src/venus/vkr_context.c b/src/venus/vkr_context.c index 2b8a1c9..a7c0124 100644 --- a/src/venus/vkr_context.c +++ b/src/venus/vkr_context.c @@ -99,7 +99,8 @@ vkr_context_submit_fence_locked(struct virgl_context *base, return -EINVAL; struct vkr_device *dev = queue->device; - struct vkr_queue_sync *sync = vkr_device_alloc_queue_sync(dev, flags, fence_cookie); + struct vkr_queue_sync *sync = + vkr_device_alloc_queue_sync(dev, flags, queue->base.id, fence_cookie); if (!sync) return -ENOMEM; @@ -162,7 +163,7 @@ vkr_context_retire_fences_locked(UNUSED struct virgl_context *base) vkr_queue_retire_syncs(queue, &retired_syncs, &queue_empty); LIST_FOR_EACH_ENTRY_SAFE (sync, sync_tmp, &retired_syncs, head) { - ctx->base.fence_retire(&ctx->base, queue->base.id, sync->fence_cookie); + ctx->base.fence_retire(&ctx->base, sync->queue_id, sync->fence_cookie); vkr_device_free_queue_sync(dev, sync); } diff --git a/src/venus/vkr_queue.c b/src/venus/vkr_queue.c index 591ff55..2350667 100644 --- a/src/venus/vkr_queue.c +++ b/src/venus/vkr_queue.c @@ -18,6 +18,7 @@ struct vkr_queue_sync * vkr_device_alloc_queue_sync(struct vkr_device *dev, uint32_t fence_flags, + uint64_t queue_id, void *fence_cookie) { struct vkr_queue_sync *sync; @@ -58,6 +59,7 @@ vkr_device_alloc_queue_sync(struct vkr_device *dev, } sync->flags = fence_flags; + sync->queue_id = queue_id; sync->fence_cookie = fence_cookie; return sync; @@ -191,7 +193,7 @@ vkr_queue_thread(void *arg) list_del(&sync->head); if (vkr_renderer_flags & VKR_RENDERER_ASYNC_FENCE_CB) { - ctx->base.fence_retire(&ctx->base, queue->base.id, sync->fence_cookie); + ctx->base.fence_retire(&ctx->base, sync->queue_id, sync->fence_cookie); vkr_device_free_queue_sync(queue->device, sync); } else { list_addtail(&sync->head, &queue->signaled_syncs); diff --git a/src/venus/vkr_queue.h b/src/venus/vkr_queue.h index 8e7bdb7..a6c8c41 100644 --- a/src/venus/vkr_queue.h +++ b/src/venus/vkr_queue.h @@ -12,6 +12,7 @@ struct vkr_queue_sync { VkFence fence; uint32_t flags; + uint64_t queue_id; void *fence_cookie; struct list_head head; @@ -81,6 +82,7 @@ vkr_context_init_event_dispatch(struct vkr_context *ctx); struct vkr_queue_sync * vkr_device_alloc_queue_sync(struct vkr_device *dev, uint32_t fence_flags, + uint64_t queue_id, void *fence_cookie); void