aboutsummaryrefslogtreecommitdiff
path: root/shared/mga_dma.c
diff options
context:
space:
mode:
authorLeif Delgass <ldelgass@users.sourceforge.net>2003-04-26 22:28:56 +0000
committerLeif Delgass <ldelgass@users.sourceforge.net>2003-04-26 22:28:56 +0000
commitf2a0c5438dc83171de1007a68e4f98e35b5a8fbe (patch)
treef886e31d758dda4c3460465d0f6be13921efbe58 /shared/mga_dma.c
parenta79adaab72bde726ce4c08184997f34b31014d9e (diff)
Ensure driver has been initialized (dev_private != NULL) before installing
irq handler in DRM(irq_install). Modify all drivers to ensure irq handler is removed before cleanup and cleanup is called at takedown. Remove unused buffer private struct fields in i810, i830. Check for lock on init/cleanup in all drivers except i810/i830. The current DDX for i810 and i830 doesn't hold the lock on kernel init (FIXME?).
Diffstat (limited to 'shared/mga_dma.c')
-rw-r--r--shared/mga_dma.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/mga_dma.c b/shared/mga_dma.c
index 96fd97ff..71b9f3a3 100644
--- a/shared/mga_dma.c
+++ b/shared/mga_dma.c
@@ -639,6 +639,14 @@ int mga_do_cleanup_dma( drm_device_t *dev )
{
DRM_DEBUG( "\n" );
+#if _HAVE_DMA_IRQ
+ /* Make sure interrupts are disabled here because the uninstall ioctl
+ * may not have been called from userspace and after dev_private
+ * is freed, it's too late.
+ */
+ if ( dev->irq ) DRM(irq_uninstall)(dev);
+#endif
+
if ( dev->dev_private ) {
drm_mga_private_t *dev_priv = dev->dev_private;
@@ -666,6 +674,8 @@ int mga_dma_init( DRM_IOCTL_ARGS )
DRM_DEVICE;
drm_mga_init_t init;
+ LOCK_TEST_WITH_RETURN( dev, filp );
+
DRM_COPY_FROM_USER_IOCTL( init, (drm_mga_init_t *)data, sizeof(init) );
switch ( init.func ) {