struct _drm_bacon_bufmgr *bufmgr;
};
-struct drm_bacon_gem_bo_bucket {
+struct bo_cache_bucket {
struct list_head head;
unsigned long size;
};
pthread_mutex_t lock;
/** Array of lists of cached gem objects of power-of-two sizes */
- struct drm_bacon_gem_bo_bucket cache_bucket[14 * 4];
+ struct bo_cache_bucket cache_bucket[14 * 4];
int num_buckets;
time_t time;
return ALIGN(pitch, tile_width);
}
-static struct drm_bacon_gem_bo_bucket *
+static struct bo_cache_bucket *
bucket_for_size(drm_bacon_bufmgr *bufmgr, unsigned long size)
{
int i;
for (i = 0; i < bufmgr->num_buckets; i++) {
- struct drm_bacon_gem_bo_bucket *bucket =
+ struct bo_cache_bucket *bucket =
&bufmgr->cache_bucket[i];
if (bucket->size >= size) {
return bucket;
/* drop the oldest entries that have been purged by the kernel */
static void
drm_bacon_gem_bo_cache_purge_bucket(drm_bacon_bufmgr *bufmgr,
- struct drm_bacon_gem_bo_bucket *bucket)
+ struct bo_cache_bucket *bucket)
{
while (!list_empty(&bucket->head)) {
drm_bacon_bo *bo;
drm_bacon_bo *bo;
unsigned int page_size = getpagesize();
int ret;
- struct drm_bacon_gem_bo_bucket *bucket;
+ struct bo_cache_bucket *bucket;
bool alloc_from_cache;
unsigned long bo_size;
bool for_render = false;
return;
for (i = 0; i < bufmgr->num_buckets; i++) {
- struct drm_bacon_gem_bo_bucket *bucket =
+ struct bo_cache_bucket *bucket =
&bufmgr->cache_bucket[i];
while (!list_empty(&bucket->head)) {
bo_unreference_final(drm_bacon_bo *bo, time_t time)
{
drm_bacon_bufmgr *bufmgr = bo->bufmgr;
- struct drm_bacon_gem_bo_bucket *bucket;
+ struct bo_cache_bucket *bucket;
DBG("bo_unreference final: %d (%s)\n",
bo->gem_handle, bo->name);
/* Free any cached buffer objects we were going to reuse */
for (int i = 0; i < bufmgr->num_buckets; i++) {
- struct drm_bacon_gem_bo_bucket *bucket =
+ struct bo_cache_bucket *bucket =
&bufmgr->cache_bucket[i];
drm_bacon_bo *bo;