summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Dawes <dawes@xfree86.org>2001-12-09 17:43:49 +0000
committerDavid Dawes <dawes@xfree86.org>2001-12-09 17:43:49 +0000
commite2d4ec37f69dcaad5d38d2cddc50f714f082cd43 (patch)
tree466d8c64f0a03b0482c2e81bcdba2d87d8157d84
parentf5357165655f3d31a745af4b99da3c38065d6f28 (diff)
Create a noop stub for DRM_IOCTL_CONTROL when __HAVE_DMA_IRQ is turned off.
This makes retaining backward-compatibility a little easier.
-rw-r--r--linux-core/drm_dma.c19
-rw-r--r--linux-core/drm_drv.c2
-rw-r--r--linux/drm_dma.h19
-rw-r--r--linux/drm_drv.h2
-rw-r--r--linux/i810.h16
5 files changed, 41 insertions, 17 deletions
diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c
index 85fa1472..dce376f6 100644
--- a/linux-core/drm_dma.c
+++ b/linux-core/drm_dma.c
@@ -598,6 +598,25 @@ int DRM(control)( struct inode *inode, struct file *filp,
}
}
+#else
+
+int DRM(control)( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg )
+{
+ drm_control_t ctl;
+
+ if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
+ return -EFAULT;
+
+ switch ( ctl.func ) {
+ case DRM_INST_HANDLER:
+ case DRM_UNINST_HANDLER:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
#endif /* __HAVE_DMA_IRQ */
#endif /* __HAVE_DMA */
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 23568288..2ac32df0 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -187,10 +187,8 @@ static drm_ioctl_desc_t DRM(ioctls)[] = {
/* The DRM_IOCTL_DMA ioctl should be defined by the driver.
*/
-#if __HAVE_DMA_IRQ
[DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { DRM(control), 1, 1 },
#endif
-#endif
#if __REALLY_HAVE_AGP
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { DRM(agp_acquire), 1, 1 },
diff --git a/linux/drm_dma.h b/linux/drm_dma.h
index 85fa1472..dce376f6 100644
--- a/linux/drm_dma.h
+++ b/linux/drm_dma.h
@@ -598,6 +598,25 @@ int DRM(control)( struct inode *inode, struct file *filp,
}
}
+#else
+
+int DRM(control)( struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg )
+{
+ drm_control_t ctl;
+
+ if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
+ return -EFAULT;
+
+ switch ( ctl.func ) {
+ case DRM_INST_HANDLER:
+ case DRM_UNINST_HANDLER:
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
#endif /* __HAVE_DMA_IRQ */
#endif /* __HAVE_DMA */
diff --git a/linux/drm_drv.h b/linux/drm_drv.h
index 23568288..2ac32df0 100644
--- a/linux/drm_drv.h
+++ b/linux/drm_drv.h
@@ -187,10 +187,8 @@ static drm_ioctl_desc_t DRM(ioctls)[] = {
/* The DRM_IOCTL_DMA ioctl should be defined by the driver.
*/
-#if __HAVE_DMA_IRQ
[DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { DRM(control), 1, 1 },
#endif
-#endif
#if __REALLY_HAVE_AGP
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { DRM(agp_acquire), 1, 1 },
diff --git a/linux/i810.h b/linux/i810.h
index 9460adb4..64309f59 100644
--- a/linux/i810.h
+++ b/linux/i810.h
@@ -60,20 +60,10 @@
i810_dma_quiescent( dev ); \
} while (0)
-/* Don't need an irq any more, but this must be kept around for
- * backwards compatibility. (Could override the core drm ioctls
- * somehow to just return success, but this does the job).
- *
- * This is pretty hacky: the return's jump out of the drm core
- * functions before the irq is allocated or deallocated. Noops might
- * be cleaner.
+/* Don't need an irq any more. The template code will make sure that
+ * a noop stub is generated for compatibility.
*/
-#define __HAVE_DMA_IRQ 1
-#define __HAVE_DMA_IRQ_BH 0 /* ??? */
-#define __HAVE_SHARED_IRQ 1
-#define DRIVER_PREINSTALL() return 0
-#define DRIVER_POSTINSTALL() return 0
-#define DRIVER_UNINSTALL() return 0
+#define __HAVE_DMA_IRQ 0
/* Buffer customization:
*/