diff options
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drmP.h | 23 | ||||
-rw-r--r-- | linux-core/drm_agpsupport.c | 12 | ||||
-rw-r--r-- | linux-core/drm_memory.h | 8 | ||||
-rw-r--r-- | linux-core/drm_memory_debug.h | 10 | ||||
-rw-r--r-- | linux-core/drm_os_linux.h | 24 | ||||
-rw-r--r-- | linux-core/i830_irq.c | 14 |
6 files changed, 55 insertions, 36 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 2989c64c..7e052a86 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -580,7 +580,7 @@ typedef struct drm_device_dma { */ typedef struct drm_agp_mem { unsigned long handle; /**< handle */ - agp_memory *memory; + DRM_AGP_MEM *memory; unsigned long bound; /**< address */ int pages; struct drm_agp_mem *prev; /**< previous entry */ @@ -593,7 +593,7 @@ typedef struct drm_agp_mem { * \sa DRM(agp_init)() and drm_device::agp. */ typedef struct drm_agp_head { - agp_kern_info agp_info; /**< AGP device information */ + DRM_AGP_KERN agp_info; /**< AGP device information */ drm_agp_mem_t *memory; /**< memory entries */ unsigned long mode; /**< AGP mode */ int enabled; /**< whether the AGP bus as been enabled */ @@ -829,10 +829,10 @@ extern void *DRM(ioremap_nocache)(unsigned long offset, unsigned long size, 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); -extern int DRM(free_agp)(agp_memory *handle, int pages); -extern int DRM(bind_agp)(agp_memory *handle, unsigned int start); -extern int DRM(unbind_agp)(agp_memory *handle); +extern DRM_AGP_MEM *DRM(alloc_agp)(int pages, u32 type); +extern int DRM(free_agp)(DRM_AGP_MEM *handle, int pages); +extern int DRM(bind_agp)(DRM_AGP_MEM *handle, unsigned int start); +extern int DRM(unbind_agp)(DRM_AGP_MEM *handle); #endif /* Misc. IOCTL support (drm_ioctl.h) */ @@ -937,8 +937,7 @@ extern int DRM(control)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern void DRM(dma_service)( int irq, void *device, - struct pt_regs *regs ); +extern DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); extern void DRM(driver_irq_uninstall)( drm_device_t *dev ); @@ -976,10 +975,10 @@ extern int DRM(agp_unbind)(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int DRM(agp_bind)(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); -extern agp_memory *DRM(agp_allocate_memory)(size_t pages, u32 type); -extern int DRM(agp_free_memory)(agp_memory *handle); -extern int DRM(agp_bind_memory)(agp_memory *handle, off_t start); -extern int DRM(agp_unbind_memory)(agp_memory *handle); +extern DRM_AGP_MEM *DRM(agp_allocate_memory)(size_t pages, u32 type); +extern int DRM(agp_free_memory)(DRM_AGP_MEM *handle); +extern int DRM(agp_bind_memory)(DRM_AGP_MEM *handle, off_t start); +extern int DRM(agp_unbind_memory)(DRM_AGP_MEM *handle); #endif /* Stub support (drm_stub.h) */ diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c index 6eaadfc2..a8f6197b 100644 --- a/linux-core/drm_agpsupport.c +++ b/linux-core/drm_agpsupport.c @@ -63,7 +63,7 @@ int DRM(agp_info)(struct inode *inode, struct file *filp, { drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; - agp_kern_info *kern; + DRM_AGP_KERN *kern; drm_agp_info_t info; if (!dev->agp || !dev->agp->acquired || !drm_agp->copy_info) @@ -201,7 +201,7 @@ int DRM(agp_alloc)(struct inode *inode, struct file *filp, drm_device_t *dev = priv->dev; drm_agp_buffer_t request; drm_agp_mem_t *entry; - agp_memory *memory; + DRM_AGP_MEM *memory; unsigned long pages; u32 type; @@ -424,14 +424,14 @@ void DRM(agp_uninit)(void) } /** Calls drm_agp->allocate_memory() */ -agp_memory *DRM(agp_allocate_memory)(size_t pages, u32 type) +DRM_AGP_MEM *DRM(agp_allocate_memory)(size_t pages, u32 type) { if (!drm_agp->allocate_memory) return NULL; return drm_agp->allocate_memory(pages, type); } /** Calls drm_agp->free_memory() */ -int DRM(agp_free_memory)(agp_memory *handle) +int DRM(agp_free_memory)(DRM_AGP_MEM *handle) { if (!handle || !drm_agp->free_memory) return 0; drm_agp->free_memory(handle); @@ -439,14 +439,14 @@ int DRM(agp_free_memory)(agp_memory *handle) } /** Calls drm_agp->bind_memory() */ -int DRM(agp_bind_memory)(agp_memory *handle, off_t start) +int DRM(agp_bind_memory)(DRM_AGP_MEM *handle, off_t start) { if (!handle || !drm_agp->bind_memory) return -EINVAL; return drm_agp->bind_memory(handle, start); } /** Calls drm_agp->unbind_memory() */ -int DRM(agp_unbind_memory)(agp_memory *handle) +int DRM(agp_unbind_memory)(DRM_AGP_MEM *handle) { if (!handle || !drm_agp->unbind_memory) return -EINVAL; return drm_agp->unbind_memory(handle); diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h index 2a969fcd..870f049d 100644 --- a/linux-core/drm_memory.h +++ b/linux-core/drm_memory.h @@ -332,25 +332,25 @@ void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev) #if __REALLY_HAVE_AGP /** Wrapper around agp_allocate_memory() */ -agp_memory *DRM(alloc_agp)(int pages, u32 type) +DRM_AGP_MEM *DRM(alloc_agp)(int pages, u32 type) { return DRM(agp_allocate_memory)(pages, type); } /** Wrapper around agp_free_memory() */ -int DRM(free_agp)(agp_memory *handle, int pages) +int DRM(free_agp)(DRM_AGP_MEM *handle, int pages) { return DRM(agp_free_memory)(handle) ? 0 : -EINVAL; } /** Wrapper around agp_bind_memory() */ -int DRM(bind_agp)(agp_memory *handle, unsigned int start) +int DRM(bind_agp)(DRM_AGP_MEM *handle, unsigned int start) { return DRM(agp_bind_memory)(handle, start); } /** Wrapper around agp_unbind_memory() */ -int DRM(unbind_agp)(agp_memory *handle) +int DRM(unbind_agp)(DRM_AGP_MEM *handle) { return DRM(agp_unbind_memory)(handle); } diff --git a/linux-core/drm_memory_debug.h b/linux-core/drm_memory_debug.h index 5cfff83a..3ef2a05c 100644 --- a/linux-core/drm_memory_debug.h +++ b/linux-core/drm_memory_debug.h @@ -343,9 +343,9 @@ void DRM(ioremapfree)(void *pt, unsigned long size, drm_device_t *dev) #if __REALLY_HAVE_AGP -agp_memory *DRM(alloc_agp)(int pages, u32 type) +DRM_AGP_MEM *DRM(alloc_agp)(int pages, u32 type) { - agp_memory *handle; + DRM_AGP_MEM *handle; if (!pages) { DRM_MEM_ERROR(DRM_MEM_TOTALAGP, "Allocating 0 pages\n"); @@ -366,7 +366,7 @@ agp_memory *DRM(alloc_agp)(int pages, u32 type) return NULL; } -int DRM(free_agp)(agp_memory *handle, int pages) +int DRM(free_agp)(DRM_AGP_MEM *handle, int pages) { int alloc_count; int free_count; @@ -395,7 +395,7 @@ int DRM(free_agp)(agp_memory *handle, int pages) return retval; } -int DRM(bind_agp)(agp_memory *handle, unsigned int start) +int DRM(bind_agp)(DRM_AGP_MEM *handle, unsigned int start) { int retcode = -EINVAL; @@ -419,7 +419,7 @@ int DRM(bind_agp)(agp_memory *handle, unsigned int start) return retcode; } -int DRM(unbind_agp)(agp_memory *handle) +int DRM(unbind_agp)(DRM_AGP_MEM *handle) { int alloc_count; int free_count; diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h index 66804c5b..94230dc4 100644 --- a/linux-core/drm_os_linux.h +++ b/linux-core/drm_os_linux.h @@ -34,8 +34,28 @@ #define DRM_DEVICE drm_file_t *priv = filp->private_data; \ drm_device_t *dev = priv->dev -/** IRQ handler arguments */ -#define DRM_IRQ_ARGS int irq, void *arg, struct pt_regs *regs +/** IRQ handler arguments and return type and values */ +#define DRM_IRQ_ARGS int irq, void *arg, struct pt_regs *regs + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) +#define DRM_IRQ_RET void +#define DRM_IRQ_NONE +#define DRM_IRQ_HANDLED +#else +#define DRM_IRQ_RET irqreturn_t +#define DRM_IRQ_NONE IRQ_NONE +#define DRM_IRQ_HANDLED IRQ_HANDLED +#endif + +/** AGP types */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,70) +#define DRM_AGP_MEM agp_memory +#define DRM_AGP_KERN agp_kern_info +#else +#define DRM_AGP_MEM struct agp_memory +#define DRM_AGP_KERN struct agp_kern_info +#endif + /** Task queue handler arguments */ #define DRM_TASKQUEUE_ARGS void *arg diff --git a/linux-core/i830_irq.c b/linux-core/i830_irq.c index 1fcd9f0a..301afc8a 100644 --- a/linux-core/i830_irq.c +++ b/linux-core/i830_irq.c @@ -36,7 +36,7 @@ #include <linux/delay.h> -void DRM(dma_service)(int irq, void *device, struct pt_regs *regs) +DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *)device; drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private; @@ -45,15 +45,15 @@ void DRM(dma_service)(int irq, void *device, struct pt_regs *regs) temp = I830_READ16(I830REG_INT_IDENTITY_R); DRM_DEBUG("%x\n", temp); - if (temp == 0) - return; + if ( !( temp & 2 ) ) + return DRM_IRQ_NONE; I830_WRITE16(I830REG_INT_IDENTITY_R, temp); - if (temp & 2) { - atomic_inc(&dev_priv->irq_received); - wake_up_interruptible(&dev_priv->irq_queue); - } + atomic_inc(&dev_priv->irq_received); + wake_up_interruptible(&dev_priv->irq_queue); + + return DRM_IRQ_HANDLED; } |