panvk: Make mempool detect NULL BOs

Contribute to fixing "dEQP-VK.api.object_management.alloc_callback_fail.device".

We needs a way to report errors in mempools.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29783>
This commit is contained in:
Mary Guillemard
2024-06-19 09:33:04 +02:00
parent 8b1eed39ad
commit 7dd771b2d7

View File

@@ -75,6 +75,9 @@ panvk_pool_alloc_backing(struct panvk_pool *pool, size_t sz)
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
}
if (bo == NULL)
return NULL;
if (pool->props.owns_bos) {
if (pan_kmod_bo_size(bo->bo) == pool->base.slab_size)
list_addtail(&bo->node, &pool->bos);
@@ -123,7 +126,7 @@ panvk_pool_alloc_mem(struct panvk_pool *pool, struct panvk_pool_alloc_info info)
offset = 0;
}
if (pool->transient_bo == bo) {
if (bo != NULL && pool->transient_bo == bo) {
pool->transient_offset = offset + info.size;
if (!pool->props.owns_bos)
panvk_priv_bo_ref(bo);