aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cp.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_cp.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
index 073894824e6b..abdc1ae38467 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
@@ -1751,6 +1751,12 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags)
1751 else 1751 else
1752 dev_priv->flags |= RADEON_IS_PCI; 1752 dev_priv->flags |= RADEON_IS_PCI;
1753 1753
1754 ret = drm_addmap(dev, drm_get_resource_start(dev, 2),
1755 drm_get_resource_len(dev, 2), _DRM_REGISTERS,
1756 _DRM_READ_ONLY | _DRM_DRIVER, &dev_priv->mmio);
1757 if (ret != 0)
1758 return ret;
1759
1754 DRM_DEBUG("%s card detected\n", 1760 DRM_DEBUG("%s card detected\n",
1755 ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); 1761 ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI"))));
1756 return ret; 1762 return ret;
@@ -1767,12 +1773,6 @@ int radeon_driver_firstopen(struct drm_device *dev)
1767 1773
1768 dev_priv->gart_info.table_size = RADEON_PCIGART_TABLE_SIZE; 1774 dev_priv->gart_info.table_size = RADEON_PCIGART_TABLE_SIZE;
1769 1775
1770 ret = drm_addmap(dev, drm_get_resource_start(dev, 2),
1771 drm_get_resource_len(dev, 2), _DRM_REGISTERS,
1772 _DRM_READ_ONLY, &dev_priv->mmio);
1773 if (ret != 0)
1774 return ret;
1775
1776 dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0); 1776 dev_priv->fb_aper_offset = drm_get_resource_start(dev, 0);
1777 ret = drm_addmap(dev, dev_priv->fb_aper_offset, 1777 ret = drm_addmap(dev, dev_priv->fb_aper_offset,
1778 drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER, 1778 drm_get_resource_len(dev, 0), _DRM_FRAME_BUFFER,
@@ -1788,6 +1788,9 @@ int radeon_driver_unload(struct drm_device *dev)
1788 drm_radeon_private_t *dev_priv = dev->dev_private; 1788 drm_radeon_private_t *dev_priv = dev->dev_private;
1789 1789
1790 DRM_DEBUG("\n"); 1790 DRM_DEBUG("\n");
1791
1792 drm_rmmap(dev, dev_priv->mmio);
1793
1791 drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER); 1794 drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER);
1792 1795
1793 dev->dev_private = NULL; 1796 dev->dev_private = NULL;