zink: fix slab allocator sizing

now that the mem type is passed directly to pb, there have to be enough
slabs to allocate all the mem types (not heaps), so create memoryTypeCount
slabs to allow this

fixes #8369

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21526>
This commit is contained in:
Mike Blumenkrantz 2023-02-24 15:56:05 -05:00 committed by Marge Bot
parent fe4271c42d
commit f1acdeba6b

View file

@ -1282,7 +1282,7 @@ zink_bo_init(struct zink_screen *screen)
for (uint32_t i = 0; i < screen->info.mem_props.memoryHeapCount; ++i)
total_mem += screen->info.mem_props.memoryHeaps[i].size;
/* Create managers. */
pb_cache_init(&screen->pb.bo_cache, ZINK_HEAP_MAX,
pb_cache_init(&screen->pb.bo_cache, screen->info.mem_props.memoryTypeCount,
500000, 2.0f, 0,
total_mem / 8, screen,
(void*)bo_destroy, (void*)bo_can_reclaim);
@ -1300,7 +1300,7 @@ zink_bo_init(struct zink_screen *screen)
if (!pb_slabs_init(&screen->pb.bo_slabs[i],
min_order, max_order,
ZINK_HEAP_MAX, true,
screen->info.mem_props.memoryTypeCount, true,
screen,
bo_can_reclaim_slab,
bo_slab_alloc_normal,