venus: workaround excessive dma-buf import failure on turnip

Workaround dEQP-VK.wsi.android.swapchain.simulate_oom.* test failures on
turnip where excessive imports can fail, and venus has to propagate oom.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28941>
This commit is contained in:
Yiwei Zhang 2024-04-25 18:34:41 +00:00 committed by Marge Bot
parent 824a8542d7
commit fdc21a95aa

View file

@ -30,7 +30,15 @@ vn_device_memory_alloc_simple(struct vn_device *dev,
{
VkDevice dev_handle = vn_device_to_handle(dev);
VkDeviceMemory mem_handle = vn_device_memory_to_handle(mem);
if (VN_PERF(NO_ASYNC_MEM_ALLOC)) {
/* Workaround dEQP-VK.wsi.android.swapchain.simulate_oom.* test failures on
* turnip where excessive imports can fail, and venus has to propagate oom.
*/
const bool force_sync =
mem->base.base.import_handle_type ==
VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT &&
dev->physical_device->renderer_driver_id == VK_DRIVER_ID_MESA_TURNIP;
if (VN_PERF(NO_ASYNC_MEM_ALLOC) || force_sync) {
return vn_call_vkAllocateMemory(dev->primary_ring, dev_handle,
alloc_info, NULL, &mem_handle);
}