summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw
diff options
context:
space:
mode:
authormdaenzer <mdaenzer>2003-07-29 10:11:48 +0000
committermdaenzer <mdaenzer>2003-07-29 10:11:48 +0000
commit2c68315c6192e4c7183e308219bb7f1791f44c39 (patch)
tree7d743f7dffe427c2e70273194c2107ee6df3a0d6 /xc/programs/Xserver/hw
parent8a50970fe0d5d4f6b3285cf61841a9bf0166b2e1 (diff)
* IRQ code cleanup suggested by Linus Torvalds
* i830 build fix
Diffstat (limited to 'xc/programs/Xserver/hw')
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_netbsd.h6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h2
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h16
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i830_irq.c8
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_irq.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_irq.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c6
11 files changed, 31 insertions, 35 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h
index 8b38d2328..c417a0ab2 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h
@@ -446,7 +446,7 @@ extern void DRM(reclaim_buffers)(drm_device_t *dev, DRMFILE filp);
#if __HAVE_DMA_IRQ
extern int DRM(irq_install)( drm_device_t *dev, int irq );
extern int DRM(irq_uninstall)( drm_device_t *dev );
-extern DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS );
+extern irqreturn_t 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 );
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h
index 88ca2e39a..accbb7fd3 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_dma.h
@@ -217,7 +217,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
if ( retcode ) {
#elif defined(__NetBSD__)
dev->irqh = pci_intr_establish(&dev->pa.pa_pc, dev->ih, IPL_TTY,
- (DRM_IRQ_RET (*)(DRM_IRQ_ARGS))DRM(dma_service), dev);
+ (irqreturn_t (*)(DRM_IRQ_ARGS))DRM(dma_service), dev);
if ( !dev->irqh ) {
#endif
DRM_LOCK;
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h
index f1184008c..32616757d 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h
@@ -112,9 +112,9 @@
#define DRM_SUSER(p) suser(p)
#define DRM_TASKQUEUE_ARGS void *arg, int pending
#define DRM_IRQ_ARGS void *arg
-#define DRM_IRQ_RET void
-#define DRM_IRQ_NONE
-#define DRM_IRQ_HANDLED
+typedef void irqreturn_t;
+#define IRQ_HANDLED /* nothing */
+#define IRQ_NONE /* nothing */
#define DRM_DEVICE drm_device_t *dev = kdev->si_drv1
#define DRM_MALLOC(size) malloc( size, DRM(M_DRM), M_NOWAIT )
#define DRM_FREE(pt,size) free( pt, DRM(M_DRM) )
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_netbsd.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_netbsd.h
index d58f668a4..b02eadd82 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_netbsd.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_netbsd.h
@@ -85,9 +85,9 @@ extern struct cfdriver DRM(cd);
#define DRM_SUSER(p) suser(p->p_ucred, &p->p_acflag)
#define DRM_TASKQUEUE_ARGS void *dev, int pending
#define DRM_IRQ_ARGS void *arg
-#define DRM_IRQ_RET int
-#define DRM_NONE /* FIXME */
-#define DRM_HANDLED /* FIXME */
+typedef int irqreturn_t;
+#define IRQ_NONE /* FIXME */
+#define IRQ_HANDLED /* FIXME */
#define DRM_DEVICE drm_device_t *dev = device_lookup(&DRM(cd), minor(kdev))
/* XXX Not sure if this is the 'right' version.. */
#if __NetBSD_Version__ >= 106140000
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
index 7e052a865..e80f7788f 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h
@@ -937,7 +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 DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS );
+extern irqreturn_t 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 );
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h
index 94230dc4c..38a5769e5 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h
@@ -33,18 +33,14 @@
/** DRM device local declaration */
#define DRM_DEVICE drm_file_t *priv = filp->private_data; \
drm_device_t *dev = priv->dev
-
+
/** 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
+/** backwards compatibility with old irq return values */
+#ifndef IRQ_HANDLED
+typedef void irqreturn_t;
+#define IRQ_HANDLED /* nothing */
+#define IRQ_NONE /* nothing */
#endif
/** AGP types */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c
index 85a9c084b..3fc6c9f86 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c
@@ -105,7 +105,7 @@ static inline int gamma_dma_is_ready(drm_device_t *dev)
return(!GAMMA_READ(GAMMA_DMACOUNT));
}
-DRM_IRQ_RET gamma_dma_service( DRM_IRQ_ARGS )
+irqreturn_t gamma_dma_service( DRM_IRQ_ARGS )
{
drm_device_t *dev = (drm_device_t *)arg;
drm_device_dma_t *dma = dev->dma;
@@ -121,7 +121,7 @@ DRM_IRQ_RET gamma_dma_service( DRM_IRQ_ARGS )
GAMMA_WRITE(GAMMA_GINTFLAGS, 0x2001);
if (gamma_dma_is_ready(dev)) {
/* Free previous buffer */
- if (test_and_set_bit(0, &dev->dma_flag)) return DRM_IRQ_HANDLED;
+ if (test_and_set_bit(0, &dev->dma_flag)) return IRQ_HANDLED;
if (dma->this_buffer) {
gamma_free_buffer(dev, dma->this_buffer);
dma->this_buffer = NULL;
@@ -136,7 +136,7 @@ DRM_IRQ_RET gamma_dma_service( DRM_IRQ_ARGS )
schedule_work(&dev->work);
#endif
}
- return DRM_IRQ_HANDLED;
+ return IRQ_HANDLED;
}
/* Only called by gamma_dma_schedule. */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i830_irq.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i830_irq.c
index 301afc8ac..d2aabf33a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i830_irq.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i830_irq.c
@@ -36,9 +36,9 @@
#include <linux/delay.h>
-DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
{
- drm_device_t *dev = (drm_device_t *)device;
+ drm_device_t *dev = (drm_device_t *)arg;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
u16 temp;
@@ -46,14 +46,14 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS )
DRM_DEBUG("%x\n", temp);
if ( !( temp & 2 ) )
- return DRM_IRQ_NONE;
+ return IRQ_NONE;
I830_WRITE16(I830REG_INT_IDENTITY_R, temp);
atomic_inc(&dev_priv->irq_received);
wake_up_interruptible(&dev_priv->irq_queue);
- return DRM_IRQ_HANDLED;
+ return IRQ_HANDLED;
}
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_irq.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_irq.c
index c53a4bc2e..ccced64f2 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_irq.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/mga_irq.c
@@ -36,7 +36,7 @@
#include "mga_drm.h"
#include "mga_drv.h"
-DRM_IRQ_RET mga_dma_service( DRM_IRQ_ARGS )
+irqreturn_t mga_dma_service( DRM_IRQ_ARGS )
{
drm_device_t *dev = (drm_device_t *) arg;
drm_mga_private_t *dev_priv =
@@ -51,9 +51,9 @@ DRM_IRQ_RET mga_dma_service( DRM_IRQ_ARGS )
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
DRM(vbl_send_signals)( dev );
- return DRM_IRQ_HANDLED;
+ return IRQ_HANDLED;
}
- return DRM_IRQ_NONE;
+ return IRQ_NONE;
}
int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_irq.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_irq.c
index 5fe5b46b2..c060e1871 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_irq.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_irq.c
@@ -36,7 +36,7 @@
#include "r128_drm.h"
#include "r128_drv.h"
-DRM_IRQ_RET r128_dma_service( DRM_IRQ_ARGS )
+irqreturn_t r128_dma_service( DRM_IRQ_ARGS )
{
drm_device_t *dev = (drm_device_t *) arg;
drm_r128_private_t *dev_priv =
@@ -51,9 +51,9 @@ DRM_IRQ_RET r128_dma_service( DRM_IRQ_ARGS )
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
DRM(vbl_send_signals)( dev );
- return DRM_IRQ_HANDLED;
+ return IRQ_HANDLED;
}
- return DRM_IRQ_NONE;
+ return IRQ_NONE;
}
int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c
index a42c7cf5b..1d339f281 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c
@@ -54,7 +54,7 @@
* tied to dma at all, this is just a hangover from dri prehistory.
*/
-DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS )
+irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS )
{
drm_device_t *dev = (drm_device_t *) arg;
drm_radeon_private_t *dev_priv =
@@ -67,7 +67,7 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS )
stat = RADEON_READ(RADEON_GEN_INT_STATUS)
& (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT);
if (!stat)
- return DRM_IRQ_NONE;
+ return IRQ_NONE;
/* SW interrupt */
if (stat & RADEON_SW_INT_TEST) {
@@ -83,7 +83,7 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS )
/* Acknowledge interrupts we handle */
RADEON_WRITE(RADEON_GEN_INT_STATUS, stat);
- return DRM_IRQ_HANDLED;
+ return IRQ_HANDLED;
}
static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv)