[Mesa-dev] [PATCH 1/4] winsys/radeon: clear the buffer cache on allocation failure and try again

Marek Olšák maraeo at gmail.com
Wed Dec 9 13:58:36 PST 2015


From: Marek Olšák <marek.olsak at amd.com>

---
 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 3fd233c..a5f8aeb 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -766,8 +766,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;
 
-- 
2.1.4



More information about the mesa-dev mailing list