vkr: rename vkr_device_memory::head to exported_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 9da6721165
commit 3e7dac5835
  1. 14
      src/venus/vkr_context.c
  2. 2
      src/venus/vkr_device.c
  3. 4
      src/venus/vkr_device_memory.c
  4. 2
      src/venus/vkr_device_memory.h

@ -342,7 +342,7 @@ vkr_context_get_blob_done(struct virgl_context *base,
mem->exported = true;
mem->exported_res_id = res_id;
list_add(&mem->head, &ctx->newly_exported_memories);
list_add(&mem->exported_head, &ctx->newly_exported_memories);
/* XXX locked in vkr_context_get_blob */
mtx_unlock(&ctx->mutex);
@ -386,7 +386,7 @@ vkr_context_transfer_3d_locked(struct virgl_context *base,
}
struct vkr_device_memory *mem =
LIST_ENTRY(struct vkr_device_memory, att->memories.next, head);
LIST_ENTRY(struct vkr_device_memory, att->memories.next, exported_head);
const VkMappedMemoryRange range = {
.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
.memory = mem->base.handle.device_memory,
@ -457,10 +457,10 @@ vkr_context_attach_resource_locked(struct virgl_context *base, struct virgl_reso
/* associate a memory with the resource, if any */
struct vkr_device_memory *mem;
LIST_FOR_EACH_ENTRY (mem, &ctx->newly_exported_memories, head) {
LIST_FOR_EACH_ENTRY (mem, &ctx->newly_exported_memories, exported_head) {
if (mem->exported_res_id == res->res_id) {
list_del(&mem->head);
list_addtail(&mem->head, &att->memories);
list_del(&mem->exported_head);
list_addtail(&mem->exported_head, &att->memories);
break;
}
}
@ -549,8 +549,8 @@ destroy_func_resource(void *val)
struct vkr_resource_attachment *att = val;
struct vkr_device_memory *mem, *tmp;
LIST_FOR_EACH_ENTRY_SAFE (mem, tmp, &att->memories, head)
list_delinit(&mem->head);
LIST_FOR_EACH_ENTRY_SAFE (mem, tmp, &att->memories, exported_head)
list_delinit(&mem->exported_head);
free(att);
}

@ -194,7 +194,7 @@ vkr_device_object_destroy(struct vkr_context *ctx,
vkFreeMemory(device, obj->handle.device_memory, NULL);
/* remove device memory from exported or attachment list */
list_del(&((struct vkr_device_memory *)obj)->head);
list_del(&((struct vkr_device_memory *)obj)->exported_head);
break;
case VK_OBJECT_TYPE_BUFFER:
vkDestroyBuffer(device, obj->handle.buffer, NULL);

@ -150,7 +150,7 @@ vkr_dispatch_vkAllocateMemory(struct vn_dispatch_context *dispatch,
mem->device = args->device;
mem->property_flags = property_flags;
mem->valid_fd_types = valid_fd_types;
list_inithead(&mem->head);
list_inithead(&mem->exported_head);
list_add(&mem->base.track_head, &dev->objects);
@ -173,7 +173,7 @@ vkr_dispatch_vkFreeMemory(struct vn_dispatch_context *dispatch,
vn_replace_vkFreeMemory_args_handle(args);
vkFreeMemory(args->device, args->memory, NULL);
list_del(&mem->head);
list_del(&mem->exported_head);
list_del(&mem->base.track_head);
util_hash_table_remove_u64(ctx->object_table, mem->base.id);

@ -17,7 +17,7 @@ struct vkr_device_memory {
bool exported;
uint32_t exported_res_id;
struct list_head head;
struct list_head exported_head;
};
void

Loading…
Cancel
Save