radv/android: Mark android WSI image as shareable.
authorBas Nieuwenhuizen <basni@chromium.org>
Mon, 26 Nov 2018 15:26:35 +0000 (16:26 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 4 Dec 2018 00:21:38 +0000 (01:21 +0100)
Fixes: b1444c9ccb0 "radv: Implement VK_ANDROID_native_buffer."
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_android.c

index f5d70825dd24f85b803ab00621f8567b1af76b6b..93799b87b8ffe8dfea224ed5c0056adf723554aa 100644 (file)
@@ -110,9 +110,19 @@ radv_image_from_gralloc(VkDevice device_h,
        struct radv_bo *bo = NULL;
        VkResult result;
 
+       VkImageCreateInfo updated_base_info = *base_info;
+
+       VkExternalMemoryImageCreateInfo external_memory_info = {
+               .sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
+               .pNext = updated_base_info.pNext,
+               .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
+       };
+
+       updated_base_info.pNext = &external_memory_info;
+
        result = radv_image_create(device_h,
                                   &(struct radv_image_create_info) {
-                                      .vk_info = base_info,
+                                      .vk_info = &updated_base_info,
                                       .scanout = true,
                                       .no_metadata_planes = true},
                                   alloc,