diff options
author | Kevin Brace <kevinbrace@gmx.com> | 2019-03-05 13:34:46 -0800 |
---|---|---|
committer | Kevin Brace <kevinbrace@gmx.com> | 2019-03-05 13:34:46 -0800 |
commit | 867c9f8620e37477dfa1cdf919ea6472e4a5348f (patch) | |
tree | 9c9f53be00d15bf56e075203062fb3080f0450a4 | |
parent | 6793836ebf7ea4d1b9cc96ea1b948b35582d9cac (diff) |
Tab to spaces conversion for xp_accel.c
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r-- | src/xp_accel.c | 451 |
1 files changed, 224 insertions, 227 deletions
diff --git a/src/xp_accel.c b/src/xp_accel.c index 615428a..401e24f 100644 --- a/src/xp_accel.c +++ b/src/xp_accel.c @@ -43,45 +43,45 @@ static void XPSync(ScrnInfoPtr pScrn); #if 0 -static void XPSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, - int rop, unsigned int planemask, int length, - unsigned char *pattern); +static void XPSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, + int rop, unsigned int planemask, int length, + unsigned char *pattern); static void XPSubsequentDashedBresenhamLine(ScrnInfoPtr pScrn, - int x, int y, int dmaj, int dmin, int e, - int len, int octant, int phase); + int x, int y, int dmaj, int dmin, int e, + int len, int octant, int phase); static void XPSetupForSolidLine(ScrnInfoPtr pScrn, int color, - int rop, unsigned int planemask); + int rop, unsigned int planemask); static void XPSubsequentSolidBresenhamLine(ScrnInfoPtr pScrn, - int x, int y, int dmaj, int dmin, int e, - int len, int octant); + int x, int y, int dmaj, int dmin, int e, + int len, int octant); #endif static void XPSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, int x, int y, - int len, int dir); + int len, int dir); static void XPSetupForFillRectSolid(ScrnInfoPtr pScrn, int color, - int rop, unsigned int planemask); + int rop, unsigned int planemask); static void XPSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, - int y, int w, int h); + int y, int w, int h); static void XPSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, - int x1, int y1, int x2, - int y2, int w, int h); + int x1, int y1, int x2, + int y2, int w, int h); static void XPSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, - int xdir, int ydir, int rop, - unsigned int planemask, - int transparency_color); -static void XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, - int patternx, int patterny, int fg, int bg, - int rop, unsigned int planemask); -static void XPSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, - int patternx, int patterny, int x, int y, - int w, int h); + int xdir, int ydir, int rop, + unsigned int planemask, + int transparency_color); +static void XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, + int patternx, int patterny, int fg, int bg, + int rop, unsigned int planemask); +static void XPSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, + int patternx, int patterny, int x, int y, + int w, int h); #if 0 static void XPSetupForScanlineCPUToScreenColorExpandFill( - ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask); + ScrnInfoPtr pScrn, + int fg, int bg, int rop, + unsigned int planemask); static void XPSubsequentScanlineCPUToScreenColorExpandFill( - ScrnInfoPtr pScrn, int x, - int y, int w, int h, int skipleft); + ScrnInfoPtr pScrn, int x, + int y, int w, int h, int skipleft); static void XPSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno); #endif @@ -99,16 +99,16 @@ XPInitializeAccelerator(ScrnInfoPtr pScrn) BLADE_XP_OPERMODE(pTrident->EngineOperation); pTrident->EngineOperation |= 0x40; switch (pScrn->bitsPerPixel) { - case 8: - default: /* Muffle compiler */ - shift = 18; - break; - case 16: - shift = 19; - break; - case 32: - shift = 20; - break; + case 8: + default: /* Muffle compiler */ + shift = 18; + break; + case 16: + shift = 19; + break; + case 32: + shift = 20; + break; } MMIO_OUT32(pTrident->IOBase, 0x2154, (pScrn->displayWidth) << shift); MMIO_OUT32(pTrident->IOBase, 0x2150, (pScrn->displayWidth) << shift); @@ -116,23 +116,21 @@ XPInitializeAccelerator(ScrnInfoPtr pScrn) } #endif -Bool -XPAccelInit(ScreenPtr pScreen) -{ +Bool XPAccelInit(ScreenPtr pScreen) { #ifdef HAVE_XAA_H XAAInfoRecPtr infoPtr; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); TRIDENTPtr pTrident = TRIDENTPTR(pScrn); if (pTrident->NoAccel) - return FALSE; + return FALSE; pTrident->AccelInfoRec = infoPtr = XAACreateInfoRec(); if (!infoPtr) return FALSE; infoPtr->Flags = PIXMAP_CACHE | - OFFSCREEN_PIXMAPS | - LINEAR_FRAMEBUFFER; + OFFSCREEN_PIXMAPS | + LINEAR_FRAMEBUFFER; pTrident->InitializeAccelerator = XPInitializeAccelerator; XPInitializeAccelerator(pScrn); @@ -146,12 +144,12 @@ XPAccelInit(ScreenPtr pScreen) infoPtr->SubsequentSolidBresenhamLine = XPSubsequentSolidBresenhamLine; infoPtr->DashedLineFlags = LINE_PATTERN_MSBFIRST_LSBJUSTIFIED | - NO_PLANEMASK | - LINE_PATTERN_POWER_OF_2_ONLY; + NO_PLANEMASK | + LINE_PATTERN_POWER_OF_2_ONLY; infoPtr->SetupForDashedLine = XPSetupForDashedLine; infoPtr->DashedBresenhamLineErrorTermBits = 12; - infoPtr->SubsequentDashedBresenhamLine = - XPSubsequentDashedBresenhamLine; + infoPtr->SubsequentDashedBresenhamLine = + XPSubsequentDashedBresenhamLine; infoPtr->DashPatternMaxLength = 16; #endif @@ -159,40 +157,40 @@ XPAccelInit(ScreenPtr pScreen) infoPtr->SetupForSolidFill = XPSetupForFillRectSolid; infoPtr->SubsequentSolidFillRect = XPSubsequentFillRectSolid; infoPtr->SubsequentSolidHorVertLine = XPSubsequentSolidHorVertLine; - + infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK | NO_TRANSPARENCY; - infoPtr->SetupForScreenToScreenCopy = - XPSetupForScreenToScreenCopy; - infoPtr->SubsequentScreenToScreenCopy = - XPSubsequentScreenToScreenCopy; + infoPtr->SetupForScreenToScreenCopy = + XPSetupForScreenToScreenCopy; + infoPtr->SubsequentScreenToScreenCopy = + XPSubsequentScreenToScreenCopy; - infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK | - HARDWARE_PATTERN_PROGRAMMED_BITS | - BIT_ORDER_IN_BYTE_MSBFIRST; + infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK | + HARDWARE_PATTERN_PROGRAMMED_BITS | + BIT_ORDER_IN_BYTE_MSBFIRST; infoPtr->SetupForMono8x8PatternFill = - XPSetupForMono8x8PatternFill; - infoPtr->SubsequentMono8x8PatternFillRect = - XPSubsequentMono8x8PatternFillRect; + XPSetupForMono8x8PatternFill; + infoPtr->SubsequentMono8x8PatternFillRect = + XPSubsequentMono8x8PatternFillRect; #if 0 /* Needs fixing */ infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK | - BIT_ORDER_IN_BYTE_MSBFIRST; + BIT_ORDER_IN_BYTE_MSBFIRST; pTrident->XAAScanlineColorExpandBuffers[0] = - xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8)); + xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8)); infoPtr->NumScanlineColorExpandBuffers = 1; - infoPtr->ScanlineColorExpandBuffers = - pTrident->XAAScanlineColorExpandBuffers; + infoPtr->ScanlineColorExpandBuffers = + pTrident->XAAScanlineColorExpandBuffers; infoPtr->SetupForScanlineCPUToScreenColorExpandFill = - XPSetupForScanlineCPUToScreenColorExpandFill; - infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = - XPSubsequentScanlineCPUToScreenColorExpandFill; - infoPtr->SubsequentColorExpandScanline = - XPSubsequentColorExpandScanline; + XPSetupForScanlineCPUToScreenColorExpandFill; + infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = + XPSubsequentScanlineCPUToScreenColorExpandFill; + infoPtr->SubsequentColorExpandScanline = + XPSubsequentColorExpandScanline; #endif return(XAAInit(pScreen, infoPtr)); @@ -212,21 +210,21 @@ XPSync(ScrnInfoPtr pScrn) BLADE_XP_OPERMODE(pTrident->EngineOperation); for (;;) { - BLTBUSY(busy); - if (busy != GE_BUSY) { - return; - } - count++; - if (count == 10000000) { - ErrorF("XP: BitBLT engine time-out.\n"); - count = 9990000; - timeout++; - if (timeout == 8) { - /* Reset BitBLT Engine */ - TGUI_STATUS(0x00); - return; - } - } + BLTBUSY(busy); + if (busy != GE_BUSY) { + return; + } + count++; + if (count == 10000000) { + ErrorF("XP: BitBLT engine time-out.\n"); + count = 9990000; + timeout++; + if (timeout == 8) { + /* Reset BitBLT Engine */ + TGUI_STATUS(0x00); + return; + } + } } } @@ -238,28 +236,28 @@ XPClearSync(ScrnInfoPtr pScrn) int busy; for (;;) { - BLTBUSY(busy); - if (busy != GE_BUSY) { - return; - } - count++; - if (count == 10000000) { - ErrorF("XP: BitBLT engine time-out.\n"); - count = 9990000; - timeout++; - if (timeout == 8) { - /* Reset BitBLT Engine */ - TGUI_STATUS(0x00); - return; - } - } + BLTBUSY(busy); + if (busy != GE_BUSY) { + return; + } + count++; + if (count == 10000000) { + ErrorF("XP: BitBLT engine time-out.\n"); + count = 9990000; + timeout++; + if (timeout == 8) { + /* Reset BitBLT Engine */ + TGUI_STATUS(0x00); + return; + } + } } } static void -XPSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, - int xdir, int ydir, int rop, - unsigned int planemask, int transparency_color) +XPSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, + int xdir, int ydir, int rop, + unsigned int planemask, int transparency_color) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); int dst = 0; @@ -270,8 +268,8 @@ XPSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, REPLICATE(transparency_color); if (transparency_color != -1) { - dst |= 3<<16; - MMIO_OUT32(pTrident->IOBase, 0x2134, transparency_color); + dst |= 3<<16; + MMIO_OUT32(pTrident->IOBase, 0x2134, transparency_color); } TGUI_DRAWFLAG(pTrident->BltScanDirection | SCR2SCR | dst); @@ -280,17 +278,17 @@ XPSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, static void XPSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, - int x2, int y2, int w, int h) + int x2, int y2, int w, int h) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); if (pTrident->BltScanDirection & YNEG) { y1 = y1 + h - 1; - y2 = y2 + h - 1; + y2 = y2 + h - 1; } if (pTrident->BltScanDirection & XNEG) { - x1 = x1 + w - 1; - x2 = x2 + w - 1; + x1 = x1 + w - 1; + x2 = x2 + w - 1; } XP_SRC_XY(x1,y1); XP_DEST_XY(x2,y2); @@ -302,7 +300,7 @@ XPSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, #if 0 static void XPSetupForSolidLine(ScrnInfoPtr pScrn, int color, - int rop, unsigned int planemask) + int rop, unsigned int planemask) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); @@ -310,13 +308,13 @@ XPSetupForSolidLine(ScrnInfoPtr pScrn, int color, REPLICATE(color); TGUI_FMIX(XAAGetPatternROP(rop)); if (pTrident->Chipset >= PROVIDIA9685) { - TGUI_FPATCOL(color); + TGUI_FPATCOL(color); } else { - TGUI_FCOLOUR(color); + TGUI_FCOLOUR(color); } } -static void +static void XPSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn, int x, int y, int dmaj, int dmin, int e, int len, int octant) { @@ -335,21 +333,21 @@ XPSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn, } #endif -static void +static void XPSubsequentSolidHorVertLine( - ScrnInfoPtr pScrn, - int x, int y, - int len, int dir -){ + ScrnInfoPtr pScrn, + int x, int y, + int len, int dir +) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); TGUI_DRAWFLAG(SOLIDFILL); if (dir == DEGREES_0) { - XP_DIM_XY(len,1); - XP_DEST_XY(x,y); + XP_DIM_XY(len,1); + XP_DEST_XY(x,y); } else { - XP_DIM_XY(1,len); - XP_DEST_XY(x,y); + XP_DIM_XY(1,len); + XP_DEST_XY(x,y); } TGUI_COMMAND(GE_BLT); XPSync(pScrn); @@ -358,42 +356,42 @@ XPSubsequentSolidHorVertLine( #if 0 void XPSetupForDashedLine( - ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int length, - unsigned char *pattern -){ + ScrnInfoPtr pScrn, + int fg, int bg, int rop, + unsigned int planemask, + int length, + unsigned char *pattern +) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); CARD32 *DashPattern = (CARD32*)pattern; CARD32 NiceDashPattern = DashPattern[0]; NiceDashPattern = *((CARD16 *)pattern) & ((1<<length) - 1); switch(length) { - case 2: NiceDashPattern |= NiceDashPattern << 2; - case 4: NiceDashPattern |= NiceDashPattern << 4; - case 8: NiceDashPattern |= NiceDashPattern << 8; + case 2: NiceDashPattern |= NiceDashPattern << 2; + case 4: NiceDashPattern |= NiceDashPattern << 4; + case 8: NiceDashPattern |= NiceDashPattern << 8; } pTrident->BltScanDirection = 0; REPLICATE(fg); if (pTrident->Chipset >= PROVIDIA9685) { - TGUI_FPATCOL(fg); - if (bg == -1) { - pTrident->BltScanDirection |= 1<<12; - TGUI_BPATCOL(~fg); - } else { - REPLICATE(bg); - TGUI_BPATCOL(bg); - } + TGUI_FPATCOL(fg); + if (bg == -1) { + pTrident->BltScanDirection |= 1<<12; + TGUI_BPATCOL(~fg); + } else { + REPLICATE(bg); + TGUI_BPATCOL(bg); + } } else { - TGUI_FCOLOUR(fg); - if (bg == -1) { - pTrident->BltScanDirection |= 1<<12; - TGUI_BCOLOUR(~fg); - } else { - REPLICATE(bg); - TGUI_BCOLOUR(bg); - } + TGUI_FCOLOUR(fg); + if (bg == -1) { + pTrident->BltScanDirection |= 1<<12; + TGUI_BCOLOUR(~fg); + } else { + REPLICATE(bg); + TGUI_BCOLOUR(bg); + } } TGUI_FMIX(XAAGetPatternROP(rop)); pTrident->LinePattern = NiceDashPattern; @@ -410,8 +408,8 @@ XPSubsequentDashedBresenhamLine(ScrnInfoPtr pScrn, if (octant & XDECREASING) tmp |= XNEG; if (octant & YDECREASING) tmp |= YNEG; - TGUI_STYLE(((pTrident->LinePattern >> phase) | - (pTrident->LinePattern << (16-phase))) & 0x0000FFFF); + TGUI_STYLE(((pTrident->LinePattern >> phase) | + (pTrident->LinePattern << (16-phase))) & 0x0000FFFF); TGUI_DRAWFLAG(STENCIL | tmp); XP_SRC_XY(dmin-dmaj,dmin); XP_DEST_XY(x,y); @@ -422,8 +420,8 @@ XPSubsequentDashedBresenhamLine(ScrnInfoPtr pScrn, #endif static void -XPSetupForFillRectSolid(ScrnInfoPtr pScrn, int color, - int rop, unsigned int planemask) +XPSetupForFillRectSolid(ScrnInfoPtr pScrn, int color, + int rop, unsigned int planemask) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); @@ -446,64 +444,63 @@ XPSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h) #if 0 static void MoveDWORDS( - register CARD32* dest, - register CARD32* src, - register int dwords ) + register CARD32* dest, + register CARD32* src, + register int dwords ) { - while(dwords & ~0x03) { - *dest = *src; - *(dest + 1) = *(src + 1); - *(dest + 2) = *(src + 2); - *(dest + 3) = *(src + 3); - src += 4; - dest += 4; - dwords -= 4; - } - if (!dwords) return; - *dest = *src; - dest += 1; - src += 1; - if (dwords == 1) return; - *dest = *src; - dest += 1; - src += 1; - if (dwords == 2) return; - *dest = *src; - dest += 1; - src += 1; + while(dwords & ~0x03) { + *dest = *src; + *(dest + 1) = *(src + 1); + *(dest + 2) = *(src + 2); + *(dest + 3) = *(src + 3); + src += 4; + dest += 4; + dwords -= 4; + } + if (!dwords) return; + *dest = *src; + dest += 1; + src += 1; + if (dwords == 1) return; + *dest = *src; + dest += 1; + src += 1; + if (dwords == 2) return; + *dest = *src; + dest += 1; + src += 1; } #endif #if 0 static void MoveDWORDS_FixedBase( - register CARD32* dest, - register CARD32* src, - register int dwords ) + register CARD32* dest, + register CARD32* src, + register int dwords ) { - while(dwords & ~0x03) { - *dest = *src; - *dest = *(src + 1); - *dest = *(src + 2); - *dest = *(src + 3); - dwords -= 4; - src += 4; - } - - if(!dwords) return; - *dest = *src; - if(dwords == 1) return; - *dest = *(src + 1); - if(dwords == 2) return; - *dest = *(src + 2); + while(dwords & ~0x03) { + *dest = *src; + *dest = *(src + 1); + *dest = *(src + 2); + *dest = *(src + 3); + dwords -= 4; + src += 4; + } + + if(!dwords) return; + *dest = *src; + if(dwords == 1) return; + *dest = *(src + 1); + if(dwords == 2) return; + *dest = *(src + 2); } #endif - -static void -XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, - int patternx, int patterny, - int fg, int bg, int rop, - unsigned int planemask) +static void +XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, + int patternx, int patterny, + int fg, int bg, int rop, + unsigned int planemask) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); int drawflag = 0; @@ -512,11 +509,11 @@ XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, MMIO_OUT32(pTrident->IOBase, 0x2158, fg); if (bg == -1) { - drawflag |= 1<<12; - MMIO_OUT32(pTrident->IOBase, 0x215C, ~fg); + drawflag |= 1<<12; + MMIO_OUT32(pTrident->IOBase, 0x215C, ~fg); } else { - REPLICATE(bg); - MMIO_OUT32(pTrident->IOBase, 0x215C, bg); + REPLICATE(bg); + MMIO_OUT32(pTrident->IOBase, 0x215C, bg); } drawflag |= 7<<18; @@ -526,14 +523,14 @@ XPSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, TGUI_FMIX(XAAGetPatternROP(rop)); } -static void -XPSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, - int patternx, int patterny, - int x, int y, - int w, int h) +static void +XPSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, + int patternx, int patterny, + int x, int y, + int w, int h) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); - + XP_DEST_XY(x,y); XP_DIM_XY(w,h); TGUI_COMMAND(GE_BLT); @@ -543,33 +540,33 @@ XPSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, #if 0 static void XPSetupForScanlineCPUToScreenColorExpandFill( - ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask -){ + ScrnInfoPtr pScrn, + int fg, int bg, + int rop, + unsigned int planemask +) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); TGUI_FMIX(XAAGetCopyROP(rop)); if (bg == -1) { - TGUI_DRAWFLAG(SRCMONO | 1<<12); - REPLICATE(fg); - TGUI_FCOLOUR(fg); - } else { - TGUI_DRAWFLAG(SRCMONO); - REPLICATE(fg); - REPLICATE(bg); - TGUI_FCOLOUR(fg); - TGUI_BCOLOUR(bg); + TGUI_DRAWFLAG(SRCMONO | 1<<12); + REPLICATE(fg); + TGUI_FCOLOUR(fg); + } else { + TGUI_DRAWFLAG(SRCMONO); + REPLICATE(fg); + REPLICATE(bg); + TGUI_FCOLOUR(fg); + TGUI_BCOLOUR(bg); } } static void XPSubsequentScanlineCPUToScreenColorExpandFill( - ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int skipleft -){ + ScrnInfoPtr pScrn, + int x, int y, int w, int h, + int skipleft +) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); pTrident->dwords = (w + 31) >> 5; pTrident->h = h; @@ -587,12 +584,12 @@ XPSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); MoveDWORDS_FixedBase((CARD32 *)pTrident->IOBase + 0x2160, - (CARD32 *)pTrident->XAAScanlineColorExpandBuffers[0], - pTrident->dwords); + (CARD32 *)pTrident->XAAScanlineColorExpandBuffers[0], + pTrident->dwords); pTrident->h--; if (pTrident->h) - XPSync(pScrn); + XPSync(pScrn); } #endif #endif |