anv: Add missing ANV_BO_ALLOC_EXTERNAL flags when calling anv_device_import_bo()
authorJosé Roberto de Souza <jose.souza@intel.com>
Thu, 12 Oct 2023 20:38:57 +0000 (13:38 -0700)
committerEric Engestrom <eric@engestrom.ch>
Wed, 8 Nov 2023 18:19:30 +0000 (18:19 +0000)
This flag is required to properly calculate the PAT index of the
imported BO.

Cc: mesa-stable
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/26099>
(cherry picked from commit 72ba0677f824d46d0f656eef07b99f5b5ab6ebe5)

.pick_status.json
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_android.c

index 4ed986863744c30d36167a2fe4d7e929f4d9f017..eae46bc0166797dc85b3eb46305ce27188feca53 100644 (file)
         "description": "anv: Add missing ANV_BO_ALLOC_EXTERNAL flags when calling anv_device_import_bo()",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
index 56073b4289913d2b1909a131556a4dfa52c6dd8b..f527aa8d03650df8b207dbb2dea7e7b8e59ac741 100644 (file)
@@ -1646,6 +1646,7 @@ anv_device_import_bo(struct anv_device *device,
    assert(!(alloc_flags & (ANV_BO_ALLOC_MAPPED |
                            ANV_BO_ALLOC_SNOOPED |
                            ANV_BO_ALLOC_FIXED_ADDRESS)));
+   assert(alloc_flags & ANV_BO_ALLOC_EXTERNAL);
 
    struct anv_bo_cache *cache = &device->bo_cache;
 
index 9dd3114f621f071b9a8cdf86e272cd3af6b7809e..2cea3fc9f36c968896f2b638806704336746dedf 100644 (file)
@@ -348,6 +348,7 @@ anv_image_init_from_gralloc(struct anv_device *device,
     *
     */
    result = anv_device_import_bo(device, dma_buf,
+                                 ANV_BO_ALLOC_EXTERNAL |
                                  ANV_BO_ALLOC_IMPLICIT_SYNC |
                                  ANV_BO_ALLOC_IMPLICIT_WRITE,
                                  0 /* client_address */,
@@ -431,6 +432,7 @@ anv_image_bind_from_gralloc(struct anv_device *device,
     */
    struct anv_bo *bo = NULL;
    VkResult result = anv_device_import_bo(device, dma_buf,
+                                          ANV_BO_ALLOC_EXTERNAL |
                                           ANV_BO_ALLOC_IMPLICIT_SYNC |
                                           ANV_BO_ALLOC_IMPLICIT_WRITE,
                                           0 /* client_address */,