From 3465e9f3526c8dbba3ef5ab5bd6158b70422ab83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 15 Dec 2023 08:24:26 -0800 Subject: [PATCH] anv: Assume that imported bos already have flat CCS requirements satisfied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10291 Signed-off-by: José Roberto de Souza Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index aa48332301a..5272e91d30e 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -2368,8 +2368,15 @@ VkResult anv_BindImageMemory2( if (!bo || !isl_aux_usage_has_ccs(image->planes[p].aux_usage)) continue; - /* Do nothing if flat CCS requirements are satisfied. */ - if (device->info->has_flat_ccs && anv_bo_is_vram_only(bo)) + /* Do nothing if flat CCS requirements are satisfied. + * + * Also, assume that imported BOs with a modifier including + * CCS live only in local memory. Otherwise the exporter should + * have failed the creation of the BO. + */ + if (device->info->has_flat_ccs && + (anv_bo_is_vram_only(bo) || + (bo->alloc_flags & ANV_BO_ALLOC_IMPORTED))) continue; /* Add the plane to the aux map when applicable. */