diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-07-01 15:25:47 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-07-01 15:25:47 +0000 |
commit | 5e8ad0f350cae687ec4789cff8f49b3b56581cd1 (patch) | |
tree | c69313bd8ae00695da97150c9b8f3102f32a026c | |
parent | 67a09b6abd8de9dd28299e888ca8168a1dc10671 (diff) |
Get the linux drm building again
-rw-r--r-- | linux-core/Makefile.kernel | 2 | ||||
-rw-r--r-- | linux-core/drmP.h | 6 | ||||
-rw-r--r-- | linux-core/drm_bufs.c | 2 | ||||
-rw-r--r-- | linux-core/drm_dma.c | 6 | ||||
-rw-r--r-- | linux-core/drm_drv.c | 4 | ||||
-rw-r--r-- | linux-core/drm_memory.h | 9 | ||||
-rw-r--r-- | linux-core/drm_memory_debug.h | 4 | ||||
-rw-r--r-- | linux-core/drm_pci.c | 12 | ||||
-rw-r--r-- | linux-core/drm_vm.c | 2 | ||||
-rw-r--r-- | linux-core/i810_dma.c | 6 | ||||
-rw-r--r-- | linux-core/i810_drv.h | 1 | ||||
-rw-r--r-- | linux-core/i830_drv.c | 1 | ||||
-rw-r--r-- | linux/Makefile.kernel | 2 | ||||
-rw-r--r-- | linux/Makefile.linux | 2 | ||||
-rw-r--r-- | linux/drmP.h | 6 | ||||
-rw-r--r-- | linux/drm_bufs.h | 2 | ||||
-rw-r--r-- | linux/drm_dma.h | 6 | ||||
-rw-r--r-- | linux/drm_drv.h | 4 | ||||
-rw-r--r-- | linux/drm_memory.h | 9 | ||||
-rw-r--r-- | linux/drm_memory_debug.h | 4 | ||||
-rw-r--r-- | linux/drm_pci.h | 12 | ||||
-rw-r--r-- | linux/drm_vm.h | 2 | ||||
-rw-r--r-- | linux/i810.h | 2 | ||||
-rw-r--r-- | linux/i810_dma.c | 6 | ||||
-rw-r--r-- | linux/i810_drv.h | 1 | ||||
-rw-r--r-- | linux/i830_drv.c | 1 |
26 files changed, 46 insertions, 68 deletions
diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index 72d69a02..2a41ab0d 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -12,7 +12,7 @@ tdfx-objs := tdfx_drv.o r128-objs := r128_drv.o r128_cce.o r128_state.o r128_irq.o 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 i830_compat.o i830_mem.o +i830-objs := i830_drv.o i830_dma.o i830_irq.o i830_mem.o radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o sis-objs := sis_drv.o sis_ds.o sis_mm.o ffb-objs := ffb_drv.o ffb_context.o diff --git a/linux-core/drmP.h b/linux-core/drmP.h index acfe4be7..94c0d3e6 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -307,7 +307,7 @@ static inline struct page * vmalloc_to_page(void * vmalloc_addr) #define DRM_IOREMAPFREE(map, dev) \ do { \ if ( (map)->handle && (map)->size ) \ - DRM(ioremapfree)( dev, map ); \ + DRM(ioremapfree)( (map)->handle, (map)->size, dev ); \ } while (0) /** @@ -827,7 +827,7 @@ extern void DRM(free_pages)(unsigned long address, int order, extern void *DRM(ioremap)(unsigned long offset, unsigned long size, drm_device_t *dev); extern void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_t *dev); -extern void DRM(ioremapfree)(drm_device_t *dev, drm_local_map_t *map); +extern void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev); #if __REALLY_HAVE_AGP extern agp_memory *DRM(alloc_agp)(int pages, u32 type); @@ -932,7 +932,7 @@ extern int DRM(mapbufs)( struct inode *inode, struct file *filp, extern int DRM(dma_setup)(drm_device_t *dev); extern void DRM(dma_takedown)(drm_device_t *dev); extern void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf); -extern void DRM(reclaim_buffers)( struct file *filp ); +extern void DRM(reclaim_buffers)( drm_device_t *dev, struct file *filp ); #if __HAVE_DMA_IRQ extern int DRM(control)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index 28bc1c40..77573709 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -282,7 +282,7 @@ int DRM(rmmap)(struct inode *inode, struct file *filp, DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - DRM(ioremapfree)(dev, map); + DRM(ioremapfree)(map->handle, map->size, dev); break; case _DRM_SHM: vfree(map->handle); diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c index 8e0ec95e..7b98b9b0 100644 --- a/linux-core/drm_dma.c +++ b/linux-core/drm_dma.c @@ -189,10 +189,10 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf) * * Frees each buffer associated with \p filp not already on the hardware. */ -void DRM(reclaim_buffers)( struct file *filp ) +void DRM(reclaim_buffers)( drm_device_t *dev, struct file *filp ) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; +/* drm_file_t *priv = filp->private_data; */ +/* drm_device_t *dev = priv->dev; */ drm_device_dma_t *dma = dev->dma; int i; diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 0c328cd9..b2b48528 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -470,7 +470,7 @@ static int DRM(takedown)( drm_device_t *dev ) DRM_DEBUG( "mtrr_del=%d\n", retcode ); } #endif - DRM(ioremapfree)( dev, map ); + DRM(ioremapfree)( map->handle, map->size, dev ); break; case _DRM_SHM: vfree(map->handle); @@ -901,7 +901,7 @@ int DRM(release)( struct inode *inode, struct file *filp ) } } #elif __HAVE_DMA - DRM(reclaim_buffers)( filp ); + DRM(reclaim_buffers)( dev, filp ); #endif DRM(fasync)( -1, filp, 0 ); diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h index 8f6f05b6..2a969fcd 100644 --- a/linux-core/drm_memory.h +++ b/linux-core/drm_memory.h @@ -172,11 +172,8 @@ static inline void *drm_ioremap_nocache(unsigned long offset, unsigned long size return ioremap_nocache(offset, size); } -static inline void drm_ioremapfree(drm_device_t *dev, drm_local_map_t *map) +static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev) { - void *pt = map->handle; - unsigned long size = map->size; - #if __REALLY_HAVE_AGP && defined(VMAP_4_ARGS) /* * This is a bit ugly. It would be much cleaner if the DRM API would use separate @@ -328,9 +325,9 @@ void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_ } /** Wrapper around drm_iounmap() */ -void DRM(ioremapfree)(drm_device_t *dev, drm_local_map_t *map) +void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev) { - drm_ioremapfree(map->handle, map->size, dev); + drm_ioremapfree(pt, size, dev); } #if __REALLY_HAVE_AGP diff --git a/linux-core/drm_memory_debug.h b/linux-core/drm_memory_debug.h index 5a1e0f0b..6d12fc53 100644 --- a/linux-core/drm_memory_debug.h +++ b/linux-core/drm_memory_debug.h @@ -318,10 +318,8 @@ void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_ return pt; } -void DRM(ioremapfree)( drm_device_t *dev, drm_local_map_t *map) +void DRM(ioremapfree)( void *pt, unsigned long size, drm_device_t *dev ) { - void *pt = map->handle; - unsigned long size = map->size; int alloc_count; int free_count; diff --git a/linux-core/drm_pci.c b/linux-core/drm_pci.c index 625470d3..b5982e33 100644 --- a/linux-core/drm_pci.c +++ b/linux-core/drm_pci.c @@ -40,15 +40,9 @@ */ void * DRM(pci_alloc)(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr, - dma_addr_t *busaddr) + dma_addr_t *busaddr) { - void *vaddr; - - vaddr = contigmalloc(size, DRM(M_DRM), M_WAITOK, 0ul, maxaddr, align, - 0); - *busaddr = vtophys(vaddr); - - return vaddr; + return pci_alloc_consistent(dev->pdev, PAGE_SIZE, busaddr); } /** @@ -57,7 +51,7 @@ DRM(pci_alloc)(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr, void DRM(pci_free)(drm_device_t *dev, size_t size, void *vaddr, dma_addr_t busaddr) { - pci_free_consistent(dev->pdev, size, vaddr, busaddr); + pci_free_consistent(dev->pdev, size, vaddr, busaddr); } /*@}*/ diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 19d497e2..9c73330f 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -242,7 +242,7 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma) DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - DRM(ioremapfree)(dev, map); + DRM(ioremapfree)(map->handle, map->size, dev); break; case _DRM_SHM: vfree(map->handle); diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index 678610c6..64b9e4ed 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -862,10 +862,10 @@ static int i810_flush_queue(drm_device_t *dev) } /* Must be called with the lock held */ -void i810_reclaim_buffers(struct file *filp) +void i810_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; +/* drm_file_t *priv = filp->private_data; */ +/* drm_device_t *dev = priv->dev; */ drm_device_dma_t *dma = dev->dma; int i; diff --git a/linux-core/i810_drv.h b/linux-core/i810_drv.h index aa82c647..916a2eca 100644 --- a/linux-core/i810_drv.h +++ b/linux-core/i810_drv.h @@ -87,7 +87,6 @@ extern int i810_dma_init(struct inode *inode, struct file *filp, extern int i810_dma_cleanup(drm_device_t *dev); extern int i810_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i810_reclaim_buffers(struct file *filp); extern int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma); diff --git a/linux-core/i830_drv.c b/linux-core/i830_drv.c index 3c9b6e46..0ed90c45 100644 --- a/linux-core/i830_drv.c +++ b/linux-core/i830_drv.c @@ -54,3 +54,4 @@ #include "drm_proc.h" #include "drm_vm.h" #include "drm_stub.h" +#include "drm_pci.h" diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel index 72d69a02..2a41ab0d 100644 --- a/linux/Makefile.kernel +++ b/linux/Makefile.kernel @@ -12,7 +12,7 @@ tdfx-objs := tdfx_drv.o r128-objs := r128_drv.o r128_cce.o r128_state.o r128_irq.o 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 i830_compat.o i830_mem.o +i830-objs := i830_drv.o i830_dma.o i830_irq.o i830_mem.o radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o sis-objs := sis_drv.o sis_ds.o sis_mm.o ffb-objs := ffb_drv.o ffb_context.o diff --git a/linux/Makefile.linux b/linux/Makefile.linux index 15870a0c..59f9a54a 100644 --- a/linux/Makefile.linux +++ b/linux/Makefile.linux @@ -79,7 +79,7 @@ MGASHARED = mga.h mga_dma.c mga_drm.h mga_drv.h mga_irq.c mga_state.c \ mga_ucode.h mga_warp.c I810HEADERS = i810.h i810_drv.h i810_drm.h $(DRMHEADERS) $(DRMTEMPLATES) I830HEADERS = i830.h i830_drv.h i830_drm.h $(DRMHEADERS) $(DRMTEMPLATES) -I830SHARED = i830_compat.c i830_dma.c i830_drm.h i830_drv.c i830_drv.h \ +I830SHARED = i830_dma.c i830_drm.h i830_drv.c i830_drv.h \ i830.h i830_irq.c i830_mem.c SISHEADERS= sis_drv.h sis_drm.h $(DRMHEADERS) diff --git a/linux/drmP.h b/linux/drmP.h index acfe4be7..94c0d3e6 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -307,7 +307,7 @@ static inline struct page * vmalloc_to_page(void * vmalloc_addr) #define DRM_IOREMAPFREE(map, dev) \ do { \ if ( (map)->handle && (map)->size ) \ - DRM(ioremapfree)( dev, map ); \ + DRM(ioremapfree)( (map)->handle, (map)->size, dev ); \ } while (0) /** @@ -827,7 +827,7 @@ extern void DRM(free_pages)(unsigned long address, int order, extern void *DRM(ioremap)(unsigned long offset, unsigned long size, drm_device_t *dev); extern void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_t *dev); -extern void DRM(ioremapfree)(drm_device_t *dev, drm_local_map_t *map); +extern void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev); #if __REALLY_HAVE_AGP extern agp_memory *DRM(alloc_agp)(int pages, u32 type); @@ -932,7 +932,7 @@ extern int DRM(mapbufs)( struct inode *inode, struct file *filp, extern int DRM(dma_setup)(drm_device_t *dev); extern void DRM(dma_takedown)(drm_device_t *dev); extern void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf); -extern void DRM(reclaim_buffers)( struct file *filp ); +extern void DRM(reclaim_buffers)( drm_device_t *dev, struct file *filp ); #if __HAVE_DMA_IRQ extern int DRM(control)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); diff --git a/linux/drm_bufs.h b/linux/drm_bufs.h index 28bc1c40..77573709 100644 --- a/linux/drm_bufs.h +++ b/linux/drm_bufs.h @@ -282,7 +282,7 @@ int DRM(rmmap)(struct inode *inode, struct file *filp, DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - DRM(ioremapfree)(dev, map); + DRM(ioremapfree)(map->handle, map->size, dev); break; case _DRM_SHM: vfree(map->handle); diff --git a/linux/drm_dma.h b/linux/drm_dma.h index 8e0ec95e..7b98b9b0 100644 --- a/linux/drm_dma.h +++ b/linux/drm_dma.h @@ -189,10 +189,10 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf) * * Frees each buffer associated with \p filp not already on the hardware. */ -void DRM(reclaim_buffers)( struct file *filp ) +void DRM(reclaim_buffers)( drm_device_t *dev, struct file *filp ) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; +/* drm_file_t *priv = filp->private_data; */ +/* drm_device_t *dev = priv->dev; */ drm_device_dma_t *dma = dev->dma; int i; diff --git a/linux/drm_drv.h b/linux/drm_drv.h index 0c328cd9..b2b48528 100644 --- a/linux/drm_drv.h +++ b/linux/drm_drv.h @@ -470,7 +470,7 @@ static int DRM(takedown)( drm_device_t *dev ) DRM_DEBUG( "mtrr_del=%d\n", retcode ); } #endif - DRM(ioremapfree)( dev, map ); + DRM(ioremapfree)( map->handle, map->size, dev ); break; case _DRM_SHM: vfree(map->handle); @@ -901,7 +901,7 @@ int DRM(release)( struct inode *inode, struct file *filp ) } } #elif __HAVE_DMA - DRM(reclaim_buffers)( filp ); + DRM(reclaim_buffers)( dev, filp ); #endif DRM(fasync)( -1, filp, 0 ); diff --git a/linux/drm_memory.h b/linux/drm_memory.h index 8f6f05b6..2a969fcd 100644 --- a/linux/drm_memory.h +++ b/linux/drm_memory.h @@ -172,11 +172,8 @@ static inline void *drm_ioremap_nocache(unsigned long offset, unsigned long size return ioremap_nocache(offset, size); } -static inline void drm_ioremapfree(drm_device_t *dev, drm_local_map_t *map) +static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev) { - void *pt = map->handle; - unsigned long size = map->size; - #if __REALLY_HAVE_AGP && defined(VMAP_4_ARGS) /* * This is a bit ugly. It would be much cleaner if the DRM API would use separate @@ -328,9 +325,9 @@ void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_ } /** Wrapper around drm_iounmap() */ -void DRM(ioremapfree)(drm_device_t *dev, drm_local_map_t *map) +void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev) { - drm_ioremapfree(map->handle, map->size, dev); + drm_ioremapfree(pt, size, dev); } #if __REALLY_HAVE_AGP diff --git a/linux/drm_memory_debug.h b/linux/drm_memory_debug.h index 5a1e0f0b..6d12fc53 100644 --- a/linux/drm_memory_debug.h +++ b/linux/drm_memory_debug.h @@ -318,10 +318,8 @@ void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, drm_device_ return pt; } -void DRM(ioremapfree)( drm_device_t *dev, drm_local_map_t *map) +void DRM(ioremapfree)( void *pt, unsigned long size, drm_device_t *dev ) { - void *pt = map->handle; - unsigned long size = map->size; int alloc_count; int free_count; diff --git a/linux/drm_pci.h b/linux/drm_pci.h index 625470d3..b5982e33 100644 --- a/linux/drm_pci.h +++ b/linux/drm_pci.h @@ -40,15 +40,9 @@ */ void * DRM(pci_alloc)(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr, - dma_addr_t *busaddr) + dma_addr_t *busaddr) { - void *vaddr; - - vaddr = contigmalloc(size, DRM(M_DRM), M_WAITOK, 0ul, maxaddr, align, - 0); - *busaddr = vtophys(vaddr); - - return vaddr; + return pci_alloc_consistent(dev->pdev, PAGE_SIZE, busaddr); } /** @@ -57,7 +51,7 @@ DRM(pci_alloc)(drm_device_t *dev, size_t size, size_t align, dma_addr_t maxaddr, void DRM(pci_free)(drm_device_t *dev, size_t size, void *vaddr, dma_addr_t busaddr) { - pci_free_consistent(dev->pdev, size, vaddr, busaddr); + pci_free_consistent(dev->pdev, size, vaddr, busaddr); } /*@}*/ diff --git a/linux/drm_vm.h b/linux/drm_vm.h index 19d497e2..9c73330f 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -242,7 +242,7 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma) DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif - DRM(ioremapfree)(dev, map); + DRM(ioremapfree)(map->handle, map->size, dev); break; case _DRM_SHM: vfree(map->handle); diff --git a/linux/i810.h b/linux/i810.h index bfb760ab..7f7719fe 100644 --- a/linux/i810.h +++ b/linux/i810.h @@ -86,7 +86,7 @@ */ #define __HAVE_RELEASE 1 #define DRIVER_RELEASE() do { \ - i810_reclaim_buffers( filp ); \ + i810_reclaim_buffers( dev, filp ); \ } while (0) #define DRIVER_PRETAKEDOWN() do { \ diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 678610c6..64b9e4ed 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -862,10 +862,10 @@ static int i810_flush_queue(drm_device_t *dev) } /* Must be called with the lock held */ -void i810_reclaim_buffers(struct file *filp) +void i810_reclaim_buffers(drm_device_t *dev, struct file *filp) { - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; +/* drm_file_t *priv = filp->private_data; */ +/* drm_device_t *dev = priv->dev; */ drm_device_dma_t *dma = dev->dma; int i; diff --git a/linux/i810_drv.h b/linux/i810_drv.h index aa82c647..916a2eca 100644 --- a/linux/i810_drv.h +++ b/linux/i810_drv.h @@ -87,7 +87,6 @@ extern int i810_dma_init(struct inode *inode, struct file *filp, extern int i810_dma_cleanup(drm_device_t *dev); extern int i810_flush_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern void i810_reclaim_buffers(struct file *filp); extern int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma); diff --git a/linux/i830_drv.c b/linux/i830_drv.c index 3c9b6e46..0ed90c45 100644 --- a/linux/i830_drv.c +++ b/linux/i830_drv.c @@ -54,3 +54,4 @@ #include "drm_proc.h" #include "drm_vm.h" #include "drm_stub.h" +#include "drm_pci.h" |