return NULL;
}
- if (!LIST_IS_EMPTY(&bucket->used)) {
+ if (!list_is_empty(&bucket->used)) {
slab = LIST_ENTRY(struct mm_slab, bucket->used.next, head);
} else {
- if (LIST_IS_EMPTY(&bucket->free)) {
+ if (list_is_empty(&bucket->free)) {
mm_slab_new(cache, MAX2(mm_get_order(size), MM_MIN_ORDER));
}
slab = LIST_ENTRY(struct mm_slab, bucket->free.next, head);
- LIST_DEL(&slab->head);
+ list_del(&slab->head);
list_add(&slab->head, &bucket->used);
}
nouveau_bo_ref(slab->bo, bo);
if (slab->free == 0) {
- LIST_DEL(&slab->head);
+ list_del(&slab->head);
list_add(&slab->head, &bucket->full);
}
mm_slab_free(slab, alloc->offset >> slab->order);
if (slab->free == slab->count) {
- LIST_DEL(&slab->head);
+ list_del(&slab->head);
list_addtail(&slab->head, &bucket->free);
} else
if (slab->free == 1) {
- LIST_DEL(&slab->head);
+ list_del(&slab->head);
list_addtail(&slab->head, &bucket->used);
}
struct mm_slab *slab, *next;
LIST_FOR_EACH_ENTRY_SAFE(slab, next, head, head) {
- LIST_DEL(&slab->head);
+ list_del(&slab->head);
nouveau_bo_ref(NULL, &slab->bo);
FREE(slab);
}
return;
for (i = 0; i < MM_NUM_BUCKETS; ++i) {
- if (!LIST_IS_EMPTY(&cache->bucket[i].used) ||
- !LIST_IS_EMPTY(&cache->bucket[i].full))
+ if (!list_is_empty(&cache->bucket[i].used) ||
+ !list_is_empty(&cache->bucket[i].full))
debug_printf("WARNING: destroying GPU memory cache "
"with some buffers still in use\n");