drm/nv50: enable non-contig vram allocations where requested
authorBen Skeggs <bskeggs@redhat.com>
Fri, 12 Nov 2010 05:13:59 +0000 (15:13 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 8 Dec 2010 03:48:16 +0000 (13:48 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_mem.c

index 3a531d53de4d86c323236cdbdaac718c6656cf02..5a1809480388646090dd23339865fa813e3c29ea 100644 (file)
@@ -713,10 +713,14 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
        struct drm_device *dev = dev_priv->dev;
        struct nouveau_bo *nvbo = nouveau_bo(bo);
        struct nouveau_vram *vram;
+       u32 size_nc = 0;
        int ret;
 
+       if (nvbo->tile_flags & NOUVEAU_GEM_TILE_NONCONTIG)
+               size_nc = 1 << nvbo->vma.node->type;
+
        ret = nv50_vram_new(dev, mem->num_pages << PAGE_SHIFT,
-                           mem->page_alignment << PAGE_SHIFT, 0,
+                           mem->page_alignment << PAGE_SHIFT, size_nc,
                            (nvbo->tile_flags >> 8) & 0x7f, &vram);
        if (ret)
                return ret;