anv: Pass device to setup_gralloc0_usage for error reporting
authorKristian H. Kristensen <hoegsberg@google.com>
Wed, 29 Jul 2020 18:02:07 +0000 (11:02 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 Aug 2020 18:08:07 +0000 (18:08 +0000)
Otherwise it doesn't compile.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: aba57b11ee8c6d ("anv: support GetSwapchainGrallocUsage2ANDROID for Android")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

src/intel/vulkan/anv_android.c

index 8e6d0b65ea1ed84c71f27042b4b0b775be6febba..a5f5904d06ba53d2b0f422279a41a953d725926a 100644 (file)
@@ -572,8 +572,8 @@ format_supported_with_usage(VkDevice device_h, VkFormat format,
 
 
 static VkResult
-setup_gralloc0_usage(VkFormat format, VkImageUsageFlags imageUsage,
-                     int *grallocUsage)
+setup_gralloc0_usage(struct anv_device *device, VkFormat format,
+                     VkImageUsageFlags imageUsage, int *grallocUsage)
 {
    /* WARNING: Android's libvulkan.so hardcodes the VkImageUsageFlags
     * returned to applications via VkSurfaceCapabilitiesKHR::supportedUsageFlags.
@@ -654,7 +654,7 @@ VkResult anv_GetSwapchainGrallocUsage2ANDROID(
       return result;
 
    int32_t grallocUsage = 0;
-   result = setup_gralloc0_usage(format, imageUsage, &grallocUsage);
+   result = setup_gralloc0_usage(device, format, imageUsage, &grallocUsage);
    if (result != VK_SUCCESS)
       return result;
 
@@ -686,6 +686,7 @@ VkResult anv_GetSwapchainGrallocUsageANDROID(
     VkImageUsageFlags   imageUsage,
     int*                grallocUsage)
 {
+   ANV_FROM_HANDLE(anv_device, device, device_h);
    VkResult result;
 
    *grallocUsage = 0;
@@ -695,7 +696,7 @@ VkResult anv_GetSwapchainGrallocUsageANDROID(
    if (result != VK_SUCCESS)
       return result;
 
-   return setup_gralloc0_usage(format, imageUsage, grallocUsage);
+   return setup_gralloc0_usage(device, format, imageUsage, grallocUsage);
 }
 
 VkResult