From 4de00e01dd9927011384258239d6d82b70f5ee0a Mon Sep 17 00:00:00 2001 From: Calder Young Date: Thu, 27 Nov 2025 15:20:12 -0800 Subject: [PATCH] anv: Fix valgrind errors on batch buffers allocated from bo_pool Although a specific size is requested, the entire range of the returned bo up to bo->size may end up being used by anv_batch_chain, spamming memcheck errors. Reviewed-by: Lionel Landwerlin Cc: mesa-stable Part-of: --- src/intel/vulkan/anv_allocator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index 845785678e4..7f1a18a2134 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1292,7 +1292,7 @@ anv_bo_pool_alloc(struct anv_bo_pool *pool, uint32_t size, struct anv_bo *bo = util_sparse_array_free_list_pop_elem(&pool->free_list[bucket]); if (bo != NULL) { - VG(VALGRIND_MEMPOOL_ALLOC(pool, bo->map, size)); + VG(VALGRIND_MEMPOOL_ALLOC(pool, bo->map, bo->size)); *bo_out = bo; return VK_SUCCESS; } @@ -1308,7 +1308,7 @@ anv_bo_pool_alloc(struct anv_bo_pool *pool, uint32_t size, /* We want it to look like it came from this pool */ VG(VALGRIND_FREELIKE_BLOCK(bo->map, 0)); - VG(VALGRIND_MEMPOOL_ALLOC(pool, bo->map, size)); + VG(VALGRIND_MEMPOOL_ALLOC(pool, bo->map, bo->size)); *bo_out = bo;