diff options
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Makefile.linux | 4 | ||||
-rw-r--r-- | linux/drmP.h | 2 | ||||
-rw-r--r-- | linux/drm_agpsupport.h | 4 | ||||
-rw-r--r-- | linux/drm_drv.h | 18 | ||||
-rw-r--r-- | linux/drm_stub.h | 4 | ||||
-rw-r--r-- | linux/drm_vm.h | 32 | ||||
-rw-r--r-- | linux/i810_dma.c | 27 | ||||
-rw-r--r-- | linux/i830_dma.c | 24 |
8 files changed, 61 insertions, 54 deletions
diff --git a/linux/Makefile.linux b/linux/Makefile.linux index 893d4985..a8cd62a7 100644 --- a/linux/Makefile.linux +++ b/linux/Makefile.linux @@ -254,12 +254,12 @@ ChangeLog: $(GAMMAOBJS): $(GAMMAHEADERS) $(TDFXOBJS): $(TDFXHEADERS) +$(R128OBJS): $(R128HEADERS) +$(RADEONOBJS): $(RADEONHEADERS) ifeq ($(AGP),1) $(MGAOBJS): $(MGAHEADERS) $(I810OBJS): $(I810HEADERS) $(I830OBJS): $(I830HEADERS) -$(R128OBJS): $(R128HEADERS) -$(RADEONOBJS): $(RADEONHEADERS) endif clean cleandir:: diff --git a/linux/drmP.h b/linux/drmP.h index c00efb4c..f31c5c3d 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -165,7 +165,7 @@ #define pte_unmap(pte) #endif -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020413 /* KERNEL_VERSION(2,4,19) */ static inline struct page * vmalloc_to_page(void * vmalloc_addr) { unsigned long addr = (unsigned long) vmalloc_addr; diff --git a/linux/drm_agpsupport.h b/linux/drm_agpsupport.h index fc0b29aa..cd46110c 100644 --- a/linux/drm_agpsupport.h +++ b/linux/drm_agpsupport.h @@ -268,11 +268,11 @@ drm_agp_head_t *DRM(agp_init)(void) case INTEL_I810: head->chipset = "Intel i810"; break; case INTEL_I815: head->chipset = "Intel i815"; break; -#if LINUX_VERSION_CODE >= 0x020415 +#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */ case INTEL_I820: head->chipset = "Intel i820"; break; #endif case INTEL_I840: head->chipset = "Intel i840"; break; -#if LINUX_VERSION_CODE >= 0x020415 +#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */ case INTEL_I845: head->chipset = "Intel i845"; break; #endif case INTEL_I850: head->chipset = "Intel i850"; break; diff --git a/linux/drm_drv.h b/linux/drm_drv.h index af6858d7..81bd7894 100644 --- a/linux/drm_drv.h +++ b/linux/drm_drv.h @@ -115,15 +115,15 @@ #ifndef DRIVER_FOPS #define DRIVER_FOPS \ static struct file_operations DRM(fops) = { \ - owner: THIS_MODULE, \ - open: DRM(open), \ - flush: DRM(flush), \ - release: DRM(release), \ - ioctl: DRM(ioctl), \ - mmap: DRM(mmap), \ - read: DRM(read), \ - fasync: DRM(fasync), \ - poll: DRM(poll), \ + .owner = THIS_MODULE, \ + .open = DRM(open), \ + .flush = DRM(flush), \ + .release = DRM(release), \ + .ioctl = DRM(ioctl), \ + .mmap = DRM(mmap), \ + .read = DRM(read), \ + .fasync = DRM(fasync), \ + .poll = DRM(poll), \ } #endif diff --git a/linux/drm_stub.h b/linux/drm_stub.h index b1e78923..3c9c69eb 100644 --- a/linux/drm_stub.h +++ b/linux/drm_stub.h @@ -66,8 +66,8 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp) } static struct file_operations DRM(stub_fops) = { - owner: THIS_MODULE, - open: DRM(stub_open) + .owner = THIS_MODULE, + .open = DRM(stub_open) }; static int DRM(stub_getminor)(const char *name, struct file_operations *fops, diff --git a/linux/drm_vm.h b/linux/drm_vm.h index c07c9aff..52dfd594 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -33,27 +33,27 @@ #include "drmP.h" struct vm_operations_struct DRM(vm_ops) = { - nopage: DRM(vm_nopage), - open: DRM(vm_open), - close: DRM(vm_close), + .nopage = DRM(vm_nopage), + .open = DRM(vm_open), + .close = DRM(vm_close), }; struct vm_operations_struct DRM(vm_shm_ops) = { - nopage: DRM(vm_shm_nopage), - open: DRM(vm_open), - close: DRM(vm_shm_close), + .nopage = DRM(vm_shm_nopage), + .open = DRM(vm_open), + .close = DRM(vm_shm_close), }; struct vm_operations_struct DRM(vm_dma_ops) = { - nopage: DRM(vm_dma_nopage), - open: DRM(vm_open), - close: DRM(vm_close), + .nopage = DRM(vm_dma_nopage), + .open = DRM(vm_open), + .close = DRM(vm_close), }; struct vm_operations_struct DRM(vm_sg_ops) = { - nopage: DRM(vm_sg_nopage), - open: DRM(vm_open), - close: DRM(vm_close), + .nopage = DRM(vm_sg_nopage), + .open = DRM(vm_open), + .close = DRM(vm_close), }; struct page *DRM(vm_nopage)(struct vm_area_struct *vma, @@ -343,7 +343,7 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma) vma->vm_ops = &DRM(vm_dma_ops); -#if LINUX_VERSION_CODE <= 0x020414 +#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ #else vma->vm_flags |= VM_RESERVED; /* Don't swap */ @@ -473,7 +473,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) vma->vm_private_data = (void *)map; /* Don't let this area swap. Change when DRM_KERNEL advisory is supported. */ -#if LINUX_VERSION_CODE <= 0x020414 +#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ vma->vm_flags |= VM_LOCKED; #else vma->vm_flags |= VM_RESERVED; @@ -482,7 +482,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) case _DRM_SCATTER_GATHER: vma->vm_ops = &DRM(vm_sg_ops); vma->vm_private_data = (void *)map; -#if LINUX_VERSION_CODE <= 0x020414 +#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ vma->vm_flags |= VM_LOCKED; #else vma->vm_flags |= VM_RESERVED; @@ -491,7 +491,7 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) default: return -EINVAL; /* This should never happen. */ } -#if LINUX_VERSION_CODE <= 0x020414 +#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ #else vma->vm_flags |= VM_RESERVED; /* Don't swap */ diff --git a/linux/i810_dma.c b/linux/i810_dma.c index a2899b5f..f4eef3a3 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -37,6 +37,7 @@ #include "i810_drm.h" #include "i810_drv.h" #include <linux/interrupt.h> /* For task queue support */ +#include <linux/delay.h> #define I810_BUF_FREE 2 #define I810_BUF_CLIENT 1 @@ -129,14 +130,14 @@ static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf) } static struct file_operations i810_buffer_fops = { - open: DRM(open), - flush: DRM(flush), - release: DRM(release), - ioctl: DRM(ioctl), - mmap: i810_mmap_buffers, - read: DRM(read), - fasync: DRM(fasync), - poll: DRM(poll), + .open = DRM(open), + .flush = DRM(flush), + .release = DRM(release), + .ioctl = DRM(ioctl), + .mmap = i810_mmap_buffers, + .read = DRM(read), + .fasync = DRM(fasync), + .poll = DRM(poll), }; int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) @@ -270,20 +271,24 @@ static unsigned long i810_alloc_page(drm_device_t *dev) if(address == 0UL) return 0; -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020409 atomic_inc(&virt_to_page(address)->count); set_bit(PG_locked, &virt_to_page(address)->flags); #else get_page(virt_to_page(address)); +#if LINUX_VERSION_CODE < 0x020500 + LockPage(virt_to_page(address)); +#else SetPageLocked(virt_to_page(address)); #endif +#endif return address; } static void i810_free_page(drm_device_t *dev, unsigned long page) { if (page) { -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020409 atomic_dec(&virt_to_page(page)->count); clear_bit(PG_locked, &virt_to_page(page)->flags); wake_up(&virt_to_page(page)->wait); @@ -337,8 +342,6 @@ static int i810_wait_ring(drm_device_t *dev, int n) end = jiffies + (HZ*3); while (ring->space < n) { - int i; - ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR; ring->space = ring->head - (ring->tail+8); if (ring->space < 0) ring->space += ring->Size; diff --git a/linux/i830_dma.c b/linux/i830_dma.c index b9c89aab..643259fc 100644 --- a/linux/i830_dma.c +++ b/linux/i830_dma.c @@ -153,14 +153,14 @@ static int i830_freelist_put(drm_device_t *dev, drm_buf_t *buf) } static struct file_operations i830_buffer_fops = { - open: DRM(open), - flush: DRM(flush), - release: DRM(release), - ioctl: DRM(ioctl), - mmap: i830_mmap_buffers, - read: DRM(read), - fasync: DRM(fasync), - poll: DRM(poll), + .open = DRM(open), + .flush = DRM(flush), + .release = DRM(release), + .ioctl = DRM(ioctl), + .mmap = i830_mmap_buffers, + .read = DRM(read), + .fasync = DRM(fasync), + .poll = DRM(poll), }; int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) @@ -303,20 +303,24 @@ static unsigned long i830_alloc_page(drm_device_t *dev) if(address == 0UL) return 0; -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020409 atomic_inc(&virt_to_page(address)->count); set_bit(PG_locked, &virt_to_page(address)->flags); #else get_page(virt_to_page(address)); +#if LINUX_VERSION_CODE < 0x020500 + LockPage(virt_to_page(address)); +#else SetPageLocked(virt_to_page(address)); #endif +#endif return address; } static void i830_free_page(drm_device_t *dev, unsigned long page) { if (page) { -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020409 atomic_dec(&virt_to_page(page)->count); clear_bit(PG_locked, &virt_to_page(page)->flags); wake_up(&virt_to_page(page)->wait); |