summaryrefslogtreecommitdiff
path: root/src/ast_accel.c
diff options
context:
space:
mode:
authorY.C. Chen <yc_chen@aspeedtech.com>2010-06-22 15:17:27 +0800
committerY.C. Chen <yc_chen@aspeedtech.com>2010-06-22 15:17:27 +0800
commit9e8d8489922d8b647b28de06045e8fddf0ffc62f (patch)
treea541ac936e888b22ee6bea20b92d93347ed0662d /src/ast_accel.c
parent59995d0619afca6e88c1be08e01bfb60903c5099 (diff)
modified: autogen.sh
modified: configure.ac modified: src/ast.h modified: src/ast_2dtool.c modified: src/ast_2dtool.h modified: src/ast_accel.c modified: src/ast_driver.c modified: src/ast_mode.c modified: src/ast_mode.h modified: src/ast_vgatool.c
Diffstat (limited to 'src/ast_accel.c')
-rw-r--r--src/ast_accel.c169
1 files changed, 164 insertions, 5 deletions
diff --git a/src/ast_accel.c b/src/ast_accel.c
index b15da59..ad8f1b1 100644
--- a/src/ast_accel.c
+++ b/src/ast_accel.c
@@ -152,6 +152,12 @@ static void ASTSetClippingRectangle(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);
+static void AIPSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn,
+ int x1, int y1, int x2, int y2,
+ int flags, int phase);
+
Bool
ASTAccelInit(ScreenPtr pScreen)
{
@@ -189,17 +195,33 @@ ASTAccelInit(ScreenPtr pScreen)
/* Solid Lines */
if (pAST->ENGCaps & ENG_CAP_SolidLine)
{
- infoPtr->SetupForSolidLine = ASTSetupForSolidLine;
+ if (pAST->jChipType == AST2300)
+ {
+ infoPtr->SubsequentSolidTwoPointLine = AIPSubsequentSolidTwoPointLine;
+ }
+ else
+ {
+ infoPtr->SubsequentSolidTwoPointLine = ASTSubsequentSolidTwoPointLine;
+ }
+
+ infoPtr->SetupForSolidLine = ASTSetupForSolidLine;
infoPtr->SubsequentSolidHorVertLine = ASTSubsequentSolidHorVertLine;
- infoPtr->SubsequentSolidTwoPointLine = ASTSubsequentSolidTwoPointLine;
infoPtr->SolidLineFlags = NO_PLANEMASK;
}
/* Dashed Lines */
if (pAST->ENGCaps & ENG_CAP_DashedLine)
- {
- infoPtr->SetupForDashedLine = ASTSetupForDashedLine;
- infoPtr->SubsequentDashedTwoPointLine = ASTSubsequentDashedTwoPointLine;
+ {
+ if (pAST->jChipType == AST2300)
+ {
+ infoPtr->SubsequentDashedTwoPointLine = AIPSubsequentDashedTwoPointLine;
+ }
+ else
+ {
+ infoPtr->SubsequentDashedTwoPointLine = ASTSubsequentDashedTwoPointLine;
+ }
+
+ infoPtr->SetupForDashedLine = ASTSetupForDashedLine;
infoPtr->DashPatternMaxLength = 64;
infoPtr->DashedLineFlags = NO_PLANEMASK |
LINE_PATTERN_MSBFIRST_LSBJUSTIFIED;
@@ -1526,4 +1548,141 @@ ASTDisableClipping(ScrnInfoPtr pScrn)
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;
+/*
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidTwoPointLine\n");
+*/
+
+ /* Modify Reg. Value */
+ ulCommand = (pAST->ulCMDReg & (~CMD_MASK)) | CMD_LINEDRAW | CMD_NORMAL_LINE;
+ if(flags & OMIT_LAST)
+ ulCommand |= CMD_NOT_DRAW_LAST_PIXEL;
+ else
+ ulCommand &= ~CMD_NOT_DRAW_LAST_PIXEL;
+ if (pAST->EnableClip)
+ ulCommand |= CMD_ENABLE_CLIP;
+ else
+ ulCommand &= ~CMD_ENABLE_CLIP;
+ dstbase = 0;
+ miny = (y1 > y2) ? y2 : y1;
+ maxy = (y1 > y2) ? y1 : y2;
+ if(maxy >= pScrn->virtualY) {
+ dstbase = pAST->VideoModeInfo.ScreenPitch * miny;
+ y1 -= miny;
+ y2 -= miny;
+ }
+
+ if (!pAST->MMIO2D)
+ {
+ /* Write to CMDQ */
+ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5);
+
+ ASTSetupDSTBase(pSingleCMD, dstbase);
+ pSingleCMD++;
+ AIPSetupLineXY(pSingleCMD, x1, y1);
+ pSingleCMD++;
+ AIPSetupLineXY2(pSingleCMD, x2, y2);
+ pSingleCMD++;
+ AIPSetupLineNumber(pSingleCMD, 0);
+ 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);
+
+ }
+
+
+} /* end of AIPSubsequentSolidTwoPointLine */
+
+static void
+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;
+/*
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentDashedTwoPointLine\n");
+*/
+
+ /* Modify Reg. Value */
+ ulCommand = pAST->ulCMDReg | CMD_NORMAL_LINE;
+ if(flags & OMIT_LAST)
+ ulCommand |= CMD_NOT_DRAW_LAST_PIXEL;
+ else
+ ulCommand &= ~CMD_NOT_DRAW_LAST_PIXEL;
+ if (pAST->EnableClip)
+ ulCommand |= CMD_ENABLE_CLIP;
+ else
+ ulCommand &= ~CMD_ENABLE_CLIP;
+ dstbase = 0;
+ miny = (y1 > y2) ? y2 : y1;
+ maxy = (y1 > y2) ? y1 : y2;
+ if(maxy >= pScrn->virtualY) {
+ dstbase = pAST->VideoModeInfo.ScreenPitch * miny;
+ y1 -= miny;
+ y2 -= miny;
+ }
+
+ if (!pAST->MMIO2D)
+ {
+ /* Write to CMDQ */
+ pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5);
+
+ ASTSetupDSTBase(pSingleCMD, dstbase);
+ pSingleCMD++;
+ AIPSetupLineXY(pSingleCMD, x1, y1);
+ pSingleCMD++;
+ AIPSetupLineXY2(pSingleCMD, x2, y2);
+ pSingleCMD++;
+ AIPSetupLineNumber(pSingleCMD, 0);
+ 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 /* end of Accel_2D */