cache->num_buckets++;
}
+/**
+ * @coarse: if true, only power-of-two bucket sizes, otherwise
+ * fill in for a bit smoother size curve..
+ */
drm_private void
-fd_bo_cache_init(struct fd_bo_cache *cache)
+fd_bo_cache_init(struct fd_bo_cache *cache, int course)
{
unsigned long size, cache_max_size = 64 * 1024 * 1024;
*/
add_bucket(cache, 4096);
add_bucket(cache, 4096 * 2);
- add_bucket(cache, 4096 * 3);
+ if (!course)
+ add_bucket(cache, 4096 * 3);
/* Initialize the linked lists for BO reuse cache. */
for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
add_bucket(cache, size);
- add_bucket(cache, size + size * 1 / 4);
- add_bucket(cache, size + size * 2 / 4);
- add_bucket(cache, size + size * 3 / 4);
+ if (!course) {
+ add_bucket(cache, size + size * 1 / 4);
+ add_bucket(cache, size + size * 2 / 4);
+ add_bucket(cache, size + size * 3 / 4);
+ }
}
}
dev->fd = fd;
dev->handle_table = drmHashCreate();
dev->name_table = drmHashCreate();
- fd_bo_cache_init(&dev->bo_cache);
+ fd_bo_cache_init(&dev->bo_cache, FALSE);
return dev;
}
int closefd; /* call close(fd) upon destruction */
};
-drm_private void fd_bo_cache_init(struct fd_bo_cache *cache);
+drm_private void fd_bo_cache_init(struct fd_bo_cache *cache, int coarse);
drm_private void fd_bo_cache_cleanup(struct fd_bo_cache *cache, time_t time);
drm_private struct fd_bo * fd_bo_cache_alloc(struct fd_bo_cache *cache,
uint32_t *size, uint32_t flags);