aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_cp.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2006-01-02 01:18:39 -0500
committerDave Airlie <airlied@linux.ie>2006-01-02 01:18:39 -0500
commitf26c473cdf557ea6e8f267d34eee82d30473a363 (patch)
tree6b8f9ab884e26b5ee7861700a3e95808442d5720 /drivers/char/drm/radeon_cp.c
parent0a406877e638a6f43ed4591bb08d528415d7d53a (diff)
drm: update PCIGART support from CVS
In order to work on FreeBSD the gart needed to use a local mapping This patch moves the mainline to the new code and aligns some comment changes From: Eric Anholt <anholt@freebsd.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/radeon_cp.c')
-rw-r--r--drivers/char/drm/radeon_cp.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index dc3a15a1819a..eaa0e2b7c2f8 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1,5 +1,5 @@
1/* radeon_cp.c -- CP support for Radeon -*- linux-c -*- 1/* radeon_cp.c -- CP support for Radeon -*- linux-c -*- */
2 * 2/*
3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. 3 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California. 4 * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
5 * All Rights Reserved. 5 * All Rights Reserved.
@@ -1561,25 +1561,28 @@ static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
1561 if (dev_priv->pcigart_offset) { 1561 if (dev_priv->pcigart_offset) {
1562 dev_priv->gart_info.bus_addr = 1562 dev_priv->gart_info.bus_addr =
1563 dev_priv->pcigart_offset + dev_priv->fb_location; 1563 dev_priv->pcigart_offset + dev_priv->fb_location;
1564 dev_priv->gart_info.mapping.offset =
1565 dev_priv->gart_info.bus_addr;
1566 dev_priv->gart_info.mapping.size =
1567 RADEON_PCIGART_TABLE_SIZE;
1568
1569 drm_core_ioremap(&dev_priv->gart_info.mapping, dev);
1564 dev_priv->gart_info.addr = 1570 dev_priv->gart_info.addr =
1565 (unsigned long)drm_ioremap(dev_priv->gart_info. 1571 dev_priv->gart_info.mapping.handle;
1566 bus_addr,
1567 RADEON_PCIGART_TABLE_SIZE,
1568 dev);
1569 1572
1570 dev_priv->gart_info.is_pcie = 1573 dev_priv->gart_info.is_pcie =
1571 !!(dev_priv->flags & CHIP_IS_PCIE); 1574 !!(dev_priv->flags & CHIP_IS_PCIE);
1572 dev_priv->gart_info.gart_table_location = 1575 dev_priv->gart_info.gart_table_location =
1573 DRM_ATI_GART_FB; 1576 DRM_ATI_GART_FB;
1574 1577
1575 DRM_DEBUG("Setting phys_pci_gart to %08lX %08lX\n", 1578 DRM_DEBUG("Setting phys_pci_gart to %p %08lX\n",
1576 dev_priv->gart_info.addr, 1579 dev_priv->gart_info.addr,
1577 dev_priv->pcigart_offset); 1580 dev_priv->pcigart_offset);
1578 } else { 1581 } else {
1579 dev_priv->gart_info.gart_table_location = 1582 dev_priv->gart_info.gart_table_location =
1580 DRM_ATI_GART_MAIN; 1583 DRM_ATI_GART_MAIN;
1581 dev_priv->gart_info.addr = 1584 dev_priv->gart_info.addr = NULL;
1582 dev_priv->gart_info.bus_addr = 0; 1585 dev_priv->gart_info.bus_addr = 0;
1583 if (dev_priv->flags & CHIP_IS_PCIE) { 1586 if (dev_priv->flags & CHIP_IS_PCIE) {
1584 DRM_ERROR 1587 DRM_ERROR
1585 ("Cannot use PCI Express without GART in FB memory\n"); 1588 ("Cannot use PCI Express without GART in FB memory\n");
@@ -1641,8 +1644,7 @@ static int radeon_do_cleanup_cp(drm_device_t * dev)
1641 DRM_ERROR("failed to cleanup PCI GART!\n"); 1644 DRM_ERROR("failed to cleanup PCI GART!\n");
1642 1645
1643 if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB) { 1646 if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB) {
1644 drm_ioremapfree((void *)dev_priv->gart_info.addr, 1647 drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
1645 RADEON_PCIGART_TABLE_SIZE, dev);
1646 dev_priv->gart_info.addr = 0; 1648 dev_priv->gart_info.addr = 0;
1647 } 1649 }
1648 } 1650 }