From f9d6fe800113656098e72baad5e5f856627b74e3 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 9 Dec 2015 22:36:26 +0100 Subject: winsys/radeon: clear the buffer cache on allocation failure and try again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gallium/winsys/radeon/drm') 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; -- cgit v1.2.3