summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Brace <kevinbrace@gmx.com>2019-02-19 19:13:31 -0800
committerKevin Brace <kevinbrace@gmx.com>2019-03-04 19:49:48 -0800
commit410ac2c46b2fc451dc3ecec30876128565f76ed6 (patch)
treefdae036c02e796a389c268a28af9945a527e18c6
parent1f965945fbe53a9a47c5d00f86b0348f495bc86b (diff)
Tab to spaces conversion for trident_accel.c
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
-rw-r--r--src/trident_accel.c540
1 files changed, 268 insertions, 272 deletions
diff --git a/src/trident_accel.c b/src/trident_accel.c
index f47fab4..329cc7a 100644
--- a/src/trident_accel.c
+++ b/src/trident_accel.c
@@ -43,56 +43,55 @@
#include "xaarop.h"
static void TridentSync(ScrnInfoPtr pScrn);
-static void TridentSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg,
- int rop, unsigned int planemask, int length,
- unsigned char *pattern);
+static void TridentSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg,
+ int rop, unsigned int planemask, int length,
+ unsigned char *pattern);
static void TridentSubsequentDashedBresenhamLine(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 TridentSetupForSolidLine(ScrnInfoPtr pScrn, int color,
- int rop, unsigned int planemask);
+ int rop, unsigned int planemask);
static void TridentSubsequentSolidBresenhamLine(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);
static void TridentSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, int x, int y,
- int len, int dir);
+ int len, int dir);
static void TridentSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
- int rop, unsigned int planemask);
+ int rop, unsigned int planemask);
static void TridentSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x,
- int y, int w, int h);
+ int y, int w, int h);
static void TridentSubsequentScreenToScreenCopy(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 TridentSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
- int xdir, int ydir, int rop,
- unsigned int planemask,
- int transparency_color);
-static void TridentSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
- int patternx, int patterny, int fg, int bg,
- int rop, unsigned int planemask);
-static void TridentSubsequentMono8x8PatternFillRect(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 TridentSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
+ int patternx, int patterny, int fg, int bg,
+ int rop, unsigned int planemask);
+static void TridentSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
+ int patternx, int patterny, int x, int y,
+ int w, int h);
#if 0
-static void TridentSetupForColor8x8PatternFill(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int rop, unsigned int planemask, int trans_col);
-static void TridentSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn,
- int patternx, int patterny, int x, int y,
- int w, int h);
+static void TridentSetupForColor8x8PatternFill(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int rop, unsigned int planemask, int trans_col);
+static void TridentSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn,
+ int patternx, int patterny, int x, int y,
+ int w, int h);
#endif
#if 0
static void TridentSetupForScanlineCPUToScreenColorExpandFill(
- ScrnInfoPtr pScrn,
- int fg, int bg, int rop,
- unsigned int planemask);
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask);
static void TridentSubsequentScanlineCPUToScreenColorExpandFill(
- 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 TridentSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
#endif
-
static void
TridentInitializeAccelerator(ScrnInfoPtr pScrn)
{
@@ -104,9 +103,9 @@ TridentInitializeAccelerator(ScrnInfoPtr pScrn)
CHECKCLIPPING;
if ( (pTrident->Chipset == PROVIDIA9682) ||
- (pTrident->Chipset == CYBER9385) ||
- (pTrident->Chipset == CYBER9382) )
- pTrident->EngineOperation |= 0x100; /* Disable Clipping */
+ (pTrident->Chipset == CYBER9385) ||
+ (pTrident->Chipset == CYBER9382) )
+ pTrident->EngineOperation |= 0x100; /* Disable Clipping */
TGUI_OPERMODE(pTrident->EngineOperation);
@@ -114,30 +113,28 @@ TridentInitializeAccelerator(ScrnInfoPtr pScrn)
}
#endif
-Bool
-TridentAccelInit(ScreenPtr pScreen)
-{
+Bool TridentAccelInit(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;
- if (!(pTrident->Chipset == TGUI9440AGi && pScrn->bitsPerPixel > 8))
- infoPtr->Flags = PIXMAP_CACHE |
- OFFSCREEN_PIXMAPS |
- LINEAR_FRAMEBUFFER;
+ if (!(pTrident->Chipset == TGUI9440AGi && pScrn->bitsPerPixel > 8))
+ infoPtr->Flags = PIXMAP_CACHE |
+ OFFSCREEN_PIXMAPS |
+ LINEAR_FRAMEBUFFER;
pTrident->InitializeAccelerator = TridentInitializeAccelerator;
TridentInitializeAccelerator(pScrn);
infoPtr->PixmapCacheFlags = DO_NOT_BLIT_STIPPLES;
-
+
infoPtr->Sync = TridentSync;
infoPtr->SolidLineFlags = NO_PLANEMASK;
@@ -147,71 +144,71 @@ TridentAccelInit(ScreenPtr pScreen)
infoPtr->SubsequentSolidHorVertLine = TridentSubsequentSolidHorVertLine;
infoPtr->DashedLineFlags = LINE_PATTERN_MSBFIRST_LSBJUSTIFIED |
- NO_PLANEMASK |
- LINE_PATTERN_POWER_OF_2_ONLY;
+ NO_PLANEMASK |
+ LINE_PATTERN_POWER_OF_2_ONLY;
infoPtr->SetupForDashedLine = TridentSetupForDashedLine;
infoPtr->DashedBresenhamLineErrorTermBits = 12;
- infoPtr->SubsequentDashedBresenhamLine =
- TridentSubsequentDashedBresenhamLine;
+ infoPtr->SubsequentDashedBresenhamLine =
+ TridentSubsequentDashedBresenhamLine;
infoPtr->DashPatternMaxLength = 16;
infoPtr->SolidFillFlags = NO_PLANEMASK;
infoPtr->SetupForSolidFill = TridentSetupForFillRectSolid;
infoPtr->SubsequentSolidFillRect = TridentSubsequentFillRectSolid;
-
+
infoPtr->ScreenToScreenCopyFlags = NO_PLANEMASK;
if (!HAS_DST_TRANS) infoPtr->ScreenToScreenCopyFlags |= NO_TRANSPARENCY;
- infoPtr->SetupForScreenToScreenCopy =
- TridentSetupForScreenToScreenCopy;
- infoPtr->SubsequentScreenToScreenCopy =
- TridentSubsequentScreenToScreenCopy;
+ infoPtr->SetupForScreenToScreenCopy =
+ TridentSetupForScreenToScreenCopy;
+ infoPtr->SubsequentScreenToScreenCopy =
+ TridentSubsequentScreenToScreenCopy;
if (!((pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388) && pScrn->bitsPerPixel > 8)) {
- infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK |
- HARDWARE_PATTERN_SCREEN_ORIGIN |
- BIT_ORDER_IN_BYTE_MSBFIRST;
-
- infoPtr->SetupForMono8x8PatternFill =
- TridentSetupForMono8x8PatternFill;
- infoPtr->SubsequentMono8x8PatternFillRect =
- TridentSubsequentMono8x8PatternFillRect;
+ pTrident->Chipset == CYBER9388) && pScrn->bitsPerPixel > 8)) {
+ infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK |
+ HARDWARE_PATTERN_SCREEN_ORIGIN |
+ BIT_ORDER_IN_BYTE_MSBFIRST;
+
+ infoPtr->SetupForMono8x8PatternFill =
+ TridentSetupForMono8x8PatternFill;
+ infoPtr->SubsequentMono8x8PatternFillRect =
+ TridentSubsequentMono8x8PatternFillRect;
}
#if 0 /* Not convinced this works 100% yet */
- infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK |
- HARDWARE_PATTERN_SCREEN_ORIGIN |
- BIT_ORDER_IN_BYTE_MSBFIRST;
+ infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK |
+ HARDWARE_PATTERN_SCREEN_ORIGIN |
+ BIT_ORDER_IN_BYTE_MSBFIRST;
if (!HAS_DST_TRANS) infoPtr->Color8x8PatternFillFlags |= NO_TRANSPARENCY;
infoPtr->SetupForColor8x8PatternFill =
- TridentSetupForColor8x8PatternFill;
- infoPtr->SubsequentColor8x8PatternFillRect =
- TridentSubsequentColor8x8PatternFillRect;
+ TridentSetupForColor8x8PatternFill;
+ infoPtr->SubsequentColor8x8PatternFillRect =
+ TridentSubsequentColor8x8PatternFillRect;
#endif
#if 0 /* This is buggy, it only seems to work 95% of the time.... */
{
- infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
- NO_TRANSPARENCY |
- BIT_ORDER_IN_BYTE_MSBFIRST;
-
- pTrident->XAAScanlineColorExpandBuffers[0] =
- xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8));
-
- infoPtr->NumScanlineColorExpandBuffers = 1;
- infoPtr->ScanlineColorExpandBuffers =
- pTrident->XAAScanlineColorExpandBuffers;
-
- infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
- TridentSetupForScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
- TridentSubsequentScanlineCPUToScreenColorExpandFill;
- infoPtr->SubsequentColorExpandScanline =
- TridentSubsequentColorExpandScanline;
+ infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK |
+ NO_TRANSPARENCY |
+ BIT_ORDER_IN_BYTE_MSBFIRST;
+
+ pTrident->XAAScanlineColorExpandBuffers[0] =
+ xnfalloc(((pScrn->virtualX + 63)) *4* (pScrn->bitsPerPixel / 8));
+
+ infoPtr->NumScanlineColorExpandBuffers = 1;
+ infoPtr->ScanlineColorExpandBuffers =
+ pTrident->XAAScanlineColorExpandBuffers;
+
+ infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
+ TridentSetupForScanlineCPUToScreenColorExpandFill;
+ infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
+ TridentSubsequentScanlineCPUToScreenColorExpandFill;
+ infoPtr->SubsequentColorExpandScanline =
+ TridentSubsequentColorExpandScanline;
}
#endif
@@ -232,21 +229,21 @@ TridentSync(ScrnInfoPtr pScrn)
TGUI_OPERMODE(pTrident->EngineOperation);
for (;;) {
- BLTBUSY(busy);
- if (busy != GE_BUSY) {
- return;
- }
- count++;
- if (count == 10000000) {
- ErrorF("Trident: 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("Trident: BitBLT engine time-out.\n");
+ count = 9990000;
+ timeout++;
+ if (timeout == 8) {
+ /* Reset BitBLT Engine */
+ TGUI_STATUS(0x00);
+ return;
+ }
+ }
}
}
@@ -258,28 +255,28 @@ TridentClearSync(ScrnInfoPtr pScrn)
int busy;
for (;;) {
- BLTBUSY(busy);
- if (busy != GE_BUSY) {
- return;
- }
- count++;
- if (count == 10000000) {
- ErrorF("Trident: 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("Trident: BitBLT engine time-out.\n");
+ count = 9990000;
+ timeout++;
+ if (timeout == 8) {
+ /* Reset BitBLT Engine */
+ TGUI_STATUS(0x00);
+ return;
+ }
+ }
}
}
static void
-TridentSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
- int xdir, int ydir, int rop,
- unsigned int planemask, int transparency_color)
+TridentSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
+ int xdir, int ydir, int rop,
+ unsigned int planemask, int transparency_color)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int dst = 0;
@@ -290,13 +287,13 @@ TridentSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
REPLICATE(transparency_color);
if (transparency_color != -1) {
- if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388) {
- dst |= 1<<16;
- } else {
- TGUI_OPERMODE(pTrident->EngineOperation | DST_ENABLE);
- }
- TGUI_CKEY(transparency_color);
+ if (pTrident->Chipset == PROVIDIA9685 ||
+ pTrident->Chipset == CYBER9388) {
+ dst |= 1<<16;
+ } else {
+ TGUI_OPERMODE(pTrident->EngineOperation | DST_ENABLE);
+ }
+ TGUI_CKEY(transparency_color);
}
TGUI_DRAWFLAG(pTrident->DrawFlag | pTrident->BltScanDirection | SCR2SCR | dst);
@@ -305,17 +302,17 @@ TridentSetupForScreenToScreenCopy(ScrnInfoPtr pScrn,
static void
TridentSubsequentScreenToScreenCopy(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;
}
TGUI_SRC_XY(x1,y1);
TGUI_DEST_XY(x2,y2);
@@ -326,7 +323,7 @@ TridentSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1,
static void
TridentSetupForSolidLine(ScrnInfoPtr pScrn, int color,
- int rop, unsigned int planemask)
+ int rop, unsigned int planemask)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
@@ -334,14 +331,14 @@ TridentSetupForSolidLine(ScrnInfoPtr pScrn, int color,
REPLICATE(color);
TGUI_FMIX(XAAGetPatternROP(rop));
if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388) {
- TGUI_FPATCOL(color);
+ pTrident->Chipset == CYBER9388) {
+ TGUI_FPATCOL(color);
} else {
- TGUI_FCOLOUR(color);
+ TGUI_FCOLOUR(color);
}
}
-static void
+static void
TridentSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn,
int x, int y, int dmaj, int dmin, int e, int len, int octant)
{
@@ -359,21 +356,21 @@ TridentSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn,
TridentSync(pScrn);
}
-static void
+static void
TridentSubsequentSolidHorVertLine(
- 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(pTrident->DrawFlag | SOLIDFILL);
if (dir == DEGREES_0) {
- TGUI_DIM_XY(len,1);
- TGUI_DEST_XY(x,y);
+ TGUI_DIM_XY(len,1);
+ TGUI_DEST_XY(x,y);
} else {
- TGUI_DIM_XY(1,len);
- TGUI_DEST_XY(x,y);
+ TGUI_DIM_XY(1,len);
+ TGUI_DEST_XY(x,y);
}
TGUI_COMMAND(GE_BLT);
TridentSync(pScrn);
@@ -381,49 +378,48 @@ TridentSubsequentSolidHorVertLine(
void
TridentSetupForDashedLine(
- 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 ||
- pTrident->Chipset == CYBER9388) {
- TGUI_FPATCOL(fg);
- if (bg == -1) {
- pTrident->BltScanDirection |= 1<<12;
- TGUI_BPATCOL(~fg);
- } else {
- REPLICATE(bg);
- TGUI_BPATCOL(bg);
- }
+ pTrident->Chipset == CYBER9388) {
+ 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;
}
-
void
TridentSubsequentDashedBresenhamLine(ScrnInfoPtr pScrn,
int x, int y, int dmaj, int dmin, int e, int len, int octant, int phase)
@@ -435,8 +431,8 @@ TridentSubsequentDashedBresenhamLine(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(pTrident->DrawFlag | STENCIL | tmp);
TGUI_SRC_XY(dmin-dmaj,dmin);
TGUI_DEST_XY(x,y);
@@ -446,8 +442,8 @@ TridentSubsequentDashedBresenhamLine(ScrnInfoPtr pScrn,
}
static void
-TridentSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
- int rop, unsigned int planemask)
+TridentSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
+ int rop, unsigned int planemask)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
@@ -455,11 +451,11 @@ TridentSetupForFillRectSolid(ScrnInfoPtr pScrn, int color,
REPLICATE(color);
TGUI_FMIX(XAAGetPatternROP(rop));
if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388) {
- TGUI_FPATCOL(color);
+ pTrident->Chipset == CYBER9388) {
+ TGUI_FPATCOL(color);
} else {
- drawflag |= PATMONO;
- TGUI_FCOLOUR(color);
+ drawflag |= PATMONO;
+ TGUI_FCOLOUR(color);
}
TGUI_DRAWFLAG(pTrident->DrawFlag | SOLIDFILL | drawflag);
}
@@ -477,84 +473,84 @@ TridentSubsequentFillRectSolid(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
-static void
-TridentSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int fg, int bg, int rop,
- unsigned int planemask)
+static void
+TridentSetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int fg, int bg, int rop,
+ unsigned int planemask)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
REPLICATE(fg);
if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388)
- TGUI_FPATCOL(fg);
+ pTrident->Chipset == CYBER9388)
+ TGUI_FPATCOL(fg);
else
- TGUI_FCOLOUR(fg);
+ TGUI_FCOLOUR(fg);
if (bg == -1) {
- drawflag |= 1<<12;
- if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388)
- TGUI_BPATCOL(~fg);
- else
- TGUI_BCOLOUR(~fg);
+ drawflag |= 1<<12;
+ if (pTrident->Chipset == PROVIDIA9685 ||
+ pTrident->Chipset == CYBER9388)
+ TGUI_BPATCOL(~fg);
+ else
+ TGUI_BCOLOUR(~fg);
} else {
- REPLICATE(bg);
- if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388)
- TGUI_BPATCOL(bg);
- else
- TGUI_BCOLOUR(bg);
+ REPLICATE(bg);
+ if (pTrident->Chipset == PROVIDIA9685 ||
+ pTrident->Chipset == CYBER9388)
+ TGUI_BPATCOL(bg);
+ else
+ TGUI_BCOLOUR(bg);
}
if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388) {
- drawflag |= 7<<18;
+ pTrident->Chipset == CYBER9388) {
+ drawflag |= 7<<18;
}
TGUI_DRAWFLAG(pTrident->DrawFlag | PAT2SCR | PATMONO | drawflag);
TGUI_PATLOC(((patterny * pTrident->PatternLocation) +
- (patternx * pScrn->bitsPerPixel / 8)) >> 6);
+ (patternx * pScrn->bitsPerPixel / 8)) >> 6);
TGUI_FMIX(XAAGetPatternROP(rop));
}
-static void
-TridentSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int x, int y,
- int w, int h)
+static void
+TridentSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int x, int y,
+ int w, int h)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
-
+
TGUI_DEST_XY(x,y);
TGUI_DIM_XY(w,h);
TGUI_COMMAND(GE_BLT);
@@ -562,41 +558,41 @@ TridentSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
}
#if 0
-static void
-TridentSetupForColor8x8PatternFill(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int rop,
- unsigned int planemask,
- int transparency_color)
+static void
+TridentSetupForColor8x8PatternFill(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int rop,
+ unsigned int planemask,
+ int transparency_color)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
int drawflag = 0;
REPLICATE(transparency_color);
if (transparency_color != -1) {
- if (pTrident->Chipset == PROVIDIA9685 ||
- pTrident->Chipset == CYBER9388) {
- drawflag |= 1<<16;
- } else {
- TGUI_OPERMODE(pTrident->EngineOperation | DST_ENABLE);
- }
- TGUI_CKEY(transparency_color);
+ if (pTrident->Chipset == PROVIDIA9685 ||
+ pTrident->Chipset == CYBER9388) {
+ drawflag |= 1<<16;
+ } else {
+ TGUI_OPERMODE(pTrident->EngineOperation | DST_ENABLE);
+ }
+ TGUI_CKEY(transparency_color);
}
TGUI_DRAWFLAG(pTrident->DrawFlag | PAT2SCR | drawflag);
TGUI_PATLOC(((patterny * pTrident->PatternLocation) +
- (patternx * pScrn->bitsPerPixel / 8)) >> 6);
+ (patternx * pScrn->bitsPerPixel / 8)) >> 6);
TGUI_FMIX(XAAGetPatternROP(rop));
}
-static void
-TridentSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn,
- int patternx, int patterny,
- int x, int y,
- int w, int h)
+static void
+TridentSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn,
+ int patternx, int patterny,
+ int x, int y,
+ int w, int h)
{
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
-
+
TGUI_DEST_XY(x,y);
TGUI_DIM_XY(w,h);
TGUI_COMMAND(GE_BLT);
@@ -607,22 +603,22 @@ TridentSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn,
#if 0
static void
TridentSetupForScanlineCPUToScreenColorExpandFill(
- 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);
int drawflag = SRCMONO;
REPLICATE(fg);
TGUI_FCOLOUR(fg);
if (bg == -1) {
- drawflag |= 1<<12;
- TGUI_BCOLOUR(~fg);
+ drawflag |= 1<<12;
+ TGUI_BCOLOUR(~fg);
} else {
- REPLICATE(bg);
- TGUI_BCOLOUR(bg);
+ REPLICATE(bg);
+ TGUI_BCOLOUR(bg);
}
TGUI_SRC_XY(0,0);
@@ -632,10 +628,10 @@ TridentSetupForScanlineCPUToScreenColorExpandFill(
static void
TridentSubsequentScanlineCPUToScreenColorExpandFill(
- 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;
@@ -655,16 +651,16 @@ TridentSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
XAAInfoRecPtr infoRec;
infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
- MoveDWORDS((CARD32 *)pTrident->FbBase,
- (CARD32 *)pTrident->XAAScanlineColorExpandBuffers[0],
- pTrident->dwords);
+ MoveDWORDS((CARD32 *)pTrident->FbBase,
+ (CARD32 *)pTrident->XAAScanlineColorExpandBuffers[0],
+ pTrident->dwords);
pTrident->h--;
TridentSync(pScrn);
if (pTrident->h) {
- TGUI_DEST_XY(pTrident->x,pTrident->y++);
- TGUI_DIM_XY(pTrident->w,1);
- TGUI_COMMAND(GE_BLT);
+ TGUI_DEST_XY(pTrident->x,pTrident->y++);
+ TGUI_DIM_XY(pTrident->w,1);
+ TGUI_COMMAND(GE_BLT);
}
}
#endif