From 78c1f66add4e3ff1a00bb4711614cd96d09e5c7e Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 2 Aug 2021 21:56:52 +0000 Subject: [PATCH] vkr: refactor vkr_queue to use track_head Signed-off-by: Yiwei Zhang Reviewed-by: Chia-I Wu Reviewed-by: Ryan Neph --- src/venus/vkr_device.c | 2 +- src/venus/vkr_queue.c | 9 +++++---- src/venus/vkr_queue.h | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/venus/vkr_device.c b/src/venus/vkr_device.c index f79213b..37b2819 100644 --- a/src/venus/vkr_device.c +++ b/src/venus/vkr_device.c @@ -300,7 +300,7 @@ vkr_device_destroy(struct vkr_context *ctx, struct vkr_device *dev) } struct vkr_queue *queue, *queue_tmp; - LIST_FOR_EACH_ENTRY_SAFE (queue, queue_tmp, &dev->queues, head) + LIST_FOR_EACH_ENTRY_SAFE (queue, queue_tmp, &dev->queues, base.track_head) vkr_queue_destroy(ctx, queue); struct vkr_queue_sync *sync, *sync_tmp; diff --git a/src/venus/vkr_queue.c b/src/venus/vkr_queue.c index 922c81b..576028c 100644 --- a/src/venus/vkr_queue.c +++ b/src/venus/vkr_queue.c @@ -145,8 +145,8 @@ vkr_queue_destroy(struct vkr_context *ctx, struct vkr_queue *queue) mtx_destroy(&queue->mutex); cnd_destroy(&queue->cond); - list_del(&queue->head); list_del(&queue->busy_head); + list_del(&queue->base.track_head); util_hash_table_remove_u64(ctx->object_table, queue->base.id); } @@ -211,7 +211,7 @@ vkr_queue_create(struct vkr_context *ctx, struct vkr_queue *queue; int ret; - LIST_FOR_EACH_ENTRY (queue, &dev->queues, head) { + LIST_FOR_EACH_ENTRY (queue, &dev->queues, base.track_head) { if (queue->flags == flags && queue->family == family && queue->index == index) return queue; } @@ -256,10 +256,11 @@ vkr_queue_create(struct vkr_context *ctx, queue->eventfd = ctx->fence_eventfd; } - /* currently queues are not tracked as device objects */ - list_addtail(&queue->head, &dev->queues); list_inithead(&queue->busy_head); + /* queues are not tracked as device objects */ + list_addtail(&queue->base.track_head, &dev->queues); + util_hash_table_set_u64(ctx->object_table, queue->base.id, queue); return queue; diff --git a/src/venus/vkr_queue.h b/src/venus/vkr_queue.h index 926c54a..16e144d 100644 --- a/src/venus/vkr_queue.h +++ b/src/venus/vkr_queue.h @@ -51,7 +51,6 @@ struct vkr_queue { struct list_head pending_syncs; struct list_head signaled_syncs; - struct list_head head; struct list_head busy_head; };