Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
/* Create a new one. */
bo = amdgpu_create_bo(ws, size, alignment, usage, domain, flags);
/* 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;
bo->use_reusable_pool = use_reusable_pool;
return &bo->base;