anv/android: Pass the correct pointer type to vk_errorf
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 10 Aug 2021 22:48:32 +0000 (17:48 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Aug 2021 23:57:52 +0000 (23:57 +0000)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>

src/intel/vulkan/anv_android.c

index fec5c58..2f337e6 100644 (file)
@@ -472,7 +472,8 @@ anv_image_from_gralloc(VkDevice device_h,
    };
 
    if (gralloc_info->handle->numFds != 1) {
-      return vk_errorf(device, device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
+      return vk_errorf(device, &device->vk.base,
+                       VK_ERROR_INVALID_EXTERNAL_HANDLE,
                        "VkNativeBufferANDROID::handle::numFds is %d, "
                        "expected 1", gralloc_info->handle->numFds);
    }
@@ -498,7 +499,7 @@ anv_image_from_gralloc(VkDevice device_h,
                                  0 /* client_address */,
                                  &bo);
    if (result != VK_SUCCESS) {
-      return vk_errorf(device, device, result,
+      return vk_errorf(device, &device->vk.base, result,
                        "failed to import dma-buf from VkNativeBufferANDROID");
    }
 
@@ -514,12 +515,14 @@ anv_image_from_gralloc(VkDevice device_h,
       anv_info.isl_tiling_flags = ISL_TILING_Y0_BIT;
       break;
    case -1:
-      result = vk_errorf(device, device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
+      result = vk_errorf(device, &device->vk.base,
+                         VK_ERROR_INVALID_EXTERNAL_HANDLE,
                          "DRM_IOCTL_I915_GEM_GET_TILING failed for "
                          "VkNativeBufferANDROID");
       goto fail_tiling;
    default:
-      result = vk_errorf(device, device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
+      result = vk_errorf(device, &device->vk.base,
+                         VK_ERROR_INVALID_EXTERNAL_HANDLE,
                          "DRM_IOCTL_I915_GEM_GET_TILING returned unknown "
                          "tiling %d for VkNativeBufferANDROID", i915_tiling);
       goto fail_tiling;
@@ -552,7 +555,8 @@ anv_image_from_gralloc(VkDevice device_h,
                 mem_reqs.memoryRequirements.alignment);
 
    if (bo->size < aligned_image_size) {
-      result = vk_errorf(device, device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
+      result = vk_errorf(device, &device->vk.base,
+                         VK_ERROR_INVALID_EXTERNAL_HANDLE,
                          "dma-buf from VkNativeBufferANDROID is too small for "
                          "VkImage: %"PRIu64"B < %"PRIu64"B",
                          bo->size, aligned_image_size);
@@ -606,7 +610,7 @@ format_supported_with_usage(VkDevice device_h, VkFormat format,
    result = anv_GetPhysicalDeviceImageFormatProperties2(phys_dev_h,
                &image_format_info, &image_format_props);
    if (result != VK_SUCCESS) {
-      return vk_errorf(device, device, result,
+      return vk_errorf(device, &device->vk.base, result,
                        "anv_GetPhysicalDeviceImageFormatProperties2 failed "
                        "inside %s", __func__);
    }
@@ -645,7 +649,7 @@ setup_gralloc0_usage(struct anv_device *device, VkFormat format,
     * gralloc swapchains.
     */
    if (imageUsage != 0) {
-      return vk_errorf(device, device, VK_ERROR_FORMAT_NOT_SUPPORTED,
+      return vk_errorf(device, &device->vk.base, VK_ERROR_FORMAT_NOT_SUPPORTED,
                        "unsupported VkImageUsageFlags(0x%x) for gralloc "
                        "swapchain", imageUsage);
    }