summaryrefslogtreecommitdiff
path: root/bsd-core/ati_pcigart.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-07-20 21:17:47 +0000
committerEric Anholt <anholt@freebsd.org>2005-07-20 21:17:47 +0000
commitab59dd285c4ccdec92adadfcb869fc83edd96e86 (patch)
tree991a507b2e9afee54d15bc60848c988d5d4b9666 /bsd-core/ati_pcigart.c
parent026e12ea937865748d54d3b8a7a3b77ccc4e3efb (diff)
Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya,
with BSD fix from jkim and the r300_reg.h license from Nicolai Haehnle. Big thanks to everyone involved!
Diffstat (limited to 'bsd-core/ati_pcigart.c')
-rw-r--r--bsd-core/ati_pcigart.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bsd-core/ati_pcigart.c b/bsd-core/ati_pcigart.c
index 2eff5be1..f6131664 100644
--- a/bsd-core/ati_pcigart.c
+++ b/bsd-core/ati_pcigart.c
@@ -36,7 +36,7 @@
#define ATI_PCIGART_TABLE_SIZE 32768
int drm_ati_pcigart_init(drm_device_t *dev, unsigned long *addr,
- dma_addr_t *bus_addr)
+ dma_addr_t *bus_addr, int is_pcie)
{
unsigned long pages;
u32 *pci_gart = 0, page_base;
@@ -71,7 +71,14 @@ int drm_ati_pcigart_init(drm_device_t *dev, unsigned long *addr,
page_base = (u32) dev->sg->busaddr[i];
for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
- *pci_gart++ = cpu_to_le32( page_base );
+ if (is_pcie) {
+ *pci_gart = (cpu_to_le32(page_base)>>8) | 0xc;
+ DRM_DEBUG("PCIE: %d %08X %08X to %p\n", i,
+ page_base, (cpu_to_le32(page_base)>>8)|0xc,
+ pci_gart);
+ } else
+ *pci_gart = cpu_to_le32(page_base);
+ pci_gart++;
page_base += ATI_PCIGART_PAGE_SIZE;
}
}