drm/nv40: support for 39-bit dma addresses on native PCIE chipsets
authorBen Skeggs <bskeggs@redhat.com>
Tue, 11 Jan 2011 05:50:26 +0000 (15:50 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 24 Feb 2011 20:44:10 +0000 (06:44 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_mem.c

index 123969dd4f56984925be9e2e244f21369542ea77..5cf924ed4ac63be9bb1b16228aabf17c88f5f921 100644 (file)
@@ -393,11 +393,17 @@ nouveau_mem_vram_init(struct drm_device *dev)
        struct ttm_bo_device *bdev = &dev_priv->ttm.bdev;
        int ret, dma_bits;
 
-       if (dev_priv->card_type >= NV_50 &&
-           pci_dma_supported(dev->pdev, DMA_BIT_MASK(40)))
-               dma_bits = 40;
-       else
-               dma_bits = 32;
+       dma_bits = 32;
+       if (dev_priv->card_type >= NV_50) {
+               if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40)))
+                       dma_bits = 40;
+       } else
+       if (drm_pci_device_is_pcie(dev) &&
+           dev_priv->chipset != 0x40 &&
+           dev_priv->chipset != 0x45) {
+               if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39)))
+                       dma_bits = 39;
+       }
 
        ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(dma_bits));
        if (ret)