fence->state = NVC0_FENCE_STATE_EMITTED;
}
+static void
+nvc0_fence_trigger_release_buffers(struct nvc0_fence *fence);
+
void
nvc0_fence_del(struct nvc0_fence *fence)
{
screen->fence.tail = it;
}
}
+
+ if (fence->buffers) {
+ debug_printf("WARNING: deleting fence with buffers "
+ "still hooked to it !\n");
+ nvc0_fence_trigger_release_buffers(fence);
+ }
+
FREE(fence);
}
nvc0_mm_free(alloc);
alloc = next;
};
+ fence->buffers = NULL;
}
static void
return cache;
}
+static INLINE void
+nvc0_mm_free_slabs(struct list_head *head)
+{
+ struct mm_slab *slab, *next;
+
+ LIST_FOR_EACH_ENTRY_SAFE(slab, next, head, head) {
+ LIST_DEL(&slab->head);
+ nouveau_bo_ref(NULL, &slab->bo);
+ FREE(slab);
+ }
+}
+
+void
+nvc0_mm_destroy(struct nvc0_mman *cache)
+{
+ int i;
+
+ for (i = 0; i < MM_NUM_BUCKETS; ++i) {
+ 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");
+
+ nvc0_mm_free_slabs(&cache->bucket[i].free);
+ nvc0_mm_free_slabs(&cache->bucket[i].used);
+ nvc0_mm_free_slabs(&cache->bucket[i].full);
+ }
+}
+
{
struct nvc0_screen *screen = nvc0_screen(pscreen);
+ nvc0_fence_wait(screen->fence.current);
+ nvc0_fence_reference(&screen->fence.current, NULL);
+
nouveau_bo_ref(NULL, &screen->text);
nouveau_bo_ref(NULL, &screen->tls);
nouveau_bo_ref(NULL, &screen->txc);
if (screen->tic.entries)
FREE(screen->tic.entries);
+ nvc0_mm_destroy(screen->mm_GART);
+ nvc0_mm_destroy(screen->mm_VRAM);
+ nvc0_mm_destroy(screen->mm_VRAM_fe0);
+
nouveau_grobj_free(&screen->fermi);
nouveau_grobj_free(&screen->eng2d);
nouveau_grobj_free(&screen->m2mf);
extern struct nvc0_mman *
nvc0_mm_create(struct nouveau_device *, uint32_t domain, uint32_t storage_type);
+extern void
+nvc0_mm_destroy(struct nvc0_mman *);
+
extern struct nvc0_mm_allocation *
nvc0_mm_allocate(struct nvc0_mman *,
uint32_t size, struct nouveau_bo **, uint32_t *offset);