v3dv: handle the case where we fail to allocate a new job gracefully
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 12 Mar 2020 10:59:04 +0000 (11:59 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:28 +0000 (21:21 +0000)
commit5cfc3b5cc965a64c07e69833f85d44e60d6f3a6e
tree7c9260c98b1e0159f0f5d2646d9d5e6cced2f079
parente5adc33e802d037178cd17095caf47e3da57e591
v3dv: handle the case where we fail to allocate a new job gracefully

There are a handful of tests that simulate 'out of memory' situations
during swapchain image creation, and these can lead to failed job
allocations when the driver is running on the prime blit path, as that
involves creating a command buffer. The tests expect us to handle this
scenario gracefully and return an appropriate OOM error as a result.
This make sure we don't try to dereference a job if we failed to allocate
it so we don't crash and can return the OOM error gracefully in the
process.

Fixes:
dEQP-VK.wsi.xlib.swapchain.simulate_oom.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/vulkan/v3dv_cmd_buffer.c
src/broadcom/vulkan/v3dv_meta_copy.c
src/broadcom/vulkan/v3dv_private.h