vkr: rename vkr_find_pnext to vkr_find_struct

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Yiwei Zhang 3 years ago
parent b0eabf0b95
commit 3f23dd679c
  1. 12
      src/venus/vkr_common.h
  2. 4
      src/venus/vkr_device_memory.c

@ -176,13 +176,13 @@ void
object_array_fini(struct object_array *arr); object_array_fini(struct object_array *arr);
static inline void * static inline void *
vkr_find_pnext(const void *chain, VkStructureType type) vkr_find_struct(const void *chain, VkStructureType type)
{ {
VkBaseOutStructure *pnext = (VkBaseOutStructure *)chain; VkBaseOutStructure *s = (VkBaseOutStructure *)chain;
while (pnext) { while (s) {
if (pnext->sType == type) if (s->sType == type)
return pnext; return s;
pnext = pnext->pNext; s = s->pNext;
} }
return NULL; return NULL;
} }

@ -48,7 +48,7 @@ vkr_dispatch_vkAllocateMemory(struct vn_dispatch_context *dispatch,
#ifdef FORCE_ENABLE_DMABUF #ifdef FORCE_ENABLE_DMABUF
VkExportMemoryAllocateInfo local_export_info; VkExportMemoryAllocateInfo local_export_info;
if (dev->physical_device->EXT_external_memory_dma_buf) { if (dev->physical_device->EXT_external_memory_dma_buf) {
VkExportMemoryAllocateInfo *export_info = vkr_find_pnext( VkExportMemoryAllocateInfo *export_info = vkr_find_struct(
args->pAllocateInfo->pNext, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO); args->pAllocateInfo->pNext, VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO);
if (export_info) { if (export_info) {
export_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT; export_info->handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT;
@ -205,7 +205,7 @@ vkr_dispatch_vkGetMemoryResourcePropertiesMESA(
args->pMemoryResourceProperties->memoryTypeBits = mem_fd_props.memoryTypeBits; args->pMemoryResourceProperties->memoryTypeBits = mem_fd_props.memoryTypeBits;
VkMemoryResourceAllocationSizeProperties100000MESA *alloc_size_props = vkr_find_pnext( VkMemoryResourceAllocationSizeProperties100000MESA *alloc_size_props = vkr_find_struct(
args->pMemoryResourceProperties->pNext, args->pMemoryResourceProperties->pNext,
VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA); VK_STRUCTURE_TYPE_MEMORY_RESOURCE_ALLOCATION_SIZE_PROPERTIES_100000_MESA);
if (alloc_size_props) if (alloc_size_props)

Loading…
Cancel
Save