diff options
author | James Cloos <cloos@jhcloos.com> | 2007-09-03 06:06:32 -0400 |
---|---|---|
committer | James Cloos <cloos@jhcloos.com> | 2007-09-03 06:06:32 -0400 |
commit | d5b5a0e603e47dd3782c41685e75c6bd2d9e1016 (patch) | |
tree | 74a0fb8bf2000077d58b493b4f480942d8ee6515 | |
parent | 2d1b72187d14d7cc5a1b9ded7cd60b3fcbaebaae (diff) | |
parent | 486380cd85cdd2532300905ee588be48480ce1dc (diff) |
Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/driver/xf86-video-ast
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/ast.h | 12 | ||||
-rw-r--r-- | src/ast_2dtool.h | 123 | ||||
-rw-r--r-- | src/ast_accel.c | 45 | ||||
-rw-r--r-- | src/ast_cursor.c | 8 | ||||
-rw-r--r-- | src/ast_driver.c | 69 | ||||
-rw-r--r-- | src/ast_mode.c | 22 | ||||
-rw-r--r-- | src/ast_mode.h | 3 | ||||
-rw-r--r-- | src/ast_vgatool.c | 1 |
10 files changed, 203 insertions, 97 deletions
@@ -1,3 +1,18 @@ +2007-08-24 Y.C. Chen <yc_chen@aspeedtech.com> + + * configure.ac: + * src/ast.h: + * src/ast_2dtool.c: + * src/ast_accel.c: + * src/ast_cursor.c: + * src/ast_driver.c: + * src/ast_mode.c: + * src/ast_tool.c: + * src/ast_vgatool.c: + * src/ast_2dtool.h + * src/ast_mode.h: + Support AST2100 + 2006-04-17 Y.C. Chen <yc_chen@aspeedtech.com> * src/ast_vgatool.c: (GetMaxDCLK): diff --git a/configure.ac b/configure.ac index 61b7a39..c033ee2 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-ast], - 0.81.0, + 0.84.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-ast) @@ -27,6 +27,7 @@ #define Accel_2D /* #define MMIO_2D */ #define HWC +/* #define PATCH_ABI_VERSION */ /* Vendor & Device Info */ #ifndef PCI_VENDOR_AST @@ -37,6 +38,12 @@ #define PCI_CHIP_AST2000 0x2000 #endif +typedef enum _CHIP_ID { + VGALegacy, + AST2000, + AST2100 +} CHIP_ID; + /* AST REC Info */ #define AST_NAME "AST" #define AST_DRIVER_NAME "ast" @@ -54,6 +61,9 @@ #define CMD_QUEUE_GUARD_BAND 0x00000020 #define DEFAULT_HWC_NUM 0x00000002 +/* Patch Info */ +#define ABI_VIDEODRV_VERSION_PATCH SET_ABI_VERSION(0, 5) + /* Data Type Definition */ typedef INT32 LONG; typedef CARD8 UCHAR; @@ -132,6 +142,8 @@ typedef struct _ASTRec { CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; + + UCHAR jChipType; Bool noAccel; Bool noHWC; diff --git a/src/ast_2dtool.h b/src/ast_2dtool.h index 193d3cd..b6ca79d 100644 --- a/src/ast_2dtool.h +++ b/src/ast_2dtool.h @@ -61,23 +61,28 @@ typedef struct _PKT_SC } PKT_SC, *PPKT_SC; /* Eng Reg. Limitation */ -#define MAX_SRC_PITCH 0x1FFF -#define MAX_DST_PITCH 0x1FFF -#define MAX_DST_HEIGHT 0x7FF #define MAX_SRC_X 0x7FF #define MAX_SRC_Y 0x7FF #define MAX_DST_X 0x7FF #define MAX_DST_Y 0x7FF -#define MAX_RECT_WIDTH 0x7FF -#define MAX_RECT_HEIGHT 0x7FF -#define MAX_CLIP 0xFFF -#define MAX_LINE_X 0x7FF -#define MAX_LINE_Y 0x7FF -#define MAX_LINE_ERR 0x3FFFFF -#define MAX_LINE_WIDTH 0x7FF -#define MAX_LINE_K1 0x3FFFFF -#define MAX_LINE_K2 0x3FFFFF +#define MASK_SRC_PITCH 0x1FFF +#define MASK_DST_PITCH 0x1FFF +#define MASK_DST_HEIGHT 0x7FF +#define MASK_SRC_X 0xFFF +#define MASK_SRC_Y 0xFFF +#define MASK_DST_X 0xFFF +#define MASK_DST_Y 0xFFF +#define MASK_RECT_WIDTH 0x7FF +#define MASK_RECT_HEIGHT 0x7FF +#define MASK_CLIP 0xFFF + +#define MASK_LINE_X 0xFFF +#define MASK_LINE_Y 0xFFF +#define MASK_LINE_ERR 0x3FFFFF +#define MASK_LINE_WIDTH 0x7FF +#define MASK_LINE_K1 0x3FFFFF +#define MASK_LINE_K2 0x3FFFFF #define MAX_PATReg_Size 256 @@ -195,10 +200,10 @@ typedef struct _LINEPARAM { typedef struct { - ULONG X1; - ULONG Y1; - ULONG X2; - ULONG Y2; + LONG X1; + LONG Y1; + LONG X2; + LONG Y2; } _LINEInfo; @@ -208,91 +213,91 @@ typedef struct { { \ do { \ *(ULONG *)(MMIOREG_SRC_BASE) = (ULONG) (base); \ - } while (*(ULONG *)(MMIOREG_SRC_BASE) != (ULONG) (base)); \ + } while (*(volatile ULONG *)(MMIOREG_SRC_BASE) != (ULONG) (base)); \ } #define ASTSetupSRCPitch_MMIO(pitch) \ { \ do { \ *(ULONG *)(MMIOREG_SRC_PITCH) = (ULONG)(pitch << 16); \ - } while (*(ULONG *)(MMIOREG_SRC_PITCH) != (ULONG)(pitch << 16)); \ + } while (*(volatile ULONG *)(MMIOREG_SRC_PITCH) != (ULONG)(pitch << 16)); \ } #define ASTSetupDSTBase_MMIO(base) \ { \ do { \ *(ULONG *)(MMIOREG_DST_BASE) = (ULONG)(base); \ - } while (*(ULONG *)(MMIOREG_DST_BASE) != (ULONG)(base)); \ + } while (*(volatile ULONG *)(MMIOREG_DST_BASE) != (ULONG)(base)); \ } #define ASTSetupDSTPitchHeight_MMIO(pitch, height) \ { \ ULONG dstpitch; \ - dstpitch = (ULONG)((pitch << 16) + ((height) & MAX_DST_HEIGHT)); \ + dstpitch = (ULONG)((pitch << 16) + ((height) & MASK_DST_HEIGHT)); \ do { \ *(ULONG *)(MMIOREG_DST_PITCH) = dstpitch; \ - } while (*(ULONG *)(MMIOREG_DST_PITCH) != dstpitch); \ + } while (*(volatile ULONG *)(MMIOREG_DST_PITCH) != dstpitch); \ } #define ASTSetupDSTXY_MMIO(x, y) \ { \ ULONG dstxy; \ - dstxy = (ULONG)(((x & MAX_DST_X) << 16) + (y & MAX_DST_Y)); \ + dstxy = (ULONG)(((x & MASK_DST_X) << 16) + (y & MASK_DST_Y)); \ do { \ *(ULONG *)(MMIOREG_DST_XY) = dstxy; \ - } while (*(ULONG *)(MMIOREG_DST_XY) != dstxy); \ + } while (*(volatile ULONG *)(MMIOREG_DST_XY) != dstxy); \ } #define ASTSetupSRCXY_MMIO(x, y) \ { \ ULONG srcxy; \ - srcxy = (ULONG)(((x & MAX_SRC_X) << 16) + (y & MAX_SRC_Y)); \ + srcxy = (ULONG)(((x & MASK_SRC_X) << 16) + (y & MASK_SRC_Y)); \ do { \ *(ULONG *)(MMIOREG_SRC_XY) = srcxy; \ - } while (*(ULONG *)(MMIOREG_SRC_XY) != srcxy); \ + } while (*(volatile ULONG *)(MMIOREG_SRC_XY) != srcxy); \ } #define ASTSetupRECTXY_MMIO(x, y) \ { \ ULONG rectxy; \ - rectxy = (ULONG)(((x & MAX_RECT_WIDTH) << 16) + (y & MAX_RECT_WIDTH)); \ + rectxy = (ULONG)(((x & MASK_RECT_WIDTH) << 16) + (y & MASK_RECT_WIDTH)); \ do { \ *(ULONG *)(MMIOREG_RECT_XY) = rectxy; \ - } while (*(ULONG *)(MMIOREG_RECT_XY) != rectxy); \ + } while (*(volatile ULONG *)(MMIOREG_RECT_XY) != rectxy); \ } #define ASTSetupFG_MMIO(color) \ { \ do { \ *(ULONG *)(MMIOREG_FG) = (ULONG)(color); \ - } while (*(ULONG *)(MMIOREG_FG) != (ULONG)(color)); \ + } while (*(volatile ULONG *)(MMIOREG_FG) != (ULONG)(color)); \ } #define ASTSetupBG_MMIO(color) \ { \ do { \ *(ULONG *)(MMIOREG_BG) = (ULONG)(color); \ - } while (*(ULONG *)(MMIOREG_BG) != (ULONG)(color)); \ + } while (*(volatile ULONG *)(MMIOREG_BG) != (ULONG)(color)); \ } #define ASTSetupMONO1_MMIO(pat) \ { \ do { \ *(ULONG *)(MMIOREG_MONO1) = (ULONG)(pat); \ - } while (*(ULONG *)(MMIOREG_MONO1) != (ULONG)(pat)); \ + } while (*(volatile ULONG *)(MMIOREG_MONO1) != (ULONG)(pat)); \ } #define ASTSetupMONO2_MMIO(pat) \ { \ do { \ *(ULONG *)(MMIOREG_MONO2) = (ULONG)(pat); \ - } while (*(ULONG *)(MMIOREG_MONO2) != (ULONG)(pat)); \ + } while (*(volatile ULONG *)(MMIOREG_MONO2) != (ULONG)(pat)); \ } #define ASTSetupCLIP1_MMIO(left, top) \ { \ ULONG clip1; \ - clip1 = (ULONG)(((left & MAX_CLIP) << 16) + (top & MAX_CLIP)); \ + clip1 = (ULONG)(((left & MASK_CLIP) << 16) + (top & MASK_CLIP)); \ do { \ *(ULONG *)(MMIOREG_CLIP1) = clip1; \ - } while (*(ULONG *)(MMIOREG_CLIP1) != clip1); \ + } while (*(volatile ULONG *)(MMIOREG_CLIP1) != clip1); \ } #define ASTSetupCLIP2_MMIO(right, bottom) \ { \ ULONG clip2; \ - clip2 = (ULONG)(((right & MAX_CLIP) << 16) + (bottom & MAX_CLIP)); \ + clip2 = (ULONG)(((right & MASK_CLIP) << 16) + (bottom & MASK_CLIP)); \ do { \ *(ULONG *)(MMIOREG_CLIP2) = clip2; \ - } while (*(ULONG *)(MMIOREG_CLIP2) != clip2); \ + } while (*(volatile ULONG *)(MMIOREG_CLIP2) != clip2); \ } #define ASTSetupCMDReg_MMIO(reg) \ { \ @@ -302,57 +307,57 @@ typedef struct { { \ do { \ *(ULONG *)(MMIOREG_PAT + patreg*4) = (ULONG)(pat); \ - } while (*(ULONG *)(MMIOREG_PAT + patreg*4) != (ULONG)(pat)); \ + } while (*(volatile ULONG *)(MMIOREG_PAT + patreg*4) != (ULONG)(pat)); \ } /* Line CMD */ #define ASTSetupLineXY_MMIO(x, y) \ { \ ULONG linexy; \ - linexy = (ULONG)(((x & MAX_LINE_X) << 16) + (y & MAX_LINE_Y)); \ + linexy = (ULONG)(((x & MASK_LINE_X) << 16) + (y & MASK_LINE_Y)); \ do { \ *(ULONG *)(MMIOREG_LINE_XY) = linexy; \ - } while (*(ULONG *)(MMIOREG_LINE_XY) != linexy); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_XY) != linexy); \ } #define ASTSetupLineXMErrTerm_MMIO(xm, err) \ { \ ULONG lineerr; \ - lineerr = (ULONG)((xm << 24) + (err & MAX_LINE_ERR)); \ + lineerr = (ULONG)((xm << 24) + (err & MASK_LINE_ERR)); \ do { \ *(ULONG *)(MMIOREG_LINE_Err) = lineerr; \ - } while (*(ULONG *)(MMIOREG_LINE_Err) != lineerr); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_Err) != lineerr); \ } #define ASTSetupLineWidth_MMIO(width) \ { \ ULONG linewidth; \ - linewidth = (ULONG)((width & MAX_LINE_WIDTH) << 16); \ + linewidth = (ULONG)((width & MASK_LINE_WIDTH) << 16); \ do { \ *(ULONG *)(MMIOREG_LINE_WIDTH) = linewidth; \ - } while (*(ULONG *)(MMIOREG_LINE_WIDTH) != linewidth); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_WIDTH) != linewidth); \ } #define ASTSetupLineK1Term_MMIO(err) \ { \ do { \ - *(ULONG *)(MMIOREG_LINE_K1) = (ULONG)(err & MAX_LINE_K1); \ - } while (*(ULONG *)(MMIOREG_LINE_K1) != (ULONG)(err & MAX_LINE_K1)); \ + *(ULONG *)(MMIOREG_LINE_K1) = (ULONG)(err & MASK_LINE_K1); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_K1) != (ULONG)(err & MASK_LINE_K1)); \ } #define ASTSetupLineK2Term_MMIO(err) \ { \ do { \ - *(ULONG *)(MMIOREG_LINE_K2) = (ULONG)(err & MAX_LINE_K2); \ - } while (*(ULONG *)(MMIOREG_LINE_K2) != (ULONG)(err & MAX_LINE_K2)); \ + *(ULONG *)(MMIOREG_LINE_K2) = (ULONG)(err & MASK_LINE_K2); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_K2) != (ULONG)(err & MASK_LINE_K2)); \ } #define ASTSetupLineStyle1_MMIO(pat) \ { \ do { \ *(ULONG *)(MMIOREG_LINE_STYLE1) = (ULONG)(pat); \ - } while (*(ULONG *)(MMIOREG_LINE_STYLE1) != (ULONG)(pat)); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_STYLE1) != (ULONG)(pat)); \ } #define ASTSetupLineStyle2_MMIO(pat) \ { \ do { \ *(ULONG *)(MMIOREG_LINE_STYLE2) = (ULONG)(pat); \ - } while (*(ULONG *)(MMIOREG_LINE_STYLE2) != (ULONG)(pat)); \ + } while (*(volatile ULONG *)(MMIOREG_LINE_STYLE2) != (ULONG)(pat)); \ } /* CMDQ Mode Macro */ @@ -377,22 +382,22 @@ typedef struct { #define ASTSetupDSTPitchHeight(addr, pitch, height) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_DST_PITCH); \ - addr->PKT_SC_dwData[0] = (ULONG)((pitch << 16) + ((height) & MAX_DST_HEIGHT)); \ + addr->PKT_SC_dwData[0] = (ULONG)((pitch << 16) + ((height) & MASK_DST_HEIGHT)); \ } #define ASTSetupDSTXY(addr, x, y) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_DST_XY); \ - addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_DST_X) << 16) + (y & MAX_DST_Y)); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MASK_DST_X) << 16) + (y & MASK_DST_Y)); \ } #define ASTSetupSRCXY(addr, x, y) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_SRC_XY); \ - addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_SRC_X) << 16) + (y & MAX_SRC_Y)); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MASK_SRC_X) << 16) + (y & MASK_SRC_Y)); \ } #define ASTSetupRECTXY(addr, x, y) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_RECT_XY); \ - addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_RECT_WIDTH) << 16) + (y & MAX_RECT_WIDTH)); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MASK_RECT_WIDTH) << 16) + (y & MASK_RECT_WIDTH)); \ } #define ASTSetupFG(addr, color) \ { \ @@ -417,12 +422,12 @@ typedef struct { #define ASTSetupCLIP1(addr, left, top) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_CLIP1); \ - addr->PKT_SC_dwData[0] = (ULONG)(((left & MAX_CLIP) << 16) + (top & MAX_CLIP)); \ + addr->PKT_SC_dwData[0] = (ULONG)(((left & MASK_CLIP) << 16) + (top & MASK_CLIP)); \ } #define ASTSetupCLIP2(addr, right, bottom) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_CLIP2); \ - addr->PKT_SC_dwData[0] = (ULONG)(((right & MAX_CLIP) << 16) + (bottom & MAX_CLIP)); \ + addr->PKT_SC_dwData[0] = (ULONG)(((right & MASK_CLIP) << 16) + (bottom & MASK_CLIP)); \ } #define ASTSetupCMDReg(addr, reg) \ { \ @@ -439,27 +444,27 @@ typedef struct { #define ASTSetupLineXY(addr, x, y) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_XY); \ - addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_LINE_X) << 16) + (y & MAX_LINE_Y)); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MASK_LINE_X) << 16) + (y & MASK_LINE_Y)); \ } #define ASTSetupLineXMErrTerm(addr, xm, err) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_Err); \ - addr->PKT_SC_dwData[0] = (ULONG)((xm << 24) + (err & MAX_LINE_ERR)); \ + addr->PKT_SC_dwData[0] = (ULONG)((xm << 24) + (err & MASK_LINE_ERR)); \ } #define ASTSetupLineWidth(addr, width) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_WIDTH); \ - addr->PKT_SC_dwData[0] = (ULONG)((width & MAX_LINE_WIDTH) << 16); \ + addr->PKT_SC_dwData[0] = (ULONG)((width & MASK_LINE_WIDTH) << 16); \ } #define ASTSetupLineK1Term(addr, err) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_K1); \ - addr->PKT_SC_dwData[0] = (ULONG)(err & MAX_LINE_K1); \ + addr->PKT_SC_dwData[0] = (ULONG)(err & MASK_LINE_K1); \ } #define ASTSetupLineK2Term(addr, err) \ { \ addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_K2); \ - addr->PKT_SC_dwData[0] = (ULONG)(err & MAX_LINE_K2); \ + addr->PKT_SC_dwData[0] = (ULONG)(err & MASK_LINE_K2); \ } #define ASTSetupLineStyle1(addr, pat) \ { \ diff --git a/src/ast_accel.c b/src/ast_accel.c index 689235e..1ef3095 100644 --- a/src/ast_accel.c +++ b/src/ast_accel.c @@ -256,7 +256,6 @@ ASTAccelInit(ScreenPtr pScreen) infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | HARDWARE_CLIP_MONO_8x8_FILL | HARDWARE_CLIP_COLOR_8x8_FILL | - HARDWARE_CLIP_SOLID_FILL | HARDWARE_CLIP_SOLID_LINE | HARDWARE_CLIP_DASHED_LINE | HARDWARE_CLIP_SOLID_LINE; @@ -338,11 +337,13 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2, /* xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentScreenToScreenCopy\n"); */ - + /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; srcbase = dstbase = 0; if (y1 >= MAX_SRC_Y) @@ -479,7 +480,9 @@ ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn, /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) - cmdreg |= CMD_ENABLE_CLIP; + cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; if (dst_y >= pScrn->virtualY) @@ -587,7 +590,9 @@ static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, /* Modify Reg. Value */ cmdreg = (pAST->ulCMDReg & (~CMD_MASK)) | CMD_BITBLT; if (pAST->EnableClip) - cmdreg |= CMD_ENABLE_CLIP; + cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; if(dir == DEGREES_0) { /* horizontal */ @@ -659,6 +664,8 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, 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; @@ -667,7 +674,7 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, y1 -= miny; y2 -= miny; } - + LineInfo.X1 = x1; LineInfo.Y1 = y1; LineInfo.X2 = x2; @@ -703,6 +710,9 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, /* Update Write Pointer */ mUpdateWritePointer; + + /* Patch KDE pass abnormal point, ycchen@052507 */ + vWaitEngIdle(pScrn, pAST); } else @@ -814,6 +824,8 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, 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; @@ -822,7 +834,7 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, y1 -= miny; y2 -= miny; } - + LineInfo.X1 = x1; LineInfo.Y1 = y1; LineInfo.X2 = x2; @@ -858,7 +870,10 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, /* Update Write Pointer */ mUpdateWritePointer; - + + /* Patch KDE pass abnormal point, ycchen@052507 */ + vWaitEngIdle(pScrn, pAST); + } else { @@ -951,7 +966,9 @@ ASTSubsequentMonoPatternFill(ScrnInfoPtr pScrn, /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) - cmdreg |= CMD_ENABLE_CLIP; + cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; if (dst_y >= pScrn->virtualY) @@ -1070,7 +1087,9 @@ ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty, /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) - cmdreg |= CMD_ENABLE_CLIP; + cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; if (dst_y >= pScrn->virtualY) @@ -1184,7 +1203,9 @@ ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) - cmdreg |= CMD_ENABLE_CLIP; + cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; if (dst_y >= pScrn->virtualY) @@ -1308,7 +1329,9 @@ ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, /* Modify Reg. Value */ cmdreg = pAST->ulCMDReg; if (pAST->EnableClip) - cmdreg |= CMD_ENABLE_CLIP; + cmdreg |= CMD_ENABLE_CLIP; + else + cmdreg &= ~CMD_ENABLE_CLIP; dstbase = 0; if (dst_y >= pScrn->virtualY) { diff --git a/src/ast_cursor.c b/src/ast_cursor.c index 9d30e5c..aaa9cb3 100644 --- a/src/ast_cursor.c +++ b/src/ast_cursor.c @@ -62,7 +62,7 @@ Bool ASTCursorInit(ScreenPtr pScreen); Bool bInitHWC(ScrnInfoPtr pScrn, ASTRecPtr pAST); static void ASTShowCursor(ScrnInfoPtr pScrn); -static void ASTHideCursor(ScrnInfoPtr pScrn); +void ASTHideCursor(ScrnInfoPtr pScrn); static void ASTSetCursorPosition(ScrnInfoPtr pScrn, int x, int y); static void ASTSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg); static void ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src); @@ -146,7 +146,7 @@ ASTShowCursor(ScrnInfoPtr pScrn) } -static void +void ASTHideCursor(ScrnInfoPtr pScrn) { ASTRecPtr pAST = ASTPTR(pScrn); @@ -235,8 +235,8 @@ ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src) for (k=7; k>0; k-=2) { jTempSrcAnd32 = *((UCHAR *) pjSrcAnd); - jTempSrcXor32 = *((UCHAR *) pjSrcXor); - ulTempDstAnd32[0] = ((jTempSrcAnd32 >> k) & 0x01) ? 0x00008000L:0x00L; + jTempSrcXor32 = *((UCHAR *) pjSrcXor); + ulTempDstAnd32[0] = ((jTempSrcAnd32 >> k) & 0x01) ? 0x00008000L:0x00L; ulTempDstXor32[0] = ((jTempSrcXor32 >> k) & 0x01) ? 0x00004000L:0x00L; ulTempDstData32[0] = ((jTempSrcXor32 >> k) & 0x01) ? pAST->HWCInfo.fg:pAST->HWCInfo.bg; ulTempDstAnd32[1] = ((jTempSrcAnd32 >> (k-1)) & 0x01) ? 0x80000000L:0x00L; diff --git a/src/ast_driver.c b/src/ast_driver.c index 8967c9b..5d6ea9d 100644 --- a/src/ast_driver.c +++ b/src/ast_driver.c @@ -78,6 +78,7 @@ extern void vDisable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST); extern Bool ASTAccelInit(ScreenPtr pScreen); extern Bool ASTCursorInit(ScreenPtr pScreen); +extern void ASTHideCursor(ScrnInfoPtr pScrn); /* Mandatory functions */ static void ASTIdentify(int flags); @@ -248,7 +249,11 @@ static XF86ModuleVersionInfo astVersRec = { XORG_VERSION_CURRENT, AST_MAJOR_VERSION, AST_MINOR_VERSION, AST_PATCH_VERSION, ABI_CLASS_VIDEODRV, +#ifdef PATCH_ABI_VERSION + ABI_VIDEODRV_VERSION_PATCH, +#else ABI_VIDEODRV_VERSION, +#endif MOD_CLASS_VIDEODRV, {0, 0, 0, 0} }; @@ -627,6 +632,12 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags) pScrn->memPhysBase = (ULONG)pAST->FBPhysAddr; pScrn->fbOffset = 0; + /* Get Revision */ + if (pAST->PciInfo->chipRev >= 0x10) + pAST->jChipType = AST2100; + else + pAST->jChipType = AST2000; + /* Do DDC * should be done after xf86CollectOptions */ @@ -641,12 +652,21 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags) clockRanges->interlaceAllowed = FALSE; clockRanges->doubleScanAllowed = FALSE; - i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + /* Add for AST2100, ycchen@061807 */ + if (pAST->jChipType == AST2100) + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, - 0, 320, 1600, 8 * pScrn->bitsPerPixel, + 0, 320, 1920, 8 * pScrn->bitsPerPixel, 200, 1200, pScrn->display->virtualX, pScrn->display->virtualY, pAST->FbMapSize, LOOKUP_BEST_REFRESH); + else + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + 0, 320, 1600, 8 * pScrn->bitsPerPixel, + 200, 1200, + pScrn->display->virtualX, pScrn->display->virtualY, + pAST->FbMapSize, LOOKUP_BEST_REFRESH); if (i == -1) { ASTFreeRec(pScrn); @@ -884,7 +904,8 @@ ASTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) if (pAST->pHWCPtr) { xf86FreeOffscreenLinear(pAST->pHWCPtr); /* free HWC Cache */ pAST->pHWCPtr = NULL; - } + } + ASTHideCursor(pScrn); #endif #ifdef Accel_2D @@ -942,7 +963,8 @@ ASTLeaveVT(int scrnIndex, int flags) if (pAST->pHWCPtr) { xf86FreeOffscreenLinear(pAST->pHWCPtr); /* free HWC Cache */ pAST->pHWCPtr = NULL; - } + } + ASTHideCursor(pScrn); #endif #ifdef Accel_2D @@ -971,6 +993,8 @@ static ModeStatus ASTValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ASTRecPtr pAST = ASTPTR(pScrn); Bool Flags = MODE_NOMODE; if (mode->Flags & V_INTERLACE) { @@ -988,6 +1012,13 @@ ASTValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) } return Flags; } + + /* Add for AST2100, ycchen@061807 */ + if (pAST->jChipType == AST2100) + { + if ( (mode->CrtcHDisplay == 1920) && (mode->CrtcVDisplay == 1200) ) + return MODE_OK; + } switch (mode->CrtcHDisplay) { @@ -1064,7 +1095,8 @@ ASTCloseScreen(int scrnIndex, ScreenPtr pScreen) if (pAST->pHWCPtr) { xf86FreeOffscreenLinear(pAST->pHWCPtr); /* free HWC Cache */ pAST->pHWCPtr = NULL; - } + } + ASTHideCursor(pScrn); #endif #ifdef Accel_2D @@ -1103,7 +1135,7 @@ ASTSave(ScrnInfoPtr pScrn) ASTRecPtr pAST; vgaRegPtr vgaReg; ASTRegPtr astReg; - int i; + int i, icount=0; pAST = ASTPTR(pScrn); vgaReg = &VGAHWPTR(pScrn)->SavedReg; @@ -1115,9 +1147,13 @@ ASTSave(ScrnInfoPtr pScrn) /* Ext. Save */ vASTOpenKey(pScrn); - for (i=0; i<0x50; i++) - GetIndexReg(CRTC_PORT, (UCHAR) (i+0x80), astReg->ExtCRTC[i]); - + /* fixed Console Switch Refresh Rate Incorrect issue, ycchen@051106 */ + for (i=0x81; i<=0xB6; i++) + GetIndexReg(CRTC_PORT, (UCHAR) (i), astReg->ExtCRTC[icount++]); + for (i=0xBC; i<=0xC1; i++) + GetIndexReg(CRTC_PORT, (UCHAR) (i), astReg->ExtCRTC[icount++]); + GetIndexReg(CRTC_PORT, (UCHAR) (0xBB), astReg->ExtCRTC[icount]); + } static void @@ -1126,7 +1162,7 @@ ASTRestore(ScrnInfoPtr pScrn) ASTRecPtr pAST; vgaRegPtr vgaReg; ASTRegPtr astReg; - int i; + int i, icount=0; pAST = ASTPTR(pScrn); vgaReg = &VGAHWPTR(pScrn)->SavedReg; @@ -1140,9 +1176,13 @@ ASTRestore(ScrnInfoPtr pScrn) /* Ext. restore */ vASTOpenKey(pScrn); - for (i=0; i<0x50; i++) - SetIndexReg(CRTC_PORT, (UCHAR) (i+0x80), astReg->ExtCRTC[i]); - + /* fixed Console Switch Refresh Rate Incorrect issue, ycchen@051106 */ + for (i=0x81; i<=0xB6; i++) + SetIndexReg(CRTC_PORT, (UCHAR) (i), astReg->ExtCRTC[icount++]); + for (i=0xBC; i<=0xC1; i++) + SetIndexReg(CRTC_PORT, (UCHAR) (i), astReg->ExtCRTC[icount++]); + SetIndexReg(CRTC_PORT, (UCHAR) (0xBB), astReg->ExtCRTC[icount]); + } static void @@ -1193,7 +1233,8 @@ vFillASTModeInfo (ScrnInfoPtr pScrn) pAST->VideoModeInfo.ScreenWidth = pScrn->virtualX; pAST->VideoModeInfo.ScreenHeight = pScrn->virtualY; pAST->VideoModeInfo.bitsPerPixel = pScrn->bitsPerPixel; - pAST->VideoModeInfo.ScreenPitch = pScrn->virtualX * ((pScrn->bitsPerPixel + 1) / 8) ; + /* Fixed screen pitch incorrect in some specific monitor, ycchen@071707 */ + pAST->VideoModeInfo.ScreenPitch = pScrn->displayWidth * ((pScrn->bitsPerPixel + 1) / 8) ; } diff --git a/src/ast_mode.c b/src/ast_mode.c index 776ac39..624c465 100644 --- a/src/ast_mode.c +++ b/src/ast_mode.c @@ -130,7 +130,7 @@ VBIOS_STDTABLE_STRUCT StdTable[] = { }; VBIOS_ENHTABLE_STRUCT Res640x480Table[] = { - { 800, 640, 8, 96, 525, 480, 2, 2, VCLK28_322, /* 60Hz */ + { 800, 640, 8, 96, 525, 480, 2, 2, VCLK25_175, /* 60Hz */ (SyncNN | HBorder | VBorder | Charx8Dot), 60, 1, 0x2E }, { 832, 640, 16, 40, 520, 480, 1, 3, VCLK31_5, /* 72Hz */ (SyncNN | HBorder | VBorder | Charx8Dot), 72, 2, 0x2E }, @@ -167,7 +167,7 @@ VBIOS_ENHTABLE_STRUCT Res1024x768Table[] = { {1312, 1024, 16, 96, 800, 768, 1, 3, VCLK78_75, /* 75Hz */ (SyncPP | Charx8Dot), 75, 3, 0x31 }, {1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5, /* 85Hz */ - (SyncPP | Charx8Dot), 85, 4, 0x31 }, + (SyncPP | Charx8Dot), 84, 4, 0x31 }, {1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5, /* end */ (SyncPP | Charx8Dot), 0xFF, 4, 0x31 }, }; @@ -187,7 +187,14 @@ VBIOS_ENHTABLE_STRUCT Res1600x1200Table[] = { {2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162, /* 60Hz */ (SyncPP | Charx8Dot), 60, 1, 0x33 }, {2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162, /* end */ - (SyncPP | Charx8Dot), 60, 1, 0x33 }, + (SyncPP | Charx8Dot), 0xFF, 1, 0x33 }, +}; + +VBIOS_ENHTABLE_STRUCT Res1920x1200Table[] = { + {2592, 1920,136, 200, 1245, 1200, 3, 6, VCLK193_25, /* 60Hz */ + (SyncPP | Charx8Dot), 60, 1, 0x33 }, + {2592, 1920,136, 200, 1245, 1200, 3, 6, VCLK193_25, /* end */ + (SyncPP | Charx8Dot), 0xFF, 1, 0x33 }, }; VBIOS_DCLK_INFO DCLKTable [] = { @@ -207,6 +214,7 @@ VBIOS_DCLK_INFO DCLKTable [] = { {0x85, 0x24, 0x00}, /* 0D: VCLK135 */ {0x67, 0x22, 0x00}, /* 0E: VCLK157_5 */ {0x6A, 0x22, 0x00}, /* 0F: VCLK162 */ + {0x61, 0x2C, 0x81}, /* 10: VCLK193_25 */ }; VBIOS_DAC_INFO DAC_TEXT[] = { @@ -423,8 +431,10 @@ Bool bGetAST1000VGAModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_ break; case 1600: pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res1600x1200Table[ulRefreshRateIndex]; - break; - default: + break; + case 1920: + pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res1920x1200Table[ulRefreshRateIndex]; + break; default: return (FALSE); } @@ -633,7 +643,7 @@ void vSetDCLKReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAMo SetIndexRegMask(CRTC_PORT,0xC0, 0x00, pDCLKPtr->Param1); SetIndexRegMask(CRTC_PORT,0xC1, 0x00, pDCLKPtr->Param2); - SetIndexRegMask(CRTC_PORT,0xBB, 0xCF, ((pDCLKPtr->Param3 & 0x03) << 4)); + SetIndexRegMask(CRTC_PORT,0xBB, 0x0F, (pDCLKPtr->Param3 & 0x80) | ((pDCLKPtr->Param3 & 0x03) << 4) ); } diff --git a/src/ast_mode.h b/src/ast_mode.h index 0a8e20c..b1926a3 100644 --- a/src/ast_mode.h +++ b/src/ast_mode.h @@ -21,7 +21,7 @@ */ /* Mode Limitation */ -#define MAX_HResolution 1600 +#define MAX_HResolution 1920 #define MAX_VResolution 1200 /* Std. Table Index Definition */ @@ -48,6 +48,7 @@ #define VCLK135 0x0D #define VCLK157_5 0x0E #define VCLK162 0x0F +#define VCLK193_25 0x10 /* Flags Definition */ #define Charx8Dot 0x00000001 diff --git a/src/ast_vgatool.c b/src/ast_vgatool.c index 14e0a75..a833b3b 100644 --- a/src/ast_vgatool.c +++ b/src/ast_vgatool.c @@ -24,7 +24,6 @@ #include <config.h> #endif #include "xf86.h" -#include "xf86_ansic.h" #include "xf86_OSproc.h" #include "xf86Resources.h" #include "xf86RAC.h" |