anv/android: fix assert in anv_import_ahw_memory
authorAbhishek Kumar <abhishek4.kumar@intel.com>
Tue, 21 Apr 2020 06:28:31 +0000 (06:28 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Apr 2020 11:50:15 +0000 (11:50 +0000)
Commit fixes assert that triggers when running
   dEQP-VK.api.external.memory.android_hardware_buffer.dedicated.buffer#bind_export_import_bind

on a debug build of Mesa.

Fixes: c79a528d ("anv/android: support import/export of AHardwareBuffer objects")
Signed-off-by: Abhishek Kumar <abhishek4.kumar@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4655>

src/intel/vulkan/anv_android.c

index 74b5b062286bbe2fed881685a225faf2dd1892d3..b46a990b32e27bc28d54f92f2a397d5d562e8a3b 100644 (file)
@@ -308,7 +308,7 @@ anv_import_ahw_memory(VkDevice device_h,
    VkResult result = anv_device_import_bo(device, dma_buf, 0,
                                           0 /* client_address */,
                                           &mem->bo);
-   assert(VK_SUCCESS);
+   assert(result == VK_SUCCESS);
 
    /* "If the vkAllocateMemory command succeeds, the implementation must
     * acquire a reference to the imported hardware buffer, which it must