diff options
Diffstat (limited to 'src/ast_accel.c')
-rw-r--r-- | src/ast_accel.c | 986 |
1 files changed, 493 insertions, 493 deletions
diff --git a/src/ast_accel.c b/src/ast_accel.c index 0e7e5d3..193666f 100644 --- a/src/ast_accel.c +++ b/src/ast_accel.c @@ -105,27 +105,27 @@ extern Bool bGetLineTerm(_LINEInfo *LineInfo, LINEPARAM *dsLineParam); Bool ASTAccelInit(ScreenPtr pScreen); #ifdef HAVE_XAA_H static void ASTSync(ScrnInfoPtr pScrn); -static void ASTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, +static void ASTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, unsigned int planemask, int trans_color); static void ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2, - int y2, int w, int h); + int y2, int w, int h); static void ASTSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask); static void ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn, - int dst_x, int dst_y, int width, int height); + int dst_x, int dst_y, int width, int height); static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask); static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, int x, int y, int len, int dir); static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, - int x1, int y1, int x2, int y2, int flags); + int x1, int y1, int x2, int y2, int flags); static void ASTSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop, unsigned int planemask, int length, UCHAR *pattern); static void ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, - int flags, int phase); + int flags, int phase); static void ASTSetupForMonoPatternFill(ScrnInfoPtr pScrn, int patx, int paty, int fg, int bg, int rop, unsigned int planemask); @@ -150,11 +150,11 @@ static void ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, int src_x, int src_y, int offset); static void ASTSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top, int right, int bottom); -static void ASTDisableClipping(ScrnInfoPtr pScrn); +static void ASTDisableClipping(ScrnInfoPtr pScrn); static void ASTSetHWClipping(ScrnInfoPtr pScrn, int delta_y); static void AIPSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, - int x1, int y1, int x2, int y2, int flags); + int x1, int y1, int x2, int y2, int flags); static void AIPSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, int flags, int phase); @@ -181,7 +181,7 @@ ASTAccelInit(ScreenPtr pScreen) /* Screen To Screen copy */ if (pAST->ENGCaps & ENG_CAP_ScreenToScreenCopy) - { + { infoPtr->SetupForScreenToScreenCopy = ASTSetupForScreenToScreenCopy; infoPtr->SubsequentScreenToScreenCopy = ASTSubsequentScreenToScreenCopy; infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY | NO_PLANEMASK; @@ -189,15 +189,15 @@ ASTAccelInit(ScreenPtr pScreen) /* Solid fill */ if (pAST->ENGCaps & ENG_CAP_SolidFill) - { + { infoPtr->SetupForSolidFill = ASTSetupForSolidFill; infoPtr->SubsequentSolidFillRect = ASTSubsequentSolidFillRect; infoPtr->SolidFillFlags = NO_PLANEMASK; - } - + } + /* Solid Lines */ if (pAST->ENGCaps & ENG_CAP_SolidLine) - { + { if ( (pAST->jChipType == AST2300) || (pAST->jChipType == AST1180) ) { infoPtr->SubsequentSolidTwoPointLine = AIPSubsequentSolidTwoPointLine; @@ -207,8 +207,8 @@ ASTAccelInit(ScreenPtr pScreen) infoPtr->SubsequentSolidTwoPointLine = ASTSubsequentSolidTwoPointLine; } - infoPtr->SetupForSolidLine = ASTSetupForSolidLine; - infoPtr->SubsequentSolidHorVertLine = ASTSubsequentSolidHorVertLine; + infoPtr->SetupForSolidLine = ASTSetupForSolidLine; + infoPtr->SubsequentSolidHorVertLine = ASTSubsequentSolidHorVertLine; infoPtr->SolidLineFlags = NO_PLANEMASK; } @@ -222,17 +222,17 @@ ASTAccelInit(ScreenPtr pScreen) else { infoPtr->SubsequentDashedTwoPointLine = ASTSubsequentDashedTwoPointLine; - } + } - infoPtr->SetupForDashedLine = ASTSetupForDashedLine; + infoPtr->SetupForDashedLine = ASTSetupForDashedLine; infoPtr->DashPatternMaxLength = 64; infoPtr->DashedLineFlags = NO_PLANEMASK | LINE_PATTERN_MSBFIRST_LSBJUSTIFIED; - } + } /* 8x8 mono pattern fill */ if (pAST->ENGCaps & ENG_CAP_Mono8x8PatternFill) - { + { infoPtr->SetupForMono8x8PatternFill = ASTSetupForMonoPatternFill; infoPtr->SubsequentMono8x8PatternFillRect = ASTSubsequentMonoPatternFill; infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK | @@ -240,50 +240,50 @@ ASTAccelInit(ScreenPtr pScreen) HARDWARE_PATTERN_SCREEN_ORIGIN | HARDWARE_PATTERN_PROGRAMMED_BITS | BIT_ORDER_IN_BYTE_MSBFIRST; - } - + } + /* 8x8 color pattern fill */ if (pAST->ENGCaps & ENG_CAP_Color8x8PatternFill) - { + { infoPtr->SetupForColor8x8PatternFill = ASTSetupForColor8x8PatternFill; infoPtr->SubsequentColor8x8PatternFillRect = ASTSubsequentColor8x8PatternFillRect; infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK | - NO_TRANSPARENCY | + NO_TRANSPARENCY | HARDWARE_PATTERN_SCREEN_ORIGIN; - } - + } + /* CPU To Screen Color Expand */ if (pAST->ENGCaps & ENG_CAP_CPUToScreenColorExpand) - { + { infoPtr->SetupForCPUToScreenColorExpandFill = ASTSetupForCPUToScreenColorExpandFill; infoPtr->SubsequentCPUToScreenColorExpandFill = ASTSubsequentCPUToScreenColorExpandFill; infoPtr->ColorExpandRange = MAX_PATReg_Size; infoPtr->ColorExpandBase = MMIOREG_PAT; infoPtr->CPUToScreenColorExpandFillFlags = NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST; - } + } /* Screen To Screen Color Expand */ if (pAST->ENGCaps & ENG_CAP_ScreenToScreenColorExpand) - { + { infoPtr->SetupForScreenToScreenColorExpandFill = ASTSetupForScreenToScreenColorExpandFill; infoPtr->SubsequentScreenToScreenColorExpandFill = ASTSubsequentScreenToScreenColorExpandFill; infoPtr->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST; - } - + } + /* Clipping */ if (pAST->ENGCaps & ENG_CAP_Clipping) - { + { infoPtr->SetClippingRectangle = ASTSetClippingRectangle; infoPtr->DisableClipping = ASTDisableClipping; infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | HARDWARE_CLIP_MONO_8x8_FILL | HARDWARE_CLIP_COLOR_8x8_FILL | - HARDWARE_CLIP_SOLID_LINE | - HARDWARE_CLIP_DASHED_LINE | - HARDWARE_CLIP_SOLID_LINE; - } + HARDWARE_CLIP_SOLID_LINE | + HARDWARE_CLIP_DASHED_LINE | + HARDWARE_CLIP_SOLID_LINE; + } return(XAAInit(pScreen, infoPtr)); #else @@ -307,14 +307,14 @@ static void ASTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, unsigned int planemask, int trans_color) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; ULONG cmdreg; - + /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForScreenToScreenCopy\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_BITBLT; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -325,35 +325,35 @@ static void ASTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } cmdreg |= (ASTXAACopyROP[rop] << 8); pAST->ulCMDReg = cmdreg; - + if (!pAST->MMIO2D) - { + { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2); - - ASTSetupSRCPitch(pSingleCMD, pAST->VideoModeInfo.ScreenPitch); + + ASTSetupSRCPitch(pSingleCMD, pAST->VideoModeInfo.ScreenPitch); pSingleCMD++; ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); - + /* Update Write Pointer */ mUpdateWritePointer; - + } else { - /* Write to MMIO */ - ASTSetupSRCPitch_MMIO(pAST->VideoModeInfo.ScreenPitch); - ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + /* Write to MMIO */ + ASTSetupSRCPitch_MMIO(pAST->VideoModeInfo.ScreenPitch); + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); } - + } /* end of ASTSetupForScreenToScreenCopy */ static void @@ -370,34 +370,34 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2, */ if ((width != 0) && (height != 0)) - { + { /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; srcbase = dstbase = 0; if (x1 < x2) - cmdreg |= CMD_X_DEC; + cmdreg |= CMD_X_DEC; if (y1 < y2) - cmdreg |= CMD_Y_DEC; - + cmdreg |= CMD_Y_DEC; + if ((y1 + height) >= MAX_SRC_Y) - { + { srcbase=pAST->VideoModeInfo.ScreenPitch*y1; y1 = 0; - } - - if ((y2 + height) >= pScrn->virtualY) - { + } + + if ((y2 + height) >= pScrn->virtualY) + { delta_y = y2; dstbase=pAST->VideoModeInfo.ScreenPitch*y2; y2 = 0; } - + if (cmdreg & CMD_X_DEC) { src_x = x1 + width - 1; @@ -406,56 +406,56 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2, else { src_x = x1; - dst_x = x2; + dst_x = x2; } - + if (cmdreg & CMD_Y_DEC) - { + { src_y = y1 + height - 1; dst_y = y2 + height - 1; } else { src_y = y1; - dst_y = y2; + dst_y = y2; } - - if (pAST->EnableClip) + + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) + + if (!pAST->MMIO2D) { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*6); - + ASTSetupSRCBase(pSingleCMD, srcbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; - ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); - pSingleCMD++; - ASTSetupSRCXY(pSingleCMD, src_x, src_y); - pSingleCMD++; - ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupSRCXY(pSingleCMD, src_x, src_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else { ASTSetupSRCBase_MMIO(srcbase); ASTSetupDSTBase_MMIO(dstbase); - ASTSetupDSTXY_MMIO(dst_x, dst_y); - ASTSetupSRCXY_MMIO(src_x, src_y); - ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupSRCXY_MMIO(src_x, src_y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + vWaitEngIdle(pScrn, pAST); } - + } /* width & height check */ } /* end of ASTSubsequentScreenToScreenCopy */ @@ -464,14 +464,14 @@ static void ASTSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; ULONG cmdreg; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForSolidFill\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_BITBLT | CMD_PAT_FGCOLOR; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -482,16 +482,16 @@ ASTSetupForSolidFill(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } cmdreg |= (ASTXAAPatternROP[rop] << 8); pAST->ulCMDReg = cmdreg; - - if (!pAST->MMIO2D) + + if (!pAST->MMIO2D) { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2); @@ -499,17 +499,17 @@ ASTSetupForSolidFill(ScrnInfoPtr pScrn, ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; ASTSetupFG(pSingleCMD, color); - + /* Update Write Pointer */ mUpdateWritePointer; - + } else { ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); - ASTSetupFG_MMIO(color); + ASTSetupFG_MMIO(color); } - + } /* end of ASTSetupForSolidFill */ @@ -519,10 +519,10 @@ ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn, { ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; - ULONG dstbase, cmdreg; + ULONG dstbase, cmdreg; int delta_y = 0; - -/* + +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidFillRect\n"); */ @@ -533,54 +533,54 @@ ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn, if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; - - if (dst_y >= pScrn->virtualY) + + if (dst_y >= pScrn->virtualY) { - delta_y = dst_y; + delta_y = dst_y; dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; dst_y=0; } - if (pAST->EnableClip) + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); - + ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); - pSingleCMD++; + pSingleCMD++; ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); ASTSetupDSTXY_MMIO(dst_x, dst_y); ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - + ASTSetupCMDReg_MMIO(cmdreg); + vWaitEngIdle(pScrn, pAST); - + } - + } /* width & height check */ } /* end of ASTSubsequentSolidFillRect */ /* Line */ -static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, +static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask) { @@ -589,7 +589,7 @@ static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, ULONG cmdreg; /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForSolidLine\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_BITBLT; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -600,38 +600,38 @@ static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } - cmdreg |= (ASTXAAPatternROP[rop] << 8); + cmdreg |= (ASTXAAPatternROP[rop] << 8); pAST->ulCMDReg = cmdreg; - + if (!pAST->MMIO2D) - { + { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*3); ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; - ASTSetupFG(pSingleCMD, color); + ASTSetupFG(pSingleCMD, color); pSingleCMD++; ASTSetupBG(pSingleCMD, 0); - + /* Update Write Pointer */ - mUpdateWritePointer; - + mUpdateWritePointer; + } else { - /* Write to MMIO */ - ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); - ASTSetupFG_MMIO(color); - ASTSetupBG_MMIO(0); + /* Write to MMIO */ + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(color); + ASTSetupBG_MMIO(0); } - + } /* end of ASTSetupForSolidLine */ @@ -641,10 +641,10 @@ static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; - ULONG dstbase, cmdreg; + ULONG dstbase, cmdreg; int width, height; int delta_y = 0; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidHorVertLine\n"); */ @@ -655,75 +655,75 @@ static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; - + if(dir == DEGREES_0) { /* horizontal */ width = len; - height = 1; + height = 1; } else { /* vertical */ width = 1; - height = len; + height = len; } - - if ((y + height) >= pScrn->virtualY) - { - delta_y = y; + + if ((y + height) >= pScrn->virtualY) + { + delta_y = y; dstbase=pAST->VideoModeInfo.ScreenPitch*y; y=0; } - - if (pAST->EnableClip) + + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); - + ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTXY(pSingleCMD, x, y); - pSingleCMD++; + pSingleCMD++; ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); ASTSetupDSTXY_MMIO(x, y); ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - + ASTSetupCMDReg_MMIO(cmdreg); + vWaitEngIdle(pScrn, pAST); - + } - + } /* len check */ - + } /* end of ASTSubsequentSolidHorVertLine */ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, int flags) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; LINEPARAM dsLineParam; - _LINEInfo LineInfo; + _LINEInfo LineInfo; ULONG dstbase, ulCommand; - ULONG miny, maxy; + ULONG miny, maxy; USHORT usXM; int delta_y = 0; - + /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidTwoPointLine\n"); -*/ +*/ /* Modify Reg. Value */ ulCommand = (pAST->ulCMDReg & (~CMD_MASK)) | CMD_LINEDRAW; @@ -734,7 +734,7 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, if (pAST->EnableClip) ulCommand |= CMD_ENABLE_CLIP; else - ulCommand &= ~CMD_ENABLE_CLIP; + ulCommand &= ~CMD_ENABLE_CLIP; dstbase = 0; miny = (y1 > y2) ? y2 : y1; maxy = (y1 > y2) ? y1 : y2; @@ -744,62 +744,62 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, y1 -= miny; y2 -= miny; } - + LineInfo.X1 = x1; LineInfo.Y1 = y1; LineInfo.X2 = x2; LineInfo.Y2 = y2; - + bGetLineTerm(&LineInfo, &dsLineParam); /* Get Line Parameter */ - - if (dsLineParam.dwLineAttributes & LINEPARAM_X_DEC) - ulCommand |= CMD_X_DEC; - if (dsLineParam.dwLineAttributes & LINEPARAM_Y_DEC) - ulCommand |= CMD_Y_DEC; - - usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0; - - if (pAST->EnableClip) + + if (dsLineParam.dwLineAttributes & LINEPARAM_X_DEC) + ulCommand |= CMD_X_DEC; + if (dsLineParam.dwLineAttributes & LINEPARAM_Y_DEC) + ulCommand |= CMD_Y_DEC; + + usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0; + + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*7); ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupLineXY(pSingleCMD, dsLineParam.dsLineX, dsLineParam.dsLineY); - pSingleCMD++; + pSingleCMD++; ASTSetupLineXMErrTerm(pSingleCMD, usXM , dsLineParam.dwErrorTerm); - pSingleCMD++; + pSingleCMD++; ASTSetupLineWidth(pSingleCMD, dsLineParam.dsLineWidth); - pSingleCMD++; + pSingleCMD++; ASTSetupLineK1Term(pSingleCMD, dsLineParam.dwK1Term); - pSingleCMD++; + pSingleCMD++; ASTSetupLineK2Term(pSingleCMD, dsLineParam.dwK2Term); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, ulCommand); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, ulCommand); + /* Update Write Pointer */ - mUpdateWritePointer; + mUpdateWritePointer; /* Patch KDE pass abnormal point, ycchen@052507 */ vWaitEngIdle(pScrn, pAST); - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); ASTSetupLineXY_MMIO(dsLineParam.dsLineX, dsLineParam.dsLineY); ASTSetupLineXMErrTerm_MMIO( usXM , dsLineParam.dwErrorTerm); ASTSetupLineWidth_MMIO(dsLineParam.dsLineWidth); ASTSetupLineK1Term_MMIO(dsLineParam.dwK1Term); ASTSetupLineK2Term_MMIO(dsLineParam.dwK2Term); - ASTSetupCMDReg_MMIO(ulCommand); - + ASTSetupCMDReg_MMIO(ulCommand); + vWaitEngIdle(pScrn, pAST); - + } @@ -817,10 +817,10 @@ ASTSetupForDashedLine(ScrnInfoPtr pScrn, ULONG cmdreg; /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForDashedLine\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_LINEDRAW | CMD_RESET_STYLE_COUNTER | CMD_ENABLE_LINE_STYLE; - + switch (pAST->VideoModeInfo.bitsPerPixel) { case 8: @@ -829,50 +829,50 @@ ASTSetupForDashedLine(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } - cmdreg |= (ASTXAAPatternROP[rop] << 8); + cmdreg |= (ASTXAAPatternROP[rop] << 8); if(bg == -1) { - cmdreg |= CMD_TRANSPARENT; + cmdreg |= CMD_TRANSPARENT; bg = 0; } cmdreg |= (((length-1) & 0x3F) << 24); /* line period */ pAST->ulCMDReg = cmdreg; - + if (!pAST->MMIO2D) - { + { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; - ASTSetupFG(pSingleCMD, fg); + ASTSetupFG(pSingleCMD, fg); pSingleCMD++; - ASTSetupBG(pSingleCMD, bg); + ASTSetupBG(pSingleCMD, bg); pSingleCMD++; ASTSetupLineStyle1(pSingleCMD, *pattern); pSingleCMD++; ASTSetupLineStyle2(pSingleCMD, *(pattern+4)); - + /* Update Write Pointer */ - mUpdateWritePointer; - + mUpdateWritePointer; + } else { - /* Write to MMIO */ + /* Write to MMIO */ ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); - ASTSetupFG_MMIO(fg); - ASTSetupBG_MMIO(bg); + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); ASTSetupLineStyle1_MMIO(*pattern); - ASTSetupLineStyle2_MMIO(*(pattern+4)); + ASTSetupLineStyle2_MMIO(*(pattern+4)); } - + } static void @@ -880,19 +880,19 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, int flags, int phase) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; LINEPARAM dsLineParam; - _LINEInfo LineInfo; - ULONG dstbase, ulCommand; - ULONG miny, maxy; + _LINEInfo LineInfo; + ULONG dstbase, ulCommand; + ULONG miny, maxy; USHORT usXM; int delta_y = 0; - + /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentDashedTwoPointLine\n"); -*/ +*/ /* Modify Reg. Value */ ulCommand = pAST->ulCMDReg; @@ -903,8 +903,8 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, if (pAST->EnableClip) ulCommand |= CMD_ENABLE_CLIP; else - ulCommand &= ~CMD_ENABLE_CLIP; - dstbase = 0; + ulCommand &= ~CMD_ENABLE_CLIP; + dstbase = 0; miny = (y1 > y2) ? y2 : y1; maxy = (y1 > y2) ? y1 : y2; if(maxy >= pScrn->virtualY) { @@ -913,64 +913,64 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, y1 -= miny; y2 -= miny; } - + LineInfo.X1 = x1; LineInfo.Y1 = y1; LineInfo.X2 = x2; LineInfo.Y2 = y2; - + bGetLineTerm(&LineInfo, &dsLineParam); /* Get Line Parameter */ - - if (dsLineParam.dwLineAttributes & LINEPARAM_X_DEC) - ulCommand |= CMD_X_DEC; - if (dsLineParam.dwLineAttributes & LINEPARAM_Y_DEC) - ulCommand |= CMD_Y_DEC; - - usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0; - - if (pAST->EnableClip) + + if (dsLineParam.dwLineAttributes & LINEPARAM_X_DEC) + ulCommand |= CMD_X_DEC; + if (dsLineParam.dwLineAttributes & LINEPARAM_Y_DEC) + ulCommand |= CMD_Y_DEC; + + usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0; + + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*7); ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupLineXY(pSingleCMD, dsLineParam.dsLineX, dsLineParam.dsLineY); - pSingleCMD++; + pSingleCMD++; ASTSetupLineXMErrTerm(pSingleCMD, usXM , dsLineParam.dwErrorTerm); - pSingleCMD++; + pSingleCMD++; ASTSetupLineWidth(pSingleCMD, dsLineParam.dsLineWidth); - pSingleCMD++; + pSingleCMD++; ASTSetupLineK1Term(pSingleCMD, dsLineParam.dwK1Term); - pSingleCMD++; + pSingleCMD++; ASTSetupLineK2Term(pSingleCMD, dsLineParam.dwK2Term); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, ulCommand); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, ulCommand); + /* Update Write Pointer */ mUpdateWritePointer; /* Patch KDE pass abnormal point, ycchen@052507 */ vWaitEngIdle(pScrn, pAST); - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); ASTSetupLineXY_MMIO(dsLineParam.dsLineX, dsLineParam.dsLineY); ASTSetupLineXMErrTerm_MMIO( usXM , dsLineParam.dwErrorTerm); ASTSetupLineWidth_MMIO(dsLineParam.dsLineWidth); ASTSetupLineK1Term_MMIO(dsLineParam.dwK1Term); ASTSetupLineK2Term_MMIO(dsLineParam.dwK2Term); - ASTSetupCMDReg_MMIO(ulCommand); - + ASTSetupCMDReg_MMIO(ulCommand); + vWaitEngIdle(pScrn, pAST); - + } - + } /* Mono Pattern Fill */ @@ -979,14 +979,14 @@ ASTSetupForMonoPatternFill(ScrnInfoPtr pScrn, int patx, int paty, int fg, int bg, int rop, unsigned int planemask) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; ULONG cmdreg; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForMonoPatternFill\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_BITBLT | CMD_PAT_MONOMASK; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -997,43 +997,43 @@ ASTSetupForMonoPatternFill(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } cmdreg |= (ASTXAAPatternROP[rop] << 8); pAST->ulCMDReg = cmdreg; - - if (!pAST->MMIO2D) + + if (!pAST->MMIO2D) { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; - ASTSetupFG(pSingleCMD, fg); + ASTSetupFG(pSingleCMD, fg); pSingleCMD++; ASTSetupBG(pSingleCMD, bg); pSingleCMD++; - ASTSetupMONO1(pSingleCMD, patx); + ASTSetupMONO1(pSingleCMD, patx); pSingleCMD++; ASTSetupMONO2(pSingleCMD, paty); - + /* Update Write Pointer */ mUpdateWritePointer; - + } else { ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); - ASTSetupFG_MMIO(fg); + ASTSetupFG_MMIO(fg); ASTSetupBG_MMIO(bg); - ASTSetupMONO1_MMIO(patx); - ASTSetupMONO2_MMIO(paty); + ASTSetupMONO1_MMIO(patx); + ASTSetupMONO2_MMIO(paty); } - + } /* end of ASTSetupForMonoPatternFill */ @@ -1046,55 +1046,55 @@ ASTSubsequentMonoPatternFill(ScrnInfoPtr pScrn, PKT_SC *pSingleCMD; ULONG dstbase, cmdreg; int delta_y = 0; - -/* + +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentMonoPatternFill\n"); -*/ - +*/ + /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; - if (dst_y >= pScrn->virtualY) - { + if (dst_y >= pScrn->virtualY) + { delta_y = dst_y; dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; dst_y=0; } - if (pAST->EnableClip) + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); - pSingleCMD++; + pSingleCMD++; ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); ASTSetupDSTXY_MMIO(dst_x, dst_y); ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - - vWaitEngIdle(pScrn, pAST); - } + ASTSetupCMDReg_MMIO(cmdreg); + + vWaitEngIdle(pScrn, pAST); + } } /* end of ASTSubsequentMonoPatternFill */ @@ -1102,16 +1102,16 @@ static void ASTSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, int rop, unsigned int planemask, int trans_col) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; ULONG cmdreg; CARD32 *pataddr; ULONG ulPatSize; int i, j, cpp; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForColor8x8PatternFill\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_BITBLT | CMD_PAT_PATREG; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -1122,22 +1122,22 @@ ASTSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } cmdreg |= (ASTXAAPatternROP[rop] << 8); pAST->ulCMDReg = cmdreg; cpp = (pScrn->bitsPerPixel + 1) / 8; pataddr = (CARD32 *)(pAST->FBVirtualAddr + - (paty * pAST->VideoModeInfo.ScreenPitch) + (patx * cpp)); + (paty * pAST->VideoModeInfo.ScreenPitch) + (patx * cpp)); ulPatSize = 8*8*cpp; - - if (!pAST->MMIO2D) + + if (!pAST->MMIO2D) { - /* Write to CMDQ */ + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*(1 + ulPatSize/4)); ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; @@ -1146,29 +1146,29 @@ ASTSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, for (j=0; j<8*cpp/4; j++) { ASTSetupPatReg(pSingleCMD, (i*j + j) , (*(CARD32 *) (pataddr++))); - pSingleCMD++; - } + pSingleCMD++; + } } - + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { + { ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); for (i=0; i<8; i++) { for (j=0; j<8*cpp/4; j++) { ASTSetupPatReg_MMIO((i*j + j) , (*(CARD32 *) (pataddr++))); - } - } - + } + } + } } /* end of ASTSetupForColor8x8PatternFill */ - + static void ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty, int dst_x, int dst_y, int width, int height) @@ -1177,56 +1177,56 @@ ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty, PKT_SC *pSingleCMD; ULONG dstbase, cmdreg; int delta_y = 0; - -/* + +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentColor8x8PatternFillRect\n"); */ - + /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; - if (dst_y >= pScrn->virtualY) - { + if (dst_y >= pScrn->virtualY) + { delta_y = dst_y; dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; dst_y=0; } - if (pAST->EnableClip) + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); - pSingleCMD++; + pSingleCMD++; ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); ASTSetupDSTXY_MMIO(dst_x, dst_y); ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - - vWaitEngIdle(pScrn, pAST); - } - + ASTSetupCMDReg_MMIO(cmdreg); + + vWaitEngIdle(pScrn, pAST); + } + } /* ASTSubsequentColor8x8PatternFillRect */ /* CPU to Screen Expand */ @@ -1240,9 +1240,9 @@ ASTSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, PKT_SC *pSingleCMD; ULONG cmdreg; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForCPUToScreenColorExpandFill\n"); -*/ +*/ /* Modify Reg. Value */ cmdreg = CMD_COLOREXP; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -1253,44 +1253,44 @@ ASTSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } cmdreg |= (ASTXAAPatternROP[rop] << 8); if(bg == -1) { - cmdreg |= CMD_FONT_TRANSPARENT; + cmdreg |= CMD_FONT_TRANSPARENT; bg = 0; - } + } pAST->ulCMDReg = cmdreg; - - if (!pAST->MMIO2D) + + if (!pAST->MMIO2D) { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*3); ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; - ASTSetupFG(pSingleCMD, fg); + ASTSetupFG(pSingleCMD, fg); pSingleCMD++; - ASTSetupBG(pSingleCMD, bg); + ASTSetupBG(pSingleCMD, bg); /* Update Write Pointer */ mUpdateWritePointer; - + } else { ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); - ASTSetupFG_MMIO(fg); - ASTSetupBG_MMIO(bg); - + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); + } - + } - + static void ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int dst_x, int dst_y, @@ -1302,61 +1302,61 @@ ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, ULONG dstbase, cmdreg; int delta_y = 0; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentCPUToScreenColorExpandFill\n"); */ - + /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; - if (dst_y >= pScrn->virtualY) - { + if (dst_y >= pScrn->virtualY) + { delta_y = dst_y; dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; dst_y=0; } - if (pAST->EnableClip) + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); - ASTSetupSRCPitch(pSingleCMD, ((width+7)/8)); - pSingleCMD++; + ASTSetupSRCPitch(pSingleCMD, ((width+7)/8)); + pSingleCMD++; ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); - pSingleCMD++; + pSingleCMD++; ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { - ASTSetupSRCPitch_MMIO((width+7)/8); + { + ASTSetupSRCPitch_MMIO((width+7)/8); ASTSetupDSTBase_MMIO(dstbase); ASTSetupDSTXY_MMIO(dst_x, dst_y); ASTSetupSRCXY_MMIO(0, 0); - + ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - + ASTSetupCMDReg_MMIO(cmdreg); + vWaitEngIdle(pScrn, pAST); - + } - + } @@ -1371,10 +1371,10 @@ ASTSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, PKT_SC *pSingleCMD; ULONG cmdreg; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForScreenToScreenColorExpandFill\n"); */ - + /* Modify Reg. Value */ cmdreg = CMD_ENHCOLOREXP; switch (pAST->VideoModeInfo.bitsPerPixel) @@ -1385,42 +1385,42 @@ ASTSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, case 15: case 16: cmdreg |= CMD_COLOR_16; - break; + break; case 24: case 32: cmdreg |= CMD_COLOR_32; - break; + break; } cmdreg |= (ASTXAAPatternROP[rop] << 8); if(bg == -1) { - cmdreg |= CMD_FONT_TRANSPARENT; + cmdreg |= CMD_FONT_TRANSPARENT; bg = 0; - } + } pAST->ulCMDReg = cmdreg; - - if (!pAST->MMIO2D) + + if (!pAST->MMIO2D) { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*3); ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); pSingleCMD++; - ASTSetupFG(pSingleCMD, fg); + ASTSetupFG(pSingleCMD, fg); pSingleCMD++; - ASTSetupBG(pSingleCMD, bg); + ASTSetupBG(pSingleCMD, bg); /* Update Write Pointer */ mUpdateWritePointer; - + } else { ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); - ASTSetupFG_MMIO(fg); - ASTSetupBG_MMIO(bg); - + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); + } - + } @@ -1436,63 +1436,63 @@ ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, USHORT srcpitch; int delta_y = 0; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentScreenToScreenColorExpandFill\n"); */ - + /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; else - cmdreg &= ~CMD_ENABLE_CLIP; + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; - if (dst_y >= pScrn->virtualY) - { + if (dst_y >= pScrn->virtualY) + { delta_y = dst_y; dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; dst_y=0; } - srcbase = pAST->VideoModeInfo.ScreenPitch*src_y + ((pScrn->bitsPerPixel+1)/8)*src_x; + srcbase = pAST->VideoModeInfo.ScreenPitch*src_y + ((pScrn->bitsPerPixel+1)/8)*src_x; srcpitch = (pScrn->displayWidth+7)/8; - if (pAST->EnableClip) + if (pAST->EnableClip) ASTSetHWClipping(pScrn, delta_y); - - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*6); ASTSetupSRCBase(pSingleCMD, srcbase); - pSingleCMD++; - ASTSetupSRCPitch(pSingleCMD,srcpitch); - pSingleCMD++; + pSingleCMD++; + ASTSetupSRCPitch(pSingleCMD,srcpitch); + pSingleCMD++; ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); - pSingleCMD++; + pSingleCMD++; ASTSetupRECTXY(pSingleCMD, width, height); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, cmdreg); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + /* Update Write Pointer */ mUpdateWritePointer; - + } else - { - ASTSetupSRCBase_MMIO(srcbase); - ASTSetupSRCPitch_MMIO(srcpitch); + { + ASTSetupSRCBase_MMIO(srcbase); + ASTSetupSRCPitch_MMIO(srcpitch); ASTSetupDSTBase_MMIO(dstbase); ASTSetupDSTXY_MMIO(dst_x, dst_y); ASTSetupRECTXY_MMIO(width, height); - ASTSetupCMDReg_MMIO(cmdreg); - + ASTSetupCMDReg_MMIO(cmdreg); + vWaitEngIdle(pScrn, pAST); - + } - + } @@ -1503,7 +1503,7 @@ ASTSetHWClipping(ScrnInfoPtr pScrn, int delta_y) ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; - if (!pAST->MMIO2D) + if (!pAST->MMIO2D) { /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2); @@ -1511,59 +1511,59 @@ ASTSetHWClipping(ScrnInfoPtr pScrn, int delta_y) ASTSetupCLIP1(pSingleCMD, pAST->clip_left, pAST->clip_top - delta_y); pSingleCMD++; ASTSetupCLIP2(pSingleCMD, pAST->clip_right + 1, pAST->clip_bottom - delta_y + 1); - + /* Update Write Pointer */ mUpdateWritePointer; - + } else { ASTSetupCLIP1_MMIO(pAST->clip_left, pAST->clip_top - delta_y); - ASTSetupCLIP2_MMIO(pAST->clip_right + 1, pAST->clip_bottom - delta_y + 1); + ASTSetupCLIP2_MMIO(pAST->clip_right + 1, pAST->clip_bottom - delta_y + 1); } - -} + +} static void ASTSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top, int right, int bottom) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetClippingRectangle\n"); -*/ +*/ pAST->EnableClip = TRUE; - + pAST->clip_left = left; pAST->clip_top = top; pAST->clip_right = right; pAST->clip_bottom = bottom; - + } static void ASTDisableClipping(ScrnInfoPtr pScrn) { ASTRecPtr pAST = ASTPTR(pScrn); -/* +/* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTDisableClipping\n"); -*/ +*/ pAST->EnableClip = FALSE; } static void AIPSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, int flags) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; ULONG dstbase, ulCommand; - ULONG miny, maxy; + ULONG miny, maxy; /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidTwoPointLine\n"); -*/ +*/ /* Modify Reg. Value */ ulCommand = (pAST->ulCMDReg & (~CMD_MASK)) | CMD_LINEDRAW | CMD_NORMAL_LINE; @@ -1574,7 +1574,7 @@ static void AIPSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, if (pAST->EnableClip) ulCommand |= CMD_ENABLE_CLIP; else - ulCommand &= ~CMD_ENABLE_CLIP; + ulCommand &= ~CMD_ENABLE_CLIP; dstbase = 0; miny = (y1 > y2) ? y2 : y1; maxy = (y1 > y2) ? y1 : y2; @@ -1584,38 +1584,38 @@ static void AIPSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, y2 -= miny; } - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; AIPSetupLineXY(pSingleCMD, x1, y1); pSingleCMD++; AIPSetupLineXY2(pSingleCMD, x2, y2); pSingleCMD++; AIPSetupLineNumber(pSingleCMD, 0); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, ulCommand); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, ulCommand); + /* Update Write Pointer */ - mUpdateWritePointer; + mUpdateWritePointer; /* Patch KDE pass abnormal point, ycchen@052507 */ vWaitEngIdle(pScrn, pAST); - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); AIPSetupLineXY_MMIO(x1, y1); AIPSetupLineXY2_MMIO(x2, y2); AIPSetupLineNumber_MMIO(0); - ASTSetupCMDReg_MMIO(ulCommand); - + ASTSetupCMDReg_MMIO(ulCommand); + vWaitEngIdle(pScrn, pAST); - + } @@ -1626,14 +1626,14 @@ AIPSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, int flags, int phase) { - + ASTRecPtr pAST = ASTPTR(pScrn); PKT_SC *pSingleCMD; - ULONG dstbase, ulCommand; - ULONG miny, maxy; + ULONG dstbase, ulCommand; + ULONG miny, maxy; /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentDashedTwoPointLine\n"); -*/ +*/ /* Modify Reg. Value */ ulCommand = pAST->ulCMDReg | CMD_NORMAL_LINE; @@ -1644,8 +1644,8 @@ AIPSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, if (pAST->EnableClip) ulCommand |= CMD_ENABLE_CLIP; else - ulCommand &= ~CMD_ENABLE_CLIP; - dstbase = 0; + ulCommand &= ~CMD_ENABLE_CLIP; + dstbase = 0; miny = (y1 > y2) ? y2 : y1; maxy = (y1 > y2) ? y1 : y2; if(maxy >= pScrn->virtualY) { @@ -1654,40 +1654,40 @@ AIPSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, y2 -= miny; } - if (!pAST->MMIO2D) - { - /* Write to CMDQ */ + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); ASTSetupDSTBase(pSingleCMD, dstbase); - pSingleCMD++; + pSingleCMD++; AIPSetupLineXY(pSingleCMD, x1, y1); pSingleCMD++; AIPSetupLineXY2(pSingleCMD, x2, y2); pSingleCMD++; AIPSetupLineNumber(pSingleCMD, 0); - pSingleCMD++; - ASTSetupCMDReg(pSingleCMD, ulCommand); - + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, ulCommand); + /* Update Write Pointer */ mUpdateWritePointer; /* Patch KDE pass abnormal point, ycchen@052507 */ vWaitEngIdle(pScrn, pAST); - + } else - { + { ASTSetupDSTBase_MMIO(dstbase); AIPSetupLineXY_MMIO(x1, y1); AIPSetupLineXY2_MMIO(x2, y2); AIPSetupLineNumber_MMIO(0); ASTSetupCMDReg_MMIO(ulCommand); - + vWaitEngIdle(pScrn, pAST); - + } - + } #endif @@ -1701,7 +1701,7 @@ AIPSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxes, int id) { ASTPtr pAST = ASTPTR(pScrn); - int nBoxs; + int nBoxs; int ScaleFactorH, ScaleFactorV; ULONG InitScaleFactorH, InitScaleFactorV; BURSTSCALECMD CopyCmd = {0}; @@ -1712,12 +1712,12 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe short lSrcX, lSrcY; ULONG dwCmd = 0; int i; - + pBox = REGION_RECTS(clipBoxes); nBoxs = REGION_NUM_RECTS(clipBoxes); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "MMIO=%x,pBox=%x, nBoxs=%x\n", pAST->MMIO2D, pBox, nBoxs); - + if(0==pPriv->drw_w || 0==pPriv->drw_h) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drwx=%x, drwy=%x\n", pPriv->drw_w, pPriv->drw_h); @@ -1727,7 +1727,7 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe /* calc scaling factor */ fScaleX = (float)pPriv->src_w /(float)pPriv->drw_w; fScaleY = (float)pPriv->src_h /(float)pPriv->drw_h; - + if (pPriv->src_w == pPriv->drw_w) ScaleFactorH = 0x8000; else @@ -1753,7 +1753,7 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe else InitScaleFactorV = 0x4000; - switch(pScrn->bitsPerPixel) + switch(pScrn->bitsPerPixel) { case 32: dwCmd = CMD_COLOR_32; @@ -1776,30 +1776,30 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe switch(id) { case PIXEL_FMT_YUY2: - dwCmd |= YUV_FORMAT_YUYV; + dwCmd |= YUV_FORMAT_YUYV; break; - case PIXEL_FMT_UYVY: - dwCmd |= YUV_FORMAT_UYVY; + case PIXEL_FMT_UYVY: + dwCmd |= YUV_FORMAT_UYVY; break; default: xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Other pix format:%x\n", id); break; } - + for(i = 0; i < nBoxs; i++, pBox++) { rect.x = pBox->x1 - pPriv->drw_x; rect.y = pBox->y1 - pPriv->drw_y; rect.width = pBox->x2 - pBox->x1; - rect.height = pBox->y2 - pBox->y1; - + rect.height = pBox->y2 - pBox->y1; + lSrcX = (ULONG)((float)rect.x * fScaleX + pPriv->src_x + 0.5f); lSrcY = (ULONG)((float)rect.y * fScaleY + pPriv->src_y + 0.5f); - - pCopyCmd = (BURSTSCALECMD*)pjRequestCMDQ(pAST, PKT_TYPESCALE_LENGTH); - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "pCopyCmd=%p, pBox=%x,%x,%x,%x\n", pCopyCmd, pBox->x1, pBox->y1, pBox->x2, pBox->y2); - + + pCopyCmd = (BURSTSCALECMD*)pjRequestCMDQ(pAST, PKT_TYPESCALE_LENGTH); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "pCopyCmd=%p, pBox=%x,%x,%x,%x\n", pCopyCmd, pBox->x1, pBox->y1, pBox->x2, pBox->y2); + CopyCmd.dwHeader0 = (ULONG) PKT_BURST_CMD_HEADER0 | PKT_TYPESCALE_DATALENGTH | PKT_TYPESCALE_ADDRSTART | @@ -1808,16 +1808,16 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CopyCmd.dwHeader0=%x\n", CopyCmd.dwHeader0); CopyCmd.dwSrcPitch = (ULONG)(pPriv->srcPitch << 16); - + CopyCmd.dwDstHeightPitch = (ULONG) ((pAST->VideoModeInfo.ScreenPitch << 16) | 0xFFFF); - - CopyCmd.dwDstXY = (ULONG) ((pBox->x1 << 16) | (pBox->y1 & 0xFFFF)); - CopyCmd.dwSrcXY = (ULONG) ((lSrcX << 16) | (lSrcY & 0xFFFF)); - CopyCmd.dwRecHeightWidth = (ULONG) ((rect.width << 16) | rect.height); - + + CopyCmd.dwDstXY = (ULONG) ((pBox->x1 << 16) | (pBox->y1 & 0xFFFF)); + CopyCmd.dwSrcXY = (ULONG) ((lSrcX << 16) | (lSrcY & 0xFFFF)); + CopyCmd.dwRecHeightWidth = (ULONG) ((rect.width << 16) | rect.height); + CopyCmd.dwInitScaleFactorH = InitScaleFactorH; CopyCmd.dwInitScaleFactorV = InitScaleFactorV; - CopyCmd.dwScaleFactorH = ScaleFactorH; + CopyCmd.dwScaleFactorH = ScaleFactorH; CopyCmd.dwScaleFactorV = ScaleFactorV; CopyCmd.dwSrcBaseAddr = pPriv->bufAddr[pPriv->currentBuf]; @@ -1825,10 +1825,10 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe CopyCmd.dwCmd = dwCmd; CopyCmd.NullData[0] = 0; /* for alignment */ memcpy(pCopyCmd, &CopyCmd, sizeof(CopyCmd)); - + mUpdateWritePointer; - -#if 0 + +#if 0 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%08x, %08x, %08x, %08x\n", *(ULONG *)(pAST->MMIOVirtualAddr+0x8000), *(ULONG *)(pAST->MMIOVirtualAddr+0x8004), @@ -1852,7 +1852,7 @@ void ASTDisplayVideo(ScrnInfoPtr pScrn, ASTPortPrivPtr pPriv, RegionPtr clipBoxe #endif } /* End of for-loop */ - + } /* ASTDisplayVideo */ #endif /* AstVideo */ |