Module Name: xsrc
Committed By: mrg
Date: Sat Aug 14 08:39:31 UTC 2010
Modified Files:
xsrc/external/mit/xf86-video-ast/dist/src: ast_vgatool.c
Log Message:
merge xf86-video-ast-0.91.10
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-ast/dist/src/ast_vgatool.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-ast/dist/src/ast_vgatool.c
diff -u xsrc/external/mit/xf86-video-ast/dist/src/ast_vgatool.c:1.3 xsrc/external/mit/xf86-video-ast/dist/src/ast_vgatool.c:1.4
--- xsrc/external/mit/xf86-video-ast/dist/src/ast_vgatool.c:1.3 Fri Aug 21 23:51:36 2009
+++ xsrc/external/mit/xf86-video-ast/dist/src/ast_vgatool.c Sat Aug 14 08:39:31 2010
@@ -219,7 +219,7 @@
/* Get Bandwidth */
/* Modify DARM utilization to 60% for AST1100/2100 16bits DRAM, ycc...@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 @@
ulDCLK = ActualDRAMBandwidth / ((pScrn->bitsPerPixel+1) / 8);
/* Add for AST2100, ycc...@061807 */
- if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200))
+ if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200) || (pAST->jChipType == AST2300))
{
if (ulDCLK > 200) ulDCLK = 200;
}
@@ -451,18 +451,18 @@
/* SCU settings */
*(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000;
*(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1;
- xf86UDelay(10000);
+ usleep(10000);
*(ULONG *) (pAST->MMIOVirtualAddr + 0x12000) = 0x1688A8A8;
ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12004);
ulData &= 0xfffffffb;
*(ULONG *) (pAST->MMIOVirtualAddr + 0x12004) = ulData;
- xf86UDelay(10000);
+ usleep(10000);
/* I2C settings */
*(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = I2C_BASE;
*(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1;
- xf86UDelay(10000);
+ usleep(10000);
/* I2C Start */
*(ULONG *) (ulI2CBase + 0x00) = 0x0;
@@ -537,7 +537,17 @@
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 @@
UCHAR ExtRegInfo[] = {
0x0F,
- 0x07,
+ 0x04,
0x1C,
0xFF
};
+UCHAR ExtRegInfo_AST2300[] = {
+ 0x0F,
+ 0x04,
+ 0x1D,
+ 0xFF
+};
+
void vSetDefExtReg(ScrnInfoPtr pScrn)
{
ASTRecPtr pAST;
@@ -572,7 +589,11 @@
}
/* 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 @@
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);
@@ -782,7 +807,7 @@
if (pjDRAMRegInfo->Index == 0xFF00) /* Delay function */
{
for (i=0; i<15; i++)
- xf86UDelay(pjDRAMRegInfo->Data);
+ usleep(pjDRAMRegInfo->Data);
}
else if ( (pjDRAMRegInfo->Index == 0x0004) && (pAST->jChipType != AST2000) )
{