summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drm_dma.c11
-rw-r--r--linux-core/i810_dma.c5
-rw-r--r--linux/drm_dma.h11
-rw-r--r--linux/i810.h22
-rw-r--r--linux/i810_dma.c5
5 files changed, 43 insertions, 11 deletions
diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c
index e715bd41..85fa1472 100644
--- a/linux-core/drm_dma.c
+++ b/linux-core/drm_dma.c
@@ -40,6 +40,15 @@
#ifndef __HAVE_DMA_RECLAIM
#define __HAVE_DMA_RECLAIM 0
#endif
+#ifndef __HAVE_SHARED_IRQ
+#define __HAVE_SHARED_IRQ 0
+#endif
+
+#if __HAVE_SHARED_IRQ
+#define DRM_IRQ_TYPE SA_SHIRQ
+#else
+#define DRM_IRQ_TYPE 0
+#endif
#if __HAVE_DMA
@@ -534,7 +543,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
/* Install handler */
ret = request_irq( dev->irq, DRM(dma_service),
- 0, dev->devname, dev );
+ DRM_IRQ_TYPE, dev->devname, dev );
if ( ret < 0 ) {
down( &dev->struct_sem );
dev->irq = 0;
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index 8a5503ea..25caca6b 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -1123,6 +1123,11 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
return -EINVAL;
}
+ /* GH: Someone's doing nasty things... */
+ if (!dev->dev_private) {
+ return -EINVAL;
+ }
+
i810_dma_dispatch_clear( dev, clear.flags,
clear.clear_color,
clear.clear_depth );
diff --git a/linux/drm_dma.h b/linux/drm_dma.h
index e715bd41..85fa1472 100644
--- a/linux/drm_dma.h
+++ b/linux/drm_dma.h
@@ -40,6 +40,15 @@
#ifndef __HAVE_DMA_RECLAIM
#define __HAVE_DMA_RECLAIM 0
#endif
+#ifndef __HAVE_SHARED_IRQ
+#define __HAVE_SHARED_IRQ 0
+#endif
+
+#if __HAVE_SHARED_IRQ
+#define DRM_IRQ_TYPE SA_SHIRQ
+#else
+#define DRM_IRQ_TYPE 0
+#endif
#if __HAVE_DMA
@@ -534,7 +543,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
/* Install handler */
ret = request_irq( dev->irq, DRM(dma_service),
- 0, dev->devname, dev );
+ DRM_IRQ_TYPE, dev->devname, dev );
if ( ret < 0 ) {
down( &dev->struct_sem );
dev->irq = 0;
diff --git a/linux/i810.h b/linux/i810.h
index ed25b2a9..a5152bc0 100644
--- a/linux/i810.h
+++ b/linux/i810.h
@@ -62,9 +62,10 @@
#define __HAVE_DMA_IRQ 1
#define __HAVE_DMA_IRQ_BH 1
+#define __HAVE_SHARED_IRQ 1
#define DRIVER_PREINSTALL() do { \
drm_i810_private_t *dev_priv = \
- (drm_i810_private_t *)dev->dev_private; \
+ (drm_i810_private_t *)dev->dev_private; \
u16 tmp; \
tmp = I810_READ16( I810REG_HWSTAM ); \
tmp = tmp & 0x6000; \
@@ -80,7 +81,7 @@
#define DRIVER_POSTINSTALL() do { \
drm_i810_private_t *dev_priv = \
- (drm_i810_private_t *)dev->dev_private; \
+ (drm_i810_private_t *)dev->dev_private; \
u16 tmp; \
tmp = I810_READ16( I810REG_INT_ENABLE_R ); \
tmp = tmp & 0x6000; \
@@ -90,15 +91,18 @@
#define DRIVER_UNINSTALL() do { \
drm_i810_private_t *dev_priv = \
- (drm_i810_private_t *)dev->dev_private; \
+ (drm_i810_private_t *)dev->dev_private; \
u16 tmp; \
- tmp = I810_READ16( I810REG_INT_IDENTITY_R ); \
- tmp = tmp & ~(0x6000); /* Clear all interrupts */ \
- if ( tmp != 0 ) I810_WRITE16( I810REG_INT_IDENTITY_R, tmp ); \
+ if ( dev_priv ) { \
+ tmp = I810_READ16( I810REG_INT_IDENTITY_R ); \
+ tmp = tmp & ~(0x6000); /* Clear all interrupts */ \
+ if ( tmp != 0 ) \
+ I810_WRITE16( I810REG_INT_IDENTITY_R, tmp ); \
\
- tmp = I810_READ16( I810REG_INT_ENABLE_R ); \
- tmp = tmp & 0x6000; /* Disable all interrupts */ \
- I810_WRITE16( I810REG_INT_ENABLE_R, tmp ); \
+ tmp = I810_READ16( I810REG_INT_ENABLE_R ); \
+ tmp = tmp & 0x6000; /* Disable all interrupts */ \
+ I810_WRITE16( I810REG_INT_ENABLE_R, tmp ); \
+ } \
} while (0)
/* Buffer customization:
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index 8a5503ea..25caca6b 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -1123,6 +1123,11 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
return -EINVAL;
}
+ /* GH: Someone's doing nasty things... */
+ if (!dev->dev_private) {
+ return -EINVAL;
+ }
+
i810_dma_dispatch_clear( dev, clear.flags,
clear.clear_color,
clear.clear_depth );