anv/android: mark gralloc allocated BOs as external
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 6 Nov 2018 11:37:51 +0000 (11:37 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 6 Nov 2018 15:28:07 +0000 (15:28 +0000)
Allocating through Gralloc implies buffers are going to be used
outside the driver. We have special MOCS settings for external BOs and
we probably want to use them here too.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a1220e73116bad7 ("anv/android: Set the BO flags in bo_cache_import (v2)")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/intel/vulkan/anv_android.c

index 46c41d57861f18f482757632c24e83290b317a8e..916e76c93ff8b76682074a6b6b98c9cfab4f0600 100644 (file)
@@ -128,7 +128,7 @@ anv_image_from_gralloc(VkDevice device_h,
     */
    int dma_buf = gralloc_info->handle->data[0];
 
-   uint64_t bo_flags = 0;
+   uint64_t bo_flags = ANV_BO_EXTERNAL;
    if (device->instance->physicalDevice.supports_48bit_addresses)
       bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
    if (device->instance->physicalDevice.use_softpin)