]> Pileus Git - ~andy/linux/blobdiff - drivers/gpu/drm/nouveau/nouveau_ttm.c
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[~andy/linux] / drivers / gpu / drm / nouveau / nouveau_ttm.c
index 560e816138eb981e37e9c80967fa9fb3e6ba4295..9be9cb58e19b30e6f463aaa637df067eb46ef9ac 100644 (file)
@@ -101,7 +101,7 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
        return 0;
 }
 
-void
+static void
 nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
 {
        struct nouveau_mm *mm = man->priv;
@@ -176,7 +176,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
        return 0;
 }
 
-void
+static void
 nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
 {
 }
@@ -248,7 +248,7 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man,
        return 0;
 }
 
-void
+static void
 nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
 {
 }
@@ -265,7 +265,7 @@ int
 nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
 {
        struct drm_file *file_priv = filp->private_data;
-       struct nouveau_drm *drm = nouveau_newpriv(file_priv->minor->dev);
+       struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
 
        if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
                return drm_mmap(filp, vma);
@@ -340,14 +340,10 @@ nouveau_ttm_init(struct nouveau_drm *drm)
        u32 bits;
        int ret;
 
-       if (nv_device(drm->device)->card_type >= NV_50) {
-               if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40)))
-                       bits = 40;
-               else
-                       bits = 32;
-       } else {
+       bits = nouveau_vmmgr(drm->device)->dma_bits;
+       if ( drm->agp.stat == ENABLED ||
+           !pci_dma_supported(dev->pdev, DMA_BIT_MASK(bits)))
                bits = 32;
-       }
 
        ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits));
        if (ret)