summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_ttm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-09-26 08:37:51 +0400
committerBen Skeggs <bskeggs@redhat.com>2012-10-03 07:13:16 +0400
commitdc73b45ad456b173610a211c588d003f7ea77957 (patch)
tree41523a117f091c0b38ea642298f30d29869f6ae3 /drivers/gpu/drm/nouveau/nouveau_ttm.c
parentc0abf5c9fa1db7188bd6b8b580614a377dbc7080 (diff)
downloadlinux-dc73b45ad456b173610a211c588d003f7ea77957.tar.xz
drm/nouveau: store supported dma mask in vmmgr
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ttm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ttm.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index d2fc121ff861..9be9cb58e19b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -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)