Module: Mesa
Branch: master
Commit: f9d6fe800113656098e72baad5e5f856627b74e3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9d6fe800113656098e72baad5e5f856627b74e3

Author: Marek Olšák <[email protected]>
Date:   Wed Dec  9 22:36:26 2015 +0100

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

Reviewed-by: Michel Dänzer <[email protected]>

---

 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c 
b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 8e86f74..b9716e5 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;
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to