From 615d0c9669595adf114a705f5b8ee88277aa99f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 30 Apr 2025 13:42:04 -0700 Subject: [PATCH] anv: Remove ANV_BO_ALLOC_HOST_CACHED from ANV_BO_ALLOC_MAPPED assert() on anv_device_alloc_bo() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ANV_BO_ALLOC_MAPPED are internal allocated bos that need mmap() but as internally we don't do any cflush() we need to make sure those are also ANV_BO_ALLOC_HOST_COHERENT. Checking for ANV_BO_ALLOC_HOST_CACHED could lead a cached+uncoherent bo being allocated internally with ANV_BO_ALLOC_MAPPED. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_allocator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index a41db38683c..b50cc2fe407 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1646,9 +1646,11 @@ anv_device_alloc_bo(struct anv_device *device, uint64_t explicit_address, struct anv_bo **bo_out) { - /* bo that needs CPU access needs to be HOST_CACHED, HOST_COHERENT or both */ - assert((alloc_flags & ANV_BO_ALLOC_MAPPED) == 0 || - (alloc_flags & (ANV_BO_ALLOC_HOST_CACHED | ANV_BO_ALLOC_HOST_COHERENT))); + /* ANV_BO_ALLOC_MAPPED are internal allocated bos that need mmap() but as + * internally we don't do any cflush() we need to make sure those are also + * ANV_BO_ALLOC_HOST_COHERENT. + */ + assert((alloc_flags & ANV_BO_ALLOC_MAPPED) == 0 || (alloc_flags & ANV_BO_ALLOC_HOST_COHERENT)); /* In platforms with LLC we can promote all bos to cached+coherent for free */ const enum anv_bo_alloc_flags not_allowed_promotion = ANV_BO_ALLOC_SCANOUT |