diff options
author | Keith Packard <keithp@koto.keithp.com> | 2007-08-26 22:40:25 -0700 |
---|---|---|
committer | Keith Packard <keithp@koto.keithp.com> | 2007-08-26 22:40:25 -0700 |
commit | 70e8e5957200401474967a467663ae049e9080f2 (patch) | |
tree | 8644333e8b24772739c199a2e66d3e0672c68fd1 | |
parent | 5516cc781bd488c936af225123812a61ed5874b8 (diff) | |
download | xorg-driver-xf86-video-intel-70e8e5957200401474967a467663ae049e9080f2.tar.gz |
Change DRI interface to fill in PCI data from new libpciaccess structure.
The DRI interface requires bus identification for each DRI object; pull that
data from the libpciaccess structures as necessary.
-rw-r--r-- | src/i810_dri.c | 20 | ||||
-rw-r--r-- | src/i830_dri.c | 34 |
2 files changed, 45 insertions, 9 deletions
diff --git a/src/i810_dri.c b/src/i810_dri.c index 72718d34..e5e15651 100644 --- a/src/i810_dri.c +++ b/src/i810_dri.c @@ -354,9 +354,15 @@ I810DRIScreenInit(ScreenPtr pScreen) } else { pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", +#if XSERVER_LIBPCIACCESS + ((pI810->PciInfo->domain << 8) | pI810->PciInfo->bus), + pI810->PciInfo->dev, pI810->PciInfo->func +#else ((pciConfigPtr) pI810->PciInfo->thisCard)->busnum, ((pciConfigPtr) pI810->PciInfo->thisCard)->devnum, - ((pciConfigPtr) pI810->PciInfo->thisCard)->funcnum); + ((pciConfigPtr) pI810->PciInfo->thisCard)->funcnum +#endif + ); } pDRIInfo->ddxDriverMajorVersion = I810_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = I810_MINOR_VERSION; @@ -972,12 +978,20 @@ I810DRIScreenInit(ScreenPtr pScreen) if (!pI810DRI->irq) { pI810DRI->irq = drmGetInterruptFromBusID(pI810->drmSubFD, +#if XSERVER_LIBPCIACCESS + ((pI810->PciInfo->domain << 8) | + pI810->PciInfo->bus), + pI810->PciInfo->dev, + pI810->PciInfo->func +#else ((pciConfigPtr) pI810-> PciInfo->thisCard)->busnum, ((pciConfigPtr) pI810-> PciInfo->thisCard)->devnum, ((pciConfigPtr) pI810-> - PciInfo->thisCard)->funcnum); + PciInfo->thisCard)->funcnum +#endif + ); if ((drmCtlInstHandler(pI810->drmSubFD, pI810DRI->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] failure adding irq handler, there is a device " @@ -991,7 +1005,7 @@ I810DRIScreenInit(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] dma control initialized, using IRQ %d\n", pI810DRI->irq); - pI810DRI->deviceID = pI810->PciInfo->chipType; + pI810DRI->deviceID = DEVICE_ID(pI810->PciInfo); pI810DRI->width = pScrn->virtualX; pI810DRI->height = pScrn->virtualY; pI810DRI->mem = pScrn->videoRam * 1024; diff --git a/src/i830_dri.c b/src/i830_dri.c index e2b42b49..32f6510a 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -539,9 +539,15 @@ I830DRIScreenInit(ScreenPtr pScreen) } else { pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", +#if XSERVER_LIBPCIACCESS + ((pI830->PciInfo->domain << 8) | pI830->PciInfo->bus), + pI830->PciInfo->dev, pI830->PciInfo->func +#else ((pciConfigPtr) pI830->PciInfo->thisCard)->busnum, ((pciConfigPtr) pI830->PciInfo->thisCard)->devnum, - ((pciConfigPtr) pI830->PciInfo->thisCard)->funcnum); + ((pciConfigPtr) pI830->PciInfo->thisCard)->funcnum +#endif + ); } pDRIInfo->ddxDriverMajorVersion = I830_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = I830_MINOR_VERSION; @@ -978,13 +984,13 @@ I830DRIDoMappings(ScreenPtr pScreen) return FALSE; } - if (pI830->PciInfo->chipType != PCI_CHIP_845_G && - pI830->PciInfo->chipType != PCI_CHIP_I830_M) { + if (DEVICE_ID(pI830->PciInfo) != PCI_CHIP_845_G && + DEVICE_ID(pI830->PciInfo) != PCI_CHIP_I830_M) { I830SetParam(pScrn, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 ); } pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate; - pI830DRI->deviceID = pI830->PciInfo->chipType; + pI830DRI->deviceID = DEVICE_ID(pI830->PciInfo); pI830DRI->width = pScrn->virtualX; pI830DRI->height = pScrn->virtualY; pI830DRI->mem = pScrn->videoRam * 1024; @@ -1020,12 +1026,20 @@ I830DRIResume(ScreenPtr pScreen) { pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD, +#if XSERVER_LIBPCIACCESS + ((pI830->PciInfo->domain << 8) | + pI830->PciInfo->bus), + pI830->PciInfo->dev, + pI830->PciInfo->func +#else ((pciConfigPtr) pI830-> PciInfo->thisCard)->busnum, ((pciConfigPtr) pI830-> PciInfo->thisCard)->devnum, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->funcnum); + PciInfo->thisCard)->funcnum +#endif + ); if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1108,12 +1122,20 @@ I830DRIFinishScreenInit(ScreenPtr pScreen) I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate; pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD, +#if XSERVER_LIBPCIACCESS + ((pI830->PciInfo->domain << 8) | + pI830->PciInfo->bus), + pI830->PciInfo->dev, + pI830->PciInfo->func +#else ((pciConfigPtr) pI830-> PciInfo->thisCard)->busnum, ((pciConfigPtr) pI830-> PciInfo->thisCard)->devnum, ((pciConfigPtr) pI830-> - PciInfo->thisCard)->funcnum); + PciInfo->thisCard)->funcnum +#endif + ); if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, |