From f2a0c5438dc83171de1007a68e4f98e35b5a8fbe Mon Sep 17 00:00:00 2001 From: Leif Delgass Date: Sat, 26 Apr 2003 22:28:56 +0000 Subject: 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?). --- linux-core/i810_dma.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'linux-core/i810_dma.c') diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index 30b7dfcf..8e0e8f45 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -234,11 +234,19 @@ static int i810_dma_get_buffer(drm_device_t *dev, drm_i810_dma_t *d, return retcode; } -static int i810_dma_cleanup(drm_device_t *dev) +int i810_dma_cleanup(drm_device_t *dev) { drm_device_dma_t *dma = dev->dma; - if(dev->dev_private) { +#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) { int i; drm_i810_private_t *dev_priv = (drm_i810_private_t *) dev->dev_private; -- cgit v1.2.3