aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'freedreno/freedreno_bo_cache.c')
-rw-r--r--freedreno/freedreno_bo_cache.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/freedreno/freedreno_bo_cache.c b/freedreno/freedreno_bo_cache.c
index 7becb0d6..3b737159 100644
--- a/freedreno/freedreno_bo_cache.c
+++ b/freedreno/freedreno_bo_cache.c
@@ -26,14 +26,9 @@
26 * Rob Clark <robclark@freedesktop.org> 26 * Rob Clark <robclark@freedesktop.org>
27 */ 27 */
28 28
29#ifdef HAVE_CONFIG_H
30# include <config.h>
31#endif
32
33#include "freedreno_drmif.h" 29#include "freedreno_drmif.h"
34#include "freedreno_priv.h" 30#include "freedreno_priv.h"
35 31
36
37drm_private void bo_del(struct fd_bo *bo); 32drm_private void bo_del(struct fd_bo *bo);
38drm_private extern pthread_mutex_t table_lock; 33drm_private extern pthread_mutex_t table_lock;
39 34
@@ -102,6 +97,7 @@ fd_bo_cache_cleanup(struct fd_bo_cache *cache, time_t time)
102 if (time && ((time - bo->free_time) <= 1)) 97 if (time && ((time - bo->free_time) <= 1))
103 break; 98 break;
104 99
100 VG_BO_OBTAIN(bo);
105 list_del(&bo->list); 101 list_del(&bo->list);
106 bo_del(bo); 102 bo_del(bo);
107 } 103 }
@@ -177,6 +173,7 @@ retry:
177 *size = bucket->size; 173 *size = bucket->size;
178 bo = find_in_bucket(bucket, flags); 174 bo = find_in_bucket(bucket, flags);
179 if (bo) { 175 if (bo) {
176 VG_BO_OBTAIN(bo);
180 if (bo->funcs->madvise(bo, TRUE) <= 0) { 177 if (bo->funcs->madvise(bo, TRUE) <= 0) {
181 /* we've lost the backing pages, delete and try again: */ 178 /* we've lost the backing pages, delete and try again: */
182 pthread_mutex_lock(&table_lock); 179 pthread_mutex_lock(&table_lock);
@@ -207,6 +204,7 @@ fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo)
207 clock_gettime(CLOCK_MONOTONIC, &time); 204 clock_gettime(CLOCK_MONOTONIC, &time);
208 205
209 bo->free_time = time.tv_sec; 206 bo->free_time = time.tv_sec;
207 VG_BO_RELEASE(bo);
210 list_addtail(&bo->list, &bucket->list); 208 list_addtail(&bo->list, &bucket->list);
211 fd_bo_cache_cleanup(cache, time.tv_sec); 209 fd_bo_cache_cleanup(cache, time.tv_sec);
212 210