diff options
Diffstat (limited to 'src/mga_dri.c')
-rw-r--r-- | src/mga_dri.c | 224 |
1 files changed, 0 insertions, 224 deletions
diff --git a/src/mga_dri.c b/src/mga_dri.c index 3070b60..4222d53 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -121,9 +121,6 @@ static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn ) void MGAGetQuiescence( ScrnInfoPtr pScrn ) { MGAPtr pMga = MGAPTR(pScrn); -#ifdef USE_XAA - MGAFBLayout *pLayout = &pMga->CurrentLayout; -#endif /* USE_XAA */ pMga->haveQuiescense = 1; @@ -131,31 +128,6 @@ void MGAGetQuiescence( ScrnInfoPtr pScrn ) MGAWaitForIdleDMA( pScrn ); /* FIXME what about EXA? */ -#ifdef USE_XAA - if (!pMga->Exa && pMga->AccelInfoRec) { - WAITFIFO( 11 ); - OUTREG( MGAREG_MACCESS, pMga->MAccess ); - OUTREG( MGAREG_PITCH, pLayout->displayWidth ); - - pMga->PlaneMask = ~0; - OUTREG( MGAREG_PLNWT, pMga->PlaneMask ); - - pMga->BgColor = 0; - pMga->FgColor = 0; - OUTREG( MGAREG_BCOL, pMga->BgColor ); - OUTREG( MGAREG_FCOL, pMga->FgColor ); - OUTREG( MGAREG_SRCORG, pMga->realSrcOrg ); - - pMga->SrcOrg = 0; - OUTREG( MGAREG_DSTORG, pMga->DstOrg ); - OUTREG( MGAREG_OPMODE, MGAOPM_DMA_BLIT ); - OUTREG( MGAREG_CXBNDRY, 0xFFFF0000 ); /* (maxX << 16) | minX */ - OUTREG( MGAREG_YTOP, 0x00000000 ); /* minPixelPointer */ - OUTREG( MGAREG_YBOT, 0x007FFFFF ); /* maxPixelPointer */ - - pMga->AccelFlags &= ~CLIPPER_ON; - } -#endif } } @@ -173,10 +145,6 @@ void MGAGetQuiescenceShared( ScrnInfoPtr pScrn ) MGAWaitForIdleDMA( pMGAEnt->pScrn_1 ); /* FIXME what about EXA? */ -#ifdef USE_XAA - if (!pMga->Exa && pMga->AccelInfoRec) - pMga->RestoreAccelState( pScrn ); -#endif xf86SetLastScrnFlag( pScrn->entityList[0], pScrn->scrnIndex ); } } @@ -667,191 +635,12 @@ static Bool MGADRIBuffersInit( ScreenPtr pScreen ) return TRUE; } -#ifdef USE_XAA -static void MGADRIInitBuffersXAA(WindowPtr pWin, RegionPtr prgn, - CARD32 index) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - MGAPtr pMga = MGAPTR(pScrn); - BoxPtr pbox = REGION_RECTS(prgn); - int nbox = REGION_NUM_RECTS(prgn); - XAAInfoRecPtr xaa = pMga->AccelInfoRec; - - CHECK_DMA_QUIESCENT(MGAPTR(pScrn), pScrn); - - xaa->SetupForSolidFill(pScrn, 0, GXcopy, -1); - - while (nbox--) { - MGASelectBuffer(pScrn, MGA_BACK); - xaa->SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1, - pbox->x2-pbox->x1, pbox->y2-pbox->y1); - MGASelectBuffer(pScrn, MGA_DEPTH); - xaa->SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1, - pbox->x2-pbox->x1, pbox->y2-pbox->y1); - pbox++; - } - - MGASelectBuffer(pScrn, MGA_FRONT); - - pMga->AccelInfoRec->NeedToSync = TRUE; -} -#endif - static void MGADRIInitBuffersEXA(WindowPtr pWin, RegionPtr prgn, CARD32 index) { /* FIXME */ } -#ifdef USE_XAA -/* - This routine is a modified form of XAADoBitBlt with the calls to - ScreenToScreenBitBlt built in. My routine has the prgnSrc as source - instead of destination. My origin is upside down so the ydir cases - are reversed. -*/ -static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg, - RegionPtr prgnSrc, CARD32 index) -{ - ScreenPtr pScreen = pParent->drawable.pScreen; - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - MGAPtr pMga = MGAPTR(pScrn); - int nbox; - BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; - DDXPointPtr pptTmp, pptNew1, pptNew2; - int xdir, ydir; - int dx, dy; - DDXPointPtr pptSrc; - int screenwidth = pScrn->virtualX; - int screenheight = pScrn->virtualY; - XAAInfoRecPtr xaa = pMga->AccelInfoRec; - - CHECK_DMA_QUIESCENT(pMga, pScrn); - - pbox = REGION_RECTS(prgnSrc); - nbox = REGION_NUM_RECTS(prgnSrc); - pboxNew1 = 0; - pptNew1 = 0; - pboxNew2 = 0; - pptNew2 = 0; - pptSrc = &ptOldOrg; - - dx = pParent->drawable.x - ptOldOrg.x; - dy = pParent->drawable.y - ptOldOrg.y; - - /* If the copy will overlap in Y, reverse the order */ - if (dy>0) { - ydir = -1; - - if (nbox>1) { - /* Keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)malloc(sizeof(BoxRec)*nbox); - if (!pboxNew1) return; - pptNew1 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox); - if (!pptNew1) { - free(pboxNew1); - return; - } - pboxBase = pboxNext = pbox+nbox-1; - while (pboxBase >= pbox) { - while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1)) - pboxNext--; - pboxTmp = pboxNext+1; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp <= pboxBase) { - *pboxNew1++ = *pboxTmp++; - *pptNew1++ = *pptTmp++; - } - pboxBase = pboxNext; - } - pboxNew1 -= nbox; - pbox = pboxNew1; - pptNew1 -= nbox; - pptSrc = pptNew1; - } - } else { - /* No changes required */ - ydir = 1; - } - - /* If the regions will overlap in X, reverse the order */ - if (dx>0) { - xdir = -1; - - if (nbox > 1) { - /*reverse orderof rects in each band */ - pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec)*nbox); - pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox); - if (!pboxNew2 || !pptNew2) { - free(pptNew2); - free(pboxNew2); - if (pboxNew1) { - free(pptNew1); - free(pboxNew1); - } - return; - } - pboxBase = pboxNext = pbox; - while (pboxBase < pbox+nbox) { - while ((pboxNext < pbox+nbox) && - (pboxNext->y1 == pboxBase->y1)) - pboxNext++; - pboxTmp = pboxNext; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp != pboxBase) { - *pboxNew2++ = *--pboxTmp; - *pptNew2++ = *--pptTmp; - } - pboxBase = pboxNext; - } - pboxNew2 -= nbox; - pbox = pboxNew2; - pptNew2 -= nbox; - pptSrc = pptNew2; - } - } else { - /* No changes are needed */ - xdir = 1; - } - - xaa->SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1); - for ( ; nbox-- ; pbox++) { - int x1 = pbox->x1; - int y1 = pbox->y1; - int destx = x1 + dx; - int desty = y1 + dy; - int w = pbox->x2 - x1 + 1; - int h = pbox->y2 - y1 + 1; - - if ( destx < 0 ) x1 -= destx, w += destx, destx = 0; - if ( desty < 0 ) y1 -= desty, h += desty, desty = 0; - if ( destx + w > screenwidth ) w = screenwidth - destx; - if ( desty + h > screenheight ) h = screenheight - desty; - if ( w <= 0 ) continue; - if ( h <= 0 ) continue; - - MGASelectBuffer(pScrn, MGA_BACK); - xaa->SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h); - MGASelectBuffer(pScrn, MGA_DEPTH); - xaa->SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h); - } - MGASelectBuffer(pScrn, MGA_FRONT); - - if (pboxNew2) { - free(pptNew2); - free(pboxNew2); - } - if (pboxNew1) { - free(pptNew1); - free(pboxNew1); - } - - pMga->AccelInfoRec->NeedToSync = TRUE; - -} -#endif - static void MGADRIMoveBuffersEXA(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index) { @@ -1001,19 +790,6 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) pDRIInfo->InitBuffers = MGADRIInitBuffersEXA; pDRIInfo->MoveBuffers = MGADRIMoveBuffersEXA; -#ifdef USE_EXA - if (pMga->Exa) { - pDRIInfo->InitBuffers = MGADRIInitBuffersEXA; - pDRIInfo->MoveBuffers = MGADRIMoveBuffersEXA; - } else { -#endif -#ifdef USE_XAA - pDRIInfo->InitBuffers = MGADRIInitBuffersXAA; - pDRIInfo->MoveBuffers = MGADRIMoveBuffersXAA; -#endif -#ifdef USE_EXA - } -#endif pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; |