winsys/amdgpu: clear the buffer cache on allocation failure and try again

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Marek Olšák 2015-12-09 22:36:26 +01:00
parent f9d6fe8001
commit eb1e1af676

View file

@ -495,8 +495,13 @@ amdgpu_bo_create(struct radeon_winsys *rws,
/* Create a new one. */
bo = amdgpu_create_bo(ws, size, alignment, usage, domain, flags);
if (!bo)
return NULL;
if (!bo) {
/* Clear the cache and try again. */
pb_cache_release_all_buffers(&ws->bo_cache);
bo = amdgpu_create_bo(ws, size, alignment, usage, domain, flags);
if (!bo)
return NULL;
}
bo->use_reusable_pool = use_reusable_pool;
return &bo->base;