diff options
author | Eric Anholt <eric@anholt.net> | 2007-09-20 08:57:58 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-09-20 08:57:58 -0700 |
commit | 126031655c3c1db9881ad17d712461533eb59632 (patch) | |
tree | aa3c6eb27d7563de489cd05df10f6ec41e8753cc /src/i830_dri.c | |
parent | c3438356d6b7b63ad9d0086efb084be8e048980e (diff) | |
parent | bda3c69a7a044869ea63514b97f8aa9260d6b5a7 (diff) |
Merge remote branch 'origin/master' into buffer-objects
Conflicts:
src/i830.h
src/i830_driver.c
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r-- | src/i830_dri.c | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index c25a0843..bff885eb 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -91,7 +91,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define DRM_VBLANK_FLIP 0x8000000 typedef struct drm_i915_flip { - int pipes; + int planes; } drm_i915_flip_t; #undef DRM_IOCTL_I915_FLIP @@ -549,9 +549,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; @@ -954,13 +960,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; @@ -996,12 +1002,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, @@ -1084,12 +1098,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, @@ -1242,20 +1264,20 @@ I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, #ifdef DAMAGE /* Try flipping back to the front page if necessary */ if (sPriv && !sPriv->pf_enabled && sPriv->pf_current_page != 0) { - drm_i915_flip_t flip = { .pipes = 0 }; + drm_i915_flip_t flip = { .planes = 0 }; if (sPriv->pf_current_page & (0x3 << 2)) { sPriv->pf_current_page = sPriv->pf_current_page & 0x3; sPriv->pf_current_page |= (sPriv->third_handle ? 2 : 1) << 2; - flip.pipes |= 0x2; + flip.planes |= 0x2; } if (sPriv->pf_current_page & 0x3) { sPriv->pf_current_page = sPriv->pf_current_page & (0x3 << 2); sPriv->pf_current_page |= sPriv->third_handle ? 2 : 1; - flip.pipes |= 0x1; + flip.planes |= 0x1; } drmCommandWrite(pI830->drmSubFD, DRM_I915_FLIP, &flip, sizeof(flip)); @@ -1590,14 +1612,14 @@ I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num) unsigned numvisible[2] = { 0, 0 }; int i, j; - crtcBox[0].x1 = sPriv->pipeA_x; - crtcBox[0].y1 = sPriv->pipeA_y; - crtcBox[0].x2 = crtcBox[0].x1 + sPriv->pipeA_w; - crtcBox[0].y2 = crtcBox[0].y1 + sPriv->pipeA_h; - crtcBox[1].x1 = sPriv->pipeB_x; - crtcBox[1].y1 = sPriv->pipeB_y; - crtcBox[1].x2 = crtcBox[1].x1 + sPriv->pipeB_w; - crtcBox[1].y2 = crtcBox[1].y1 + sPriv->pipeB_h; + crtcBox[0].x1 = sPriv->planeA_x; + crtcBox[0].y1 = sPriv->planeA_y; + crtcBox[0].x2 = crtcBox[0].x1 + sPriv->planeA_w; + crtcBox[0].y2 = crtcBox[0].y1 + sPriv->planeA_h; + crtcBox[1].x1 = sPriv->planeB_x; + crtcBox[1].y1 = sPriv->planeB_y; + crtcBox[1].x2 = crtcBox[1].x1 + sPriv->planeB_w; + crtcBox[1].y2 = crtcBox[1].y1 + sPriv->planeB_h; for (i = 0; i < 2; i++) { for (j = 0; j < num; j++) { |