summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5eec286)
raw | patch | inline | side by side (parent: 5eec286)
author | Chris Wilson <chris@chris-wilson.co.uk> | |
Mon, 21 Jun 2010 14:21:48 +0000 (15:21 +0100) | ||
committer | Chris Wilson <chris@chris-wilson.co.uk> | |
Mon, 21 Jun 2010 21:37:18 +0000 (22:37 +0100) |
Rearrange the cache cleanup so that we always scan following a final
unreference, and guard against multiple scans in a single second.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
unreference, and guard against multiple scans in a single second.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
intel/intel_bufmgr_gem.c | patch | blob | history |
index 19eea345ebab8db267822abd82829f4f984902f2..b0d1651d703a8f71a8aaa1fd0138aca58d14cf7f 100644 (file)
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
/** Array of lists of cached gem objects of power-of-two sizes */
struct drm_intel_gem_bo_bucket cache_bucket[14 * 4];
int num_buckets;
+ time_t time;
uint64_t gtt_size;
int available_fences;
{
int i;
+ if (bufmgr_gem->time == time)
+ return;
+
for (i = 0; i < bufmgr_gem->num_buckets; i++) {
struct drm_intel_gem_bo_bucket *bucket =
&bufmgr_gem->cache_bucket[i];
drm_intel_gem_bo_free(&bo_gem->bo);
}
}
+
+ bufmgr_gem->time = time;
}
static void
bo_gem->validate_index = -1;
DRMLISTADDTAIL(&bo_gem->head, &bucket->head);
-
- drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time);
} else {
drm_intel_gem_bo_free(bo);
}
pthread_mutex_lock(&bufmgr_gem->lock);
drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
+ drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time.tv_sec);
pthread_mutex_unlock(&bufmgr_gem->lock);
}
}