panvk: improve big_bo_pool bo utilization

Better not cap at slab_size, otherwise the bo cache is purely wasting
memory as it could only be used for up to slab_size upon re-use. This
change unlocks the pool alloc limit to the actual bo size.

Dropped the redundant pair of parentheses to stay in one line.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37861>
This commit is contained in:
Yiwei Zhang 2025-10-13 22:11:25 -07:00 committed by Marge Bot
parent dcd2a99415
commit 22ed6c3582

View file

@ -149,7 +149,7 @@ panvk_pool_alloc_mem(struct panvk_pool *pool, struct panvk_pool_alloc_info info)
unsigned offset = ALIGN_POT(pool->transient_offset, info.alignment);
/* If we don't fit, allocate a new backing */
if (unlikely(bo == NULL || (offset + info.size) > pool->base.slab_size)) {
if (unlikely(bo == NULL || offset + info.size > pan_kmod_bo_size(bo->bo))) {
bo = panvk_pool_alloc_backing(pool, info.size);
offset = 0;
}