panvk: allow panvk_pool_alloc_mem to use full slab_size

We waste the last chunk if the last alloc happen to match the size.

Cc: mesa-stable
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37861>
(cherry picked from commit dcd2a99415)
This commit is contained in:
Yiwei Zhang 2025-10-13 22:08:59 -07:00 committed by Eric Engestrom
parent 273232abd4
commit 0a491ccfa8
2 changed files with 2 additions and 2 deletions

View file

@ -1184,7 +1184,7 @@
"description": "panvk: allow panvk_pool_alloc_mem to use full slab_size",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -132,7 +132,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) > pool->base.slab_size)) {
bo = panvk_pool_alloc_backing(pool, info.size);
offset = 0;
}