nouveau/mm: move slabs to correct list on memory release
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 30 Aug 2011 12:29:23 +0000 (14:29 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 30 Aug 2011 12:52:17 +0000 (14:52 +0200)
Should get rid of "destroying GPU memory cache with some buffers
still in use" message.

src/gallium/drivers/nouveau/nouveau_mm.c

index 6c6d28c17f6ed0764bda693532a6e0caf8d895d7..91532d7ec72f95ef32d3fc6bd65ef4dd451bb35a 100644 (file)
@@ -210,13 +210,13 @@ nouveau_mm_free(struct nouveau_mm_allocation *alloc)
 
    mm_slab_free(slab, alloc->offset >> slab->order);
 
+   if (slab->free == slab->count) {
+      LIST_DEL(&slab->head);
+      LIST_ADDTAIL(&slab->head, &bucket->free);
+   } else
    if (slab->free == 1) {
       LIST_DEL(&slab->head);
-
-      if (slab->count > 1)
-         LIST_ADDTAIL(&slab->head, &bucket->used);
-      else
-         LIST_ADDTAIL(&slab->head, &bucket->free);
+      LIST_ADDTAIL(&slab->head, &bucket->used);
    }
 
    FREE(alloc);