From 4e7ba17413b0869cb5874ecf979ac8ed6adda0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 5 Feb 2025 12:01:49 -0800 Subject: [PATCH] anv: Export anv_bo_is_small_heap() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function will be needs in two places in the next patches. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_allocator.c | 6 +----- src/intel/vulkan/anv_private.h | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 704bdce2ac8..181ac011e5c 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1509,11 +1509,7 @@ anv_bo_vma_alloc_or_close(struct anv_device *device, assert(bo->vma_heap == NULL); assert(explicit_address == intel_48b_address(explicit_address)); - const bool is_small_heap = - alloc_flags & (ANV_BO_ALLOC_DESCRIPTOR_POOL | - ANV_BO_ALLOC_DYNAMIC_VISIBLE_POOL | - ANV_BO_ALLOC_32BIT_ADDRESS); - + const bool is_small_heap = anv_bo_is_small_heap(alloc_flags); uint32_t align = device->physical->info.mem_alignment; /* If it's big enough to store a tiled resource, we need 64K alignment */ diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 2471d1c3329..0c3cd5ca7ba 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2396,6 +2396,14 @@ void anv_vma_free(struct anv_device *device, struct util_vma_heap *vma_heap, uint64_t address, uint64_t size); +static inline bool +anv_bo_is_small_heap(enum anv_bo_alloc_flags alloc_flags) +{ + return alloc_flags & (ANV_BO_ALLOC_DESCRIPTOR_POOL | + ANV_BO_ALLOC_DYNAMIC_VISIBLE_POOL | + ANV_BO_ALLOC_32BIT_ADDRESS); +} + struct anv_reloc_list { bool uses_relocs; uint32_t dep_words;