From: Marek Olšák Date: Wed, 9 Dec 2015 21:36:26 +0000 (+0100) Subject: winsys/radeon: clear the buffer cache on allocation failure and try again X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f9d6fe800113656098e72baad5e5f856627b74e3;p=mesa.git winsys/radeon: clear the buffer cache on allocation failure and try again Reviewed-by: Michel Dänzer --- diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 8e86f746217..b9716e50229 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -767,8 +767,13 @@ radeon_winsys_bo_create(struct radeon_winsys *rws, } bo = radeon_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 = radeon_create_bo(ws, size, alignment, usage, domain, flags); + if (!bo) + return NULL; + } bo->use_reusable_pool = use_reusable_pool;