Mesa (main): radv: Fix Android build for common functions.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Oct 3 00:56:07 UTC 2021


Module: Mesa
Branch: main
Commit: c6b8702eb40bb2f99b10abe07881d5450997320f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6b8702eb40bb2f99b10abe07881d5450997320f

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Wed Sep  8 12:25:46 2021 +0200

radv: Fix Android build for common functions.

Fixes: 9fc16b66d0d ("radv: use common vkGetPhysicalDevice{Image}FormatProperties()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5328
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12764>

---

 src/amd/vulkan/radv_android.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_android.c b/src/amd/vulkan/radv_android.c
index 066cae971e6..3275923ac6f 100644
--- a/src/amd/vulkan/radv_android.c
+++ b/src/amd/vulkan/radv_android.c
@@ -196,7 +196,13 @@ radv_image_from_gralloc(VkDevice device_h, const VkImageCreateInfo *base_info,
 
    radv_image_override_offset_stride(device, image, 0, gralloc_info->stride);
 
-   radv_BindImageMemory(device_h, image_h, memory_h, 0);
+   VkBindImageMemoryInfo bind_info = {
+      .sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
+      .image = image_h,
+      .memory = memory_h,
+      .memoryOffset = 0
+   };
+   radv_BindImageMemory2(device_h, 1, &bind_info);
 
    image->owned_memory = memory_h;
    /* Don't clobber the out-parameter until success is certain. */
@@ -605,14 +611,17 @@ get_ahb_buffer_format_properties(VkDevice device_h, const struct AHardwareBuffer
    p->format = vk_format_from_android(desc.format, desc.usage);
    p->externalFormat = (uint64_t)(uintptr_t)p->format;
 
-   VkFormatProperties format_properties;
-   radv_GetPhysicalDeviceFormatProperties(radv_physical_device_to_handle(device->physical_device),
-                                          p->format, &format_properties);
+   VkFormatProperties2 format_properties = {
+      .sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2
+   };
+
+   radv_GetPhysicalDeviceFormatProperties2(radv_physical_device_to_handle(device->physical_device),
+                                               p->format, &format_properties);
 
    if (desc.usage & AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER)
-      p->formatFeatures = format_properties.linearTilingFeatures;
+      p->formatFeatures = format_properties.formatProperties.linearTilingFeatures;
    else
-      p->formatFeatures = format_properties.optimalTilingFeatures;
+      p->formatFeatures = format_properties.formatProperties.optimalTilingFeatures;
 
    /* "Images can be created with an external format even if the Android hardware
     *  buffer has a format which has an equivalent Vulkan format to enable



More information about the mesa-commit mailing list