diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2006-08-24 10:30:27 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2006-09-27 11:00:37 +0200 |
commit | 89cbc6e215a5f313ccc17370424c35630cf75892 (patch) | |
tree | 5bddc8bc70598ab03c81b894d573e24e93767999 /src/i830_dri.c | |
parent | 6614b4bda2e079fd1e56e0825894481b80e2df58 (diff) |
Only enable the IRQ after DRIFinishScreenInit.
This makes sure we've been assigned a context ID, so the interrupt context
won't mess things up if it grabs the HW lock.
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r-- | src/i830_dri.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index c9b52c48..92f8d4a1 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -835,29 +835,6 @@ I830DRIDoMappings(ScreenPtr pScreen) I830SetParam(pScrn, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 ); } - /* Okay now initialize the dma engine */ - { - pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD, - ((pciConfigPtr) pI830-> - PciInfo->thisCard)->busnum, - ((pciConfigPtr) pI830-> - PciInfo->thisCard)->devnum, - ((pciConfigPtr) pI830-> - PciInfo->thisCard)->funcnum); - - if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "[drm] failure adding irq handler\n"); - pI830DRI->irq = 0; - DRICloseScreen(pScreen); - return FALSE; - } - else - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "[drm] dma control initialized, using IRQ %d\n", - pI830DRI->irq); - } - pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate; pI830DRI->deviceID = pI830->PciInfo->chipType; pI830DRI->width = pScrn->virtualX; @@ -982,7 +959,34 @@ I830DRIFinishScreenInit(ScreenPtr pScreen) pI830->allowPageFlip = 0; - return DRIFinishScreenInit(pScreen); + if (!DRIFinishScreenInit(pScreen)) + return FALSE; + + /* Okay now initialize the dma engine */ + { + I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate; + + pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD, + ((pciConfigPtr) pI830-> + PciInfo->thisCard)->busnum, + ((pciConfigPtr) pI830-> + PciInfo->thisCard)->devnum, + ((pciConfigPtr) pI830-> + PciInfo->thisCard)->funcnum); + + if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[drm] failure adding irq handler\n"); + pI830DRI->irq = 0; + DRICloseScreen(pScreen); + return FALSE; + } + else + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[drm] dma control initialized, using IRQ %d\n", + pI830DRI->irq); + return TRUE; + } } void |