drm/nouveau/core/mm: modify test for if building a mm with holes in it
authorBen Skeggs <bskeggs@redhat.com>
Tue, 12 Aug 2014 03:40:42 +0000 (13:40 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 15 Sep 2014 12:22:13 +0000 (22:22 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/core/mm.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c

index 6692eb43edf91d8fbce2df2c4dd0a478a84434b6..cdd0c9ad0eff59ecb2204a0d8e85babba6b0dbe1 100644 (file)
@@ -211,7 +211,9 @@ nouveau_mm_init(struct nouveau_mm *mm, u32 offset, u32 length, u32 block)
 {
        struct nouveau_mm_node *node;
 
-       if (block) {
+       if (nouveau_mm_initialised(mm)) {
+               BUG_ON(block != mm->block_size);
+       } else {
                INIT_LIST_HEAD(&mm->nodes);
                INIT_LIST_HEAD(&mm->free);
                mm->block_size = block;
index 2b284b19276330aabd6b584c55b21eb727232662..8007f610df3943f3b9dbe8380348e142d6ef285a 100644 (file)
@@ -562,7 +562,7 @@ nvc0_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
                offset = (0x0200000000ULL >> 12) + (bsize << 8);
                length = (ram->size >> 12) - ((bsize * parts) << 8) - rsvd_tail;
 
-               ret = nouveau_mm_init(&pfb->vram, offset, length, 0);
+               ret = nouveau_mm_init(&pfb->vram, offset, length, 1);
                if (ret)
                        nouveau_mm_fini(&pfb->vram);
        }