diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 147e59c4015..b02a231d693 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -779,29 +779,24 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) | |||
779 | return ret; | 779 | return ret; |
780 | } | 780 | } |
781 | 781 | ||
782 | /* map larger RAMIN aperture on NV40 cards */ | 782 | /* Map PRAMIN BAR, or on older cards, the aperture withing BAR0 */ |
783 | dev_priv->ramin = NULL; | ||
784 | if (dev_priv->card_type >= NV_40) { | 783 | if (dev_priv->card_type >= NV_40) { |
785 | int ramin_bar = 2; | 784 | int ramin_bar = 2; |
786 | if (pci_resource_len(dev->pdev, ramin_bar) == 0) | 785 | if (pci_resource_len(dev->pdev, ramin_bar) == 0) |
787 | ramin_bar = 3; | 786 | ramin_bar = 3; |
788 | 787 | ||
789 | dev_priv->ramin_size = pci_resource_len(dev->pdev, ramin_bar); | 788 | dev_priv->ramin_size = pci_resource_len(dev->pdev, ramin_bar); |
790 | dev_priv->ramin = ioremap( | 789 | dev_priv->ramin = |
791 | pci_resource_start(dev->pdev, ramin_bar), | 790 | ioremap(pci_resource_start(dev->pdev, ramin_bar), |
792 | dev_priv->ramin_size); | 791 | dev_priv->ramin_size); |
793 | if (!dev_priv->ramin) { | 792 | if (!dev_priv->ramin) { |
794 | NV_ERROR(dev, "Failed to init RAMIN mapping, " | 793 | NV_ERROR(dev, "Failed to PRAMIN BAR"); |
795 | "limited instance memory available\n"); | 794 | return -ENOMEM; |
796 | } | 795 | } |
797 | } | 796 | } else { |
798 | |||
799 | /* On older cards (or if the above failed), create a map covering | ||
800 | * the BAR0 PRAMIN aperture */ | ||
801 | if (!dev_priv->ramin) { | ||
802 | dev_priv->ramin_size = 1 * 1024 * 1024; | 797 | dev_priv->ramin_size = 1 * 1024 * 1024; |
803 | dev_priv->ramin = ioremap(mmio_start_offs + NV_RAMIN, | 798 | dev_priv->ramin = ioremap(mmio_start_offs + NV_RAMIN, |
804 | dev_priv->ramin_size); | 799 | dev_priv->ramin_size); |
805 | if (!dev_priv->ramin) { | 800 | if (!dev_priv->ramin) { |
806 | NV_ERROR(dev, "Failed to map BAR0 PRAMIN.\n"); | 801 | NV_ERROR(dev, "Failed to map BAR0 PRAMIN.\n"); |
807 | return -ENOMEM; | 802 | return -ENOMEM; |