diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-07-20 21:17:47 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-07-20 21:17:47 +0000 |
commit | ab59dd285c4ccdec92adadfcb869fc83edd96e86 (patch) | |
tree | 991a507b2e9afee54d15bc60848c988d5d4b9666 /linux-core | |
parent | 026e12ea937865748d54d3b8a7a3b77ccc4e3efb (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 'linux-core')
-rw-r--r-- | linux-core/Makefile | 4 | ||||
-rw-r--r-- | linux-core/Makefile.kernel | 2 | ||||
-rw-r--r-- | linux-core/ati_pcigart.c | 12 | ||||
-rw-r--r-- | linux-core/drmP.h | 7 | ||||
-rw-r--r-- | linux-core/drm_memory.h | 1 |
5 files changed, 20 insertions, 6 deletions
diff --git a/linux-core/Makefile b/linux-core/Makefile index 70b2a8f7..5b2b2315 100644 --- a/linux-core/Makefile +++ b/linux-core/Makefile @@ -75,9 +75,9 @@ TDFXHEADERS = tdfx_drv.h $(DRMHEADERS) TDFXSHARED = tdfx_drv.h R128HEADERS = r128_drv.h r128_drm.h $(DRMHEADERS) R128SHARED = r128_drv.h r128_drm.h r128_cce.c r128_state.c r128_irq.c -RADEONHEADERS = radeon_drv.h radeon_drm.h $(DRMHEADERS) +RADEONHEADERS = radeon_drv.h radeon_drm.h r300_reg.h $(DRMHEADERS) RADEONSHARED = radeon_drv.h radeon_drm.h radeon_cp.c radeon_irq.c \ - radeon_mem.c radeon_state.c + radeon_mem.c radeon_state.c r300_cmdbuf.c r300_reg.h MGAHEADERS = mga_drv.h mga_drm.h mga_ucode.h $(DRMHEADERS) MGASHARED = mga_dma.c mga_drm.h mga_drv.h mga_irq.c mga_state.c \ mga_ucode.h mga_warp.c diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index b091156f..1700c0a9 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -18,7 +18,7 @@ mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o i810-objs := i810_drv.o i810_dma.o i830-objs := i830_drv.o i830_dma.o i830_irq.o i915-objs := i915_drv.o i915_dma.o i915_irq.o i915_mem.o i915_pm.o -radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o +radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o r300_cmdbuf.o sis-objs := sis_drv.o sis_ds.o sis_mm.o ffb-objs := ffb_drv.o ffb_context.o savage-objs := savage_drv.o savage_bci.o savage_state.o diff --git a/linux-core/ati_pcigart.c b/linux-core/ati_pcigart.c index f990635a..3e654c79 100644 --- a/linux-core/ati_pcigart.c +++ b/linux-core/ati_pcigart.c @@ -92,7 +92,8 @@ static void drm_ati_free_pcigart_table(unsigned long address) } int drm_ati_pcigart_init(drm_device_t * dev, - unsigned long *addr, dma_addr_t * bus_addr) + unsigned long *addr, dma_addr_t * bus_addr, + int is_pcie) { drm_sg_mem_t *entry = dev->sg; unsigned long address = 0; @@ -149,7 +150,14 @@ int drm_ati_pcigart_init(drm_device_t * dev, page_base = (u32) entry->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; } } diff --git a/linux-core/drmP.h b/linux-core/drmP.h index ba289968..53048ebf 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -973,7 +973,7 @@ extern int drm_sg_free(struct inode *inode, struct file *filp, /* ATI PCIGART support (ati_pcigart.h) */ extern int drm_ati_pcigart_init(drm_device_t * dev, - unsigned long *addr, dma_addr_t * bus_addr); + unsigned long *addr, dma_addr_t * bus_addr, int is_pcie); extern int drm_ati_pcigart_cleanup(drm_device_t * dev, unsigned long addr, dma_addr_t bus_addr); @@ -1038,6 +1038,11 @@ static __inline__ int drm_device_is_agp(drm_device_t *dev) return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP); } +static __inline__ int drm_device_is_pcie(drm_device_t *dev) +{ + return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); +} + static __inline__ void drm_core_dropmap(struct drm_map *map) { } diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h index f354885b..4a4fd5c3 100644 --- a/linux-core/drm_memory.h +++ b/linux-core/drm_memory.h @@ -35,6 +35,7 @@ #include <linux/config.h> #include <linux/highmem.h> +#include <linux/vmalloc.h> #include "drmP.h" /** |