anv: Assume that imported bos already have flat CCS requirements satisfied
authorJosé Roberto de Souza <jose.souza@intel.com>
Fri, 15 Dec 2023 16:24:26 +0000 (08:24 -0800)
committerEric Engestrom <eric@engestrom.ch>
Thu, 28 Dec 2023 12:07:33 +0000 (12:07 +0000)
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10291
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26711>
(cherry picked from commit 3465e9f3526c8dbba3ef5ab5bd6158b70422ab83)

.pick_status.json
src/intel/vulkan/anv_image.c

index 1dd5d26..14a0536 100644 (file)
@@ -34,7 +34,7 @@
         "description": "anv: Assume that imported bos already have flat CCS requirements satisfied",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
index 8e14b46..aecb297 100644 (file)
@@ -2301,8 +2301,14 @@ 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 && bo->vram_only)
+         /* 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 &&
+             (bo->vram_only || bo->is_external))
             continue;
 
          /* Add the plane to the aux map when applicable. */