Revert "zink: use a slab allocator for zink_kopper_present_info"

This reverts commit 738fbddca8.

This was missing locking which caused problems

Closes: 11161
Fixes: 738fbddca8 ("zink: use a slab allocator for zink_kopper_present_info")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29338>
This commit is contained in:
Dave Airlie 2024-05-23 12:20:18 +10:00
parent cdf75e8e02
commit 2abdc84606
3 changed files with 2 additions and 5 deletions

View file

@ -799,7 +799,7 @@ out:
struct pipe_resource *pres = &cpi->res->base.b;
pipe_resource_reference(&pres, NULL);
}
slab_free_st(&screen->present_mempool, cpi);
free(cpi);
}
void
@ -814,7 +814,7 @@ zink_kopper_present_queue(struct zink_screen *screen, struct zink_resource *res,
if (cdt->swapchain->last_present != UINT32_MAX)
prune_old_swapchains(screen, cdt, false);
struct zink_kopper_present_info *cpi = slab_alloc_st(&screen->present_mempool);
struct zink_kopper_present_info *cpi = malloc(sizeof(struct zink_kopper_present_info));
if (!cpi) {
mesa_loge("ZINK: failed to allocate cpi!");
return;

View file

@ -1641,7 +1641,6 @@ zink_destroy_screen(struct pipe_screen *pscreen)
close(screen->drm_fd);
slab_destroy_parent(&screen->transfer_pool);
slab_destroy(&screen->present_mempool);
ralloc_free(screen);
glsl_type_singleton_decref();
}
@ -3540,7 +3539,6 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
populate_format_props(screen);
slab_create_parent(&screen->transfer_pool, sizeof(struct zink_transfer), 16);
slab_create(&screen->present_mempool, sizeof(struct zink_kopper_present_info), 16);
screen->driconf.inline_uniforms = debug_get_bool_option("ZINK_INLINE_UNIFORMS", screen->is_cpu);

View file

@ -1420,7 +1420,6 @@ struct zink_screen {
bool device_lost;
int drm_fd;
struct slab_mempool present_mempool;
struct slab_parent_pool transfer_pool;
struct disk_cache *disk_cache;
struct util_queue cache_put_thread;