From 33ee43af7229caa62c105ad38034714a3952fac3 Mon Sep 17 00:00:00 2001 From: ldelgass Date: Mon, 24 Mar 2003 18:42:03 +0000 Subject: Uninstall irq handler for i810/i830 on DRICloseScreen (before DMA cleanup). Fixes problem when interrupts arrive after DMA cleanup with older drm modules that use interrupts for DMA. (Dave Airlie) --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c | 6 ++++++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c | 1 + xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c index c4fdfcfbf..eac75c03b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c @@ -931,6 +931,12 @@ I810DRICloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; I810Ptr pI810 = I810PTR(pScrn); + I810DRIPtr pI810DRI = pI810->pDRIInfo->devPrivate; + + if (pI810DRI->irq) { + drmCtlUninstHandler(pI810->drmSubFD); + pI810DRI->irq = 0; + } I810CleanupDma(pScrn); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c index 3e84979ac..b8e203897 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c @@ -262,6 +262,7 @@ static const char *drmSymbols[] = { "drmCommandWriteRead", "drmCreateContext", "drmCtlInstHandler", + "drmCtlUninstHandler", "drmDestroyContext", "drmFreeVersion", "drmGetInterruptFromBusID", diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c index bdfb9169e..b7a752695 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c @@ -713,9 +713,15 @@ I830DRICloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; I830Ptr pI830 = I830PTR(pScrn); + I830DRIPtr pI830DRI = pI830->pDRIInfo->devPrivate; DPRINTF(PFX, "I830DRICloseScreen\n"); + if (pI830DRI->irq) { + drmCtlUninstHandler(pI830->drmSubFD); + pI830DRI->irq = 0; + } + I830CleanupDma(pScrn); DRICloseScreen(pScreen); -- cgit v1.2.3