From 4aee4f097575bf8e7d4e4422d1620c5e6f4fefc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 30 Sep 2025 14:45:08 -0700 Subject: [PATCH] anv/allocator: Move definition of ANV_FREE_LIST_EMPTY to anv_allocator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While at it also renaming EMPTY to ANV_FREE_LIST_EMPTY_VAL to be more explicit. No changes in behavior expected here. 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 | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 56440a9072b..b970bdd4959 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -104,7 +104,9 @@ /* Allocations are always at least 64 byte aligned, so 1 is an invalid value. * We use it to indicate the free list is empty. */ -#define EMPTY UINT32_MAX +#define ANV_FREE_LIST_EMPTY_VAL UINT32_MAX + +#define ANV_FREE_LIST_EMPTY ((union anv_free_list) { { ANV_FREE_LIST_EMPTY_VAL, 0 } }) /* On FreeBSD PAGE_SIZE is already defined in * /usr/include/machine/param.h that is indirectly @@ -329,7 +331,7 @@ anv_free_list_pop(union anv_free_list *list, union anv_free_list current, new, old; current.u64 = list->u64; - while (current.offset != EMPTY) { + while (current.offset != ANV_FREE_LIST_EMPTY_VAL) { __sync_synchronize(); new.offset = table->map[current.offset].next; new.count = current.count + 1; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index ac7f587448e..3d493c0c840 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -708,8 +708,6 @@ union anv_free_list { alignas(8) uint64_t u64; }; -#define ANV_FREE_LIST_EMPTY ((union anv_free_list) { { UINT32_MAX, 0 } }) - struct anv_block_state { union { struct {