[Mesa-dev] [PATCH] winsys/radeon: only call pb_slabs_reclaim when slabs are actually used

Nicolai Hähnle nhaehnle at gmail.com
Tue Jun 27 16:19:04 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100242
Fixes: fb827c055cb1 ("winsys/radeon: enable buffer allocation from slabs")
Cc: mesa-stable at lists.freedesktop.org
---
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 9bbf1b3..2700c6f 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -1020,21 +1020,22 @@ no_slab:
 
     bo = radeon_bo(pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment,
                                            usage, pb_cache_bucket));
     if (bo)
         return &bo->base;
 
     bo = radeon_create_bo(ws, size, alignment, usage, domain, flags,
                           pb_cache_bucket);
     if (!bo) {
         /* Clear the cache and try again. */
-        pb_slabs_reclaim(&ws->bo_slabs);
+        if (ws->info.has_virtual_memory)
+            pb_slabs_reclaim(&ws->bo_slabs);
         pb_cache_release_all_buffers(&ws->bo_cache);
         bo = radeon_create_bo(ws, size, alignment, usage, domain, flags,
                               pb_cache_bucket);
         if (!bo)
             return NULL;
     }
 
     bo->u.real.use_reusable_pool = true;
 
     mtx_lock(&ws->bo_handles_mutex);
-- 
2.9.3



More information about the mesa-dev mailing list