aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_mem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 775a7017af64..37c7bf8e8296 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -471,8 +471,9 @@ void nouveau_mem_close(struct drm_device *dev)
471 } 471 }
472 472
473 if (dev_priv->fb_mtrr) { 473 if (dev_priv->fb_mtrr) {
474 drm_mtrr_del(dev_priv->fb_mtrr, drm_get_resource_start(dev, 1), 474 drm_mtrr_del(dev_priv->fb_mtrr,
475 drm_get_resource_len(dev, 1), DRM_MTRR_WC); 475 pci_resource_start(dev->pdev, 1),
476 pci_resource_len(dev->pdev, 1), DRM_MTRR_WC);
476 dev_priv->fb_mtrr = 0; 477 dev_priv->fb_mtrr = 0;
477 } 478 }
478} 479}
@@ -632,7 +633,7 @@ nouveau_mem_init(struct drm_device *dev)
632 struct ttm_bo_device *bdev = &dev_priv->ttm.bdev; 633 struct ttm_bo_device *bdev = &dev_priv->ttm.bdev;
633 int ret, dma_bits = 32; 634 int ret, dma_bits = 32;
634 635
635 dev_priv->fb_phys = drm_get_resource_start(dev, 1); 636 dev_priv->fb_phys = pci_resource_start(dev->pdev, 1);
636 dev_priv->gart_info.type = NOUVEAU_GART_NONE; 637 dev_priv->gart_info.type = NOUVEAU_GART_NONE;
637 638
638 if (dev_priv->card_type >= NV_50 && 639 if (dev_priv->card_type >= NV_50 &&
@@ -664,8 +665,9 @@ nouveau_mem_init(struct drm_device *dev)
664 665
665 dev_priv->fb_available_size = dev_priv->vram_size; 666 dev_priv->fb_available_size = dev_priv->vram_size;
666 dev_priv->fb_mappable_pages = dev_priv->fb_available_size; 667 dev_priv->fb_mappable_pages = dev_priv->fb_available_size;
667 if (dev_priv->fb_mappable_pages > drm_get_resource_len(dev, 1)) 668 if (dev_priv->fb_mappable_pages > pci_resource_len(dev->pdev, 1))
668 dev_priv->fb_mappable_pages = drm_get_resource_len(dev, 1); 669 dev_priv->fb_mappable_pages =
670 pci_resource_len(dev->pdev, 1);
669 dev_priv->fb_mappable_pages >>= PAGE_SHIFT; 671 dev_priv->fb_mappable_pages >>= PAGE_SHIFT;
670 672
671 /* remove reserved space at end of vram from available amount */ 673 /* remove reserved space at end of vram from available amount */
@@ -717,8 +719,8 @@ nouveau_mem_init(struct drm_device *dev)
717 return ret; 719 return ret;
718 } 720 }
719 721
720 dev_priv->fb_mtrr = drm_mtrr_add(drm_get_resource_start(dev, 1), 722 dev_priv->fb_mtrr = drm_mtrr_add(pci_resource_start(dev->pdev, 1),
721 drm_get_resource_len(dev, 1), 723 pci_resource_len(dev->pdev, 1),
722 DRM_MTRR_WC); 724 DRM_MTRR_WC);
723 725
724 return 0; 726 return 0;