vkr: refactor vkr_queue to use track_head

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Yiwei Zhang 3 years ago
parent 59a5ac4d33
commit 78c1f66add
  1. 2
      src/venus/vkr_device.c
  2. 9
      src/venus/vkr_queue.c
  3. 1
      src/venus/vkr_queue.h

@ -300,7 +300,7 @@ vkr_device_destroy(struct vkr_context *ctx, struct vkr_device *dev)
} }
struct vkr_queue *queue, *queue_tmp; 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); vkr_queue_destroy(ctx, queue);
struct vkr_queue_sync *sync, *sync_tmp; struct vkr_queue_sync *sync, *sync_tmp;

@ -145,8 +145,8 @@ vkr_queue_destroy(struct vkr_context *ctx, struct vkr_queue *queue)
mtx_destroy(&queue->mutex); mtx_destroy(&queue->mutex);
cnd_destroy(&queue->cond); cnd_destroy(&queue->cond);
list_del(&queue->head);
list_del(&queue->busy_head); list_del(&queue->busy_head);
list_del(&queue->base.track_head);
util_hash_table_remove_u64(ctx->object_table, queue->base.id); 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; struct vkr_queue *queue;
int ret; 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) if (queue->flags == flags && queue->family == family && queue->index == index)
return queue; return queue;
} }
@ -256,10 +256,11 @@ vkr_queue_create(struct vkr_context *ctx,
queue->eventfd = ctx->fence_eventfd; queue->eventfd = ctx->fence_eventfd;
} }
/* currently queues are not tracked as device objects */
list_addtail(&queue->head, &dev->queues);
list_inithead(&queue->busy_head); 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); util_hash_table_set_u64(ctx->object_table, queue->base.id, queue);
return queue; return queue;

@ -51,7 +51,6 @@ struct vkr_queue {
struct list_head pending_syncs; struct list_head pending_syncs;
struct list_head signaled_syncs; struct list_head signaled_syncs;
struct list_head head;
struct list_head busy_head; struct list_head busy_head;
}; };

Loading…
Cancel
Save