From 9e8d8489922d8b647b28de06045e8fddf0ffc62f Mon Sep 17 00:00:00 2001 From: "Y.C. Chen" Date: Tue, 22 Jun 2010 15:17:27 +0800 Subject: 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 --- src/ast_vgatool.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'src/ast_vgatool.c') diff --git a/src/ast_vgatool.c b/src/ast_vgatool.c index 5629b85..356e7ba 100644 --- a/src/ast_vgatool.c +++ b/src/ast_vgatool.c @@ -219,7 +219,7 @@ GetMaxDCLK(ScrnInfoPtr pScrn) /* Get Bandwidth */ /* Modify DARM utilization to 60% for AST1100/2100 16bits DRAM, ycchen@032508 */ - if ( ((pAST->jChipType == AST2100) || (pAST->jChipType == AST1100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2150)) && (ulDRAMBusWidth == 16) ) + if ( ((pAST->jChipType == AST2100) || (pAST->jChipType == AST1100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2150) || (pAST->jChipType == AST2300)) && (ulDRAMBusWidth == 16) ) DRAMEfficiency = 600; ulDRAMBandwidth = ulMCLK * ulDRAMBusWidth * 2 / 8; ActualDRAMBandwidth = ulDRAMBandwidth * DRAMEfficiency / 1000; @@ -235,7 +235,7 @@ GetMaxDCLK(ScrnInfoPtr pScrn) ulDCLK = ActualDRAMBandwidth / ((pScrn->bitsPerPixel+1) / 8); /* Add for AST2100, ycchen@061807 */ - if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200)) + if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300)) { if (ulDCLK > 200) ulDCLK = 200; } @@ -537,7 +537,17 @@ Bool bIsVGAEnabled(ScrnInfoPtr pScrn) ch = GetReg(pAST->RelocateIO+0x43); - return (ch & 0x01); + if (ch) + { + + vASTOpenKey(pScrn); + + GetIndexRegMask(CRTC_PORT, 0xB6, 0xFF, ch); + + return (ch & 0x04); + } + + return (0); } void vEnableVGA(ScrnInfoPtr pScrn) @@ -553,11 +563,18 @@ void vEnableVGA(ScrnInfoPtr pScrn) UCHAR ExtRegInfo[] = { 0x0F, - 0x07, + 0x04, 0x1C, 0xFF }; +UCHAR ExtRegInfo_AST2300[] = { + 0x0F, + 0x04, + 0x1D, + 0xFF +}; + void vSetDefExtReg(ScrnInfoPtr pScrn) { ASTRecPtr pAST; @@ -572,7 +589,11 @@ void vSetDefExtReg(ScrnInfoPtr pScrn) } /* Set Ext. Reg */ - pjExtRegInfo = ExtRegInfo; + if (pAST->jChipType == AST2300) + pjExtRegInfo = ExtRegInfo_AST2300; + else + pjExtRegInfo = ExtRegInfo; + jIndex = 0xA0; while (*(UCHAR *) (pjExtRegInfo) != 0xFF) { @@ -581,6 +602,10 @@ void vSetDefExtReg(ScrnInfoPtr pScrn) pjExtRegInfo++; } + /* disable standard IO/MEM decode if secondary */ + if (!xf86IsPrimaryPci(pAST->PciInfo)) + SetIndexRegMask(CRTC_PORT,0xA1, 0xFF, 0x03); + /* Set Ext. Default */ SetIndexRegMask(CRTC_PORT,0x8C, 0x00, 0x01); SetIndexRegMask(CRTC_PORT,0xB7, 0x00, 0x00); -- cgit v1.2.3