Lines Matching refs:SiS_Pr

88 static USHORT SiS_GetBIOSLCDResInfo(SiS_Private *SiS_Pr);
95 SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_UnLockCRT2() argument
98 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_UnLockCRT2()
100 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); in SiS_UnLockCRT2()
104 SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_LockCRT2() argument
107 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE); in SiS_LockCRT2()
109 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE); in SiS_LockCRT2()
117 SiS_SetRegSR11ANDOR(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DataAND, USHORT DataOR) in SiS_SetRegSR11ANDOR() argument
123 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR); in SiS_SetRegSR11ANDOR()
132 GetLCDStructPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in GetLCDStructPtr661() argument
142 if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in GetLCDStructPtr661()
146 romindex += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x7d) & 0x1f) * 26); in GetLCDStructPtr661()
154 GetLCDStructPtr661_2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in GetLCDStructPtr661_2() argument
163 if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in GetLCDStructPtr661_2()
165 romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize); in GetLCDStructPtr661_2()
177 SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_AdjustCRT2Rate() argument
183 modeid = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID; in SiS_AdjustCRT2Rate()
185 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_AdjustCRT2Rate()
187 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_AdjustCRT2Rate()
192 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_AdjustCRT2Rate()
194 if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SiS_AdjustCRT2Rate()
200 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_AdjustCRT2Rate()
204 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_AdjustCRT2Rate()
205 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_AdjustCRT2Rate()
211 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_AdjustCRT2Rate()
215 …} else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750|SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCAR… in SiS_AdjustCRT2Rate()
218 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_AdjustCRT2Rate()
220 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_AdjustCRT2Rate()
221 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_AdjustCRT2Rate()
231 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_AdjustCRT2Rate()
232 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_AdjustCRT2Rate()
237 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_AdjustCRT2Rate()
244 for(; SiS_Pr->SiS_RefIndex[RefreshRateTableIndex+(*i)].ModeID == modeid; (*i)--) { in SiS_AdjustCRT2Rate()
245 infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag; in SiS_AdjustCRT2Rate()
254 if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID != modeid) { in SiS_AdjustCRT2Rate()
257 infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag; in SiS_AdjustCRT2Rate()
268 SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetRatePtr() argument
283 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetRatePtr()
285 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetRatePtr()
288 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
289 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetRatePtr()
296 index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; in SiS_GetRatePtr()
301 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetRatePtr()
302 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetRatePtr()
303 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetRatePtr()
304 if(SiS_Pr->SiS_VBType & VB_NoLCD) index = 0; in SiS_GetRatePtr()
305 else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0; in SiS_GetRatePtr()
307 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_GetRatePtr()
308 if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetRatePtr()
309 temp = LCDRefreshIndex[SiS_GetBIOSLCDResInfo(SiS_Pr)]; in SiS_GetRatePtr()
314 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0; in SiS_GetRatePtr()
315 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
316 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0; in SiS_GetRatePtr()
321 RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; in SiS_GetRatePtr()
322 ModeNo = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].ModeID; in SiS_GetRatePtr()
325 if(!(SiS_Pr->SiS_VBInfo & DriverMode)) { in SiS_GetRatePtr()
326 if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) || in SiS_GetRatePtr()
327 (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) { in SiS_GetRatePtr()
335 if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i].ModeID != ModeNo) break; in SiS_GetRatePtr()
336 temp = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i].Ext_InfoFlag; in SiS_GetRatePtr()
338 if(temp < SiS_Pr->SiS_ModeType) break; in SiS_GetRatePtr()
343 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_GetRatePtr()
344 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetRatePtr()
345 temp = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + i - 1].Ext_InfoFlag; in SiS_GetRatePtr()
352 if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) { in SiS_GetRatePtr()
354 if(!(SiS_AdjustCRT2Rate(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &i, HwInfo))) { in SiS_GetRatePtr()
367 SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo) in SiS_SaveCRT2Info() argument
372 SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo); in SiS_SaveCRT2Info()
373 temp1 = (SiS_Pr->SiS_VBInfo & SetInSlaveMode) >> 8; in SiS_SaveCRT2Info()
375 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1); in SiS_SaveCRT2Info()
384 SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_CR36BIOSWord23b() argument
389 if(SiS_Pr->SiS_UseROM) { in SiS_CR36BIOSWord23b()
391 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xff) >> 4); in SiS_CR36BIOSWord23b()
400 SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_CR36BIOSWord23d() argument
405 if(SiS_Pr->SiS_UseROM) { in SiS_CR36BIOSWord23d()
407 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xff) >> 4); in SiS_CR36BIOSWord23d()
421 SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime) in SiS_DDC2Delay() argument
426 j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); in SiS_DDC2Delay()
431 SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay) in SiS_GenericDelay() argument
447 SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay) in SiS_LongDelay() argument
450 SiS_GenericDelay(SiS_Pr,0x19df); in SiS_LongDelay()
456 SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay) in SiS_ShortDelay() argument
459 SiS_GenericDelay(SiS_Pr,0x42); in SiS_ShortDelay()
464 SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime) in SiS_PanelDelay() argument
473 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
474 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_PanelDelay()
475 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
483 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
485 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; in SiS_PanelDelay()
487 if(SiS_Pr->SiS_UseROM) { in SiS_PanelDelay()
494 SiS_ShortDelay(SiS_Pr, Delay); in SiS_PanelDelay()
507 SiS_DDC2Delay(SiS_Pr, 0x1000); in SiS_PanelDelay()
509 SiS_DDC2Delay(SiS_Pr, 0x4000); in SiS_PanelDelay()
512 } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || in SiS_PanelDelay()
516 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_PanelDelay()
517 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
518 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) { in SiS_PanelDelay()
519 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
521 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_PanelDelay()
531 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0]; in SiS_PanelDelay()
533 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1]; in SiS_PanelDelay()
535 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_PanelDelay()
545 SiS_ShortDelay(SiS_Pr, Delay); in SiS_PanelDelay()
548 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 315 series, all bridges */ in SiS_PanelDelay()
550 DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_PanelDelay()
552 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
554 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; in SiS_PanelDelay()
557 SiS_DDC2Delay(SiS_Pr, Delay); in SiS_PanelDelay()
568 SiS_PanelDelayLoop(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SiS_PanelDelayLoop() argument
573 SiS_PanelDelay(SiS_Pr, HwInfo, DelayTime); in SiS_PanelDelayLoop()
583 SiS_WaitRetrace1(SiS_Private *SiS_Pr) in SiS_WaitRetrace1() argument
587 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return; in SiS_WaitRetrace1()
588 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return; in SiS_WaitRetrace1()
591 while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog); in SiS_WaitRetrace1()
593 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); in SiS_WaitRetrace1()
597 SiS_WaitRetrace2(SiS_Private *SiS_Pr, USHORT reg) in SiS_WaitRetrace2() argument
602 while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog); in SiS_WaitRetrace2()
604 while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog); in SiS_WaitRetrace2()
608 SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_WaitVBRetrace() argument
612 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_WaitVBRetrace()
613 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; in SiS_WaitVBRetrace()
615 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) { in SiS_WaitVBRetrace()
616 SiS_WaitRetrace1(SiS_Pr); in SiS_WaitVBRetrace()
618 SiS_WaitRetrace2(SiS_Pr, 0x25); in SiS_WaitVBRetrace()
623 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { in SiS_WaitVBRetrace()
624 SiS_WaitRetrace1(SiS_Pr); in SiS_WaitVBRetrace()
626 SiS_WaitRetrace2(SiS_Pr, 0x30); in SiS_WaitVBRetrace()
633 SiS_VBWait(SiS_Private *SiS_Pr) in SiS_VBWait() argument
640 tempal = SiS_GetRegByte(SiS_Pr->SiS_P3da); in SiS_VBWait()
654 SiS_VBLongWait(SiS_Private *SiS_Pr) in SiS_VBLongWait() argument
656 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_VBLongWait()
657 SiS_VBWait(SiS_Pr); in SiS_VBLongWait()
659 SiS_WaitRetrace1(SiS_Pr); in SiS_VBLongWait()
669 SiS_Is301B(SiS_Private *SiS_Pr) in SiS_Is301B() argument
671 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return TRUE; in SiS_Is301B()
677 SiS_CRT2IsLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_CRT2IsLCD() argument
682 flag = SiS_GetReg(SiS_Pr->SiS_P3c4,0x13); in SiS_CRT2IsLCD()
685 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_CRT2IsLCD()
691 SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsDualEdge() argument
697 if((HwInfo->jChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { in SiS_IsDualEdge()
698 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsDualEdge()
707 SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsVAMode() argument
713 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsVAMode()
722 SiS_IsVAorLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsVAorLCD() argument
724 if(SiS_IsVAMode(SiS_Pr,HwInfo)) return TRUE; in SiS_IsVAorLCD()
725 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) return TRUE; in SiS_IsVAorLCD()
731 SiS_IsDualLink(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsDualLink() argument
735 if((SiS_CRT2IsLCD(SiS_Pr, HwInfo)) || in SiS_IsDualLink()
736 (SiS_IsVAMode(SiS_Pr, HwInfo))) { in SiS_IsDualLink()
737 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return TRUE; in SiS_IsDualLink()
746 SiS_TVEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_TVEnabled() argument
748 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return TRUE; in SiS_TVEnabled()
749 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS301LV302LV)) { in SiS_TVEnabled()
750 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return TRUE; in SiS_TVEnabled()
758 SiS_LCDAEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_LCDAEnabled() argument
760 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return TRUE; in SiS_LCDAEnabled()
767 SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_WeHaveBacklightCtrl() argument
770 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return TRUE; in SiS_WeHaveBacklightCtrl()
778 SiS_IsNotM650orLater(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsNotM650orLater() argument
783 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f); in SiS_IsNotM650orLater()
795 SiS_IsYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsYPbPr() argument
800 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsYPbPr()
809 SiS_IsChScart(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsChScart() argument
814 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsChScart()
823 SiS_IsTVOrYPbPrOrScart(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsTVOrYPbPrOrScart() argument
828 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
830 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsTVOrYPbPrOrScart()
834 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
843 SiS_IsLCDOrLCDA(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_IsLCDOrLCDA() argument
848 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
850 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsLCDOrLCDA()
853 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
861 SiS_BridgeIsOn(SiS_Private *SiS_Pr) in SiS_BridgeIsOn() argument
865 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_BridgeIsOn()
867 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_BridgeIsOn()
868 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiS_BridgeIsOn()
875 SiS_BridgeIsEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_BridgeIsEnabled() argument
879 if(SiS_BridgeIsOn(SiS_Pr)) { in SiS_BridgeIsEnabled()
880 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_BridgeIsEnabled()
893 SiS_BridgeInSlavemode(SiS_Private *SiS_Pr) in SiS_BridgeInSlavemode() argument
897 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); in SiS_BridgeInSlavemode()
908 SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo) in SiS_SetChrontelGPIO() argument
913 if(!(SiS_Pr->SiS_ChSW)) return; in SiS_SetChrontelGPIO()
934 SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetVBInfo() argument
941 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetVBInfo()
942 } else if(SiS_Pr->UseCustomMode) { in SiS_GetVBInfo()
943 modeflag = SiS_Pr->CModeFlag; in SiS_GetVBInfo()
945 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetVBInfo()
946 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetVBInfo()
949 SiS_Pr->SiS_SetFlag = 0; in SiS_GetVBInfo()
951 SiS_Pr->SiS_ModeType = modeflag & ModeInfoFlag; in SiS_GetVBInfo()
954 if(SiS_BridgeIsOn(SiS_Pr)) { in SiS_GetVBInfo()
955 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_GetVBInfo()
959 if(SiS_Pr->SiS_YPbPr & <all ypbpr except 525i>) { in SiS_GetVBInfo()
963 if(SiS_Pr->SiS_YPbPr & <ypbpr525i>) { in SiS_GetVBInfo()
970 tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8; in SiS_GetVBInfo()
976 if(SiS_Pr->SiS_VBType & (VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)) { in SiS_GetVBInfo()
979 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf); in SiS_GetVBInfo()
981 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) { in SiS_GetVBInfo()
983 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); in SiS_GetVBInfo()
986 if(SiS_Pr->SiS_UseLCDA) { in SiS_GetVBInfo()
987 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) { in SiS_GetVBInfo()
988 if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) { in SiS_GetVBInfo()
989 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA)); in SiS_GetVBInfo()
994 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1000 if(SiS_Pr->SiS_VBType & (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)) { in SiS_GetVBInfo()
1006 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1007 if(SiS_Pr->SiS_VBType & (VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)) { in SiS_GetVBInfo()
1009 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; in SiS_GetVBInfo()
1013 } else if(SiS_Pr->SiS_VBType & (VB_SIS301 | VB_SIS301B | VB_SIS302B)) { in SiS_GetVBInfo()
1015 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; in SiS_GetVBInfo()
1021 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetVBInfo()
1022 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1026 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1036 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetVBInfo()
1047 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1059 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1072 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetVBInfo()
1093 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1117 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_GetVBInfo()
1118 if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_GetVBInfo()
1119 ((SiS_Pr->SiS_VBType & VB_NoLCD) && (tempbx & SetCRT2ToLCD)) ) { in SiS_GetVBInfo()
1128 (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) ) { in SiS_GetVBInfo()
1137 if(SiS_BridgeIsEnabled(SiS_Pr,HwInfo)) { in SiS_GetVBInfo()
1139 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_GetVBInfo()
1152 (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) ) { in SiS_GetVBInfo()
1168 SiS_Pr->SiS_VBInfo = tempbx; in SiS_GetVBInfo()
1171 SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); in SiS_GetVBInfo()
1177 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); in SiS_GetVBInfo()
1181 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); in SiS_GetVBInfo()
1191 SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_SetYPbPr() argument
1204 SiS_Pr->SiS_YPbPr = 0; in SiS_SetYPbPr()
1207 if(SiS_Pr->SiS_VBType) { in SiS_SetYPbPr()
1208 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetYPbPr()
1209 SiS_Pr->SiS_YPbPr = YPbPrHiVision; in SiS_SetYPbPr()
1214 if(SiS_Pr->SiS_VBType & (VB_SIS301LV302LV | VB_SIS301C)) { in SiS_SetYPbPr()
1215 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetYPbPr()
1218 case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i; break; in SiS_SetYPbPr()
1219 case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p; break; in SiS_SetYPbPr()
1220 case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p; break; in SiS_SetYPbPr()
1221 case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break; in SiS_SetYPbPr()
1234 SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo) in SiS_SetTVMode() argument
1238 UCHAR OutputSelect = *SiS_Pr->pSiS_OutputSelect; in SiS_SetTVMode()
1240 SiS_Pr->SiS_TVMode = 0; in SiS_SetTVMode()
1242 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; in SiS_SetTVMode()
1243 if(SiS_Pr->UseCustomMode) return; in SiS_SetTVMode()
1246 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetTVMode()
1251 if(SiS_Pr->SiS_VBInfo & SetPALTV) SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1253 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1265 if(romindex && SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetTVMode()
1268 SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F); in SiS_SetTVMode()
1271 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,temp); in SiS_SetTVMode()
1272 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetTVMode()
1274 SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1275 SiS_Pr->SiS_TVMode &= ~TVSetPAL; in SiS_SetTVMode()
1277 SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1281 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1286 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1287 if(SiS_Pr->SiS_YPbPr == YPbPr750p) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1288 else if(SiS_Pr->SiS_YPbPr == YPbPr525p) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1289 else if(SiS_Pr->SiS_YPbPr == YPbPrHiVision) SiS_Pr->SiS_TVMode |= TVSetHiVision; in SiS_SetTVMode()
1290 else SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1291 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p | TVSetYPbPr525i)) { in SiS_SetTVMode()
1292 SiS_Pr->SiS_VBInfo &= ~SetCRT2ToHiVision; in SiS_SetTVMode()
1293 SiS_Pr->SiS_VBInfo |= SetCRT2ToYPbPr525750; in SiS_SetTVMode()
1294 } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { in SiS_SetTVMode()
1295 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1298 } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetTVMode()
1299 if(SiS_Pr->SiS_CHOverScan) { in SiS_SetTVMode()
1300 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetTVMode()
1301 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1302 if((temp & TVOverScan) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1303 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1305 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1306 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79); in SiS_SetTVMode()
1307 if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1308 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1311 if(SiS_Pr->SiS_CHSOverScan) { in SiS_SetTVMode()
1312 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1315 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1316 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetTVMode()
1317 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetTVMode()
1318 if(temp & EnablePALM) SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1319 else if(temp & EnablePALN) SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1322 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1330 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1332 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1334 SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1336 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1337 SiS_Pr->SiS_TVMode &= ~TVSetPAL; in SiS_SetTVMode()
1339 SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1343 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1346 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1347 if(SiS_Pr->SiS_CHOverScan) { in SiS_SetTVMode()
1348 if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1349 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1353 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1354 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetTVMode()
1356 if(temp1 == 0x00) SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1357 else if(temp1 == 0x20) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1358 else if(temp1 == 0x40) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1359 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1360 SiS_Pr->SiS_TVMode |= (TVSetHiVision | TVSetPAL); in SiS_SetTVMode()
1362 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750 | SetCRT2ToHiVision)) { in SiS_SetTVMode()
1364 SiS_Pr->SiS_TVMode |= TVAspect169; in SiS_SetTVMode()
1366 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39); in SiS_SetTVMode()
1368 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetHiVision)) { in SiS_SetTVMode()
1369 SiS_Pr->SiS_TVMode |= TVAspect169; in SiS_SetTVMode()
1371 SiS_Pr->SiS_TVMode |= TVAspect43LB; in SiS_SetTVMode()
1374 SiS_Pr->SiS_TVMode |= TVAspect43; in SiS_SetTVMode()
1381 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1383 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1385 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1386 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1387 SiS_Pr->SiS_TVMode &= ~(TVSetPALM | TVSetPALN | TVSetNTSCJ); in SiS_SetTVMode()
1388 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetTVMode()
1389 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525i | TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetTVMode()
1390 SiS_Pr->SiS_TVMode &= ~(TVSetPAL | TVSetNTSCJ | TVSetPALM | TVSetPALN); in SiS_SetTVMode()
1394 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetTVMode()
1395 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_SetTVMode()
1396 SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; in SiS_SetTVMode()
1400 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetTVMode()
1402 if(!(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr525p | TVSetYPbPr750p))) { in SiS_SetTVMode()
1404 SiS_Pr->SiS_TVMode |= TVSetNTSC1024; in SiS_SetTVMode()
1409 SiS_Pr->SiS_TVMode |= TVRPLLDIV2XO; in SiS_SetTVMode()
1410 if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) && in SiS_SetTVMode()
1411 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetTVMode()
1412 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1413 } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetTVMode()
1414 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1415 } else if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) { in SiS_SetTVMode()
1416 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetTVMode()
1417 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1423 SiS_Pr->SiS_VBInfo &= ~SetPALTV; in SiS_SetTVMode()
1426 …xf86DrvMsg(0, X_INFO, "(init301: TVMode %x, VBInfo %x)\n", SiS_Pr->SiS_TVMode, SiS_Pr->SiS_VBInfo); in SiS_SetTVMode()
1435 SiS_GetBIOSLCDResInfo(SiS_Private *SiS_Pr) in SiS_GetBIOSLCDResInfo() argument
1437 USHORT temp = SiS_Pr->SiS_LCDResInfo; in SiS_GetBIOSLCDResInfo()
1445 SiS_GetLCDInfoBIOS(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_GetLCDInfoBIOS() argument
1453 SiS_Pr->PanelHT, SiS_Pr->PanelVT, in SiS_GetLCDInfoBIOS()
1454 SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, in SiS_GetLCDInfoBIOS()
1455 SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, in SiS_GetLCDInfoBIOS()
1456 SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, in SiS_GetLCDInfoBIOS()
1457 SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, in SiS_GetLCDInfoBIOS()
1458 SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); in SiS_GetLCDInfoBIOS()
1461 if((ROMAddr = GetLCDStructPtr661(SiS_Pr, HwInfo))) { in SiS_GetLCDInfoBIOS()
1462 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { in SiS_GetLCDInfoBIOS()
1463 SiS_Pr->SiS_NeedRomModeData = TRUE; in SiS_GetLCDInfoBIOS()
1464 SiS_Pr->PanelHT = temp; in SiS_GetLCDInfoBIOS()
1466 if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) { in SiS_GetLCDInfoBIOS()
1467 SiS_Pr->SiS_NeedRomModeData = TRUE; in SiS_GetLCDInfoBIOS()
1468 SiS_Pr->PanelVT = temp; in SiS_GetLCDInfoBIOS()
1470 SiS_Pr->PanelHRS = SISGETROMW(10); in SiS_GetLCDInfoBIOS()
1471 SiS_Pr->PanelHRE = SISGETROMW(12); in SiS_GetLCDInfoBIOS()
1472 SiS_Pr->PanelVRS = SISGETROMW(14); in SiS_GetLCDInfoBIOS()
1473 SiS_Pr->PanelVRE = SISGETROMW(16); in SiS_GetLCDInfoBIOS()
1474 SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; in SiS_GetLCDInfoBIOS()
1475 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].CLOCK = in SiS_GetLCDInfoBIOS()
1476 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].CLOCK = (USHORT)((UCHAR)ROMAddr[18]); in SiS_GetLCDInfoBIOS()
1477 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2B = in SiS_GetLCDInfoBIOS()
1478 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; in SiS_GetLCDInfoBIOS()
1479 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = in SiS_GetLCDInfoBIOS()
1480 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; in SiS_GetLCDInfoBIOS()
1484 SiS_Pr->PanelHT, SiS_Pr->PanelVT, in SiS_GetLCDInfoBIOS()
1485 SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, in SiS_GetLCDInfoBIOS()
1486 SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, in SiS_GetLCDInfoBIOS()
1487 SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, in SiS_GetLCDInfoBIOS()
1488 SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, in SiS_GetLCDInfoBIOS()
1489 SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); in SiS_GetLCDInfoBIOS()
1497 SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetLCDResInfo() argument
1511 SiS_Pr->SiS_LCDResInfo = 0; in SiS_GetLCDResInfo()
1512 SiS_Pr->SiS_LCDTypeInfo = 0; in SiS_GetLCDResInfo()
1513 SiS_Pr->SiS_LCDInfo = 0; in SiS_GetLCDResInfo()
1514 SiS_Pr->PanelHRS = 999; /* HSync start */ in SiS_GetLCDResInfo()
1515 SiS_Pr->PanelHRE = 999; /* HSync end */ in SiS_GetLCDResInfo()
1516 SiS_Pr->PanelVRS = 999; /* VSync start */ in SiS_GetLCDResInfo()
1517 SiS_Pr->PanelVRE = 999; /* VSync end */ in SiS_GetLCDResInfo()
1518 SiS_Pr->SiS_NeedRomModeData = FALSE; in SiS_GetLCDResInfo()
1520 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return; in SiS_GetLCDResInfo()
1523 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLCDResInfo()
1524 } else if(SiS_Pr->UseCustomMode) { in SiS_GetLCDResInfo()
1525 modeflag = SiS_Pr->CModeFlag; in SiS_GetLCDResInfo()
1527 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetLCDResInfo()
1528 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetLCDResInfo()
1531 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_GetLCDResInfo()
1534 if((HwInfo->jChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_GetLCDResInfo()
1535 SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; in SiS_GetLCDResInfo()
1537 SiS_Pr->SiS_LCDTypeInfo = temp >> 4; in SiS_GetLCDResInfo()
1539 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; in SiS_GetLCDResInfo()
1552 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { /* SiS LVDS */ in SiS_GetLCDResInfo()
1556 if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) { in SiS_GetLCDResInfo()
1563 SiS_Pr->SiS_LCDResInfo = temp; in SiS_GetLCDResInfo()
1565 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1566 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetLCDResInfo()
1567 SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; in SiS_GetLCDResInfo()
1568 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { in SiS_GetLCDResInfo()
1569 SiS_Pr->SiS_LCDResInfo = Panel_848x480; in SiS_GetLCDResInfo()
1573 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1574 if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301) in SiS_GetLCDResInfo()
1575 SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301; in SiS_GetLCDResInfo()
1577 if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS) in SiS_GetLCDResInfo()
1578 SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS; in SiS_GetLCDResInfo()
1581 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1582 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
1584 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
1585 case Panel_320x480: SiS_Pr->PanelXRes = 320; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1586 SiS_Pr->PanelHT = 400; SiS_Pr->PanelVT = 525; in SiS_GetLCDResInfo()
1587 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1588 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1591 case Panel_640x480_3: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1592 SiS_Pr->PanelVRS = 24; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1593 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1594 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1596 case Panel_640x480: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1597 SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1598 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1599 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1601 case Panel_800x600: SiS_Pr->PanelXRes = 800; SiS_Pr->PanelYRes = 600; in SiS_GetLCDResInfo()
1602 SiS_Pr->PanelHT = 1056; SiS_Pr->PanelVT = 628; in SiS_GetLCDResInfo()
1603 SiS_Pr->PanelHRS = 40; SiS_Pr->PanelHRE = 128; in SiS_GetLCDResInfo()
1604 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 4; in SiS_GetLCDResInfo()
1605 SiS_Pr->PanelVCLKIdx300 = VCLK40; in SiS_GetLCDResInfo()
1606 SiS_Pr->PanelVCLKIdx315 = VCLK40; in SiS_GetLCDResInfo()
1608 case Panel_1024x600: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 600; in SiS_GetLCDResInfo()
1609 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 800; in SiS_GetLCDResInfo()
1610 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
1611 SiS_Pr->PanelVRS = 2 /* 88 */ ; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1612 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1613 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
1615 case Panel_1024x768: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
1616 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
1617 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
1618 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1620 SiS_Pr->PanelHRS = 23; in SiS_GetLCDResInfo()
1621 SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
1623 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1624 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
1625 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1627 case Panel_1152x768: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
1628 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
1629 SiS_Pr->PanelHRS = 24; in SiS_GetLCDResInfo()
1630 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1632 SiS_Pr->PanelHRS = 23; in SiS_GetLCDResInfo()
1633 SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
1635 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1636 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
1638 case Panel_1152x864: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 864; in SiS_GetLCDResInfo()
1640 case Panel_1280x720: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 720; in SiS_GetLCDResInfo()
1641 SiS_Pr->PanelHT = 1650; SiS_Pr->PanelVT = 750; in SiS_GetLCDResInfo()
1642 SiS_Pr->PanelHRS = 110; SiS_Pr->PanelHRE = 40; in SiS_GetLCDResInfo()
1643 SiS_Pr->PanelVRS = 5; SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
1644 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x720; in SiS_GetLCDResInfo()
1646 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1648 case Panel_1280x768: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
1649 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; in SiS_GetLCDResInfo()
1650 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRS = 112; in SiS_GetLCDResInfo()
1651 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1652 SiS_Pr->PanelVCLKIdx300 = VCLK81_300; in SiS_GetLCDResInfo()
1653 SiS_Pr->PanelVCLKIdx315 = VCLK81_315; in SiS_GetLCDResInfo()
1655 case Panel_1280x768_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
1656 SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
1657 SiS_Pr->PanelHRS = 16; SiS_Pr->PanelHRE = 64; in SiS_GetLCDResInfo()
1658 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1659 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2; in SiS_GetLCDResInfo()
1660 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1662 case Panel_1280x768_3: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
1663 SiS_Pr->PanelHT = 1664; SiS_Pr->PanelVT = 798; in SiS_GetLCDResInfo()
1664 SiS_Pr->PanelHRS = 64; SiS_Pr->PanelHRE = 128; in SiS_GetLCDResInfo()
1665 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 7; in SiS_GetLCDResInfo()
1666 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_3; in SiS_GetLCDResInfo()
1667 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1669 case Panel_1280x800: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; in SiS_GetLCDResInfo()
1670 SiS_Pr->PanelHT = 1656; SiS_Pr->PanelVT = 841; /* 1408, 816 */ in SiS_GetLCDResInfo()
1671 SiS_Pr->PanelHRS = 32; SiS_Pr->PanelHRE = 312; /* 16, 64 */ in SiS_GetLCDResInfo()
1672 SiS_Pr->PanelVRS = 16; SiS_Pr->PanelVRE = 8; /* 4, 3 */ in SiS_GetLCDResInfo()
1673 SiS_Pr->PanelVCLKIdx315 = VCLK83_315; in SiS_GetLCDResInfo()
1674 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1676 case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960; in SiS_GetLCDResInfo()
1677 SiS_Pr->PanelHT = 1800; SiS_Pr->PanelVT = 1000; in SiS_GetLCDResInfo()
1678 SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; in SiS_GetLCDResInfo()
1679 SiS_Pr->PanelVCLKIdx315 = VCLK108_3_315; in SiS_GetLCDResInfo()
1681 SiS_Pr->PanelVCLKIdx300 = VCLK100_300; in SiS_GetLCDResInfo()
1682 SiS_Pr->PanelVCLKIdx315 = VCLK100_315; in SiS_GetLCDResInfo()
1685 case Panel_1280x1024: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024; in SiS_GetLCDResInfo()
1686 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
1687 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
1688 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1689 SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; in SiS_GetLCDResInfo()
1690 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
1691 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1693 case Panel_1400x1050: SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050; in SiS_GetLCDResInfo()
1694 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
1695 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; /* HRE OK for LVDS, not for LCDA */ in SiS_GetLCDResInfo()
1696 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1697 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
1698 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1700 case Panel_1600x1200: SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200; in SiS_GetLCDResInfo()
1701 SiS_Pr->PanelHT = 2160; SiS_Pr->PanelVT = 1250; in SiS_GetLCDResInfo()
1702 SiS_Pr->PanelHRS = 64; SiS_Pr->PanelHRE = 192; in SiS_GetLCDResInfo()
1703 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1704 SiS_Pr->PanelVCLKIdx315 = VCLK162_315; in SiS_GetLCDResInfo()
1705 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1707 case Panel_1680x1050: SiS_Pr->PanelXRes = 1680; SiS_Pr->PanelYRes = 1050; in SiS_GetLCDResInfo()
1708 SiS_Pr->PanelHT = 1900; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
1709 SiS_Pr->PanelHRS = 26; SiS_Pr->PanelHRE = 76; in SiS_GetLCDResInfo()
1710 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1711 SiS_Pr->PanelVCLKIdx315 = VCLK121_315; in SiS_GetLCDResInfo()
1712 SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); in SiS_GetLCDResInfo()
1714 case Panel_Custom: SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX; in SiS_GetLCDResInfo()
1715 SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY; in SiS_GetLCDResInfo()
1716 SiS_Pr->PanelHT = SiS_Pr->CHTotal; in SiS_GetLCDResInfo()
1717 SiS_Pr->PanelVT = SiS_Pr->CVTotal; in SiS_GetLCDResInfo()
1718 if(SiS_Pr->CP_PreferredIndex != -1) { in SiS_GetLCDResInfo()
1719 SiS_Pr->PanelXRes = SiS_Pr->CP_HDisplay[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1720 SiS_Pr->PanelYRes = SiS_Pr->CP_VDisplay[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1721 SiS_Pr->PanelHT = SiS_Pr->CP_HTotal[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1722 SiS_Pr->PanelVT = SiS_Pr->CP_VTotal[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1723 SiS_Pr->PanelHRS = SiS_Pr->CP_HSyncStart[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1724 SiS_Pr->PanelHRE = SiS_Pr->CP_HSyncEnd[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1725 SiS_Pr->PanelVRS = SiS_Pr->CP_VSyncStart[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1726 SiS_Pr->PanelVRE = SiS_Pr->CP_VSyncEnd[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
1727 SiS_Pr->PanelHRS -= SiS_Pr->PanelXRes; in SiS_GetLCDResInfo()
1728 SiS_Pr->PanelHRE -= SiS_Pr->PanelHRS; in SiS_GetLCDResInfo()
1729 SiS_Pr->PanelVRS -= SiS_Pr->PanelYRes; in SiS_GetLCDResInfo()
1730 SiS_Pr->PanelVRE -= SiS_Pr->PanelVRS; in SiS_GetLCDResInfo()
1733 case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; in SiS_GetLCDResInfo()
1734 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
1736 case Panel_848x480: SiS_Pr->PanelXRes = 848; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1737 SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; in SiS_GetLCDResInfo()
1739 default: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
1740 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
1744 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_GetLCDResInfo()
1745 SiS_Pr->SiS_LCDInfo = temp & ~0x000e; in SiS_GetLCDResInfo()
1747 if(!(SiS_Pr->UsePanelScaler)) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; in SiS_GetLCDResInfo()
1748 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1752 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1753 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1755 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_GetLCDResInfo()
1756 if(SiS_Pr->SiS_ROMNew) { in SiS_GetLCDResInfo()
1757 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1758 } else if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) { in SiS_GetLCDResInfo()
1759 if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1763 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1764 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1766 if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) { in SiS_GetLCDResInfo()
1767 SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit); in SiS_GetLCDResInfo()
1768 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_GetLCDResInfo()
1769 if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; in SiS_GetLCDResInfo()
1770 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_GetLCDResInfo()
1771 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1777 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1779 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1780 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1781 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_GetLCDResInfo()
1783 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1786 SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1787 if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1791 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1792 if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { in SiS_GetLCDResInfo()
1793 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ in SiS_GetLCDResInfo()
1797 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1798 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_GetLCDResInfo()
1801 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1803 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
1806 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1809 if(SiS_Pr->PanelHT == 1650) { in SiS_GetLCDResInfo()
1810 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1814 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1817 SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; in SiS_GetLCDResInfo()
1820 if(SiS_Pr->SiS_VBType & VB_SISTMDS) { in SiS_GetLCDResInfo()
1825 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1832 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1837 if(SiS_Pr->SiS_VBType & VB_SISTMDS) { in SiS_GetLCDResInfo()
1843 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1846 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_GetLCDResInfo()
1848 if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
1850 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1856 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1860 if(SiS_Pr->SiS_VBType & VB_SISTMDS) { in SiS_GetLCDResInfo()
1862 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1871 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1872 if(SiS_Pr->SiS_UseROM) { in SiS_GetLCDResInfo()
1875 SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); in SiS_GetLCDResInfo()
1879 } else if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_GetLCDResInfo()
1880 if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) { in SiS_GetLCDResInfo()
1881 SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); in SiS_GetLCDResInfo()
1888 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_GetLCDResInfo()
1889 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
1892 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) { in SiS_GetLCDResInfo()
1893 SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1896 if(SiS_Pr->UseCustomMode) { in SiS_GetLCDResInfo()
1897 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
1901 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLCDResInfo()
1902 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1906 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_GetLCDResInfo()
1907 (SiS_Pr->SiS_IF_DEF_DSTN) || in SiS_GetLCDResInfo()
1908 (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_GetLCDResInfo()
1909 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_GetLCDResInfo()
1910 (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { in SiS_GetLCDResInfo()
1911 SiS_Pr->PanelHRS = 999; in SiS_GetLCDResInfo()
1912 SiS_Pr->PanelHRE = 999; in SiS_GetLCDResInfo()
1915 if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_GetLCDResInfo()
1916 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_GetLCDResInfo()
1917 (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { in SiS_GetLCDResInfo()
1918 SiS_Pr->PanelVRS = 999; in SiS_GetLCDResInfo()
1919 SiS_Pr->PanelVRE = 999; in SiS_GetLCDResInfo()
1924 if(!(SiS_Pr->SiS_ROMNew)) { in SiS_GetLCDResInfo()
1925 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_GetLCDResInfo()
1929 if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) && in SiS_GetLCDResInfo()
1930 (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) { in SiS_GetLCDResInfo()
1932 SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1934 if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_GetLCDResInfo()
1935 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_GetLCDResInfo()
1936 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || in SiS_GetLCDResInfo()
1937 (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) { in SiS_GetLCDResInfo()
1938 SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1945 if(!((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) { in SiS_GetLCDResInfo()
1947 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1948 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { in SiS_GetLCDResInfo()
1950 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_GetLCDResInfo()
1951 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1954 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { in SiS_GetLCDResInfo()
1955 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLCDResInfo()
1957 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1966 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 1) { in SiS_GetLCDResInfo()
1967 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1968 } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1969 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1970 } else if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) { in SiS_GetLCDResInfo()
1971 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1973 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLCDResInfo()
1974 if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1975 } else if(SiS_Pr->SiS_LCDResInfo == Panel_800x600) { in SiS_GetLCDResInfo()
1976 if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
1983 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetLCDResInfo()
1984 if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) { in SiS_GetLCDResInfo()
1985 SiS_Pr->SiS_SetFlag |= LCDVESATiming; in SiS_GetLCDResInfo()
1988 SiS_Pr->SiS_SetFlag |= LCDVESATiming; in SiS_GetLCDResInfo()
1994 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); in SiS_GetLCDResInfo()
2000 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo, SiS_Pr->SiS_SetFlag); in SiS_GetLCDResInfo()
2009 SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetVCLK2Ptr() argument
2017 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetVCLK2Ptr()
2018 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_GetVCLK2Ptr()
2019 CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetVCLK2Ptr()
2020 VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03; in SiS_GetVCLK2Ptr()
2022 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetVCLK2Ptr()
2023 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetVCLK2Ptr()
2024 CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetVCLK2Ptr()
2025 VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; in SiS_GetVCLK2Ptr()
2029 if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 30x/B/LV */ in SiS_GetVCLK2Ptr()
2031 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetVCLK2Ptr()
2034 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /* LCD */ in SiS_GetVCLK2Ptr()
2037 VCLKIndex = SiS_Pr->PanelVCLKIdx300; in SiS_GetVCLK2Ptr()
2039 VCLKIndex = SiS_Pr->PanelVCLKIdx315; in SiS_GetVCLK2Ptr()
2040 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_GetVCLK2Ptr()
2044 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) { in SiS_GetVCLK2Ptr()
2045 if(SiS_Pr->PanelHT == 1344) { in SiS_GetVCLK2Ptr()
2063 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42; in SiS_GetVCLK2Ptr()
2065 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00; in SiS_GetVCLK2Ptr()
2076 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* TV */ in SiS_GetVCLK2Ptr()
2078 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetVCLK2Ptr()
2079 if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = HiTVVCLKDIV2; in SiS_GetVCLK2Ptr()
2081 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_GetVCLK2Ptr()
2085 } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) VCLKIndex = YPbPr750pVCLK; in SiS_GetVCLK2Ptr()
2086 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) VCLKIndex = TVVCLKDIV2; in SiS_GetVCLK2Ptr()
2087 else if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = TVVCLKDIV2; in SiS_GetVCLK2Ptr()
2125 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetVCLK2Ptr()
2127 if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) { in SiS_GetVCLK2Ptr()
2131 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2132 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetVCLK2Ptr()
2134 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetVCLK2Ptr()
2135 if(SiS_Pr->SiS_CHSOverScan) tempbx = 8; in SiS_GetVCLK2Ptr()
2137 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_GetVCLK2Ptr()
2139 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2140 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_GetVCLK2Ptr()
2142 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2146 case 0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC; break; in SiS_GetVCLK2Ptr()
2147 case 1: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKONTSC; break; in SiS_GetVCLK2Ptr()
2148 case 2: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPAL; break; in SiS_GetVCLK2Ptr()
2149 case 3: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; in SiS_GetVCLK2Ptr()
2150 case 4: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALM; break; in SiS_GetVCLK2Ptr()
2151 case 5: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALM; break; in SiS_GetVCLK2Ptr()
2152 case 6: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALN; break; in SiS_GetVCLK2Ptr()
2153 case 7: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALN; break; in SiS_GetVCLK2Ptr()
2154 case 8: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKSOPAL; break; in SiS_GetVCLK2Ptr()
2155 default: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; in SiS_GetVCLK2Ptr()
2159 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetVCLK2Ptr()
2162 VCLKIndex = SiS_Pr->PanelVCLKIdx300; in SiS_GetVCLK2Ptr()
2164 VCLKIndex = SiS_Pr->PanelVCLKIdx315; in SiS_GetVCLK2Ptr()
2168 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2171 if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { in SiS_GetVCLK2Ptr()
2228 SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetCRT2ModeRegs() argument
2239 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetCRT2ModeRegs()
2240 } else if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2ModeRegs()
2241 modeflag = SiS_Pr->CModeFlag; in SiS_SetCRT2ModeRegs()
2243 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT2ModeRegs()
2248 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x00); /* fix write part1 index 0 BTDRAM bit Bug */ in SiS_SetCRT2ModeRegs()
2250 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetCRT2ModeRegs()
2252 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); in SiS_SetCRT2ModeRegs()
2253 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7); in SiS_SetCRT2ModeRegs()
2257 for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0); in SiS_SetCRT2ModeRegs()
2259 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F); in SiS_SetCRT2ModeRegs()
2262 tempcl = SiS_Pr->SiS_ModeType; in SiS_SetCRT2ModeRegs()
2269 if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_SetCRT2ModeRegs()
2270 tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32); in SiS_SetCRT2ModeRegs()
2273 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2ModeRegs()
2277 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl); in SiS_SetCRT2ModeRegs()
2287 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; in SiS_SetCRT2ModeRegs()
2295 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetCRT2ModeRegs()
2296 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2ModeRegs()
2297 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x08); in SiS_SetCRT2ModeRegs()
2310 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; in SiS_SetCRT2ModeRegs()
2316 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2319 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2321 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2ModeRegs()
2322 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2323 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2325 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2327 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2332 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2335 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ModeRegs()
2338 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2ModeRegs()
2340 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetCRT2ModeRegs()
2345 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2350 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2355 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF8,tempah); in SiS_SetCRT2ModeRegs()
2359 if((SiS_Pr->SiS_ModeType == ModeVGA) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { in SiS_SetCRT2ModeRegs()
2363 if((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301)) { in SiS_SetCRT2ModeRegs()
2364 if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_SetCRT2ModeRegs()
2365 (SiS_Pr->SiS_LCDResInfo == Panel_1280x960)) { in SiS_SetCRT2ModeRegs()
2372 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2373 if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p))) { in SiS_SetCRT2ModeRegs()
2374 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT2ModeRegs()
2380 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah); in SiS_SetCRT2ModeRegs()
2384 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2386 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2387 if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) { in SiS_SetCRT2ModeRegs()
2392 if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_SetCRT2ModeRegs()
2393 (SiS_Pr->SiS_LCDResInfo == Panel_1280x960) || in SiS_SetCRT2ModeRegs()
2394 ((SiS_Pr->SiS_LCDResInfo == Panel_Custom) && in SiS_SetCRT2ModeRegs()
2395 (SiS_Pr->CP_MaxX >= 1280) && (SiS_Pr->CP_MaxY >= 960))) { in SiS_SetCRT2ModeRegs()
2399 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah); in SiS_SetCRT2ModeRegs()
2407 if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { in SiS_SetCRT2ModeRegs()
2408 if(SiS_Pr->SiS_VBInfo & DriverMode) { in SiS_SetCRT2ModeRegs()
2413 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ModeRegs()
2417 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2421 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2ModeRegs()
2425 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2430 if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { in SiS_SetCRT2ModeRegs()
2435 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2437 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2445 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2451 unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); in SiS_SetCRT2ModeRegs()
2467 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2469 if(SiS_IsDualEdge(SiS_Pr, HwInfo)) { in SiS_SetCRT2ModeRegs()
2473 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2482 if((IS_SIS740) || (HwInfo->jChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_SetCRT2ModeRegs()
2485 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || in SiS_SetCRT2ModeRegs()
2486 ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) { in SiS_SetCRT2ModeRegs()
2490 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah); in SiS_SetCRT2ModeRegs()
2491 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl); in SiS_SetCRT2ModeRegs()
2492 } else if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2494 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf); /* For 301 */ in SiS_SetCRT2ModeRegs()
2495 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2496 } else if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_SetCRT2ModeRegs()
2497 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xLV */ in SiS_SetCRT2ModeRegs()
2498 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); in SiS_SetCRT2ModeRegs()
2499 } else if((SiS_Pr->SiS_VBType & VB_NoLCD) && (bridgerev == 0xb0)) { in SiS_SetCRT2ModeRegs()
2500 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xB-DH rev b0 (or "DH on 651"?) */ in SiS_SetCRT2ModeRegs()
2501 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); in SiS_SetCRT2ModeRegs()
2505 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2507 if(SiS_IsDualEdge(SiS_Pr, HwInfo)) { in SiS_SetCRT2ModeRegs()
2511 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2512 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2517 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00; in SiS_SetCRT2ModeRegs()
2518 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah); in SiS_SetCRT2ModeRegs()
2522 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2524 if(!(SiS_IsDualEdge(SiS_Pr, HwInfo))) tempah = 0x80; in SiS_SetCRT2ModeRegs()
2526 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2530 if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SiS_SetCRT2ModeRegs()
2531 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0xc0); in SiS_SetCRT2ModeRegs()
2537 } else if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetCRT2ModeRegs()
2539 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2541 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || in SiS_SetCRT2ModeRegs()
2542 ( (SiS_Pr->SiS_VBType & VB_NoLCD) && in SiS_SetCRT2ModeRegs()
2543 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) ) ) { in SiS_SetCRT2ModeRegs()
2544 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F); in SiS_SetCRT2ModeRegs()
2546 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80); in SiS_SetCRT2ModeRegs()
2556 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2ModeRegs()
2560 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2562 if(SiS_IsDualEdge(SiS_Pr, HwInfo)) tempbl = 0xff; in SiS_SetCRT2ModeRegs()
2564 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2566 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2ModeRegs()
2567 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
2570 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
2574 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
2575 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
2591 SiS_GetResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex) in SiS_GetResInfo() argument
2593 if(ModeNo <= 0x13) return((USHORT)SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo); in SiS_GetResInfo()
2594 else return((USHORT)SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO); in SiS_GetResInfo()
2598 SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetCRT2ResInfo() argument
2603 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2ResInfo()
2604 xres = SiS_Pr->CHDisplay; in SiS_GetCRT2ResInfo()
2605 if(SiS_Pr->CModeFlag & HalfDCLK) xres *= 2; in SiS_GetCRT2ResInfo()
2606 SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; in SiS_GetCRT2ResInfo()
2607 yres = SiS_Pr->CVDisplay; in SiS_GetCRT2ResInfo()
2608 if(SiS_Pr->CModeFlag & DoubleScanMode) yres *= 2; in SiS_GetCRT2ResInfo()
2609 SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres; in SiS_GetCRT2ResInfo()
2613 resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex); in SiS_GetCRT2ResInfo()
2616 xres = SiS_Pr->SiS_StResInfo[resindex].HTotal; in SiS_GetCRT2ResInfo()
2617 yres = SiS_Pr->SiS_StResInfo[resindex].VTotal; in SiS_GetCRT2ResInfo()
2619 xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal; in SiS_GetCRT2ResInfo()
2620 yres = SiS_Pr->SiS_ModeResInfo[resindex].VTotal; in SiS_GetCRT2ResInfo()
2621 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetCRT2ResInfo()
2624 if(!SiS_Pr->SiS_IF_DEF_DSTN && !SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_GetCRT2ResInfo()
2626 if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) { in SiS_GetCRT2ResInfo()
2627 if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetCRT2ResInfo()
2630 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) { in SiS_GetCRT2ResInfo()
2640 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_GetCRT2ResInfo()
2643 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCDA | SetCRT2ToLCD | SetCRT2ToHiVision)) { in SiS_GetCRT2ResInfo()
2648 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetCRT2ResInfo()
2649 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2ResInfo()
2651 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2ResInfo()
2652 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2ResInfo()
2660 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2ResInfo()
2665 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_GetCRT2ResInfo()
2670 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2ResInfo()
2679 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2ResInfo()
2680 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) { in SiS_GetCRT2ResInfo()
2685 if(SiS_Pr->SiS_SetFlag & SetDOSMode) { in SiS_GetCRT2ResInfo()
2688 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
2690 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
2692 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) yres = 480; in SiS_GetCRT2ResInfo()
2696 SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; in SiS_GetCRT2ResInfo()
2697 SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres; in SiS_GetCRT2ResInfo()
2705 SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetLVDSCRT1Ptr() argument
2711 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLVDSCRT1Ptr()
2712 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSCRT1Ptr()
2713 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return FALSE; in SiS_GetLVDSCRT1Ptr()
2715 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLVDSCRT1Ptr()
2716 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return FALSE; in SiS_GetLVDSCRT1Ptr()
2721 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSCRT1Ptr()
2722 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSCRT1Ptr()
2724 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetLVDSCRT1Ptr()
2725 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetLVDSCRT1Ptr()
2730 if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSCRT1Ptr()
2732 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++; in SiS_GetLVDSCRT1Ptr()
2733 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetLVDSCRT1Ptr()
2735 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetLVDSCRT1Ptr()
2736 if(SiS_Pr->SiS_CHSOverScan) (*DisplayType) = 99; in SiS_GetLVDSCRT1Ptr()
2738 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_GetLVDSCRT1Ptr()
2740 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++; in SiS_GetLVDSCRT1Ptr()
2741 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_GetLVDSCRT1Ptr()
2743 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++; in SiS_GetLVDSCRT1Ptr()
2747 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSCRT1Ptr()
2764 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSCRT1Ptr()
2770 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) (*DisplayType) += 2; in SiS_GetLVDSCRT1Ptr()
2773 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_GetLVDSCRT1Ptr()
2780 if(SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_GetLVDSCRT1Ptr()
2781 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480){ in SiS_GetLVDSCRT1Ptr()
2791 SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetCRT2Ptr() argument
2798 tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2Ptr()
2800 tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetCRT2Ptr()
2801 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetCRT2Ptr()
2804 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) { in SiS_GetCRT2Ptr()
2806 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { /* LCD */ in SiS_GetCRT2Ptr()
2808 tempbx = SiS_Pr->SiS_LCDResInfo; in SiS_GetCRT2Ptr()
2809 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 32; in SiS_GetCRT2Ptr()
2811 if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) { in SiS_GetCRT2Ptr()
2816 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { /* Pass 1:1 only (center-screen handled outside) */ in SiS_GetCRT2Ptr()
2819 tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; in SiS_GetCRT2Ptr()
2820 if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) && in SiS_GetCRT2Ptr()
2821 (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 768)) { in SiS_GetCRT2Ptr()
2823 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768) tempal = 0x08; in SiS_GetCRT2Ptr()
2824 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_2) tempal = 0x0f; in SiS_GetCRT2Ptr()
2825 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_3) tempal = 0x10; in SiS_GetCRT2Ptr()
2831 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_GetCRT2Ptr()
2832 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_GetCRT2Ptr()
2833 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2Ptr()
2835 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; in SiS_GetCRT2Ptr()
2843 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetCRT2Ptr()
2846 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetCRT2Ptr()
2848 if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) tempbx = 14; in SiS_GetCRT2Ptr()
2850 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
2851 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempbx = 7; in SiS_GetCRT2Ptr()
2852 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempbx = 6; in SiS_GetCRT2Ptr()
2854 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; in SiS_GetCRT2Ptr()
2856 if(SiS_Pr->SiS_TVMode & TVSetPAL) tempbx = 3; in SiS_GetCRT2Ptr()
2858 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; in SiS_GetCRT2Ptr()
2866 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) { in SiS_GetCRT2Ptr()
2872 if(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetPALN)) { in SiS_GetCRT2Ptr()
2876 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
2877 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_GetCRT2Ptr()
2880 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_GetCRT2Ptr()
2897 if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetCRT2Ptr()
2899 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetCRT2Ptr()
2900 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetCRT2Ptr()
2902 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetCRT2Ptr()
2903 if(SiS_Pr->SiS_CHSOverScan) tempbx = 99; in SiS_GetCRT2Ptr()
2905 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_GetCRT2Ptr()
2907 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetCRT2Ptr()
2908 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_GetCRT2Ptr()
2910 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetCRT2Ptr()
2914 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Ptr()
2929 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Ptr()
2935 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
2938 if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 7; in SiS_GetCRT2Ptr()
2940 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SiS_GetCRT2Ptr()
2942 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
2943 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { in SiS_GetCRT2Ptr()
2945 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
2950 if(SiS_Pr->SiS_SetFlag & SetDOSMode) { in SiS_GetCRT2Ptr()
2951 if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempal = 7; in SiS_GetCRT2Ptr()
2953 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++; in SiS_GetCRT2Ptr()
2963 SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetRAMDAC2DATA() argument
2970 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetRAMDAC2DATA()
2971 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetRAMDAC2DATA()
2975 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetRAMDAC2DATA()
2976 index = SiS_GetModePtr(SiS_Pr,ModeNo,ModeIdIndex); in SiS_GetRAMDAC2DATA()
2978 tempax = SiS_Pr->SiS_StandTable[index].CRTC[0]; in SiS_GetRAMDAC2DATA()
2979 tempbx = SiS_Pr->SiS_StandTable[index].CRTC[6]; in SiS_GetRAMDAC2DATA()
2980 temp1 = SiS_Pr->SiS_StandTable[index].CRTC[7]; in SiS_GetRAMDAC2DATA()
2984 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetRAMDAC2DATA()
2985 index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; in SiS_GetRAMDAC2DATA()
2987 tempax = SiS_Pr->SiS_CRT1Table[index].CR[0]; in SiS_GetRAMDAC2DATA()
2988 tempax |= (SiS_Pr->SiS_CRT1Table[index].CR[14] << 8); in SiS_GetRAMDAC2DATA()
2990 tempbx = SiS_Pr->SiS_CRT1Table[index].CR[6]; in SiS_GetRAMDAC2DATA()
2991 tempcx = SiS_Pr->SiS_CRT1Table[index].CR[13] << 8; in SiS_GetRAMDAC2DATA()
2995 temp1 = SiS_Pr->SiS_CRT1Table[index].CR[7]; in SiS_GetRAMDAC2DATA()
3005 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_GetRAMDAC2DATA()
3016 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetRAMDAC2DATA()
3017 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = tempbx; in SiS_GetRAMDAC2DATA()
3021 SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetCRT2DataLVDS() argument
3027 SiS_GetCRT2ResInfo(SiS_Pr, ModeNo, ModeIdIndex, HwInfo); in SiS_GetCRT2DataLVDS()
3029 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2DataLVDS()
3030 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2DataLVDS()
3031 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2DataLVDS()
3032 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2DataLVDS()
3033 SiS_Pr->SiS_RVBHRS = 50; in SiS_GetCRT2DataLVDS()
3034 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2DataLVDS()
3035 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2DataLVDS()
3036 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2DataLVDS()
3037 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2DataLVDS()
3040 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetCRT2DataLVDS()
3043 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetCRT2DataLVDS()
3044 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_GetCRT2DataLVDS()
3045 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2DataLVDS()
3046 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->CHTotal; in SiS_GetCRT2DataLVDS()
3047 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2DataLVDS()
3050 ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2DataLVDS()
3052 ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; in SiS_GetCRT2DataLVDS()
3054 if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) && in SiS_GetCRT2DataLVDS()
3055 (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 768)) { in SiS_GetCRT2DataLVDS()
3056 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768) ResIndex = 0x08; in SiS_GetCRT2DataLVDS()
3057 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_2) ResIndex = 0x0f; in SiS_GetCRT2DataLVDS()
3058 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_3) ResIndex = 0x10; in SiS_GetCRT2DataLVDS()
3061 if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) && in SiS_GetCRT2DataLVDS()
3062 (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 720)) { in SiS_GetCRT2DataLVDS()
3063 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) { in SiS_GetCRT2DataLVDS()
3064 if(SiS_Pr->PanelHT == 1344) ResIndex = 0x12; in SiS_GetCRT2DataLVDS()
3068 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAHT; in SiS_GetCRT2DataLVDS()
3069 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAVT; in SiS_GetCRT2DataLVDS()
3070 SiS_Pr->SiS_HT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDHT; in SiS_GetCRT2DataLVDS()
3071 SiS_Pr->SiS_VT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDVT; in SiS_GetCRT2DataLVDS()
3074 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2DataLVDS()
3075 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2DataLVDS()
3079 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; in SiS_GetCRT2DataLVDS()
3080 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; in SiS_GetCRT2DataLVDS()
3081 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2DataLVDS()
3082 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2DataLVDS()
3083 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT - (SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE); in SiS_GetCRT2DataLVDS()
3084 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT - (SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE); in SiS_GetCRT2DataLVDS()
3087 SiS_CalcLCDACRT1Timing(SiS_Pr,ModeNo,ModeIdIndex); in SiS_GetCRT2DataLVDS()
3094 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2DataLVDS()
3095 SiS_Pr->SiS_IF_DEF_LVDS = 1; in SiS_GetCRT2DataLVDS()
3098 SiS_GetCRT2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_GetCRT2DataLVDS()
3102 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2DataLVDS()
3103 SiS_Pr->SiS_IF_DEF_LVDS = 0; in SiS_GetCRT2DataLVDS()
3107 case 0: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; in SiS_GetCRT2DataLVDS()
3108 case 1: LVDSData = SiS_Pr->SiS_LVDS800x600Data_2; break; in SiS_GetCRT2DataLVDS()
3109 case 2: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; in SiS_GetCRT2DataLVDS()
3110 case 3: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_2; break; in SiS_GetCRT2DataLVDS()
3111 case 4: LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_1; break; in SiS_GetCRT2DataLVDS()
3112 case 5: LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_2; break; in SiS_GetCRT2DataLVDS()
3113 case 6: LVDSData = SiS_Pr->SiS_LVDS640x480Data_1; break; in SiS_GetCRT2DataLVDS()
3114 case 7: LVDSData = SiS_Pr->SiS_LVDSXXXxXXXData_1; break; in SiS_GetCRT2DataLVDS()
3115 case 8: LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_1; break; in SiS_GetCRT2DataLVDS()
3116 case 9: LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_2; break; in SiS_GetCRT2DataLVDS()
3117 case 10: LVDSData = SiS_Pr->SiS_CHTVUNTSCData; break; in SiS_GetCRT2DataLVDS()
3118 case 11: LVDSData = SiS_Pr->SiS_CHTVONTSCData; break; in SiS_GetCRT2DataLVDS()
3119 case 12: LVDSData = SiS_Pr->SiS_CHTVUPALData; break; in SiS_GetCRT2DataLVDS()
3120 case 13: LVDSData = SiS_Pr->SiS_CHTVOPALData; break; in SiS_GetCRT2DataLVDS()
3121 case 14: LVDSData = SiS_Pr->SiS_LVDS320x480Data_1; break; in SiS_GetCRT2DataLVDS()
3122 case 15: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; in SiS_GetCRT2DataLVDS()
3123 case 16: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_2; break; in SiS_GetCRT2DataLVDS()
3124 case 17: LVDSData = SiS_Pr->SiS_LVDS1152x768Data_1; break; in SiS_GetCRT2DataLVDS()
3125 case 18: LVDSData = SiS_Pr->SiS_LVDS1152x768Data_2; break; in SiS_GetCRT2DataLVDS()
3126 case 19: LVDSData = SiS_Pr->SiS_LVDS1280x768Data_1; break; in SiS_GetCRT2DataLVDS()
3127 case 20: LVDSData = SiS_Pr->SiS_LVDS1280x768Data_2; break; in SiS_GetCRT2DataLVDS()
3128 case 21: LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_1; break; in SiS_GetCRT2DataLVDS()
3129 case 22: LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_2; break; in SiS_GetCRT2DataLVDS()
3130 case 30: LVDSData = SiS_Pr->SiS_LVDS640x480Data_2; break; in SiS_GetCRT2DataLVDS()
3131 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; in SiS_GetCRT2DataLVDS()
3132 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; in SiS_GetCRT2DataLVDS()
3133 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; in SiS_GetCRT2DataLVDS()
3134 case 83: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_2; break; in SiS_GetCRT2DataLVDS()
3135 case 84: LVDSData = SiS_Pr->SiS_LVDS848x480Data_1; break; in SiS_GetCRT2DataLVDS()
3136 case 85: LVDSData = SiS_Pr->SiS_LVDS848x480Data_2; break; in SiS_GetCRT2DataLVDS()
3137 case 90: LVDSData = SiS_Pr->SiS_CHTVUPALMData; break; in SiS_GetCRT2DataLVDS()
3138 case 91: LVDSData = SiS_Pr->SiS_CHTVOPALMData; break; in SiS_GetCRT2DataLVDS()
3139 case 92: LVDSData = SiS_Pr->SiS_CHTVUPALNData; break; in SiS_GetCRT2DataLVDS()
3140 case 93: LVDSData = SiS_Pr->SiS_CHTVOPALNData; break; in SiS_GetCRT2DataLVDS()
3141 case 99: LVDSData = SiS_Pr->SiS_CHTVSOPALData; break; /* Super Overscan */ in SiS_GetCRT2DataLVDS()
3142 default: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; in SiS_GetCRT2DataLVDS()
3145 SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT; in SiS_GetCRT2DataLVDS()
3146 SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT; in SiS_GetCRT2DataLVDS()
3147 SiS_Pr->SiS_HT = (LVDSData+ResIndex)->LCDHT; in SiS_GetCRT2DataLVDS()
3148 SiS_Pr->SiS_VT = (LVDSData+ResIndex)->LCDVT; in SiS_GetCRT2DataLVDS()
3150 if(!(SiS_Pr->SiS_VBType & VB_SISVB)) { in SiS_GetCRT2DataLVDS()
3151 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_GetCRT2DataLVDS()
3152 if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetCRT2DataLVDS()
3153 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; in SiS_GetCRT2DataLVDS()
3154 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; in SiS_GetCRT2DataLVDS()
3155 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetCRT2DataLVDS()
3157 SiS_Pr->SiS_HDE = 1280; in SiS_GetCRT2DataLVDS()
3158 SiS_Pr->SiS_VDE = 1024; in SiS_GetCRT2DataLVDS()
3168 SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetCRT2Data301() argument
3182 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetCRT2Data301()
3183 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_GetCRT2Data301()
3184 } else if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3185 modeflag = SiS_Pr->CModeFlag; in SiS_GetCRT2Data301()
3188 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetCRT2Data301()
3189 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetCRT2Data301()
3191 resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; in SiS_GetCRT2Data301()
3192 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && in SiS_GetCRT2Data301()
3193 (SiS_Pr->SiS_SetFlag & LCDVESATiming) && in SiS_GetCRT2Data301()
3195 (SiS_Pr->SiS_NeedRomModeData) ) { in SiS_GetCRT2Data301()
3196 if((ROMAddr = GetLCDStructPtr661(SiS_Pr, HwInfo))) { in SiS_GetCRT2Data301()
3206 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2Data301()
3207 SiS_Pr->SiS_RVBHRS = 50; in SiS_GetCRT2Data301()
3208 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2Data301()
3209 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2Data301()
3210 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2Data301()
3211 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2Data301()
3213 SiS_GetCRT2ResInfo(SiS_Pr,ModeNo,ModeIdIndex,HwInfo); in SiS_GetCRT2Data301()
3215 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC){ in SiS_GetCRT2Data301()
3217 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3219 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3220 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3221 SiS_Pr->SiS_VGAHT = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3222 SiS_Pr->SiS_VGAVT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3223 SiS_Pr->SiS_HT = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3224 SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3225 SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3226 SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3230 SiS_GetRAMDAC2DATA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_GetCRT2Data301()
3234 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetCRT2Data301()
3236 SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex, in SiS_GetCRT2Data301()
3240 case 2: TVPtr = SiS_Pr->SiS_ExtHiTVData; break; in SiS_GetCRT2Data301()
3241 case 3: TVPtr = SiS_Pr->SiS_ExtPALData; break; in SiS_GetCRT2Data301()
3242 case 4: TVPtr = SiS_Pr->SiS_ExtNTSCData; break; in SiS_GetCRT2Data301()
3243 case 5: TVPtr = SiS_Pr->SiS_Ext525iData; break; in SiS_GetCRT2Data301()
3244 case 6: TVPtr = SiS_Pr->SiS_Ext525pData; break; in SiS_GetCRT2Data301()
3245 case 7: TVPtr = SiS_Pr->SiS_Ext750pData; break; in SiS_GetCRT2Data301()
3246 case 8: TVPtr = SiS_Pr->SiS_StPALData; break; in SiS_GetCRT2Data301()
3247 case 9: TVPtr = SiS_Pr->SiS_StNTSCData; break; in SiS_GetCRT2Data301()
3248 case 10: TVPtr = SiS_Pr->SiS_St525iData; break; in SiS_GetCRT2Data301()
3249 case 11: TVPtr = SiS_Pr->SiS_St525pData; break; in SiS_GetCRT2Data301()
3250 case 12: TVPtr = SiS_Pr->SiS_St750pData; break; in SiS_GetCRT2Data301()
3251 case 13: TVPtr = SiS_Pr->SiS_St1HiTVData; break; in SiS_GetCRT2Data301()
3252 case 14: TVPtr = SiS_Pr->SiS_St2HiTVData; break; in SiS_GetCRT2Data301()
3253 default: TVPtr = SiS_Pr->SiS_StPALData; break; in SiS_GetCRT2Data301()
3256 SiS_Pr->SiS_RVBHCMAX = (TVPtr+ResIndex)->RVBHCMAX; in SiS_GetCRT2Data301()
3257 SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT; in SiS_GetCRT2Data301()
3258 SiS_Pr->SiS_VGAHT = (TVPtr+ResIndex)->VGAHT; in SiS_GetCRT2Data301()
3259 SiS_Pr->SiS_VGAVT = (TVPtr+ResIndex)->VGAVT; in SiS_GetCRT2Data301()
3260 SiS_Pr->SiS_HDE = (TVPtr+ResIndex)->TVHDE; in SiS_GetCRT2Data301()
3261 SiS_Pr->SiS_VDE = (TVPtr+ResIndex)->TVVDE; in SiS_GetCRT2Data301()
3262 SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->RVBHRS; in SiS_GetCRT2Data301()
3263 SiS_Pr->SiS_NewFlickerMode = (TVPtr+ResIndex)->FlickerMode; in SiS_GetCRT2Data301()
3265 SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->HALFRVBHRS; in SiS_GetCRT2Data301()
3268 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetCRT2Data301()
3273 SiS_Pr->SiS_NewFlickerMode = 0x40; in SiS_GetCRT2Data301()
3276 if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; in SiS_GetCRT2Data301()
3278 SiS_Pr->SiS_HT = ExtHiTVHT; in SiS_GetCRT2Data301()
3279 SiS_Pr->SiS_VT = ExtHiTVVT; in SiS_GetCRT2Data301()
3280 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetCRT2Data301()
3281 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_GetCRT2Data301()
3282 SiS_Pr->SiS_HT = StHiTVHT; in SiS_GetCRT2Data301()
3283 SiS_Pr->SiS_VT = StHiTVVT; in SiS_GetCRT2Data301()
3286 SiS_Pr->SiS_HT = StHiTextTVHT; in SiS_GetCRT2Data301()
3287 SiS_Pr->SiS_VT = StHiTextTVVT; in SiS_GetCRT2Data301()
3293 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Data301()
3295 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_GetCRT2Data301()
3296 SiS_Pr->SiS_HT = 1650; in SiS_GetCRT2Data301()
3297 SiS_Pr->SiS_VT = 750; in SiS_GetCRT2Data301()
3298 } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_GetCRT2Data301()
3299 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3300 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3302 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3303 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3304 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3309 SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE; in SiS_GetCRT2Data301()
3310 SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE; in SiS_GetCRT2Data301()
3311 SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE; in SiS_GetCRT2Data301()
3312 SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE; in SiS_GetCRT2Data301()
3315 SiS_Pr->SiS_RY1COE = 0x00; in SiS_GetCRT2Data301()
3316 SiS_Pr->SiS_RY2COE = 0xf4; in SiS_GetCRT2Data301()
3317 SiS_Pr->SiS_RY3COE = 0x10; in SiS_GetCRT2Data301()
3318 SiS_Pr->SiS_RY4COE = 0x38; in SiS_GetCRT2Data301()
3321 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_GetCRT2Data301()
3322 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3323 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3324 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3326 SiS_Pr->SiS_HT = PALHT; in SiS_GetCRT2Data301()
3327 SiS_Pr->SiS_VT = PALVT; in SiS_GetCRT2Data301()
3332 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetCRT2Data301()
3334 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3335 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3337 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3339 SiS_Pr->SiS_VGAHT = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3340 SiS_Pr->SiS_VGAVT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3341 SiS_Pr->SiS_HT = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3342 SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3343 SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3344 SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3350 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_GetCRT2Data301()
3352 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3353 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3354 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3355 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3358 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { in SiS_GetCRT2Data301()
3361 SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; in SiS_GetCRT2Data301()
3362 SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; in SiS_GetCRT2Data301()
3363 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); in SiS_GetCRT2Data301()
3364 SiS_Pr->SiS_VGAVT = ROMAddr[romptr+4] | ((ROMAddr[romptr+3] & 0xf0) << 4); in SiS_GetCRT2Data301()
3365 SiS_Pr->SiS_HT = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8); in SiS_GetCRT2Data301()
3366 SiS_Pr->SiS_VT = ROMAddr[romptr+7] | ((ROMAddr[romptr+6] & 0xf0) << 4); in SiS_GetCRT2Data301()
3367 if(SiS_Pr->SiS_VGAHT) gotit = TRUE; in SiS_GetCRT2Data301()
3374 SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex, in SiS_GetCRT2Data301()
3378 case Panel_1024x768 : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; in SiS_GetCRT2Data301()
3379 case Panel_1024x768 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data; break; in SiS_GetCRT2Data301()
3381 case Panel_1280x720 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x720Data; break; in SiS_GetCRT2Data301()
3382 case Panel_1280x768_2 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x768_2Data; break; in SiS_GetCRT2Data301()
3383 case Panel_1280x768_2+ 32: LCDPtr = SiS_Pr->SiS_StLCD1280x768_2Data; break; in SiS_GetCRT2Data301()
3385 case Panel_1280x768_3+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x768_3Data; break; in SiS_GetCRT2Data301()
3387 case Panel_1280x800 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x800Data; break; in SiS_GetCRT2Data301()
3389 case Panel_1280x960 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data; break; in SiS_GetCRT2Data301()
3390 case Panel_1280x1024 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data; break; in SiS_GetCRT2Data301()
3391 case Panel_1280x1024 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; in SiS_GetCRT2Data301()
3392 case Panel_1400x1050 : LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data; break; in SiS_GetCRT2Data301()
3393 case Panel_1400x1050 + 32: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data; break; in SiS_GetCRT2Data301()
3394 case Panel_1600x1200 : LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data; break; in SiS_GetCRT2Data301()
3395 case Panel_1600x1200 + 32: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data; break; in SiS_GetCRT2Data301()
3397 case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; in SiS_GetCRT2Data301()
3398 case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; in SiS_GetCRT2Data301()
3401 case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; in SiS_GetCRT2Data301()
3403 default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; in SiS_GetCRT2Data301()
3410 SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; in SiS_GetCRT2Data301()
3411 SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; in SiS_GetCRT2Data301()
3412 SiS_Pr->SiS_VGAHT = (LCDPtr+ResIndex)->VGAHT; in SiS_GetCRT2Data301()
3413 SiS_Pr->SiS_VGAVT = (LCDPtr+ResIndex)->VGAVT; in SiS_GetCRT2Data301()
3414 SiS_Pr->SiS_HT = (LCDPtr+ResIndex)->LCDHT; in SiS_GetCRT2Data301()
3415 SiS_Pr->SiS_VT = (LCDPtr+ResIndex)->LCDVT; in SiS_GetCRT2Data301()
3419 tempax = SiS_Pr->PanelXRes; in SiS_GetCRT2Data301()
3420 tempbx = SiS_Pr->PanelYRes; in SiS_GetCRT2Data301()
3422 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Data301()
3423 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_GetCRT2Data301()
3425 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; in SiS_GetCRT2Data301()
3426 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; in SiS_GetCRT2Data301()
3429 if (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527; in SiS_GetCRT2Data301()
3430 else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620; in SiS_GetCRT2Data301()
3431 else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775; in SiS_GetCRT2Data301()
3432 else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775; in SiS_GetCRT2Data301()
3433 else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; in SiS_GetCRT2Data301()
3434 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; in SiS_GetCRT2Data301()
3436 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) { in SiS_GetCRT2Data301()
3437 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 700; in SiS_GetCRT2Data301()
3438 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 800; in SiS_GetCRT2Data301()
3439 else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960; in SiS_GetCRT2Data301()
3440 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_GetCRT2Data301()
3441 if (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768; in SiS_GetCRT2Data301()
3442 else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800; in SiS_GetCRT2Data301()
3443 else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864; in SiS_GetCRT2Data301()
3444 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) { in SiS_GetCRT2Data301()
3445 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2Data301()
3446 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 875; in SiS_GetCRT2Data301()
3447 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 1000; in SiS_GetCRT2Data301()
3451 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetCRT2Data301()
3452 tempax = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3453 tempbx = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3456 SiS_Pr->SiS_HDE = tempax; in SiS_GetCRT2Data301()
3457 SiS_Pr->SiS_VDE = tempbx; in SiS_GetCRT2Data301()
3463 SiS_GetCRT2Data(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetCRT2Data() argument
3467 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2Data()
3469 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_GetCRT2Data()
3470 SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_GetCRT2Data()
3472 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2Data()
3474 SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_GetCRT2Data()
3476 SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_GetCRT2Data()
3482 SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_GetCRT2Data()
3492 SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_GetLVDSDesPtr() argument
3499 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSDesPtr()
3500 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSDesPtr()
3502 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetLVDSDesPtr()
3503 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetLVDSDesPtr()
3509 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetLVDSDesPtr()
3510 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetLVDSDesPtr()
3512 … if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) (*PanelIndex) += 2; in SiS_GetLVDSDesPtr()
3513 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*PanelIndex) += 1; in SiS_GetLVDSDesPtr()
3519 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetLVDSDesPtr()
3520 *PanelIndex = SiS_Pr->SiS_LCDTypeInfo; in SiS_GetLVDSDesPtr()
3525 (*PanelIndex) = SiS_Pr->SiS_LCDResInfo - 1; in SiS_GetLVDSDesPtr()
3527 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesPtr()
3529 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_GetLVDSDesPtr()
3536 if(SiS_Pr->SiS_SetFlag & SetDOSMode) { in SiS_GetLVDSDesPtr()
3537 if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) { in SiS_GetLVDSDesPtr()
3540 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) (*ResIndex)++; in SiS_GetLVDSDesPtr()
3547 SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetLVDSDesData() argument
3554 SiS_Pr->SiS_LCDHDES = 0; in SiS_GetLVDSDesData()
3555 SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
3557 if( (SiS_Pr->UseCustomMode) || in SiS_GetLVDSDesData()
3558 (SiS_Pr->SiS_LCDResInfo == Panel_Custom) || in SiS_GetLVDSDesData()
3559 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLVDSDesData()
3560 ((SiS_Pr->SiS_VBType & VB_SISVB) && in SiS_GetLVDSDesData()
3561 (SiS_Pr->SiS_LCDInfo & DontExpandLCD) && in SiS_GetLVDSDesData()
3562 (SiS_Pr->SiS_LCDInfo & LCDPass11)) ) { in SiS_GetLVDSDesData()
3566 if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSDesData()
3569 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesData()
3571 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { in SiS_GetLVDSDesData()
3572 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); in SiS_GetLVDSDesData()
3574 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3575 SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); in SiS_GetLVDSDesData()
3578 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3579 switch(SiS_Pr->SiS_CustomT) { in SiS_GetLVDSDesData()
3583 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLVDSDesData()
3584 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3588 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_GetLVDSDesData()
3589 if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) { in SiS_GetLVDSDesData()
3590 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3598 SiS_GetLVDSDesPtr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_GetLVDSDesData()
3602 case 0: PanelDesPtr = SiS_Pr->SiS_PanelType00_1; break; /* --- */ in SiS_GetLVDSDesData()
3603 case 1: PanelDesPtr = SiS_Pr->SiS_PanelType01_1; break; in SiS_GetLVDSDesData()
3604 case 2: PanelDesPtr = SiS_Pr->SiS_PanelType02_1; break; in SiS_GetLVDSDesData()
3605 case 3: PanelDesPtr = SiS_Pr->SiS_PanelType03_1; break; in SiS_GetLVDSDesData()
3606 case 4: PanelDesPtr = SiS_Pr->SiS_PanelType04_1; break; in SiS_GetLVDSDesData()
3607 case 5: PanelDesPtr = SiS_Pr->SiS_PanelType05_1; break; in SiS_GetLVDSDesData()
3608 case 6: PanelDesPtr = SiS_Pr->SiS_PanelType06_1; break; in SiS_GetLVDSDesData()
3609 case 7: PanelDesPtr = SiS_Pr->SiS_PanelType07_1; break; in SiS_GetLVDSDesData()
3610 case 8: PanelDesPtr = SiS_Pr->SiS_PanelType08_1; break; in SiS_GetLVDSDesData()
3611 case 9: PanelDesPtr = SiS_Pr->SiS_PanelType09_1; break; in SiS_GetLVDSDesData()
3612 case 10: PanelDesPtr = SiS_Pr->SiS_PanelType0a_1; break; in SiS_GetLVDSDesData()
3613 case 11: PanelDesPtr = SiS_Pr->SiS_PanelType0b_1; break; in SiS_GetLVDSDesData()
3614 case 12: PanelDesPtr = SiS_Pr->SiS_PanelType0c_1; break; in SiS_GetLVDSDesData()
3615 case 13: PanelDesPtr = SiS_Pr->SiS_PanelType0d_1; break; in SiS_GetLVDSDesData()
3616 case 14: PanelDesPtr = SiS_Pr->SiS_PanelType0e_1; break; in SiS_GetLVDSDesData()
3617 case 15: PanelDesPtr = SiS_Pr->SiS_PanelType0f_1; break; in SiS_GetLVDSDesData()
3618 case 16: PanelDesPtr = SiS_Pr->SiS_PanelType00_2; break; /* --- */ in SiS_GetLVDSDesData()
3619 case 17: PanelDesPtr = SiS_Pr->SiS_PanelType01_2; break; in SiS_GetLVDSDesData()
3620 case 18: PanelDesPtr = SiS_Pr->SiS_PanelType02_2; break; in SiS_GetLVDSDesData()
3621 case 19: PanelDesPtr = SiS_Pr->SiS_PanelType03_2; break; in SiS_GetLVDSDesData()
3622 case 20: PanelDesPtr = SiS_Pr->SiS_PanelType04_2; break; in SiS_GetLVDSDesData()
3623 case 21: PanelDesPtr = SiS_Pr->SiS_PanelType05_2; break; in SiS_GetLVDSDesData()
3624 case 22: PanelDesPtr = SiS_Pr->SiS_PanelType06_2; break; in SiS_GetLVDSDesData()
3625 case 23: PanelDesPtr = SiS_Pr->SiS_PanelType07_2; break; in SiS_GetLVDSDesData()
3626 case 24: PanelDesPtr = SiS_Pr->SiS_PanelType08_2; break; in SiS_GetLVDSDesData()
3627 case 25: PanelDesPtr = SiS_Pr->SiS_PanelType09_2; break; in SiS_GetLVDSDesData()
3628 case 26: PanelDesPtr = SiS_Pr->SiS_PanelType0a_2; break; in SiS_GetLVDSDesData()
3629 case 27: PanelDesPtr = SiS_Pr->SiS_PanelType0b_2; break; in SiS_GetLVDSDesData()
3630 case 28: PanelDesPtr = SiS_Pr->SiS_PanelType0c_2; break; in SiS_GetLVDSDesData()
3631 case 29: PanelDesPtr = SiS_Pr->SiS_PanelType0d_2; break; in SiS_GetLVDSDesData()
3632 case 30: PanelDesPtr = SiS_Pr->SiS_PanelType0e_2; break; in SiS_GetLVDSDesData()
3633 case 31: PanelDesPtr = SiS_Pr->SiS_PanelType0f_2; break; in SiS_GetLVDSDesData()
3634 case 32: PanelDesPtr = SiS_Pr->SiS_PanelTypeNS_1; break; /* pass 1:1 */ in SiS_GetLVDSDesData()
3635 case 33: PanelDesPtr = SiS_Pr->SiS_PanelTypeNS_2; break; in SiS_GetLVDSDesData()
3636 case 50: PanelDesPtr = SiS_Pr->SiS_CHTVUNTSCDesData; break; /* TV */ in SiS_GetLVDSDesData()
3637 case 51: PanelDesPtr = SiS_Pr->SiS_CHTVONTSCDesData; break; in SiS_GetLVDSDesData()
3638 case 52: PanelDesPtr = SiS_Pr->SiS_CHTVUPALDesData; break; in SiS_GetLVDSDesData()
3639 case 53: PanelDesPtr = SiS_Pr->SiS_CHTVOPALDesData; break; in SiS_GetLVDSDesData()
3643 SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES; in SiS_GetLVDSDesData()
3644 SiS_Pr->SiS_LCDVDES = (PanelDesPtr+ResIndex)->LCDVDES; in SiS_GetLVDSDesData()
3646 if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLVDSDesData()
3647 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSDesData()
3648 if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSDesData()
3649 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 632; in SiS_GetLVDSDesData()
3650 } else if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetLVDSDesData()
3651 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { in SiS_GetLVDSDesData()
3652 if(SiS_Pr->SiS_LCDResInfo >= Panel_1024x768) { in SiS_GetLVDSDesData()
3654 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; in SiS_GetLVDSDesData()
3656 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; in SiS_GetLVDSDesData()
3657 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; in SiS_GetLVDSDesData()
3658 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; in SiS_GetLVDSDesData()
3660 SiS_Pr->SiS_LCDHDES = 320; in SiS_GetLVDSDesData()
3661 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 632; in SiS_GetLVDSDesData()
3662 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 542; in SiS_GetLVDSDesData()
3681 SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_DisableBridge() argument
3688 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_DisableBridge()
3690 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { /* ===== For 30xB/LV ===== */ in SiS_DisableBridge()
3696 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3697 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3698 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_DisableBridge()
3700 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08); in SiS_DisableBridge()
3702 SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3704 if(SiS_Is301B(SiS_Pr)) { in SiS_DisableBridge()
3705 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f); in SiS_DisableBridge()
3706 SiS_ShortDelay(SiS_Pr,1); in SiS_DisableBridge()
3708 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); in SiS_DisableBridge()
3709 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3710 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
3711 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
3712 SiS_UnLockCRT2(SiS_Pr,HwInfo); in SiS_DisableBridge()
3713 if(!(SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in SiS_DisableBridge()
3714 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
3715 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
3717 if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) || in SiS_DisableBridge()
3718 (!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) ) { in SiS_DisableBridge()
3719 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
3720 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3721 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
3723 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04); in SiS_DisableBridge()
3733 BOOLEAN custom1 = ((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || in SiS_DisableBridge()
3734 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) ? TRUE : FALSE; in SiS_DisableBridge()
3736 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; in SiS_DisableBridge()
3738 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3741 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_DisableBridge()
3742 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { in SiS_DisableBridge()
3743 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_DisableBridge()
3748 (SiS_IsVAMode(SiS_Pr,HwInfo)) || in SiS_DisableBridge()
3749 (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
3750 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_DisableBridge()
3751 if(custom1) SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3755 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_DisableBridge()
3756 SiS_DDC2Delay(SiS_Pr,0xe000); in SiS_DisableBridge()
3757 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_DisableBridge()
3758 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_DisableBridge()
3760 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_DisableBridge()
3762 SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3767 if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) { in SiS_DisableBridge()
3769 if(SiS_IsVAMode(SiS_Pr,HwInfo)) tempah = 0xf7; in SiS_DisableBridge()
3770 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_DisableBridge()
3773 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3774 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10); in SiS_DisableBridge()
3778 if(SiS_IsDualEdge(SiS_Pr,HwInfo)) { in SiS_DisableBridge()
3780 if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) tempah = 0xbf; in SiS_DisableBridge()
3782 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_DisableBridge()
3784 if((SiS_IsVAMode(SiS_Pr,HwInfo)) || in SiS_DisableBridge()
3785 ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) { in SiS_DisableBridge()
3787 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3788 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3789 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
3791 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
3792 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF); in SiS_DisableBridge()
3796 if((!(SiS_IsVAMode(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
3797 ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) { in SiS_DisableBridge()
3799 if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3800 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf); in SiS_DisableBridge()
3801 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3803 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
3805 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3806 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
3809 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
3810 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
3811 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
3812 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
3813 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
3817 if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) { in SiS_DisableBridge()
3818 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
3821 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_DisableBridge()
3825 if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3826 if(!(SiS_CRT2IsLCD(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3827 if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3828 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
3833 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_DisableBridge()
3835 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_DisableBridge()
3836 if(SiS_IsVAorLCD(SiS_Pr, HwInfo)) { in SiS_DisableBridge()
3837 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 20); in SiS_DisableBridge()
3843 if((SiS_IsVAMode(SiS_Pr,HwInfo)) || in SiS_DisableBridge()
3844 (!(SiS_IsDualEdge(SiS_Pr,HwInfo)))) { in SiS_DisableBridge()
3845 if((!(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo))) || in SiS_DisableBridge()
3846 (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo)))) { in SiS_DisableBridge()
3847 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
3848 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
3849 SiS_PanelDelay(SiS_Pr, HwInfo, 4); in SiS_DisableBridge()
3864 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3865 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08); in SiS_DisableBridge()
3866 SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3871 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); /* disable VB */ in SiS_DisableBridge()
3872 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3875 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
3878 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); /* disable lock mode */ in SiS_DisableBridge()
3881 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
3882 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
3883 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_DisableBridge()
3884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
3887 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ in SiS_DisableBridge()
3888 if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) || in SiS_DisableBridge()
3889 (!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
3890 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
3891 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04); in SiS_DisableBridge()
3904 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_DisableBridge()
3905 SiS_SetCH700x(SiS_Pr,0x090E); in SiS_DisableBridge()
3909 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
3910 SiS_WaitVBRetrace(SiS_Pr,HwInfo); in SiS_DisableBridge()
3912 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3913 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08); in SiS_DisableBridge()
3914 SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3917 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
3918 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_DisableBridge()
3919 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3920 SiS_WaitVBRetrace(SiS_Pr,HwInfo); in SiS_DisableBridge()
3921 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) { in SiS_DisableBridge()
3922 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3924 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08); in SiS_DisableBridge()
3925 SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3931 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3933 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
3935 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
3936 SiS_UnLockCRT2(SiS_Pr,HwInfo); in SiS_DisableBridge()
3937 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
3938 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
3940 if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) || in SiS_DisableBridge()
3941 (!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
3942 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
3943 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04); in SiS_DisableBridge()
3952 if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
3953 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18); in SiS_DisableBridge()
3956 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
3959 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_DisableBridge()
3961 SiS_SetCH701x(SiS_Pr,0xac76); in SiS_DisableBridge()
3962 SiS_SetCH701x(SiS_Pr,0x0066); in SiS_DisableBridge()
3965 if( (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
3966 (SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo)) ) { in SiS_DisableBridge()
3967 SiS_SetCH701x(SiS_Pr,0x3e49); in SiS_DisableBridge()
3971 if( (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
3972 (SiS_IsVAMode(SiS_Pr,HwInfo)) ) { in SiS_DisableBridge()
3973 SiS_Chrontel701xBLOff(SiS_Pr); in SiS_DisableBridge()
3974 SiS_Chrontel701xOff(SiS_Pr,HwInfo); in SiS_DisableBridge()
3978 if( (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
3979 (SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo)) ) { in SiS_DisableBridge()
3980 SiS_SetCH701x(SiS_Pr,0x0149); in SiS_DisableBridge()
3986 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
3987 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08); in SiS_DisableBridge()
3988 SiS_PanelDelay(SiS_Pr, HwInfo, 3); in SiS_DisableBridge()
3991 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
3992 (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
3993 (!(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
3994 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
3997 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
3998 (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
3999 (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
4000 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4004 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4007 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4009 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4010 (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
4011 (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
4012 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4015 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4016 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_DisableBridge()
4017 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4019 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf); in SiS_DisableBridge()
4020 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef); in SiS_DisableBridge()
4025 if(SiS_IsLCDOrLCDA(SiS_Pr,HwInfo)) { in SiS_DisableBridge()
4026 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4028 } else if(SiS_IsVAMode(SiS_Pr,HwInfo)) { in SiS_DisableBridge()
4029 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4033 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4034 if(SiS_IsDualEdge(SiS_Pr,HwInfo)) { in SiS_DisableBridge()
4037 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_DisableBridge()
4041 SiS_UnLockCRT2(SiS_Pr,HwInfo); in SiS_DisableBridge()
4044 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/ in SiS_DisableBridge()
4045 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */ in SiS_DisableBridge()
4046 } else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4047 (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) || in SiS_DisableBridge()
4048 (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) { in SiS_DisableBridge()
4049 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_DisableBridge()
4052 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4053 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_DisableBridge()
4054 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) { in SiS_DisableBridge()
4055 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_DisableBridge()
4056 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04); in SiS_DisableBridge()
4078 SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_EnableBridge() argument
4086 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_EnableBridge()
4088 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { /* ====== For 301B et al ====== */ in SiS_EnableBridge()
4094 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4095 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_EnableBridge()
4096 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4097 } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_EnableBridge()
4098 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00); in SiS_EnableBridge()
4100 if(SiS_Pr->SiS_VBType & (VB_SIS301LV302LV | VB_NoLCD)) { in SiS_EnableBridge()
4101 if(!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) { in SiS_EnableBridge()
4102 SiS_PanelDelay(SiS_Pr, HwInfo, 0); in SiS_EnableBridge()
4107 if((SiS_Pr->SiS_VBType & VB_NoLCD) && in SiS_EnableBridge()
4108 (SiS_CRT2IsLCD(SiS_Pr, HwInfo))) { in SiS_EnableBridge()
4110 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* Enable CRT2 */ in SiS_EnableBridge()
4111 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4112 SiS_UnLockCRT2(SiS_Pr,HwInfo); in SiS_EnableBridge()
4113 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
4114 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4115 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
4117 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
4119 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
4120 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4121 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4122 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4124 SiS_WaitVBRetrace(SiS_Pr,HwInfo); in SiS_EnableBridge()
4125 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00); in SiS_EnableBridge()
4131 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4132 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4133 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4136 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4137 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4138 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4139 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0); in SiS_EnableBridge()
4140 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4141 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_EnableBridge()
4142 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4143 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4144 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4145 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4147 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4164 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_EnableBridge()
4165 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef); in SiS_EnableBridge()
4167 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_EnableBridge()
4168 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4173 if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) { in SiS_EnableBridge()
4175 if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4176 if(SiS_TVEnabled(SiS_Pr, HwInfo)) tempah = 0x18; in SiS_EnableBridge()
4179 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_EnableBridge()
4182 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_EnableBridge()
4184 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_EnableBridge()
4185 SiS_DisplayOff(SiS_Pr); in SiS_EnableBridge()
4186 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_EnableBridge()
4188 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_EnableBridge()
4191 if(SiS_IsVAorLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4192 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_EnableBridge()
4193 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2); in SiS_EnableBridge()
4194 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4195 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2); in SiS_EnableBridge()
4196 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_EnableBridge()
4197 SiS_GenericDelay(SiS_Pr, 0x4500); in SiS_EnableBridge()
4202 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { in SiS_EnableBridge()
4203 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10); in SiS_EnableBridge()
4209 if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4211 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; in SiS_EnableBridge()
4212 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4213 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4215 if(!(SiS_LCDAEnabled(SiS_Pr, HwInfo))) temp |= 0x20; in SiS_EnableBridge()
4218 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4220 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4222 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
4223 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4225 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_EnableBridge()
4226 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_EnableBridge()
4231 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_EnableBridge()
4235 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20); in SiS_EnableBridge()
4236 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4239 if(SiS_IsDualEdge(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4241 if(!(SiS_IsVAMode(SiS_Pr, HwInfo))) tempah = 0x40; in SiS_EnableBridge()
4243 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_EnableBridge()
4245 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_EnableBridge()
4247 SiS_PanelDelay(SiS_Pr, HwInfo, 2); in SiS_EnableBridge()
4249 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10); in SiS_EnableBridge()
4250 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4252 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { in SiS_EnableBridge()
4254 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_EnableBridge()
4255 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4258 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c); in SiS_EnableBridge()
4260 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_EnableBridge()
4262 cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_EnableBridge()
4264 if(SiS_Pr->SiS_ROMNew) { in SiS_EnableBridge()
4266 USHORT romptr = GetLCDStructPtr661_2(SiS_Pr, HwInfo); in SiS_EnableBridge()
4268 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); in SiS_EnableBridge()
4269 SiS_Pr->EMI_30 = 0; in SiS_EnableBridge()
4270 SiS_Pr->EMI_31 = ROMAddr[romptr + 14]; in SiS_EnableBridge()
4271 SiS_Pr->EMI_32 = ROMAddr[romptr + 15]; in SiS_EnableBridge()
4272 SiS_Pr->EMI_33 = ROMAddr[romptr + 16]; in SiS_EnableBridge()
4273 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; in SiS_EnableBridge()
4275 SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = TRUE; in SiS_EnableBridge()
4290 if(SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4291 r30 = SiS_Pr->EMI_30; r31 = SiS_Pr->EMI_31; in SiS_EnableBridge()
4292 r32 = SiS_Pr->EMI_32; r33 = SiS_Pr->EMI_33; in SiS_EnableBridge()
4304 if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) { in SiS_EnableBridge()
4308 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40; in SiS_EnableBridge()
4309 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4317 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40; in SiS_EnableBridge()
4318 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4320 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_EnableBridge()
4327 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4329 if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { in SiS_EnableBridge()
4336 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4343 if(!SiS_Pr->OverruleEMI) { in SiS_EnableBridge()
4345 if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { in SiS_EnableBridge()
4352 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_EnableBridge()
4359 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_EnableBridge()
4370 if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) { in SiS_EnableBridge()
4371 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); in SiS_EnableBridge()
4373 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31); in SiS_EnableBridge()
4374 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32); in SiS_EnableBridge()
4375 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33); in SiS_EnableBridge()
4376 if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) { in SiS_EnableBridge()
4377 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_EnableBridge()
4379 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x00); in SiS_EnableBridge()
4382 if( (SiS_LCDAEnabled(SiS_Pr, HwInfo)) || in SiS_EnableBridge()
4383 (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) { in SiS_EnableBridge()
4385 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5); in SiS_EnableBridge()
4387 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5); in SiS_EnableBridge()
4390 SiS_WaitVBRetrace(SiS_Pr,HwInfo); in SiS_EnableBridge()
4391 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_EnableBridge()
4392 SiS_GenericDelay(SiS_Pr, 0x500); in SiS_EnableBridge()
4394 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); in SiS_EnableBridge()
4401 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4402 if(SiS_IsVAorLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4403 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10); in SiS_EnableBridge()
4405 SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10); in SiS_EnableBridge()
4407 SiS_WaitVBRetrace(SiS_Pr,HwInfo); in SiS_EnableBridge()
4408 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_EnableBridge()
4409 SiS_GenericDelay(SiS_Pr, 0x500); in SiS_EnableBridge()
4411 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4415 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_EnableBridge()
4416 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4417 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff); in SiS_EnableBridge()
4421 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4422 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4432 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4433 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00); in SiS_EnableBridge()
4434 SiS_PanelDelay(SiS_Pr, HwInfo, 0); in SiS_EnableBridge()
4438 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4439 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4440 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4443 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4445 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4448 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
4450 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); /* BVBDOENABLE=1 */ in SiS_EnableBridge()
4454 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4456 SiS_VBLongWait(SiS_Pr); in SiS_EnableBridge()
4457 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4459 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4461 SiS_VBLongWait(SiS_Pr); in SiS_EnableBridge()
4464 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4465 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4466 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00); in SiS_EnableBridge()
4478 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4480 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4481 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4482 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4484 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00); in SiS_EnableBridge()
4485 if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4486 SiS_PanelDelay(SiS_Pr, HwInfo, 0); in SiS_EnableBridge()
4490 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4491 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4492 SiS_UnLockCRT2(SiS_Pr,HwInfo); in SiS_EnableBridge()
4493 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
4494 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4495 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
4497 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
4500 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_EnableBridge()
4501 if(!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) { in SiS_EnableBridge()
4502 SiS_WaitVBRetrace(SiS_Pr, HwInfo); in SiS_EnableBridge()
4503 SiS_SetCH700x(SiS_Pr,0x0B0E); in SiS_EnableBridge()
4507 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4508 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
4509 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4510 if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4511 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4512 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4514 SiS_WaitVBRetrace(SiS_Pr, HwInfo); in SiS_EnableBridge()
4515 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00); in SiS_EnableBridge()
4526 if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4527 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18); in SiS_EnableBridge()
4530 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
4531 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4532 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00); in SiS_EnableBridge()
4533 SiS_PanelDelay(SiS_Pr, HwInfo, 0); in SiS_EnableBridge()
4537 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4538 SiS_UnLockCRT2(SiS_Pr,HwInfo); in SiS_EnableBridge()
4540 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_EnableBridge()
4542 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
4543 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_EnableBridge()
4545 SiS_Chrontel701xBLOff(SiS_Pr); in SiS_EnableBridge()
4549 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
4553 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
4554 if(SiS_IsLCDOrLCDA(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4555 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
4560 temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
4562 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); in SiS_EnableBridge()
4565 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
4567 SiS_Chrontel701xBLOn(SiS_Pr, HwInfo); in SiS_EnableBridge()
4571 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
4572 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4573 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
4575 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40); in SiS_EnableBridge()
4576 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10); in SiS_EnableBridge()
4579 } else if(SiS_IsVAMode(SiS_Pr,HwInfo)) { in SiS_EnableBridge()
4581 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
4585 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4586 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4589 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
4590 if(SiS_IsTVOrYPbPrOrScart(SiS_Pr,HwInfo)) { in SiS_EnableBridge()
4591 SiS_Chrontel701xOn(SiS_Pr,HwInfo); in SiS_EnableBridge()
4593 if( (SiS_IsVAMode(SiS_Pr,HwInfo)) || in SiS_EnableBridge()
4594 (SiS_IsLCDOrLCDA(SiS_Pr,HwInfo)) ) { in SiS_EnableBridge()
4595 SiS_ChrontelDoSomething1(SiS_Pr,HwInfo); in SiS_EnableBridge()
4599 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
4600 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4601 if( (SiS_IsVAMode(SiS_Pr,HwInfo)) || in SiS_EnableBridge()
4602 (SiS_IsLCDOrLCDA(SiS_Pr,HwInfo)) ) { in SiS_EnableBridge()
4603 SiS_Chrontel701xBLOn(SiS_Pr, HwInfo); in SiS_EnableBridge()
4604 SiS_ChrontelInitTVVSync(SiS_Pr,HwInfo); in SiS_EnableBridge()
4607 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
4608 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) { in SiS_EnableBridge()
4609 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) { in SiS_EnableBridge()
4610 SiS_PanelDelay(SiS_Pr, HwInfo, 1); in SiS_EnableBridge()
4611 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00); in SiS_EnableBridge()
4630 SiS_SetCRT2Offset(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetCRT2Offset() argument
4636 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return; in SiS_SetCRT2Offset()
4638 offset = SiS_GetOffset(SiS_Pr,ModeNo,ModeIdIndex,RRTI,HwInfo); in SiS_SetCRT2Offset()
4640 if((SiS_Pr->SiS_LCDResInfo == Panel_640x480_2) || in SiS_SetCRT2Offset()
4641 (SiS_Pr->SiS_LCDResInfo == Panel_640x480_3)) { in SiS_SetCRT2Offset()
4645 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF)); in SiS_SetCRT2Offset()
4646 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8)); in SiS_SetCRT2Offset()
4649 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp); in SiS_SetCRT2Offset()
4654 SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex, in SiS_SetCRT2Sync() argument
4661 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2Sync()
4662 infoflag = SiS_Pr->CInfoFlag; in SiS_SetCRT2Sync()
4664 infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; in SiS_SetCRT2Sync()
4667 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* LVDS */ in SiS_SetCRT2Sync()
4669 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Sync()
4671 } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) { in SiS_SetCRT2Sync()
4672 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
4676 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
4677 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
4678 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_SetCRT2Sync()
4679 (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2Sync()
4682 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_SetCRT2Sync()
4683 (SiS_Pr->SiS_IF_DEF_DSTN) || in SiS_SetCRT2Sync()
4684 (SiS_Pr->SiS_IF_DEF_TRUMPION) || in SiS_SetCRT2Sync()
4685 (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { in SiS_SetCRT2Sync()
4689 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Sync()
4693 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah); in SiS_SetCRT2Sync()
4696 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0); in SiS_SetCRT2Sync()
4699 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
4702 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2Sync()
4708 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { /* 630 - 301B(-DH) */ in SiS_SetCRT2Sync()
4712 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
4713 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
4714 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
4720 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
4722 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
4723 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetCRT2Sync()
4724 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
4732 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
4733 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
4743 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { /* 315 - LVDS */ in SiS_SetCRT2Sync()
4746 if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) && in SiS_SetCRT2Sync()
4747 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetCRT2Sync()
4749 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
4750 tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6); in SiS_SetCRT2Sync()
4752 } else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400) && in SiS_SetCRT2Sync()
4753 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050)) { in SiS_SetCRT2Sync()
4757 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_SetCRT2Sync()
4760 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04; in SiS_SetCRT2Sync()
4764 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
4765 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) tempah |= 0xc0; in SiS_SetCRT2Sync()
4766 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
4767 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetCRT2Sync()
4768 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
4769 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
4776 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2Sync()
4778 if((SiS_Pr->SiS_VBType & VB_SIS301C) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2Sync()
4780 tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetCRT2Sync()
4783 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetCRT2Sync()
4784 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
4785 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
4792 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
4793 if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_SetCRT2Sync()
4795 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah |= 0xc0; in SiS_SetCRT2Sync()
4797 if((SiS_Pr->SiS_VBType & VB_SIS301C) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2Sync()
4800 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah); in SiS_SetCRT2Sync()
4802 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
4803 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetCRT2Sync()
4804 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
4805 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
4819 SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo, in SiS_SetCRT2FIFO_300() argument
4867 SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate; in SiS_SetCRT2FIFO_300()
4869 if(!SiS_Pr->CRT1UsesCustomMode) { in SiS_SetCRT2FIFO_300()
4871 CRT1ModeNo = SiS_Pr->SiS_CRT1Mode; /* get CRT1 ModeNo */ in SiS_SetCRT2FIFO_300()
4872 SiS_SearchModeID(SiS_Pr, &CRT1ModeNo, &modeidindex); in SiS_SetCRT2FIFO_300()
4873 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT2FIFO_300()
4874 SiS_Pr->SiS_SelectCRT2Rate = 0; in SiS_SetCRT2FIFO_300()
4875 refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT1ModeNo, modeidindex, HwInfo); in SiS_SetCRT2FIFO_300()
4878 index = SiS_Pr->SiS_RefIndex[refreshratetableindex].Ext_CRTVCLK; in SiS_SetCRT2FIFO_300()
4880 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; /* Get VCLK */ in SiS_SetCRT2FIFO_300()
4882 colorth = SiS_GetColorDepth(SiS_Pr,CRT1ModeNo,modeidindex); /* Get colordepth */ in SiS_SetCRT2FIFO_300()
4890 VCLK = SiS_Pr->CSRClock_CRT1; /* Get VCLK */ in SiS_SetCRT2FIFO_300()
4891 data2 = (SiS_Pr->CModeFlag_CRT1 & ModeInfoFlag) - 2; in SiS_SetCRT2FIFO_300()
4906 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A); in SiS_SetCRT2FIFO_300()
4908 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A); in SiS_SetCRT2FIFO_300()
4911 MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK; /* Get MCLK */ in SiS_SetCRT2FIFO_300()
4915 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14); in SiS_SetCRT2FIFO_300()
4932 tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x18); in SiS_SetCRT2FIFO_300()
4940 tempbx = SiS_GetReg(SiS_Pr->SiS_P3c4,0x16); in SiS_SetCRT2FIFO_300()
4942 tempah = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14); in SiS_SetCRT2FIFO_300()
4985 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14); in SiS_SetCRT2FIFO_300()
4991 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14); in SiS_SetCRT2FIFO_300()
5021 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14); in SiS_SetCRT2FIFO_300()
5027 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2FIFO_300()
5028 SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; in SiS_SetCRT2FIFO_300()
5030 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2FIFO_300()
5033 SiS_SearchModeID(SiS_Pr, &CRT2ModeNo, &modeidindex); in SiS_SetCRT2FIFO_300()
5035 refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT2ModeNo, modeidindex, HwInfo); in SiS_SetCRT2FIFO_300()
5037 index = SiS_GetVCLK2Ptr(SiS_Pr,CRT2ModeNo,modeidindex, in SiS_SetCRT2FIFO_300()
5039 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; /* Get VCLK */ in SiS_SetCRT2FIFO_300()
5041 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2FIFO_300()
5042 if(SiS_Pr->SiS_UseROM) { in SiS_SetCRT2FIFO_300()
5052 VCLK = SiS_Pr->CSRClock; /* Get VCLK */ in SiS_SetCRT2FIFO_300()
5056 colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex); /* Get colordepth */ in SiS_SetCRT2FIFO_300()
5071 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x01); in SiS_SetCRT2FIFO_300()
5075 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetCRT2FIFO_300()
5088 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp); in SiS_SetCRT2FIFO_300()
5095 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data); in SiS_SetCRT2FIFO_300()
5099 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2FIFO_300()
5100 SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; in SiS_SetCRT2FIFO_300()
5109 SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_SetCRT2FIFO_310() argument
5111 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B); in SiS_SetCRT2FIFO_310()
5113 (SiS_Pr->SiS_SysFlags & SF_760LFB) && in SiS_SetCRT2FIFO_310()
5114 (SiS_Pr->SiS_ModeType == Mode32Bpp) && in SiS_SetCRT2FIFO_310()
5115 (SiS_Pr->SiS_VGAHDE >= 1280) && in SiS_SetCRT2FIFO_310()
5116 (SiS_Pr->SiS_VGAVDE >= 1024) ) { in SiS_SetCRT2FIFO_310()
5117 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03); in SiS_SetCRT2FIFO_310()
5118 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b); in SiS_SetCRT2FIFO_310()
5119 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5120 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_SetCRT2FIFO_310()
5121 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5122 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e); in SiS_SetCRT2FIFO_310()
5124 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04); in SiS_SetCRT2FIFO_310()
5131 SiS_GetVGAHT2(SiS_Private *SiS_Pr) in SiS_GetVGAHT2() argument
5135 tempbx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX; in SiS_GetVGAHT2()
5136 tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT; in SiS_GetVGAHT2()
5137 tempax = (tempax * SiS_Pr->SiS_HT) / tempbx; in SiS_GetVGAHT2()
5143 SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex, in SiS_SetGroup1_301() argument
5152 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1_301()
5153 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup1_301()
5154 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1_301()
5155 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1_301()
5157 xres = SiS_Pr->CHDisplay; in SiS_SetGroup1_301()
5159 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1_301()
5160 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1_301()
5161 xres = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes; in SiS_SetGroup1_301()
5168 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04); in SiS_SetGroup1_301()
5172 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0xff); /* set MAX HT */ in SiS_SetGroup1_301()
5174 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) modeflag |= Charx8Dot; in SiS_SetGroup1_301()
5179 tempax = SiS_Pr->SiS_VGAHDE; /* 0x04 Horizontal Display End */ in SiS_SetGroup1_301()
5185 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,temp); in SiS_SetGroup1_301()
5187 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup1_301()
5188 if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) { in SiS_SetGroup1_301()
5192 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup1_301()
5195 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x05,temp); /* 0x05 Horizontal Display Start */ in SiS_SetGroup1_301()
5197 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x06,0x03); /* 0x06 Horizontal Blank end */ in SiS_SetGroup1_301()
5200 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempax = SiS_GetVGAHT2(SiS_Pr); in SiS_SetGroup1_301()
5201 if(tempax >= SiS_Pr->SiS_VGAHT) tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1_301()
5206 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup1_301()
5210 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup1_301()
5218 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup1_301()
5223 if(SiS_Pr->SiS_VGAHDE >= 800) temp -= 6; in SiS_SetGroup1_301()
5225 if(SiS_Pr->SiS_VGAHDE == 800) temp += 2; in SiS_SetGroup1_301()
5232 if((SiS_Pr->SiS_LCDResInfo != Panel_1280x960) && in SiS_SetGroup1_301()
5233 (SiS_Pr->SiS_LCDResInfo != Panel_1600x1200)) { in SiS_SetGroup1_301()
5234 if(SiS_Pr->SiS_VGAHDE >= 800) { in SiS_SetGroup1_301()
5237 if(SiS_Pr->SiS_ModeType == ModeEGA) { in SiS_SetGroup1_301()
5238 if(SiS_Pr->SiS_VGAVDE == 1024) { in SiS_SetGroup1_301()
5240 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) in SiS_SetGroup1_301()
5245 if(SiS_Pr->SiS_LCDResInfo != Panel_1400x1050) { in SiS_SetGroup1_301()
5246 if(SiS_Pr->SiS_VGAHDE >= 1280) { in SiS_SetGroup1_301()
5247 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) temp += 28; in SiS_SetGroup1_301()
5259 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup1_301()
5260 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup1_301()
5263 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) p1_8 = 0x61; in SiS_SetGroup1_301()
5265 } else if(SiS_Pr->SiS_ModeType == ModeText) { in SiS_SetGroup1_301()
5266 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) p1_7 = 0x54; in SiS_SetGroup1_301()
5271 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetGroup1_301()
5286 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetGroup1_301()
5297 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup1_301()
5298 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p)) { in SiS_SetGroup1_301()
5300 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) p1_7 = 0x55; in SiS_SetGroup1_301()
5302 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup1_301()
5305 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_SetGroup1_301()
5310 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_SetGroup1_301()
5316 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,p1_7); /* 0x07 Horizontal Retrace Start */ in SiS_SetGroup1_301()
5317 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,p1_8); /* 0x08 Horizontal Retrace End */ in SiS_SetGroup1_301()
5319 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x03); /* 0x18 SR08 (FIFO Threshold?) */ in SiS_SetGroup1_301()
5321 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x19,0xF0); in SiS_SetGroup1_301()
5323 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,0xFF); /* 0x09 Set Max VT */ in SiS_SetGroup1_301()
5326 tempbx = SiS_Pr->SiS_VGAVDE; /* 0x0E Vertical Display End */ in SiS_SetGroup1_301()
5334 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1_301()
5335 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_301()
5336 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_SetGroup1_301()
5344 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,temp); /* 0x10 vertical Blank Start */ in SiS_SetGroup1_301()
5355 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); in SiS_SetGroup1_301()
5361 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x0B,0x5F,temp); in SiS_SetGroup1_301()
5365 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,temp); in SiS_SetGroup1_301()
5372 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,0x00); /* 0x11 Vertical Blank End */ in SiS_SetGroup1_301()
5374 tempax = (SiS_Pr->SiS_VGAVT - tempbx) >> 2; in SiS_SetGroup1_301()
5381 if(SiS_Pr->SiS_LCDResInfo != Panel_1400x1050) { in SiS_SetGroup1_301()
5386 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup1_301()
5389 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup1_301()
5390 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup1_301()
5393 if(SiS_Pr->SiS_VGAHDE == 800) tempbx += 10; in SiS_SetGroup1_301()
5402 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup1_301()
5408 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* 0x0C Vertical Retrace Start */ in SiS_SetGroup1_301()
5412 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,temp); in SiS_SetGroup1_301()
5417 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x0B,0x20); in SiS_SetGroup1_301()
5425 else if(SiS_Pr->SiS_VBType & VB_SIS301) tempcx |= 0x0800; in SiS_SetGroup1_301()
5431 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,temp); /* 0x0D vertical Retrace End */ in SiS_SetGroup1_301()
5436 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* 0x0A CR07 */ in SiS_SetGroup1_301()
5439 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* 0x17 SR0A */ in SiS_SetGroup1_301()
5444 if(!(SiS_Pr->SiS_VBType & VB_SIS301)) temp |= 0x01; /* Always 8 dotclock */ in SiS_SetGroup1_301()
5445 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* 0x16 SR01 */ in SiS_SetGroup1_301()
5447 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00); /* 0x0F CR14 */ in SiS_SetGroup1_301()
5449 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00); /* 0x12 CR17 */ in SiS_SetGroup1_301()
5452 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup1_301()
5453 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { in SiS_SetGroup1_301()
5457 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* 0x1A SR0E */ in SiS_SetGroup1_301()
5459 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetGroup1_301()
5460 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); in SiS_SetGroup1_301()
5468 SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetGroup1_LVDS() argument
5483 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1_LVDS()
5484 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup1_LVDS()
5486 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup1_LVDS()
5488 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1_LVDS()
5489 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1_LVDS()
5495 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1_LVDS()
5496 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1_LVDS()
5498 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup1_LVDS()
5503 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_SetGroup1_LVDS()
5504 ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetGroup1_LVDS()
5509 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetGroup1_LVDS()
5513 if((HwInfo->jChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) { in SiS_SetGroup1_LVDS()
5514 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) { in SiS_SetGroup1_LVDS()
5520 if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5522 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5525 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5526 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03); in SiS_SetGroup1_LVDS()
5527 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1_LVDS()
5528 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5532 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5533 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00); in SiS_SetGroup1_LVDS()
5534 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1_LVDS()
5535 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f); in SiS_SetGroup1_LVDS()
5536 if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SiS_SetGroup1_LVDS()
5537 if((SiS_Pr->SiS_LCDResInfo == Panel_1024x768) || in SiS_SetGroup1_LVDS()
5538 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetGroup1_LVDS()
5539 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20); in SiS_SetGroup1_LVDS()
5549 tempax = SiS_Pr->SiS_LCDHDES; in SiS_SetGroup1_LVDS()
5551 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5552 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) { in SiS_SetGroup1_LVDS()
5553 if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) && in SiS_SetGroup1_LVDS()
5554 (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { in SiS_SetGroup1_LVDS()
5562 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* BPLHDESKEW[2:0] */ in SiS_SetGroup1_LVDS()
5564 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* BPLHDESKEW[10:3] */ in SiS_SetGroup1_LVDS()
5566 tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
5567 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5568 if((SiS_Pr->SiS_LCDResInfo == Panel_640x480_2) || in SiS_SetGroup1_LVDS()
5569 (SiS_Pr->SiS_LCDResInfo == Panel_640x480_3)) { in SiS_SetGroup1_LVDS()
5572 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5573 tempbx = SiS_Pr->PanelXRes; in SiS_SetGroup1_LVDS()
5578 if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5583 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* BPLHDEE */ in SiS_SetGroup1_LVDS()
5585 tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2; in SiS_SetGroup1_LVDS()
5587 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5588 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5589 if(SiS_Pr->PanelHRS != 999) tempcx = SiS_Pr->PanelHRS; in SiS_SetGroup1_LVDS()
5594 if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5597 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5598 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5599 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5620 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp); /* BPLHRS */ in SiS_SetGroup1_LVDS()
5622 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5624 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5626 if(SiS_Pr->PanelHRE != 999) { in SiS_SetGroup1_LVDS()
5627 temp = tempcx + SiS_Pr->PanelHRE; in SiS_SetGroup1_LVDS()
5628 if(temp >= SiS_Pr->SiS_HT) temp -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5639 if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0x20; /* WRONG? BIOS loads cl, not ah */ in SiS_SetGroup1_LVDS()
5641 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp); /* BPLHRE */ in SiS_SetGroup1_LVDS()
5645 tempax = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5646 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5647 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5648 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup1_LVDS()
5652 tempbx = SiS_Pr->SiS_LCDVDES + tempax; in SiS_SetGroup1_LVDS()
5653 if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; in SiS_SetGroup1_LVDS()
5657 tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5659 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5660 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5661 tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->PanelYRes; in SiS_SetGroup1_LVDS()
5668 if( (SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && in SiS_SetGroup1_LVDS()
5669 (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) && in SiS_SetGroup1_LVDS()
5670 (SiS_Pr->PanelVRS != 999) ) { in SiS_SetGroup1_LVDS()
5671 tempcx = SiS_Pr->PanelVRS; in SiS_SetGroup1_LVDS()
5680 if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; /* BPLVRS */ in SiS_SetGroup1_LVDS()
5683 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5684 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5688 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); in SiS_SetGroup1_LVDS()
5693 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5694 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5695 if(SiS_Pr->PanelVRE != 999) tempcx = SiS_Pr->PanelVRE; in SiS_SetGroup1_LVDS()
5701 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); /* BPLVRE */ in SiS_SetGroup1_LVDS()
5704 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
5705 if(SiS_Pr->SiS_HDE != 640) { in SiS_SetGroup1_LVDS()
5706 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5708 } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5709 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) temp |= 0x40; in SiS_SetGroup1_LVDS()
5714 if((SiS_Pr->SiS_IF_DEF_CH70xx == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup1_LVDS()
5715 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03) temp |= 0x80; in SiS_SetGroup1_LVDS()
5718 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup1_LVDS()
5719 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1_LVDS()
5720 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80; in SiS_SetGroup1_LVDS()
5722 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80; in SiS_SetGroup1_LVDS()
5726 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp); in SiS_SetGroup1_LVDS()
5730 tempcx = SiS_Pr->SiS_LCDVDES; /* BPLVDES */ in SiS_SetGroup1_LVDS()
5732 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5733 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_SetGroup1_LVDS()
5735 tempbx = SiS_Pr->SiS_VGAVDE - 1; in SiS_SetGroup1_LVDS()
5736 tempcx = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5739 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5744 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5746 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup1_LVDS()
5753 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5763 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp); in SiS_SetGroup1_LVDS()
5765 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx); in SiS_SetGroup1_LVDS()
5766 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx); in SiS_SetGroup1_LVDS()
5773 tempeax = SiS_Pr->SiS_VGAVDE << 6; in SiS_SetGroup1_LVDS()
5774 temp = (tempeax % (ULONG)SiS_Pr->SiS_VDE); in SiS_SetGroup1_LVDS()
5775 tempeax = tempeax / (ULONG)SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5778 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F; in SiS_SetGroup1_LVDS()
5781 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ in SiS_SetGroup1_LVDS()
5788 tempeax = SiS_Pr->SiS_VGAVDE << 18; in SiS_SetGroup1_LVDS()
5789 tempebx = SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5796 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp); in SiS_SetGroup1_LVDS()
5798 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp); in SiS_SetGroup1_LVDS()
5800 if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04; in SiS_SetGroup1_LVDS()
5801 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp); in SiS_SetGroup1_LVDS()
5803 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) { in SiS_SetGroup1_LVDS()
5805 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp); in SiS_SetGroup1_LVDS()
5807 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp); in SiS_SetGroup1_LVDS()
5809 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp); in SiS_SetGroup1_LVDS()
5811 if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08; in SiS_SetGroup1_LVDS()
5812 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp); in SiS_SetGroup1_LVDS()
5820 tempeax = SiS_Pr->SiS_VGAHDE; /* 1f = ( (VGAHDE * 65536) / ( (VGAHDE * 65536) / HDE ) ) - 1*/ in SiS_SetGroup1_LVDS()
5825 if(SiS_Pr->SiS_HDE == tempeax) { in SiS_SetGroup1_LVDS()
5828 tempecx = tempebx / SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
5830 if(tempebx % SiS_Pr->SiS_HDE) tempecx++; in SiS_SetGroup1_LVDS()
5837 tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1; in SiS_SetGroup1_LVDS()
5841 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp); in SiS_SetGroup1_LVDS()
5844 tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact; in SiS_SetGroup1_LVDS()
5847 tempeax = SiS_Pr->SiS_VGAVDE << 6; in SiS_SetGroup1_LVDS()
5853 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tempbx--; in SiS_SetGroup1_LVDS()
5854 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) { in SiS_SetGroup1_LVDS()
5855 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) tempbx = 1; in SiS_SetGroup1_LVDS()
5856 else if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempbx = 1; in SiS_SetGroup1_LVDS()
5861 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp); in SiS_SetGroup1_LVDS()
5862 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx); in SiS_SetGroup1_LVDS()
5869 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp); in SiS_SetGroup1_LVDS()
5871 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); in SiS_SetGroup1_LVDS()
5875 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1_LVDS()
5876 if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SIS301LV302LV)) { in SiS_SetGroup1_LVDS()
5877 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_SetGroup1_LVDS()
5882 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_SetGroup1_LVDS()
5884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23); in SiS_SetGroup1_LVDS()
5892 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5898 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf); in SiS_SetGroup1_LVDS()
5900 SiS_SetTrumpionBlock(SiS_Pr, &SiS300_TrumpionData[crt2crtc][0]); in SiS_SetGroup1_LVDS()
5902 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5905 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode13[0]); in SiS_SetGroup1_LVDS()
5909 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_1[0]); in SiS_SetGroup1_LVDS()
5910 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_2[0]); in SiS_SetGroup1_LVDS()
5914 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_SetGroup1_LVDS()
5919 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
5920 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); in SiS_SetGroup1_LVDS()
5921 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); in SiS_SetGroup1_LVDS()
5922 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00); in SiS_SetGroup1_LVDS()
5923 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87); in SiS_SetGroup1_LVDS()
5924 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A); in SiS_SetGroup1_LVDS()
5925 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B); in SiS_SetGroup1_LVDS()
5926 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03); in SiS_SetGroup1_LVDS()
5927 tempax = SiS_Pr->SiS_HDE; /* Blps = lcdhdee(lcdhdes+HDE) + 64 */ in SiS_SetGroup1_LVDS()
5928 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 || in SiS_SetGroup1_LVDS()
5929 SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
5932 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,temp); in SiS_SetGroup1_LVDS()
5934 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp); in SiS_SetGroup1_LVDS()
5937 if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0; in SiS_SetGroup1_LVDS()
5938 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,temp); in SiS_SetGroup1_LVDS()
5939 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00); /* Bflml=0 */ in SiS_SetGroup1_LVDS()
5940 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x007,0x00); in SiS_SetGroup1_LVDS()
5942 tempax = SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5943 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 || in SiS_SetGroup1_LVDS()
5944 SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
5947 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,temp); in SiS_SetGroup1_LVDS()
5949 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp); in SiS_SetGroup1_LVDS()
5951 tempeax = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
5952 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 || in SiS_SetGroup1_LVDS()
5953 SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempeax >>= 1; in SiS_SetGroup1_LVDS()
5960 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x45,~0x0FF,temp); in SiS_SetGroup1_LVDS()
5961 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00); /* BDxWadrst0 */ in SiS_SetGroup1_LVDS()
5962 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00); in SiS_SetGroup1_LVDS()
5963 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10); in SiS_SetGroup1_LVDS()
5964 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x040,0x00); in SiS_SetGroup1_LVDS()
5966 tempax = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
5967 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 || in SiS_SetGroup1_LVDS()
5968 SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
5972 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp); in SiS_SetGroup1_LVDS()
5974 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x0F8,temp); in SiS_SetGroup1_LVDS()
5976 …tempax = SiS_Pr->SiS_VDE; /* BDxWadrst1 = BDxWadrst0 + BDxWadroff * V… in SiS_SetGroup1_LVDS()
5977 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 || in SiS_SetGroup1_LVDS()
5978 SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
5982 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp); in SiS_SetGroup1_LVDS()
5984 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp); in SiS_SetGroup1_LVDS()
5986 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp); in SiS_SetGroup1_LVDS()
5988 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x080,temp); in SiS_SetGroup1_LVDS()
5990 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03); in SiS_SetGroup1_LVDS()
5991 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50); in SiS_SetGroup1_LVDS()
5992 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00); in SiS_SetGroup1_LVDS()
5993 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01); in SiS_SetGroup1_LVDS()
5994 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38); in SiS_SetGroup1_LVDS()
5996 if(SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_SetGroup1_LVDS()
5997 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02); in SiS_SetGroup1_LVDS()
5998 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00); in SiS_SetGroup1_LVDS()
5999 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00); in SiS_SetGroup1_LVDS()
6000 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c); in SiS_SetGroup1_LVDS()
6001 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00); in SiS_SetGroup1_LVDS()
6002 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00); in SiS_SetGroup1_LVDS()
6003 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80); in SiS_SetGroup1_LVDS()
6004 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0); in SiS_SetGroup1_LVDS()
6005 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00); in SiS_SetGroup1_LVDS()
6006 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0); in SiS_SetGroup1_LVDS()
6007 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00); in SiS_SetGroup1_LVDS()
6008 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10); in SiS_SetGroup1_LVDS()
6009 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00); in SiS_SetGroup1_LVDS()
6010 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00); in SiS_SetGroup1_LVDS()
6011 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10); in SiS_SetGroup1_LVDS()
6012 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25); in SiS_SetGroup1_LVDS()
6013 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80); in SiS_SetGroup1_LVDS()
6014 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14); in SiS_SetGroup1_LVDS()
6015 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03); in SiS_SetGroup1_LVDS()
6016 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); in SiS_SetGroup1_LVDS()
6024 SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetGroup1() argument
6034 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1()
6035 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex); in SiS_SetGroup1()
6040 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1()
6041 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6042 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1()
6044 CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; in SiS_SetGroup1()
6045 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1()
6046 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1()
6049 SiS_SetCRT2Offset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetGroup1()
6052 (SiS_Pr->SiS_IF_DEF_LVDS == 1) && in SiS_SetGroup1()
6053 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { in SiS_SetGroup1()
6057 SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo, HwInfo); in SiS_SetGroup1()
6061 SiS_SetCRT2FIFO_310(SiS_Pr, HwInfo); in SiS_SetGroup1()
6071 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6072 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6074 temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4; in SiS_SetGroup1()
6075 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6077 temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6078 … SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6080 pushbx = SiS_Pr->SiS_VGAHDE + 12; /* bx BTVGA2HRS 0x0B,0x0C */ in SiS_SetGroup1()
6081 tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2; in SiS_SetGroup1()
6094 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6096 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6099 tempax = SiS_Pr->SiS_VGAHDE >> 1; in SiS_SetGroup1()
6100 tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax; in SiS_SetGroup1()
6101 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup1()
6102 tempcx = SiS_Pr->SiS_HT - tempax; in SiS_SetGroup1()
6107 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6109 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6111 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6112 tempbx = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup1()
6121 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6130 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6132 if((SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || in SiS_SetGroup1()
6133 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetGroup1()
6147 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6149 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6150 tempbx = SiS_Pr->CHSyncStart + bridgeadd; in SiS_SetGroup1()
6151 tempcx = SiS_Pr->CHSyncEnd + bridgeadd; in SiS_SetGroup1()
6152 tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1()
6158 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_SetGroup1()
6160 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6161 cr4 = SiS_Pr->CCRT1CRTC[4]; in SiS_SetGroup1()
6162 cr14 = SiS_Pr->CCRT1CRTC[14]; in SiS_SetGroup1()
6163 cr5 = SiS_Pr->CCRT1CRTC[5]; in SiS_SetGroup1()
6164 cr15 = SiS_Pr->CCRT1CRTC[15]; in SiS_SetGroup1()
6166 cr4 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4]; in SiS_SetGroup1()
6167 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14]; in SiS_SetGroup1()
6168 cr5 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5]; in SiS_SetGroup1()
6169 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15]; in SiS_SetGroup1()
6177 tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1()
6183 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetGroup1()
6190 … SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx); /* CRT2 Horizontal Retrace Start */ in SiS_SetGroup1()
6192 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx); /* CRT2 Horizontal Retrace End */ in SiS_SetGroup1()
6195 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* Overflow */ in SiS_SetGroup1()
6199 tempcx = SiS_Pr->SiS_VGAVT - 1; in SiS_SetGroup1()
6203 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetGroup1()
6205 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6206 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { in SiS_SetGroup1()
6217 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); /* CRT2 Vertical Total */ in SiS_SetGroup1()
6219 tempbx = SiS_Pr->SiS_VGAVDE - 1; in SiS_SetGroup1()
6220 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx); /* CRT2 Vertical Display Enable End */ in SiS_SetGroup1()
6223 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp); /* Overflow */ in SiS_SetGroup1()
6237 …tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x1… in SiS_SetGroup1()
6238 …tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 … in SiS_SetGroup1()
6241 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6242 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6243 tempbx = SiS_Pr->CVSyncStart; in SiS_SetGroup1()
6244 tempcx = SiS_Pr->CVSyncEnd; in SiS_SetGroup1()
6246 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_SetGroup1()
6248 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6249 cr8 = SiS_Pr->CCRT1CRTC[8]; in SiS_SetGroup1()
6250 cr7 = SiS_Pr->CCRT1CRTC[7]; in SiS_SetGroup1()
6251 cr13 = SiS_Pr->CCRT1CRTC[13]; in SiS_SetGroup1()
6252 tempcx = SiS_Pr->CCRT1CRTC[9]; in SiS_SetGroup1()
6254 cr8 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8]; in SiS_SetGroup1()
6255 cr7 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7]; in SiS_SetGroup1()
6256 cr13 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13]; in SiS_SetGroup1()
6257 tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9]; in SiS_SetGroup1()
6265 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx); /* CRT2 Vertical Retrace Start */ in SiS_SetGroup1()
6268 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp); /* CRT2 Vert. Retrace End; Overflow */ in SiS_SetGroup1()
6276 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6280 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) temp = 0x2c; in SiS_SetGroup1()
6281 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6283 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetGroup1()
6284 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6286 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) temp = 0x24; in SiS_SetGroup1()
6287 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) temp = 0x2c; in SiS_SetGroup1()
6288 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x08; in SiS_SetGroup1()
6289 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup1()
6290 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) temp = 0x2c; in SiS_SetGroup1()
6293 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1()
6295 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) in SiS_SetGroup1()
6297 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) in SiS_SetGroup1()
6299 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) in SiS_SetGroup1()
6306 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1()
6307 if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC & 0x3c; in SiS_SetGroup1()
6312 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup1()
6313 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04; in SiS_SetGroup1()
6315 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1()
6320 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1()
6321 if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC & 0x3c; in SiS_SetGroup1()
6325 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Softw… in SiS_SetGroup1()
6335 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetGroup1()
6340 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a; in SiS_SetGroup1()
6343 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6344 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F; in SiS_SetGroup1()
6348 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_SetGroup1()
6351 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetGroup1()
6356 … SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp); /* Panel Link Delay Compensation */ in SiS_SetGroup1()
6364 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); in SiS_SetGroup1()
6372 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6373 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetGroup1()
6375 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex); in SiS_SetGroup1()
6376 } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup1()
6377 SiS_SetGroup1_301(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex); in SiS_SetGroup1()
6381 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex); in SiS_SetGroup1()
6383 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6384 if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1()
6385 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex, HwInfo,RefreshRateTableIndex); in SiS_SetGroup1()
6388 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex, HwInfo,RefreshRateTableIndex); in SiS_SetGroup1()
6400 SiS_GetGroup2CLVXPtr(SiS_Private *SiS_Pr, int tabletype, PSIS_HW_INFO HwInfo) in SiS_GetGroup2CLVXPtr() argument
6405 a = SiS_Pr->SiS_VGAHDE; in SiS_GetGroup2CLVXPtr()
6406 b = SiS_Pr->SiS_HDE; in SiS_GetGroup2CLVXPtr()
6408 a = SiS_Pr->SiS_VGAVDE; in SiS_GetGroup2CLVXPtr()
6409 b = SiS_Pr->SiS_VDE; in SiS_GetGroup2CLVXPtr()
6417 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetGroup2CLVXPtr()
6422 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetGroup2CLVXPtr()
6423 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) tableptr = SiS_Part2CLVX_3; in SiS_GetGroup2CLVXPtr()
6424 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tableptr = SiS_Part2CLVX_3; in SiS_GetGroup2CLVXPtr()
6426 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetGroup2CLVXPtr()
6440 SiS_SetGroup2_C_ELV(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetGroup2_C_ELV() argument
6447 if(!(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV))) return; in SiS_SetGroup2_C_ELV()
6449 tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 0, HwInfo); in SiS_SetGroup2_C_ELV()
6451 SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]); in SiS_SetGroup2_C_ELV()
6453 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2_C_ELV()
6454 tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 1, HwInfo); in SiS_SetGroup2_C_ELV()
6456 SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]); in SiS_SetGroup2_C_ELV()
6460 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04; in SiS_SetGroup2_C_ELV()
6461 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); in SiS_SetGroup2_C_ELV()
6465 SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, in SiS_GetCRT2Part2Ptr() argument
6473 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2Part2Ptr()
6475 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetCRT2Part2Ptr()
6480 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Part2Ptr()
6481 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2Part2Ptr()
6486 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_GetCRT2Part2Ptr()
6487 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Part2Ptr()
6488 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) (*CRT2Index) = 206; in SiS_GetCRT2Part2Ptr()
6497 SiS_Group2LCDSpecial(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT crt2crtc) in SiS_Group2LCDSpecial() argument
6505 if(!SiS_Pr->UseCustomMode) { in SiS_Group2LCDSpecial()
6509 (SiS_Pr->SiS_LCDResInfo == Panel_1024x768) && in SiS_Group2LCDSpecial()
6510 (!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) && in SiS_Group2LCDSpecial()
6511 (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) { in SiS_Group2LCDSpecial()
6513 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9); in SiS_Group2LCDSpecial()
6514 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC); in SiS_Group2LCDSpecial()
6515 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6); in SiS_Group2LCDSpecial()
6518 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B); in SiS_Group2LCDSpecial()
6519 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13); in SiS_Group2LCDSpecial()
6520 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5); in SiS_Group2LCDSpecial()
6521 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08); in SiS_Group2LCDSpecial()
6522 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2); in SiS_Group2LCDSpecial()
6528 if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) { in SiS_Group2LCDSpecial()
6531 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_Group2LCDSpecial()
6532 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_Group2LCDSpecial()
6538 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff); in SiS_Group2LCDSpecial()
6541 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_Group2LCDSpecial()
6542 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_Group2LCDSpecial()
6544 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28); in SiS_Group2LCDSpecial()
6548 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18); in SiS_Group2LCDSpecial()
6549 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]); in SiS_Group2LCDSpecial()
6557 SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SiS_Set300Part2Regs() argument
6566 if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) return; in SiS_Set300Part2Regs()
6567 if(SiS_Pr->UseCustomMode) return; in SiS_Set300Part2Regs()
6570 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_Set300Part2Regs()
6572 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_Set300Part2Regs()
6576 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; in SiS_Set300Part2Regs()
6577 else CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2; in SiS_Set300Part2Regs()
6581 CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; in SiS_Set300Part2Regs()
6585 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_Set300Part2Regs()
6586 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_Set300Part2Regs()
6588 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6591 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6594 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6596 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_Set300Part2Regs()
6597 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_Set300Part2Regs()
6602 SiS_SetTVSpecial(SiS_Private *SiS_Pr, USHORT ModeNo) in SiS_SetTVSpecial() argument
6604 if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) return; in SiS_SetTVSpecial()
6605 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) return; in SiS_SetTVSpecial()
6606 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) return; in SiS_SetTVSpecial()
6608 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetTVSpecial()
6609 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetTVSpecial()
6617 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,specialtv[j]); in SiS_SetTVSpecial()
6619 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72); in SiS_SetTVSpecial()
6620 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750)) { in SiS_SetTVSpecial()
6621 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetTVSpecial()
6622 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); in SiS_SetTVSpecial()
6623 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b); in SiS_SetTVSpecial()
6625 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); /* 15 */ in SiS_SetTVSpecial()
6626 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a); /* 1b */ in SiS_SetTVSpecial()
6633 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 21 */ in SiS_SetTVSpecial()
6634 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 5a */ in SiS_SetTVSpecial()
6636 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a); /* 21 */ in SiS_SetTVSpecial()
6637 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53); /* 5a */ in SiS_SetTVSpecial()
6643 SiS_SetGroup2_Tail(SiS_Private *SiS_Pr, USHORT ModeNo) in SiS_SetGroup2_Tail() argument
6647 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_SetGroup2_Tail()
6648 if(SiS_Pr->SiS_VGAVDE == 525) { in SiS_SetGroup2_Tail()
6650 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2_Tail()
6652 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp += 2; in SiS_SetGroup2_Tail()
6654 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6655 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3); in SiS_SetGroup2_Tail()
6656 } else if(SiS_Pr->SiS_VGAVDE == 420) { in SiS_SetGroup2_Tail()
6658 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2_Tail()
6660 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp++; in SiS_SetGroup2_Tail()
6662 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6666 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup2_Tail()
6667 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { in SiS_SetGroup2_Tail()
6668 if(SiS_Pr->SiS_VBType & VB_SIS301B302B) { in SiS_SetGroup2_Tail()
6669 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03); in SiS_SetGroup2_Tail()
6674 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp); in SiS_SetGroup2_Tail()
6678 if((SiS_Pr->SiS_PanelXRes == 1280) && (SiS_Pr->SiS_PanelYRes == 768)) { in SiS_SetGroup2_Tail()
6679 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { in SiS_SetGroup2_Tail()
6680 if(((SiS_Pr->SiS_HDE == 640) && (SiS_Pr->SiS_VDE == 480)) || in SiS_SetGroup2_Tail()
6681 ((SiS_Pr->SiS_HDE == 320) && (SiS_Pr->SiS_VDE == 240))) { in SiS_SetGroup2_Tail()
6702 SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT RefreshRateTableIndex, in SiS_SetGroup2() argument
6714 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup2()
6718 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup2()
6719 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup2()
6720 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
6721 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup2()
6724 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup2()
6725 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetGroup2()
6729 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08; in SiS_SetGroup2()
6730 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04; in SiS_SetGroup2()
6731 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) temp |= 0x02; in SiS_SetGroup2()
6732 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp |= 0x01; in SiS_SetGroup2()
6734 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) temp |= 0x10; in SiS_SetGroup2()
6736 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp); in SiS_SetGroup2()
6738 PhasePoint = SiS_Pr->SiS_PALPhase; in SiS_SetGroup2()
6739 TimingPoint = SiS_Pr->SiS_PALTiming; in SiS_SetGroup2()
6741 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
6743 TimingPoint = SiS_Pr->SiS_HiTVExtTiming; in SiS_SetGroup2()
6744 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
6745 TimingPoint = SiS_Pr->SiS_HiTVSt2Timing; in SiS_SetGroup2()
6746 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup2()
6747 TimingPoint = SiS_Pr->SiS_HiTVSt1Timing; in SiS_SetGroup2()
6749 if(!(modeflag & Charx8Dot)) TimingPoint = SiS_Pr->SiS_HiTVTextTiming; in SiS_SetGroup2()
6754 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
6756 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) TimingPoint = &SiS_YPbPrTable[2][0]; in SiS_SetGroup2()
6757 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) TimingPoint = &SiS_YPbPrTable[1][0]; in SiS_SetGroup2()
6760 PhasePoint = SiS_Pr->SiS_NTSCPhase; in SiS_SetGroup2()
6762 } else if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
6764 if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && in SiS_SetGroup2()
6765 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in SiS_SetGroup2()
6766 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { in SiS_SetGroup2()
6767 PhasePoint = SiS_Pr->SiS_PALPhase2; in SiS_SetGroup2()
6772 TimingPoint = SiS_Pr->SiS_NTSCTiming; in SiS_SetGroup2()
6773 PhasePoint = SiS_Pr->SiS_NTSCPhase; in SiS_SetGroup2()
6774 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetGroup2()
6775 PhasePoint = SiS_Pr->SiS_PALPhase; in SiS_SetGroup2()
6778 if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && in SiS_SetGroup2()
6779 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in SiS_SetGroup2()
6780 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { in SiS_SetGroup2()
6781 PhasePoint = SiS_Pr->SiS_NTSCPhase2; in SiS_SetGroup2()
6782 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetGroup2()
6783 PhasePoint = SiS_Pr->SiS_PALPhase2; in SiS_SetGroup2()
6789 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
6790 PhasePoint = SiS_Pr->SiS_PALMPhase; in SiS_SetGroup2()
6791 if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && in SiS_SetGroup2()
6792 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in SiS_SetGroup2()
6793 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { in SiS_SetGroup2()
6794 PhasePoint = SiS_Pr->SiS_PALMPhase2; in SiS_SetGroup2()
6798 if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_SetGroup2()
6799 PhasePoint = SiS_Pr->SiS_PALNPhase; in SiS_SetGroup2()
6800 if( (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && in SiS_SetGroup2()
6801 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in SiS_SetGroup2()
6802 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { in SiS_SetGroup2()
6803 PhasePoint = SiS_Pr->SiS_PALNPhase2; in SiS_SetGroup2()
6807 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetGroup2()
6808 PhasePoint = SiS_Pr->SiS_SpecialPhase; in SiS_SetGroup2()
6809 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
6810 PhasePoint = SiS_Pr->SiS_SpecialPhaseM; in SiS_SetGroup2()
6811 } else if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetGroup2()
6812 PhasePoint = SiS_Pr->SiS_SpecialPhaseJ; in SiS_SetGroup2()
6817 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,PhasePoint[j]); in SiS_SetGroup2()
6821 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
6824 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
6827 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2()
6828 if(SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetGroup2()
6829 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F); in SiS_SetGroup2()
6833 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode); in SiS_SetGroup2()
6835 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE); in SiS_SetGroup2()
6836 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE); in SiS_SetGroup2()
6837 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE); in SiS_SetGroup2()
6838 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE); in SiS_SetGroup2()
6840 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempax = 950; in SiS_SetGroup2()
6841 else if(SiS_Pr->SiS_TVMode & TVSetPAL) tempax = 520; in SiS_SetGroup2()
6844 if( ( (!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) && (SiS_Pr->SiS_VDE <= tempax) ) || in SiS_SetGroup2()
6845 ( (SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) && in SiS_SetGroup2()
6846 ((SiS_Pr->SiS_VGAHDE == 1024) || (SiS_Pr->SiS_VDE <= tempax)) ) ) { in SiS_SetGroup2()
6848 tempax -= SiS_Pr->SiS_VDE; in SiS_SetGroup2()
6853 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
6856 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
6858 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) { in SiS_SetGroup2()
6859 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
6860 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 19 */ in SiS_SetGroup2()
6861 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 52 */ in SiS_SetGroup2()
6863 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17); in SiS_SetGroup2()
6864 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d); in SiS_SetGroup2()
6870 tempcx = SiS_Pr->SiS_HT; in SiS_SetGroup2()
6871 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1; in SiS_SetGroup2()
6873 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) tempcx--; in SiS_SetGroup2()
6874 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx); in SiS_SetGroup2()
6875 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f)); in SiS_SetGroup2()
6877 tempcx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup2()
6878 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1; in SiS_SetGroup2()
6880 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; in SiS_SetGroup2()
6881 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
6885 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx); in SiS_SetGroup2()
6886 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
6889 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
6893 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0)); in SiS_SetGroup2()
6897 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx); in SiS_SetGroup2()
6898 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0)); in SiS_SetGroup2()
6901 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; in SiS_SetGroup2()
6902 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
6904 tempcx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup2()
6905 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1; in SiS_SetGroup2()
6908 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
6911 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup2()
6912 tempcx = SiS_GetVGAHT2(SiS_Pr) - 1; in SiS_SetGroup2()
6914 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx); in SiS_SetGroup2()
6916 tempbx = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
6917 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup2()
6918 if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746; in SiS_SetGroup2()
6919 if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746; in SiS_SetGroup2()
6920 if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853; in SiS_SetGroup2()
6921 } else if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && in SiS_SetGroup2()
6922 (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p))) ) { in SiS_SetGroup2()
6925 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup2()
6927 } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
6928 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2()
6933 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
6934 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
6937 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetGroup2()
6943 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx); in SiS_SetGroup2()
6947 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { in SiS_SetGroup2()
6949 if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20; in SiS_SetGroup2()
6951 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp); in SiS_SetGroup2()
6953 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) { in SiS_SetGroup2()
6954 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5)); in SiS_SetGroup2()
6959 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
6961 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
6964 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
6969 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetGroup2()
6970 tempbx = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
6971 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && in SiS_SetGroup2()
6972 (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) ) { in SiS_SetGroup2()
6977 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp); in SiS_SetGroup2()
6978 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx); in SiS_SetGroup2()
6980 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) { in SiS_SetGroup2()
6981 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4)); in SiS_SetGroup2()
6987 if(SiS_Pr->SiS_VGAHDE >= SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
6994 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2()
6995 if(SiS_Pr->SiS_VGAHDE >= 1024) { in SiS_SetGroup2()
6999 if(SiS_Pr->SiS_VGAHDE >= 1280) { in SiS_SetGroup2()
7009 longtemp = ((SiS_Pr->SiS_VGAHDE * tempch) / tempcl) << 13; in SiS_SetGroup2()
7010 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) longtemp <<= 3; in SiS_SetGroup2()
7011 tempax = longtemp / SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7012 if(longtemp % SiS_Pr->SiS_HDE) tempax++; in SiS_SetGroup2()
7017 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax); in SiS_SetGroup2()
7018 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx); in SiS_SetGroup2()
7020 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetGroup2()
7024 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,tempcx); in SiS_SetGroup2()
7026 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
7033 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx); in SiS_SetGroup2()
7034 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx); in SiS_SetGroup2()
7037 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
7039 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp |= 0x20; in SiS_SetGroup2()
7040 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40; in SiS_SetGroup2()
7042 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp); in SiS_SetGroup2()
7044 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); in SiS_SetGroup2()
7045 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3)); in SiS_SetGroup2()
7047 SiS_SetTVSpecial(SiS_Pr, ModeNo); in SiS_SetGroup2()
7049 if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SiS_SetGroup2()
7051 if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; in SiS_SetGroup2()
7052 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp); in SiS_SetGroup2()
7057 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
7058 if(!(SiS_Pr->SiS_TVMode & TVSetNTSC1024)) { in SiS_SetGroup2()
7059 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_SetGroup2()
7060 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1)); in SiS_SetGroup2()
7062 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF); in SiS_SetGroup2()
7065 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7066 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup2()
7067 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00); in SiS_SetGroup2()
7071 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) return; in SiS_SetGroup2()
7075 tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7076 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1; in SiS_SetGroup2()
7078 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx); in SiS_SetGroup2()
7079 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7082 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetGroup2()
7083 if(SiS_Pr->SiS_ModeType == ModeEGA) { in SiS_SetGroup2()
7084 if(SiS_Pr->SiS_VGAHDE >= 1024) { in SiS_SetGroup2()
7087 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_SetGroup2()
7094 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp); in SiS_SetGroup2()
7096 tempbx = SiS_Pr->SiS_VDE - 1; in SiS_SetGroup2()
7097 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx); in SiS_SetGroup2()
7098 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07)); in SiS_SetGroup2()
7100 tempcx = SiS_Pr->SiS_VT - 1; in SiS_SetGroup2()
7101 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx); in SiS_SetGroup2()
7103 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup2()
7105 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { in SiS_SetGroup2()
7109 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp); in SiS_SetGroup2()
7111 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0); in SiS_SetGroup2()
7112 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0); in SiS_SetGroup2()
7114 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); in SiS_SetGroup2()
7115 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); in SiS_SetGroup2()
7118 if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_SetGroup2()
7121 case 200: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; break; in SiS_SetGroup2()
7123 default: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_3; break; in SiS_SetGroup2()
7126 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_SetGroup2()
7127 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_SetGroup2()
7129 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7132 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7135 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7137 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_SetGroup2()
7138 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_SetGroup2()
7140 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); in SiS_SetGroup2()
7151 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7152 if((SiS_Pr->SiS_LCDInfo & LCDPass11) || (SiS_Pr->PanelYRes == SiS_Pr->SiS_VDE)) { in SiS_SetGroup2()
7153 tempbx = SiS_Pr->SiS_VDE - 1; in SiS_SetGroup2()
7154 tempcx = SiS_Pr->SiS_VT - 1; in SiS_SetGroup2()
7156 tempbx = SiS_Pr->SiS_VDE + ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); in SiS_SetGroup2()
7157 tempcx = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); in SiS_SetGroup2()
7160 tempbx = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7161 tempcx = SiS_Pr->SiS_VT; in SiS_SetGroup2()
7163 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7164 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7166 if(SiS_Pr->PanelYRes < SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7169 tempax -= SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7183 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ in SiS_SetGroup2()
7184 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ in SiS_SetGroup2()
7188 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7190 tempax = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7191 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7192 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7194 tempcx = (SiS_Pr->SiS_VT - tempax) >> 4; in SiS_SetGroup2()
7195 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7196 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7197 tempcx = (SiS_Pr->SiS_VT - tempax) / 10; in SiS_SetGroup2()
7201 tempbx = ((SiS_Pr->SiS_VT + SiS_Pr->SiS_VDE) >> 1) - 1; in SiS_SetGroup2()
7202 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7203 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7204 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { /* ? */ in SiS_SetGroup2()
7205 tempax = SiS_Pr->SiS_VT - SiS_Pr->PanelYRes; in SiS_SetGroup2()
7211 if(tempbx <= SiS_Pr->SiS_VDE) tempbx = SiS_Pr->SiS_VDE + 1; in SiS_SetGroup2()
7215 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup2()
7217 if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (crt2crtc == 6)) { in SiS_SetGroup2()
7218 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_SetGroup2()
7227 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7228 tempbx = SiS_Pr->CVSyncStart; in SiS_SetGroup2()
7235 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ in SiS_SetGroup2()
7241 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7243 temp |= (SiS_Pr->CVSyncEnd & 0x0f); in SiS_SetGroup2()
7250 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7253 SiS_Group2LCDSpecial(SiS_Pr, HwInfo, ModeNo, crt2crtc); in SiS_SetGroup2()
7257 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) bridgeoffset += 2; in SiS_SetGroup2()
7258 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) bridgeoffset++; in SiS_SetGroup2()
7259 if(SiS_IsDualLink(SiS_Pr, HwInfo)) bridgeoffset++; in SiS_SetGroup2()
7262 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7263 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7264 temp = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); in SiS_SetGroup2()
7265 if(SiS_IsDualLink(SiS_Pr, HwInfo)) temp >>= 1; in SiS_SetGroup2()
7269 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp); /* lcdhdes */ in SiS_SetGroup2()
7270 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0)); in SiS_SetGroup2()
7272 tempcx = SiS_Pr->SiS_HT; in SiS_SetGroup2()
7273 tempax = tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7274 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7275 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7276 tempax = SiS_Pr->PanelXRes; in SiS_SetGroup2()
7277 tempbx = SiS_Pr->PanelXRes - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); in SiS_SetGroup2()
7280 if(SiS_IsDualLink(SiS_Pr, HwInfo)) { in SiS_SetGroup2()
7292 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ in SiS_SetGroup2()
7293 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f)); in SiS_SetGroup2()
7300 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetGroup2()
7301 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7302 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetGroup2()
7303 if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47; in SiS_SetGroup2()
7308 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7309 tempbx = SiS_Pr->CHSyncStart; in SiS_SetGroup2()
7310 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1; in SiS_SetGroup2()
7318 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ in SiS_SetGroup2()
7319 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7324 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7325 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) tempcx >>= 2; in SiS_SetGroup2()
7329 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7330 tempbx = SiS_Pr->CHSyncEnd; in SiS_SetGroup2()
7331 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1; in SiS_SetGroup2()
7339 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ in SiS_SetGroup2()
7341 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); in SiS_SetGroup2()
7344 SiS_Set300Part2Regs(SiS_Pr, HwInfo, ModeIdIndex, RefreshRateTableIndex, ModeNo); in SiS_SetGroup2()
7356 SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetGroup3() argument
7362 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup3()
7365 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00); in SiS_SetGroup3()
7370 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup3()
7371 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7372 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7374 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5); in SiS_SetGroup3()
7375 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7); in SiS_SetGroup3()
7378 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup3()
7379 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7380 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7381 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8); in SiS_SetGroup3()
7385 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup3()
7386 tempdi = SiS_Pr->SiS_HiTVGroup3Data; in SiS_SetGroup3()
7387 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup3()
7388 tempdi = SiS_Pr->SiS_HiTVGroup3Simu; in SiS_SetGroup3()
7390 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup3()
7391 if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) { in SiS_SetGroup3()
7393 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempdi = SiS_HiTVGroup3_2; in SiS_SetGroup3()
7398 SiS_SetReg(SiS_Pr->SiS_Part3Port,i,tempdi[i]); in SiS_SetGroup3()
7400 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) { in SiS_SetGroup3()
7401 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_SetGroup3()
7402 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f); in SiS_SetGroup3()
7418 SiS_ShiftXPos(SiS_Private *SiS_Pr, int shift) in SiS_ShiftXPos() argument
7422 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f); in SiS_ShiftXPos()
7423 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20); in SiS_ShiftXPos()
7425 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp); in SiS_ShiftXPos()
7426 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0)); in SiS_ShiftXPos()
7427 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f; in SiS_ShiftXPos()
7429 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f)); in SiS_ShiftXPos()
7430 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); in SiS_ShiftXPos()
7431 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42); in SiS_ShiftXPos()
7433 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp); in SiS_ShiftXPos()
7434 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0)); in SiS_ShiftXPos()
7438 SiS_SetGroup4_C_ELV(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SiS_SetGroup4_C_ELV() argument
7443 if(!(SiS_Pr->SiS_VBType & VB_SIS301C)) return; in SiS_SetGroup4_C_ELV()
7444 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) return; in SiS_SetGroup4_C_ELV()
7447 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup4_C_ELV()
7450 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08); in SiS_SetGroup4_C_ELV()
7451 temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a); in SiS_SetGroup4_C_ELV()
7453 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf); in SiS_SetGroup4_C_ELV()
7454 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc); in SiS_SetGroup4_C_ELV()
7456 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8); in SiS_SetGroup4_C_ELV()
7458 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb); in SiS_SetGroup4_C_ELV()
7459 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp = 0x0000; in SiS_SetGroup4_C_ELV()
7460 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp = 0x0002; in SiS_SetGroup4_C_ELV()
7461 else if(SiS_Pr->SiS_TVMode & TVSetHiVision) temp = 0x0400; in SiS_SetGroup4_C_ELV()
7465 if(SiS_Pr->SiS_TVMode & TVAspect43) temp1 = 4; in SiS_SetGroup4_C_ELV()
7466 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1); in SiS_SetGroup4_C_ELV()
7467 if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7468 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7470 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03; in SiS_SetGroup4_C_ELV()
7473 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7475 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7478 if(SiS_Pr->SiS_TVMode & TVAspect43) { in SiS_SetGroup4_C_ELV()
7479 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_SetGroup4_C_ELV()
7481 SiS_ShiftXPos(SiS_Pr, 97); in SiS_SetGroup4_C_ELV()
7483 SiS_ShiftXPos(SiS_Pr, 111); in SiS_SetGroup4_C_ELV()
7485 } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { in SiS_SetGroup4_C_ELV()
7486 SiS_ShiftXPos(SiS_Pr, 136); in SiS_SetGroup4_C_ELV()
7495 SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetCRT2VCLK() argument
7501 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2VCLK()
7502 reg1 = SiS_Pr->CSR2B; in SiS_SetCRT2VCLK()
7503 reg2 = SiS_Pr->CSR2C; in SiS_SetCRT2VCLK()
7505 vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_SetCRT2VCLK()
7507 reg1 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A; in SiS_SetCRT2VCLK()
7508 reg2 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B; in SiS_SetCRT2VCLK()
7511 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetCRT2VCLK()
7512 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetCRT2VCLK()
7513 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57); in SiS_SetCRT2VCLK()
7514 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46); in SiS_SetCRT2VCLK()
7515 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6); in SiS_SetCRT2VCLK()
7517 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7518 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7521 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01); in SiS_SetCRT2VCLK()
7522 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7523 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7525 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00); in SiS_SetCRT2VCLK()
7527 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20; in SiS_SetCRT2VCLK()
7528 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp); in SiS_SetCRT2VCLK()
7532 SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetGroup4() argument
7539 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup4()
7540 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup4()
7541 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup4()
7542 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup4()
7545 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup4()
7546 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup4()
7550 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_SetGroup4()
7551 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup4()
7552 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7557 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV)) { in SiS_SetGroup4()
7558 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7559 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f); in SiS_SetGroup4()
7564 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup4()
7565 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_SetGroup4()
7566 if(SiS_IsDualLink(SiS_Pr, HwInfo)) { in SiS_SetGroup4()
7567 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); in SiS_SetGroup4()
7570 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_SetGroup4()
7571 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_SetGroup4()
7572 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_SetGroup4()
7573 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_SetGroup4()
7581 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT); in SiS_SetGroup4()
7583 tempbx = SiS_Pr->SiS_RVBHCMAX; in SiS_SetGroup4()
7584 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx); in SiS_SetGroup4()
7588 tempcx = SiS_Pr->SiS_VGAHT - 1; in SiS_SetGroup4()
7589 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx); in SiS_SetGroup4()
7593 tempcx = SiS_Pr->SiS_VGAVT - 1; in SiS_SetGroup4()
7594 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempcx -= 5; in SiS_SetGroup4()
7595 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx); in SiS_SetGroup4()
7598 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp); in SiS_SetGroup4()
7600 tempbx = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup4()
7602 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1; in SiS_SetGroup4()
7604 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7607 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup4()
7611 } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetGroup4()
7620 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetGroup4()
7621 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) temp |= 0x0A; in SiS_SetGroup4()
7624 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp); in SiS_SetGroup4()
7626 tempeax = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup4()
7627 tempebx = SiS_Pr->SiS_VDE; in SiS_SetGroup4()
7628 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup4()
7632 tempcx = SiS_Pr->SiS_RVBHRS; in SiS_SetGroup4()
7633 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx); in SiS_SetGroup4()
7649 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp); in SiS_SetGroup4()
7651 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp); in SiS_SetGroup4()
7654 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp); in SiS_SetGroup4()
7656 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SiS_SetGroup4()
7658 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28); in SiS_SetGroup4()
7662 if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08; in SiS_SetGroup4()
7663 tempax = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup4()
7665 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempax >>= 1; in SiS_SetGroup4()
7667 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7677 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) || in SiS_SetGroup4()
7678 (SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) { in SiS_SetGroup4()
7688 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax); in SiS_SetGroup4()
7689 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp); in SiS_SetGroup4()
7692 if((IS_SIS550650740660) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in SiS_SetGroup4()
7695 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7696 … if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr525p))) { in SiS_SetGroup4()
7698 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup4()
7699 if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in SiS_SetGroup4()
7705 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp); in SiS_SetGroup4()
7707 tempbx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup4()
7708 if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1; in SiS_SetGroup4()
7710 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx); in SiS_SetGroup4()
7712 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp); in SiS_SetGroup4()
7714 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SiS_SetGroup4()
7715 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7716 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7720 if(SiS_IsDualLink(SiS_Pr, HwInfo)) { in SiS_SetGroup4()
7721 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); in SiS_SetGroup4()
7725 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_SetGroup4()
7726 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_SetGroup4()
7727 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_SetGroup4()
7728 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_SetGroup4()
7735 SiS_SetCRT2VCLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetGroup4()
7743 SiS_SetGroup5(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetGroup5() argument
7747 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup5()
7749 if(SiS_Pr->SiS_ModeType == ModeVGA) { in SiS_SetGroup5()
7750 if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))) { in SiS_SetGroup5()
7751 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_SetGroup5()
7752 SiS_LoadDAC(SiS_Pr, HwInfo, ModeNo, ModeIdIndex); in SiS_SetGroup5()
7762 SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_ModCRT1CRTC() argument
7769 if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_ModCRT1CRTC()
7770 else modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_ModCRT1CRTC()
7772 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_ModCRT1CRTC()
7773 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_ModCRT1CRTC()
7774 (SiS_Pr->SiS_CustomT == CUT_PANEL848)) in SiS_ModCRT1CRTC()
7777 if(!(SiS_GetLVDSCRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_ModCRT1CRTC()
7783 if(SiS_Pr->SiS_SetFlag & SetDOSMode) return; in SiS_ModCRT1CRTC()
7787 case 0 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1; break; in SiS_ModCRT1CRTC()
7788 case 1 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1_H; break; in SiS_ModCRT1CRTC()
7789 case 2 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2; break; in SiS_ModCRT1CRTC()
7790 case 3 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2_H; break; in SiS_ModCRT1CRTC()
7791 case 4 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1; break; in SiS_ModCRT1CRTC()
7792 case 5 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1_H; break; in SiS_ModCRT1CRTC()
7793 case 6 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2; break; in SiS_ModCRT1CRTC()
7794 case 7 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2_H; break; in SiS_ModCRT1CRTC()
7795 case 8 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1; break; in SiS_ModCRT1CRTC()
7796 case 9 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1_H; break; in SiS_ModCRT1CRTC()
7797 case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2; break; in SiS_ModCRT1CRTC()
7798 case 11: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2_H; break; in SiS_ModCRT1CRTC()
7799 case 12: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1XXXxXXX_1; break; in SiS_ModCRT1CRTC()
7800 case 13: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H; break; in SiS_ModCRT1CRTC()
7801 case 14: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_1; break; in SiS_ModCRT1CRTC()
7802 case 15: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_1_H; break; in SiS_ModCRT1CRTC()
7803 case 16: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_2; break; in SiS_ModCRT1CRTC()
7804 case 17: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11400x1050_2_H; break; in SiS_ModCRT1CRTC()
7805 case 18: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UNTSC; break; in SiS_ModCRT1CRTC()
7806 case 19: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1ONTSC; break; in SiS_ModCRT1CRTC()
7807 case 20: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UPAL; break; in SiS_ModCRT1CRTC()
7808 case 21: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1OPAL; break; in SiS_ModCRT1CRTC()
7809 case 22: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x480_1; break; /* FSTN */ in SiS_ModCRT1CRTC()
7810 case 23: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1; break; in SiS_ModCRT1CRTC()
7811 case 24: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1_H; break; in SiS_ModCRT1CRTC()
7812 case 25: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2; break; in SiS_ModCRT1CRTC()
7813 case 26: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2_H; break; in SiS_ModCRT1CRTC()
7814 case 27: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_1; break; in SiS_ModCRT1CRTC()
7815 case 28: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_1_H; break; in SiS_ModCRT1CRTC()
7816 case 29: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_2; break; in SiS_ModCRT1CRTC()
7817 case 30: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11152x768_2_H; break; in SiS_ModCRT1CRTC()
7818 case 36: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_1; break; in SiS_ModCRT1CRTC()
7819 case 37: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_1_H; break; in SiS_ModCRT1CRTC()
7820 case 38: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_2; break; in SiS_ModCRT1CRTC()
7821 case 39: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11600x1200_2_H; break; in SiS_ModCRT1CRTC()
7822 case 40: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_1; break; in SiS_ModCRT1CRTC()
7823 case 41: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_1_H; break; in SiS_ModCRT1CRTC()
7824 case 42: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_2; break; in SiS_ModCRT1CRTC()
7825 case 43: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x768_2_H; break; in SiS_ModCRT1CRTC()
7826 case 50: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1; break; in SiS_ModCRT1CRTC()
7827 case 51: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1_H; break; in SiS_ModCRT1CRTC()
7828 case 52: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_2; break; in SiS_ModCRT1CRTC()
7829 case 53: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_2_H; break; in SiS_ModCRT1CRTC()
7830 case 54: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_3; break; in SiS_ModCRT1CRTC()
7831 case 55: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_3_H; break; in SiS_ModCRT1CRTC()
7832 case 99: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1SOPAL; break; in SiS_ModCRT1CRTC()
7833 default: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1; break; in SiS_ModCRT1CRTC()
7836 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_ModCRT1CRTC()
7839 SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,tempah); in SiS_ModCRT1CRTC()
7843 SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah); in SiS_ModCRT1CRTC()
7847 SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah); in SiS_ModCRT1CRTC()
7851 SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah); in SiS_ModCRT1CRTC()
7855 SiS_SetReg(SiS_Pr->SiS_P3d4,i,tempah); in SiS_ModCRT1CRTC()
7859 SiS_SetReg(SiS_Pr->SiS_P3c4,i,tempah); in SiS_ModCRT1CRTC()
7864 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah); in SiS_ModCRT1CRTC()
7870 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah); in SiS_ModCRT1CRTC()
7878 SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetCRT2ECLK() argument
7885 if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) || (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetCRT2ECLK()
7886 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT2ECLK()
7887 if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK & 0x3f) == 2) { in SiS_SetCRT2ECLK()
7890 vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, in SiS_SetCRT2ECLK()
7892 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2ECLK()
7894 vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, in SiS_SetCRT2ECLK()
7898 sr2b = SiS_Pr->SiS_VCLKData[vclkindex].SR2B; in SiS_SetCRT2ECLK()
7899 sr2c = SiS_Pr->SiS_VCLKData[vclkindex].SR2C; in SiS_SetCRT2ECLK()
7901 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2ECLK()
7902 if(SiS_Pr->SiS_UseROM) { in SiS_SetCRT2ECLK()
7911 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ECLK()
7912 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ECLK()
7917 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20); in SiS_SetCRT2ECLK()
7918 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
7919 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
7920 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10); in SiS_SetCRT2ECLK()
7921 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
7922 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
7923 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00); in SiS_SetCRT2ECLK()
7924 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
7925 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
7933 SiS_SetCHTVReg(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_SetCHTVReg() argument
7941 tempcl = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetCHTVReg()
7943 tempcl = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetCHTVReg()
7946 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
7947 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetCHTVReg()
7949 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetCHTVReg()
7950 if(SiS_Pr->SiS_CHSOverScan) TVType = 8; in SiS_SetCHTVReg()
7952 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetCHTVReg()
7954 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
7955 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_SetCHTVReg()
7957 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
7961 case 0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break; in SiS_SetCHTVReg()
7962 case 1: CHTVRegData = SiS_Pr->SiS_CHTVReg_ONTSC; break; in SiS_SetCHTVReg()
7963 case 2: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPAL; break; in SiS_SetCHTVReg()
7964 case 3: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; in SiS_SetCHTVReg()
7965 case 4: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALM; break; in SiS_SetCHTVReg()
7966 case 5: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALM; break; in SiS_SetCHTVReg()
7967 case 6: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALN; break; in SiS_SetCHTVReg()
7968 case 7: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALN; break; in SiS_SetCHTVReg()
7969 case 8: CHTVRegData = SiS_Pr->SiS_CHTVReg_SOPAL; break; in SiS_SetCHTVReg()
7970 default: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; in SiS_SetCHTVReg()
7974 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetCHTVReg()
7983 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetCHTVReg()
7984 SiS_SetCH700x(SiS_Pr,0x4304); /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
7985 SiS_SetCH700x(SiS_Pr,0x6909); /* Black level for PAL (105)*/ in SiS_SetCHTVReg()
7987 SiS_SetCH700x(SiS_Pr,0x0304); /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
7988 SiS_SetCH700x(SiS_Pr,0x7109); /* Black level for NTSC (113)*/ in SiS_SetCHTVReg()
7993 SiS_SetCH700x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
7996 SiS_SetCH700x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
7999 SiS_SetCH700x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8002 SiS_SetCH700x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8005 SiS_SetCH700x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8012 SiS_SetCH700x(SiS_Pr,0x2801); in SiS_SetCHTVReg()
8021 SiS_SetCH700x(SiS_Pr,0xb103); /* old: 3103 */ in SiS_SetCHTVReg()
8027 SiS_SetCH70xx(SiS_Pr,0x003D); in SiS_SetCHTVReg()
8033 SiS_SetCH70xxANDOR(SiS_Pr,0x0010,0x1F); in SiS_SetCHTVReg()
8038 SiS_SetCH70xxANDOR(SiS_Pr,0x0211,0xF8); in SiS_SetCHTVReg()
8042 SiS_SetCH70xxANDOR(SiS_Pr,0x001C,0xEF); in SiS_SetCHTVReg()
8044 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { /* ---- NTSC ---- */ in SiS_SetCHTVReg()
8045 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) { in SiS_SetCHTVReg()
8047 SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8048 SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE); /* ACIV on, no need to set FSCI */ in SiS_SetCHTVReg()
8050 SiS_SetCH70xxANDOR(SiS_Pr,0x0118,0xF0); /* 0x18-0x1f: FSCI 469,762,048 */ in SiS_SetCHTVReg()
8051 SiS_SetCH70xxANDOR(SiS_Pr,0x0C19,0xF0); in SiS_SetCHTVReg()
8052 SiS_SetCH70xxANDOR(SiS_Pr,0x001A,0xF0); in SiS_SetCHTVReg()
8053 SiS_SetCH70xxANDOR(SiS_Pr,0x001B,0xF0); in SiS_SetCHTVReg()
8054 SiS_SetCH70xxANDOR(SiS_Pr,0x001C,0xF0); in SiS_SetCHTVReg()
8055 SiS_SetCH70xxANDOR(SiS_Pr,0x001D,0xF0); in SiS_SetCHTVReg()
8056 SiS_SetCH70xxANDOR(SiS_Pr,0x001E,0xF0); in SiS_SetCHTVReg()
8057 SiS_SetCH70xxANDOR(SiS_Pr,0x001F,0xF0); in SiS_SetCHTVReg()
8058 SiS_SetCH70xxANDOR(SiS_Pr,0x0120,0xEF); /* Loop filter on for mode 23 */ in SiS_SetCHTVReg()
8059 SiS_SetCH70xxANDOR(SiS_Pr,0x0021,0xFE); /* ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8063 SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8064 SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE); in SiS_SetCHTVReg()
8067 … SiS_SetCH70xxANDOR(SiS_Pr,0x0118,0xF0); /* (FSCI was 0x1f1c71c7 - this is for mode 22) */ in SiS_SetCHTVReg()
8068 SiS_SetCH70xxANDOR(SiS_Pr,0x0919,0xF0); /* FSCI for mode 24 is 428,554,851 */ in SiS_SetCHTVReg()
8069 SiS_SetCH70xxANDOR(SiS_Pr,0x081A,0xF0); /* 198b3a63 */ in SiS_SetCHTVReg()
8070 SiS_SetCH70xxANDOR(SiS_Pr,0x0b1B,0xF0); in SiS_SetCHTVReg()
8071 SiS_SetCH70xxANDOR(SiS_Pr,0x041C,0xF0); in SiS_SetCHTVReg()
8072 SiS_SetCH70xxANDOR(SiS_Pr,0x011D,0xF0); in SiS_SetCHTVReg()
8073 SiS_SetCH70xxANDOR(SiS_Pr,0x061E,0xF0); in SiS_SetCHTVReg()
8074 SiS_SetCH70xxANDOR(SiS_Pr,0x051F,0xF0); in SiS_SetCHTVReg()
8075 SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); /* loop filter off for mode 24 */ in SiS_SetCHTVReg()
8076 SiS_SetCH70xxANDOR(SiS_Pr,0x0021,0xFE); /* ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8078 SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8079 SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE); in SiS_SetCHTVReg()
8085 SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8086 SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE); /* ACIV on */ in SiS_SetCHTVReg()
8088 SiS_SetCH70xxANDOR(SiS_Pr,0x0020,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8089 SiS_SetCH70xxANDOR(SiS_Pr,0x0121,0xFE); /* ACIV on */ in SiS_SetCHTVReg()
8105 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetCHTVReg()
8109 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8113 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8117 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8121 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8125 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8129 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8133 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8136 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetCHTVReg()
8140 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8144 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8148 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8152 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8156 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8160 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8164 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8168 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8172 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCHTVReg()
8174 temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02; in SiS_SetCHTVReg()
8181 if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02; in SiS_SetCHTVReg()
8182 SiS_SetCH701x(SiS_Pr,((temp << 8) | 0x21)); in SiS_SetCHTVReg()
8195 SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_Chrontel701xBLOn() argument
8200 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xBLOn()
8202 SiS_SetCH701x(SiS_Pr,0x6566); in SiS_Chrontel701xBLOn()
8204 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOn()
8206 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66); in SiS_Chrontel701xBLOn()
8212 SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr) in SiS_Chrontel701xBLOff() argument
8217 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xBLOff()
8218 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOff()
8220 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66); in SiS_Chrontel701xBLOff()
8227 SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_ChrontelPowerSequencing() argument
8242 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_ChrontelPowerSequencing()
8243 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1024_740; in SiS_ChrontelPowerSequencing()
8245 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_ChrontelPowerSequencing()
8246 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_ChrontelPowerSequencing()
8247 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { in SiS_ChrontelPowerSequencing()
8248 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1400_740; in SiS_ChrontelPowerSequencing()
8252 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_ChrontelPowerSequencing()
8254 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_ChrontelPowerSequencing()
8255 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_ChrontelPowerSequencing()
8256 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { in SiS_ChrontelPowerSequencing()
8262 SiS_SetCH701x(SiS_Pr,(tableptr[i] << 8) | regtable[i]); in SiS_ChrontelPowerSequencing()
8267 SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_SetCH701xForLCD() argument
8292 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_740; in SiS_SetCH701xForLCD()
8293 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_740; in SiS_SetCH701xForLCD()
8294 else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_740; in SiS_SetCH701xForLCD()
8295 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_740; in SiS_SetCH701xForLCD()
8298 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_650; in SiS_SetCH701xForLCD()
8299 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_650; in SiS_SetCH701xForLCD()
8300 else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_650; in SiS_SetCH701xForLCD()
8301 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_650; in SiS_SetCH701xForLCD()
8305 tempbh = SiS_GetCH701x(SiS_Pr,0x74); in SiS_SetCH701xForLCD()
8307 tempbh = SiS_GetCH701x(SiS_Pr,0x73); in SiS_SetCH701xForLCD()
8309 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) return; in SiS_SetCH701xForLCD()
8311 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) return; in SiS_SetCH701xForLCD()
8312 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) return; in SiS_SetCH701xForLCD()
8314 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) return; in SiS_SetCH701xForLCD()
8322 SiS_SetCH701x(SiS_Pr,(tableptr[i] << 8) | regtable[i]); in SiS_SetCH701xForLCD()
8324 SiS_ChrontelPowerSequencing(SiS_Pr,HwInfo); in SiS_SetCH701xForLCD()
8325 tempbh = SiS_GetCH701x(SiS_Pr,0x1e); in SiS_SetCH701xForLCD()
8327 SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x1e); in SiS_SetCH701xForLCD()
8330 tempbh = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_SetCH701xForLCD()
8332 SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x1c); in SiS_SetCH701xForLCD()
8333 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_SetCH701xForLCD()
8334 tempbh = SiS_GetCH701x(SiS_Pr,0x64); in SiS_SetCH701xForLCD()
8336 SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x64); in SiS_SetCH701xForLCD()
8337 tempbh = SiS_GetCH701x(SiS_Pr,0x03); in SiS_SetCH701xForLCD()
8339 SiS_SetCH701x(SiS_Pr,(tempbh << 8) | 0x03); in SiS_SetCH701xForLCD()
8344 SiS_ChrontelResetVSync(SiS_Private *SiS_Pr) in SiS_ChrontelResetVSync() argument
8348 temp1 = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetVSync()
8349 SiS_SetCH701x(SiS_Pr,0x3e49); in SiS_ChrontelResetVSync()
8350 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8352 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47); in SiS_ChrontelResetVSync()
8353 SiS_LongDelay(SiS_Pr,3); in SiS_ChrontelResetVSync()
8354 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8356 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47); in SiS_ChrontelResetVSync()
8357 SiS_SetCH701x(SiS_Pr,(temp1 << 8) | 0x49); in SiS_ChrontelResetVSync()
8361 SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_Chrontel701xOn() argument
8365 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xOn()
8367 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_Chrontel701xOn()
8369 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x1c); in SiS_Chrontel701xOn()
8371 if(SiS_IsYPbPr(SiS_Pr, HwInfo)) { in SiS_Chrontel701xOn()
8372 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8375 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x01); in SiS_Chrontel701xOn()
8377 if(SiS_IsChScart(SiS_Pr, HwInfo)) { in SiS_Chrontel701xOn()
8378 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8381 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x01); in SiS_Chrontel701xOn()
8384 SiS_ChrontelResetVSync(SiS_Pr); in SiS_Chrontel701xOn()
8385 SiS_SetCH701x(SiS_Pr,0x2049); /* Enable TV path */ in SiS_Chrontel701xOn()
8387 SiS_SetCH701x(SiS_Pr,0x2049); /* Enable TV path */ in SiS_Chrontel701xOn()
8388 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_Chrontel701xOn()
8389 if(SiS_IsYPbPr(SiS_Pr,HwInfo)) { in SiS_Chrontel701xOn()
8390 temp = SiS_GetCH701x(SiS_Pr,0x73); in SiS_Chrontel701xOn()
8392 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x73); in SiS_Chrontel701xOn()
8394 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8396 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47); in SiS_Chrontel701xOn()
8397 SiS_LongDelay(SiS_Pr,2); in SiS_Chrontel701xOn()
8398 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8400 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47); in SiS_Chrontel701xOn()
8406 SiS_Chrontel701xOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_Chrontel701xOff() argument
8411 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xOff()
8413 SiS_LongDelay(SiS_Pr,1); in SiS_Chrontel701xOff()
8414 SiS_GenericDelay(SiS_Pr,0x16ff); in SiS_Chrontel701xOff()
8415 SiS_SetCH701x(SiS_Pr,0xac76); in SiS_Chrontel701xOff()
8416 SiS_SetCH701x(SiS_Pr,0x0066); in SiS_Chrontel701xOff()
8418 SiS_LongDelay(SiS_Pr,2); in SiS_Chrontel701xOff()
8419 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_Chrontel701xOff()
8421 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76); in SiS_Chrontel701xOff()
8422 SiS_SetCH701x(SiS_Pr,0x0066); in SiS_Chrontel701xOff()
8428 SiS_ChrontelResetDB(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_ChrontelResetDB() argument
8434 temp = SiS_GetCH701x(SiS_Pr,0x4a); /* Version ID */ in SiS_ChrontelResetDB()
8438 if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo)) { in SiS_ChrontelResetDB()
8439 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetDB()
8440 SiS_SetCH701x(SiS_Pr,0x3e49); in SiS_ChrontelResetDB()
8443 SiS_SetCH701x(SiS_Pr,0x1048); in SiS_ChrontelResetDB()
8444 SiS_LongDelay(SiS_Pr,1); in SiS_ChrontelResetDB()
8445 SiS_SetCH701x(SiS_Pr,0x1848); in SiS_ChrontelResetDB()
8447 if(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo)) { in SiS_ChrontelResetDB()
8448 SiS_ChrontelResetVSync(SiS_Pr); in SiS_ChrontelResetDB()
8449 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x49); in SiS_ChrontelResetDB()
8455 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8457 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c); in SiS_ChrontelResetDB()
8458 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8460 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c); in SiS_ChrontelResetDB()
8461 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8463 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x5c); in SiS_ChrontelResetDB()
8464 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelResetDB()
8466 SiS_SetCH701xForLCD(SiS_Pr, HwInfo); in SiS_ChrontelResetDB()
8472 SiS_SetCH701x(SiS_Pr,0x1048); in SiS_ChrontelResetDB()
8473 SiS_LongDelay(SiS_Pr,1); in SiS_ChrontelResetDB()
8474 SiS_SetCH701x(SiS_Pr,0x1848); in SiS_ChrontelResetDB()
8479 SiS_ChrontelInitTVVSync(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_ChrontelInitTVVSync() argument
8485 if(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo)) { in SiS_ChrontelInitTVVSync()
8486 SiS_ChrontelResetVSync(SiS_Pr); in SiS_ChrontelInitTVVSync()
8491 SiS_SetCH701x(SiS_Pr,0xaf76); /* Power up LVDS block */ in SiS_ChrontelInitTVVSync()
8492 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelInitTVVSync()
8495 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8497 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47); /* enable VSYNC */ in SiS_ChrontelInitTVVSync()
8498 SiS_LongDelay(SiS_Pr,3); in SiS_ChrontelInitTVVSync()
8499 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8501 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x47); /* disable VSYNC */ in SiS_ChrontelInitTVVSync()
8508 SiS_ChrontelDoSomething3(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo) in SiS_ChrontelDoSomething3() argument
8514 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8517 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x61); in SiS_ChrontelDoSomething3()
8519 SiS_SetCH701x(SiS_Pr,0x4566); /* Panel power on */ in SiS_ChrontelDoSomething3()
8520 SiS_SetCH701x(SiS_Pr,0xaf76); /* All power on */ in SiS_ChrontelDoSomething3()
8521 SiS_LongDelay(SiS_Pr,1); in SiS_ChrontelDoSomething3()
8522 SiS_GenericDelay(SiS_Pr,0x16ff); in SiS_ChrontelDoSomething3()
8527 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8530 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x61); in SiS_ChrontelDoSomething3()
8533 SiS_SetCH701x(SiS_Pr,0xac76); in SiS_ChrontelDoSomething3()
8534 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8536 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66); in SiS_ChrontelDoSomething3()
8538 if(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo)) { in SiS_ChrontelDoSomething3()
8539 SiS_GenericDelay(SiS_Pr,0x3ff); in SiS_ChrontelDoSomething3()
8541 SiS_GenericDelay(SiS_Pr,0x2ff); in SiS_ChrontelDoSomething3()
8545 SiS_GenericDelay(SiS_Pr,0x2ff); in SiS_ChrontelDoSomething3()
8547 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething3()
8549 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76); in SiS_ChrontelDoSomething3()
8550 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8552 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x66); in SiS_ChrontelDoSomething3()
8553 SiS_LongDelay(SiS_Pr,1); in SiS_ChrontelDoSomething3()
8559 SiS_ChrontelDoSomething2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_ChrontelDoSomething2() argument
8563 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelDoSomething2()
8568 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething2()
8574 SiS_SetCH701x(SiS_Pr,0xac76); in SiS_ChrontelDoSomething2()
8577 SiS_SetCH701xForLCD(SiS_Pr,HwInfo); in SiS_ChrontelDoSomething2()
8581 SiS_ChrontelResetDB(SiS_Pr,HwInfo); in SiS_ChrontelDoSomething2()
8586 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8588 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76); in SiS_ChrontelDoSomething2()
8589 SiS_LongDelay(SiS_Pr,2); in SiS_ChrontelDoSomething2()
8590 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8592 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x76); in SiS_ChrontelDoSomething2()
8594 SiS_SetCH701x(SiS_Pr,0xe078); /* PLL loop filter */ in SiS_ChrontelDoSomething2()
8596 SiS_SetCH701x(SiS_Pr,0x6078); in SiS_ChrontelDoSomething2()
8598 SiS_LongDelay(SiS_Pr,2); in SiS_ChrontelDoSomething2()
8601 SiS_SetCH701x(SiS_Pr,0x0077); /* MV? */ in SiS_ChrontelDoSomething2()
8605 SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_ChrontelDoSomething1() argument
8609 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8612 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x03); in SiS_ChrontelDoSomething1()
8616 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_ChrontelDoSomething1()
8618 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x1c); in SiS_ChrontelDoSomething1()
8620 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_ChrontelDoSomething1()
8622 temp = SiS_GetCH701x(SiS_Pr,0x64); in SiS_ChrontelDoSomething1()
8624 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x64); in SiS_ChrontelDoSomething1()
8626 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8628 SiS_SetCH701x(SiS_Pr,(temp << 8) | 0x03); in SiS_ChrontelDoSomething1()
8630 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) { in SiS_ChrontelDoSomething1()
8631 SiS_SetCH701x(SiS_Pr,0x4063); /* LVDS off */ in SiS_ChrontelDoSomething1()
8632 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelDoSomething1()
8633 SiS_SetCH701x(SiS_Pr,0x0063); /* LVDS on */ in SiS_ChrontelDoSomething1()
8634 SiS_ChrontelResetDB(SiS_Pr, HwInfo); in SiS_ChrontelDoSomething1()
8635 SiS_ChrontelDoSomething2(SiS_Pr, HwInfo); in SiS_ChrontelDoSomething1()
8636 SiS_ChrontelDoSomething3(SiS_Pr, 0, HwInfo); in SiS_ChrontelDoSomething1()
8638 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething1()
8640 SiS_ChrontelResetDB(SiS_Pr, HwInfo); in SiS_ChrontelDoSomething1()
8641 SiS_ChrontelDoSomething2(SiS_Pr, HwInfo); in SiS_ChrontelDoSomething1()
8642 SiS_ChrontelDoSomething3(SiS_Pr, 0, HwInfo); in SiS_ChrontelDoSomething1()
8648 SiS_ChrontelResetDB(SiS_Pr,HwInfo); in SiS_ChrontelDoSomething1()
8649 SiS_ChrontelDoSomething2(SiS_Pr,HwInfo); in SiS_ChrontelDoSomething1()
8650 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34); in SiS_ChrontelDoSomething1()
8651 SiS_ChrontelDoSomething3(SiS_Pr,temp,HwInfo); in SiS_ChrontelDoSomething1()
8652 SiS_SetCH701x(SiS_Pr,0xaf76); /* All power on, LVDS normal operation */ in SiS_ChrontelDoSomething1()
8664 SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo) in SiS_SetCRT2Group() argument
8674 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2Group()
8676 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2Group()
8677 SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex); in SiS_SetCRT2Group()
8683 SiS_Pr->SiS_SelectCRT2Rate = 4; in SiS_SetCRT2Group()
8685 SiS_UnLockCRT2(SiS_Pr, HwInfo); in SiS_SetCRT2Group()
8687 RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex, HwInfo); in SiS_SetCRT2Group()
8689 SiS_SaveCRT2Info(SiS_Pr,ModeNo); in SiS_SetCRT2Group()
8691 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8692 SiS_DisableBridge(SiS_Pr,HwInfo); in SiS_SetCRT2Group()
8693 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (HwInfo->jChipType == SIS_730)) { in SiS_SetCRT2Group()
8694 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_SetCRT2Group()
8696 SiS_SetCRT2ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, HwInfo); in SiS_SetCRT2Group()
8699 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2Group()
8700 SiS_LockCRT2(SiS_Pr, HwInfo); in SiS_SetCRT2Group()
8701 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8705 SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8708 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_SetCRT2Group()
8709 if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_SetCRT2Group()
8710 ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) || in SiS_SetCRT2Group()
8711 ((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) { in SiS_SetCRT2Group()
8712 SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8717 …xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->S… in SiS_SetCRT2Group()
8718 …xf86DrvMsg(0, X_INFO, "(init301: HDE 0x%03x VDE 0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_V… in SiS_SetCRT2Group()
8719 …xf86DrvMsg(0, X_INFO, "(init301: VGAHDE 0x%03x VGAVDE 0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->Si… in SiS_SetCRT2Group()
8720 …xf86DrvMsg(0, X_INFO, "(init301: HT 0x%03x VT 0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT… in SiS_SetCRT2Group()
8721 …xf86DrvMsg(0, X_INFO, "(init301: VGAHT 0x%03x VGAVT 0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS… in SiS_SetCRT2Group()
8725 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8726 SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex); in SiS_SetCRT2Group()
8729 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2Group()
8731 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8733 SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8735 SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8737 SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex, HwInfo); in SiS_SetCRT2Group()
8738 SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8740 SiS_SetGroup4_C_ELV(SiS_Pr, HwInfo, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8742 SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex, HwInfo); in SiS_SetCRT2Group()
8744 SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8747 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetCRT2Group()
8748 if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) { in SiS_SetCRT2Group()
8749 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) { in SiS_SetCRT2Group()
8750 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT2Group()
8751 SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex, in SiS_SetCRT2Group()
8756 SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex, in SiS_SetCRT2Group()
8763 SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo); in SiS_SetCRT2Group()
8765 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetCRT2Group()
8766 SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwInfo); in SiS_SetCRT2Group()
8769 SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwInfo); in SiS_SetCRT2Group()
8771 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8772 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2Group()
8773 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetCRT2Group()
8774 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetCRT2Group()
8776 SiS_SetCH701xForLCD(SiS_Pr,HwInfo); in SiS_SetCRT2Group()
8780 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Group()
8781 SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); in SiS_SetCRT2Group()
8790 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8791 if(SiS_Pr->SiS_UseOEM) { in SiS_SetCRT2Group()
8792 if((SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_UseOEM == -1)) { in SiS_SetCRT2Group()
8794 SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex, in SiS_SetCRT2Group()
8798 SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex, in SiS_SetCRT2Group()
8802 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2Group()
8803 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_SetCRT2Group()
8804 (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2Group()
8805 SetOEMLCDData2(SiS_Pr, HwInfo, ModeNo, ModeIdIndex,RefreshRateTableIndex); in SiS_SetCRT2Group()
8808 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8812 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2Group()
8814 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8822 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8824 SiS_FinalizeLCD(SiS_Pr, ModeNo, ModeIdIndex, HwInfo); in SiS_SetCRT2Group()
8825 SiS_OEM310Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8827 SiS_OEM661Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8829 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); in SiS_SetCRT2Group()
8834 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8835 SiS_EnableBridge(SiS_Pr, HwInfo); in SiS_SetCRT2Group()
8838 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8840 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetCRT2Group()
8841 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Group()
8843 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFF,0x0C); in SiS_SetCRT2Group()
8846 SiS_SetCH70xxANDOR(SiS_Pr,0x010E,0xF8); in SiS_SetCRT2Group()
8850 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8851 SiS_LockCRT2(SiS_Pr,HwInfo); in SiS_SetCRT2Group()
8863 SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_SiS30xBLOn() argument
8866 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOn()
8867 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_SiS30xBLOn()
8868 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_SiS30xBLOn()
8869 SiS_WaitVBRetrace(SiS_Pr,HwInfo); in SiS_SiS30xBLOn()
8871 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) { in SiS_SiS30xBLOn()
8872 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_SiS30xBLOn()
8877 SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SiS_SiS30xBLOff() argument
8880 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_SiS30xBLOff()
8881 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_SiS30xBLOff()
8882 SiS_DDC2Delay(SiS_Pr,0xe000); in SiS_SiS30xBLOff()
8890 SiS_SetupDDCN(SiS_Private *SiS_Pr) in SiS_SetupDDCN() argument
8892 SiS_Pr->SiS_DDC_NData = ~SiS_Pr->SiS_DDC_Data; in SiS_SetupDDCN()
8893 SiS_Pr->SiS_DDC_NClk = ~SiS_Pr->SiS_DDC_Clk; in SiS_SetupDDCN()
8894 if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) { in SiS_SetupDDCN()
8895 SiS_Pr->SiS_DDC_NData &= 0x0f; in SiS_SetupDDCN()
8896 SiS_Pr->SiS_DDC_NClk &= 0x0f; in SiS_SetupDDCN()
8902 SiS_SetTrumpBlockLoop(SiS_Private *SiS_Pr, UCHAR *dataptr) in SiS_SetTrumpBlockLoop() argument
8913 SiS_SetStop(SiS_Pr); in SiS_SetTrumpBlockLoop()
8914 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT*2); in SiS_SetTrumpBlockLoop()
8916 if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ in SiS_SetTrumpBlockLoop()
8917 tempah = SiS_Pr->SiS_DDC_DeviceAddr; in SiS_SetTrumpBlockLoop()
8918 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
8921 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write register number */ in SiS_SetTrumpBlockLoop()
8925 temp = SiS_WriteDDC2Data(SiS_Pr,tempah);/* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
8929 if(SiS_SetStop(SiS_Pr)) continue; in SiS_SetTrumpBlockLoop()
8936 SiS_SetTrumpionBlock(SiS_Private *SiS_Pr, UCHAR *dataptr) in SiS_SetTrumpionBlock() argument
8938 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ in SiS_SetTrumpionBlock()
8939 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetTrumpionBlock()
8940 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetTrumpionBlock()
8941 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetTrumpionBlock()
8942 SiS_SetupDDCN(SiS_Pr); in SiS_SetTrumpionBlock()
8944 SiS_SetSwitchDDC2(SiS_Pr); in SiS_SetTrumpionBlock()
8947 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); in SiS_SetTrumpionBlock()
8965 SiS_SetChReg(SiS_Private *SiS_Pr, USHORT tempbx, USHORT myor) in SiS_SetChReg() argument
8971 SiS_SetStop(SiS_Pr); in SiS_SetChReg()
8972 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_SetChReg()
8974 if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ in SiS_SetChReg()
8975 tempah = SiS_Pr->SiS_DDC_DeviceAddr; in SiS_SetChReg()
8976 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_SetChReg()
8980 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); in SiS_SetChReg()
8983 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write data */ in SiS_SetChReg()
8985 if(SiS_SetStop(SiS_Pr)) continue; /* Set stop condition */ in SiS_SetChReg()
8986 SiS_Pr->SiS_ChrontelInit = 1; in SiS_SetChReg()
8995 SiS_SetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_SetTrumpReg() argument
8997 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ in SiS_SetTrumpReg()
8998 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetTrumpReg()
8999 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetTrumpReg()
9000 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetTrumpReg()
9001 SiS_SetupDDCN(SiS_Pr); in SiS_SetTrumpReg()
9002 SiS_SetChReg(SiS_Pr, tempbx, 0); in SiS_SetTrumpReg()
9009 SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_SetCH700x() argument
9011 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH700x()
9013 if(!(SiS_Pr->SiS_ChrontelInit)) { in SiS_SetCH700x()
9014 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH700x()
9015 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetCH700x()
9016 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetCH700x()
9017 SiS_SetupDDCN(SiS_Pr); in SiS_SetCH700x()
9020 if( (!(SiS_SetChReg(SiS_Pr, tempbx, 0x80))) && in SiS_SetCH700x()
9021 (!(SiS_Pr->SiS_ChrontelInit)) ) { in SiS_SetCH700x()
9022 SiS_Pr->SiS_DDC_Index = 0x0a; /* Bit 7 = SC; Bit 6 = SD */ in SiS_SetCH700x()
9023 SiS_Pr->SiS_DDC_Data = 0x80; /* Bitmask in IndexReg for Data */ in SiS_SetCH700x()
9024 SiS_Pr->SiS_DDC_Clk = 0x40; /* Bitmask in IndexReg for Clk */ in SiS_SetCH700x()
9025 SiS_SetupDDCN(SiS_Pr); in SiS_SetCH700x()
9027 SiS_SetChReg(SiS_Pr, tempbx, 0x80); in SiS_SetCH700x()
9034 SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_SetCH701x() argument
9036 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH701x()
9037 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_SetCH701x()
9038 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_SetCH701x()
9039 SiS_SetupDDCN(SiS_Pr); in SiS_SetCH701x()
9040 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH701x()
9041 SiS_SetChReg(SiS_Pr, tempbx, 0); in SiS_SetCH701x()
9045 SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_SetCH70xx() argument
9047 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) in SiS_SetCH70xx()
9048 SiS_SetCH700x(SiS_Pr,tempbx); in SiS_SetCH70xx()
9050 SiS_SetCH701x(SiS_Pr,tempbx); in SiS_SetCH70xx()
9054 SiS_GetChReg(SiS_Private *SiS_Pr, USHORT myor) in SiS_GetChReg() argument
9060 SiS_SetStop(SiS_Pr); in SiS_GetChReg()
9061 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_GetChReg()
9063 if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ in SiS_GetChReg()
9064 tempah = SiS_Pr->SiS_DDC_DeviceAddr; in SiS_GetChReg()
9065 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_GetChReg()
9067 tempah = SiS_Pr->SiS_DDC_ReadAddr | myor; /* Write RAB (700x: | 0x80) */ in SiS_GetChReg()
9068 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); in SiS_GetChReg()
9070 if (SiS_SetStart(SiS_Pr)) continue; /* Re-start */ in SiS_GetChReg()
9071 tempah = SiS_Pr->SiS_DDC_DeviceAddr | 0x01;/* DAB | 0x01 = Read */ in SiS_GetChReg()
9072 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* DAB (S0=1=read) */ in SiS_GetChReg()
9074 tempah = SiS_ReadDDC2Data(SiS_Pr,tempah); /* Read byte */ in SiS_GetChReg()
9075 if(SiS_SetStop(SiS_Pr)) continue; /* Stop condition */ in SiS_GetChReg()
9076 SiS_Pr->SiS_ChrontelInit = 1; in SiS_GetChReg()
9085 SiS_GetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_GetTrumpReg() argument
9087 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB */ in SiS_GetTrumpReg()
9088 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetTrumpReg()
9089 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_GetTrumpReg()
9090 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_GetTrumpReg()
9091 SiS_SetupDDCN(SiS_Pr); in SiS_GetTrumpReg()
9092 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetTrumpReg()
9093 return(SiS_GetChReg(SiS_Pr,0)); in SiS_GetTrumpReg()
9100 SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_GetCH700x() argument
9104 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH700x()
9106 if(!(SiS_Pr->SiS_ChrontelInit)) { in SiS_GetCH700x()
9107 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH700x()
9108 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_GetCH700x()
9109 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_GetCH700x()
9110 SiS_SetupDDCN(SiS_Pr); in SiS_GetCH700x()
9113 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetCH700x()
9115 if( ((result = SiS_GetChReg(SiS_Pr,0x80)) == 0xFFFF) && in SiS_GetCH700x()
9116 (!SiS_Pr->SiS_ChrontelInit) ) { in SiS_GetCH700x()
9118 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_GetCH700x()
9119 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_GetCH700x()
9120 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_GetCH700x()
9121 SiS_SetupDDCN(SiS_Pr); in SiS_GetCH700x()
9123 result = SiS_GetChReg(SiS_Pr,0x80); in SiS_GetCH700x()
9131 SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_GetCH701x() argument
9133 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH701x()
9134 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_GetCH701x()
9135 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_GetCH701x()
9136 SiS_SetupDDCN(SiS_Pr); in SiS_GetCH701x()
9137 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH701x()
9139 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetCH701x()
9141 return(SiS_GetChReg(SiS_Pr,0)); in SiS_GetCH701x()
9147 SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx) in SiS_GetCH70xx() argument
9149 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) in SiS_GetCH70xx()
9150 return(SiS_GetCH700x(SiS_Pr, tempbx)); in SiS_GetCH70xx()
9152 return(SiS_GetCH701x(SiS_Pr, tempbx)); in SiS_GetCH70xx()
9157 SiS_InitDDCRegs(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine, in SiS_InitDDCRegs() argument
9171 SiS_Pr->SiS_ChrontelInit = 0; /* force re-detection! */ in SiS_InitDDCRegs()
9173 SiS_Pr->SiS_DDC_SecAddr = 0; in SiS_InitDDCRegs()
9174 SiS_Pr->SiS_DDC_DeviceAddr = ddcdtype[DDCdatatype]; in SiS_InitDDCRegs()
9175 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_P3c4; in SiS_InitDDCRegs()
9176 SiS_Pr->SiS_DDC_Index = 0x11; in SiS_InitDDCRegs()
9179 cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32); in SiS_InitDDCRegs()
9202 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; in SiS_InitDDCRegs()
9203 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9234 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; in SiS_InitDDCRegs()
9235 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9257 SiS_Pr->SiS_DDC_Data = 0x02 << temp; in SiS_InitDDCRegs()
9258 SiS_Pr->SiS_DDC_Clk = 0x01 << temp; in SiS_InitDDCRegs()
9260 SiS_SetupDDCN(SiS_Pr); in SiS_InitDDCRegs()
9264 SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, temp); in SiS_InitDDCRegs()
9271 SiS_WriteDABDDC(SiS_Private *SiS_Pr) in SiS_WriteDABDDC() argument
9273 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_WriteDABDDC()
9274 if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr)) { in SiS_WriteDABDDC()
9277 if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_SecAddr)) { in SiS_WriteDABDDC()
9284 SiS_PrepareReadDDC(SiS_Private *SiS_Pr) in SiS_PrepareReadDDC() argument
9286 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_PrepareReadDDC()
9287 if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) { in SiS_PrepareReadDDC()
9294 SiS_PrepareDDC(SiS_Private *SiS_Pr) in SiS_PrepareDDC() argument
9296 if(SiS_WriteDABDDC(SiS_Pr)) SiS_WriteDABDDC(SiS_Pr); in SiS_PrepareDDC()
9297 if(SiS_PrepareReadDDC(SiS_Pr)) return(SiS_PrepareReadDDC(SiS_Pr)); in SiS_PrepareDDC()
9302 SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno) in SiS_SendACK() argument
9304 SiS_SetSCLKLow(SiS_Pr); in SiS_SendACK()
9306 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SendACK()
9307 SiS_Pr->SiS_DDC_Index, in SiS_SendACK()
9308 SiS_Pr->SiS_DDC_NData, in SiS_SendACK()
9309 SiS_Pr->SiS_DDC_Data); in SiS_SendACK()
9311 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SendACK()
9312 SiS_Pr->SiS_DDC_Index, in SiS_SendACK()
9313 SiS_Pr->SiS_DDC_NData, in SiS_SendACK()
9316 SiS_SetSCLKHigh(SiS_Pr); in SiS_SendACK()
9320 SiS_DoProbeDDC(SiS_Private *SiS_Pr) in SiS_DoProbeDDC() argument
9326 SiS_SetSwitchDDC2(SiS_Pr); in SiS_DoProbeDDC()
9327 if(SiS_PrepareDDC(SiS_Pr)) { in SiS_DoProbeDDC()
9328 SiS_SetStop(SiS_Pr); in SiS_DoProbeDDC()
9336 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9337 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr, 0); in SiS_DoProbeDDC()
9338 SiS_SendACK(SiS_Pr, 0); in SiS_DoProbeDDC()
9351 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr, 0); in SiS_DoProbeDDC()
9352 SiS_SendACK(SiS_Pr, 1); in SiS_DoProbeDDC()
9360 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9365 SiS_SetStop(SiS_Pr); in SiS_DoProbeDDC()
9370 SiS_ProbeDDC(SiS_Private *SiS_Pr) in SiS_ProbeDDC() argument
9375 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; in SiS_ProbeDDC()
9376 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x02; in SiS_ProbeDDC()
9377 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; in SiS_ProbeDDC()
9378 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x08; in SiS_ProbeDDC()
9379 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; in SiS_ProbeDDC()
9380 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x10; in SiS_ProbeDDC()
9386 SiS_ReadDDC(SiS_Private *SiS_Pr, USHORT DDCdatatype, unsigned char *buffer) in SiS_ReadDDC() argument
9394 SiS_SetSwitchDDC2(SiS_Pr); in SiS_ReadDDC()
9395 if(!(SiS_PrepareDDC(SiS_Pr))) { in SiS_ReadDDC()
9401 buffer[i] = (unsigned char)SiS_ReadDDC2Data(SiS_Pr, 0); in SiS_ReadDDC()
9404 SiS_SendACK(SiS_Pr, 0); in SiS_ReadDDC()
9406 buffer[i] = (unsigned char)SiS_ReadDDC2Data(SiS_Pr, 0); in SiS_ReadDDC()
9408 SiS_SendACK(SiS_Pr, 1); in SiS_ReadDDC()
9414 SiS_SetStop(SiS_Pr); in SiS_ReadDDC()
9439 SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine, in SiS_HandleDDC() argument
9448 …if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, FALSE) == 0xFFFF) return 0xF… in SiS_HandleDDC()
9450 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); in SiS_HandleDDC()
9451 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04); in SiS_HandleDDC()
9453 cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80; in SiS_HandleDDC()
9455 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80); in SiS_HandleDDC()
9456 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01); in SiS_HandleDDC()
9457 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); in SiS_HandleDDC()
9461 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9462 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9463 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9464 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9468 result = SiS_ProbeDDC(SiS_Pr); in SiS_HandleDDC()
9470 result = SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer); in SiS_HandleDDC()
9472 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f); in SiS_HandleDDC()
9474 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17); in SiS_HandleDDC()
9527 SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS) in SiS_SenseLCDDDC() argument
9536 for(i=0; i<7; i++) SiS_Pr->CP_DataValid[i] = FALSE; in SiS_SenseLCDDDC()
9537 SiS_Pr->CP_HaveCustomData = FALSE; in SiS_SenseLCDDDC()
9538 SiS_Pr->CP_MaxX = SiS_Pr->CP_MaxY = SiS_Pr->CP_MaxClock = 0; in SiS_SenseLCDDDC()
9539 SiS_Pr->CP_PreferredX = SiS_Pr->CP_PreferredY = 0; in SiS_SenseLCDDDC()
9540 SiS_Pr->CP_PreferredIndex = -1; in SiS_SenseLCDDDC()
9545 if(SiS_InitDDCRegs(SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, 1, 0, FALSE) == 0xFFFF) return 0; in SiS_SenseLCDDDC()
9547 SiS_Pr->SiS_DDC_SecAddr = 0x00; in SiS_SenseLCDDDC()
9550 flag = SiS_ProbeDDC(SiS_Pr); in SiS_SenseLCDDDC()
9556 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; /* EDID V2 (FP) */ in SiS_SenseLCDDDC()
9559 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; /* EDID V2 (P&D-D Monitor) */ in SiS_SenseLCDDDC()
9562 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; /* EDID V1 */ in SiS_SenseLCDDDC()
9569 if(SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer)) { in SiS_SenseLCDDDC()
9631 SiS_Pr->CP_PreferredX = xres; in SiS_SenseLCDDDC()
9632 SiS_Pr->CP_PreferredY = yres; in SiS_SenseLCDDDC()
9725 SiS_Pr->CP_Supports64048075 = TRUE; in SiS_SenseLCDDDC()
9733 if(estx[16 - i] > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = estx[16 - i]; in SiS_SenseLCDDDC()
9734 if(esty[16 - i] > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = esty[16 - i]; in SiS_SenseLCDDDC()
9742 if(temp > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = temp; in SiS_SenseLCDDDC()
9748 if(temp > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = temp; in SiS_SenseLCDDDC()
9762 SiS_Pr->CP_HDisplay[i] = xres; in SiS_SenseLCDDDC()
9763 SiS_Pr->CP_HSyncStart[i] = xres + (buffer[base+8] | ((buffer[base+11] & 0xc0) << 2)); in SiS_SenseLCDDDC()
9764SiS_Pr->CP_HSyncEnd[i] = SiS_Pr->CP_HSyncStart[i] + (buffer[base+9] | ((buffer[base+11] & 0x30) … in SiS_SenseLCDDDC()
9765 SiS_Pr->CP_HTotal[i] = xres + (buffer[base+3] | ((buffer[base+4] & 0x0f) << 8)); in SiS_SenseLCDDDC()
9766 SiS_Pr->CP_HBlankStart[i] = xres + 1; in SiS_SenseLCDDDC()
9767 SiS_Pr->CP_HBlankEnd[i] = SiS_Pr->CP_HTotal[i]; in SiS_SenseLCDDDC()
9769 SiS_Pr->CP_VDisplay[i] = yres; in SiS_SenseLCDDDC()
9770SiS_Pr->CP_VSyncStart[i] = yres + (((buffer[base+10] & 0xf0) >> 4) | ((buffer[base+11] & 0x0c) << … in SiS_SenseLCDDDC()
9771SiS_Pr->CP_VSyncEnd[i] = SiS_Pr->CP_VSyncStart[i] + ((buffer[base+10] & 0x0f) | ((buffer[base+11] … in SiS_SenseLCDDDC()
9772 SiS_Pr->CP_VTotal[i] = yres + (buffer[base+6] | ((buffer[base+7] & 0x0f) << 8)); in SiS_SenseLCDDDC()
9773 SiS_Pr->CP_VBlankStart[i] = yres + 1; in SiS_SenseLCDDDC()
9774 SiS_Pr->CP_VBlankEnd[i] = SiS_Pr->CP_VTotal[i]; in SiS_SenseLCDDDC()
9776 SiS_Pr->CP_Clock[i] = (buffer[base] | (buffer[base+1] << 8)) * 10; in SiS_SenseLCDDDC()
9778 SiS_Pr->CP_DataValid[i] = TRUE; in SiS_SenseLCDDDC()
9781 if((SiS_Pr->CP_HDisplay[i] & 7) || in SiS_SenseLCDDDC()
9782 (SiS_Pr->CP_HDisplay[i] > SiS_Pr->CP_HSyncStart[i]) || in SiS_SenseLCDDDC()
9783 (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HSyncEnd[i]) || in SiS_SenseLCDDDC()
9784 (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HTotal[i]) || in SiS_SenseLCDDDC()
9785 (SiS_Pr->CP_HSyncStart[i] >= SiS_Pr->CP_HSyncEnd[i]) || in SiS_SenseLCDDDC()
9786 (SiS_Pr->CP_HSyncStart[i] > SiS_Pr->CP_HTotal[i]) || in SiS_SenseLCDDDC()
9787 (SiS_Pr->CP_HSyncEnd[i] > SiS_Pr->CP_HTotal[i]) || in SiS_SenseLCDDDC()
9788 (SiS_Pr->CP_VDisplay[i] > SiS_Pr->CP_VSyncStart[i]) || in SiS_SenseLCDDDC()
9789 (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VSyncEnd[i]) || in SiS_SenseLCDDDC()
9790 (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VTotal[i]) || in SiS_SenseLCDDDC()
9791 (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VSyncEnd[i]) || in SiS_SenseLCDDDC()
9792 (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VTotal[i]) || in SiS_SenseLCDDDC()
9793 (SiS_Pr->CP_VSyncEnd[i] > SiS_Pr->CP_VTotal[i]) || in SiS_SenseLCDDDC()
9794 (((pSiS->VBFlags & VB_301C) && (SiS_Pr->CP_Clock[i] > 162500)) || in SiS_SenseLCDDDC()
9795 ((!(pSiS->VBFlags & VB_301C)) && (SiS_Pr->CP_Clock[i] > 108200))) || in SiS_SenseLCDDDC()
9798 SiS_Pr->CP_DataValid[i] = FALSE; in SiS_SenseLCDDDC()
9804 SiS_Pr->CP_HaveCustomData = TRUE; in SiS_SenseLCDDDC()
9806 if(xres > SiS_Pr->CP_MaxX) SiS_Pr->CP_MaxX = xres; in SiS_SenseLCDDDC()
9807 if(yres > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = yres; in SiS_SenseLCDDDC()
9808 if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i]; in SiS_SenseLCDDDC()
9810 if((SiS_Pr->CP_PreferredX == xres) && (SiS_Pr->CP_PreferredY == yres)) { in SiS_SenseLCDDDC()
9811 SiS_Pr->CP_PreferredIndex = i; in SiS_SenseLCDDDC()
9814 SiS_Pr->CP_Vendor = buffer[9] | (buffer[8] << 8); in SiS_SenseLCDDDC()
9815 SiS_Pr->CP_Product = buffer[10] | (buffer[11] << 8); in SiS_SenseLCDDDC()
9820 if(!(buffer[0x23] & 0x04)) SiS_Pr->CP_Supports64048075 = FALSE; in SiS_SenseLCDDDC()
9832 SiS_Pr->CP_HSync_P[i] = (buffer[base+17] & 0x02) ? TRUE : FALSE; in SiS_SenseLCDDDC()
9833 SiS_Pr->CP_VSync_P[i] = (buffer[base+17] & 0x04) ? TRUE : FALSE; in SiS_SenseLCDDDC()
9834 SiS_Pr->CP_SyncValid[i] = TRUE; in SiS_SenseLCDDDC()
9840 SiS_Pr->CP_SyncValid[i] = FALSE; in SiS_SenseLCDDDC()
9891 SiS_Pr->CP_MaxX = xres = buffer[0x76] | (buffer[0x77] << 8); in SiS_SenseLCDDDC()
9892 SiS_Pr->CP_MaxY = yres = buffer[0x78] | (buffer[0x79] << 8); in SiS_SenseLCDDDC()
9987 SiS_Pr->CP_Supports64048075 = TRUE; in SiS_SenseLCDDDC()
9995 SiS_Pr->CP_HDisplay[i] = xres; in SiS_SenseLCDDDC()
9996 SiS_Pr->CP_HSyncStart[i] = xres + (buffer[index+8] | ((buffer[index+11] & 0xc0) << 2)); in SiS_SenseLCDDDC()
9997SiS_Pr->CP_HSyncEnd[i] = SiS_Pr->CP_HSyncStart[i] + (buffer[index+9] | ((buffer[index+11] & 0x30) … in SiS_SenseLCDDDC()
9998 SiS_Pr->CP_HTotal[i] = xres + (buffer[index+3] | ((buffer[index+4] & 0x0f) << 8)); in SiS_SenseLCDDDC()
9999 SiS_Pr->CP_HBlankStart[i] = xres + 1; in SiS_SenseLCDDDC()
10000 SiS_Pr->CP_HBlankEnd[i] = SiS_Pr->CP_HTotal[i]; in SiS_SenseLCDDDC()
10002 SiS_Pr->CP_VDisplay[i] = yres; in SiS_SenseLCDDDC()
10003SiS_Pr->CP_VSyncStart[i] = yres + (((buffer[index+10] & 0xf0) >> 4) | ((buffer[index+11] & 0x0c) <… in SiS_SenseLCDDDC()
10004SiS_Pr->CP_VSyncEnd[i] = SiS_Pr->CP_VSyncStart[i] + ((buffer[index+10] & 0x0f) | ((buffer[index+11… in SiS_SenseLCDDDC()
10005 SiS_Pr->CP_VTotal[i] = yres + (buffer[index+6] | ((buffer[index+7] & 0x0f) << 8)); in SiS_SenseLCDDDC()
10006 SiS_Pr->CP_VBlankStart[i] = yres + 1; in SiS_SenseLCDDDC()
10007 SiS_Pr->CP_VBlankEnd[i] = SiS_Pr->CP_VTotal[i]; in SiS_SenseLCDDDC()
10009 SiS_Pr->CP_Clock[i] = (buffer[index] | (buffer[index+1] << 8)) * 10; in SiS_SenseLCDDDC()
10011 SiS_Pr->CP_DataValid[i] = TRUE; in SiS_SenseLCDDDC()
10013 if((SiS_Pr->CP_HDisplay[i] & 7) || in SiS_SenseLCDDDC()
10014 (SiS_Pr->CP_HDisplay[i] > SiS_Pr->CP_HSyncStart[i]) || in SiS_SenseLCDDDC()
10015 (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HSyncEnd[i]) || in SiS_SenseLCDDDC()
10016 (SiS_Pr->CP_HDisplay[i] >= SiS_Pr->CP_HTotal[i]) || in SiS_SenseLCDDDC()
10017 (SiS_Pr->CP_HSyncStart[i] >= SiS_Pr->CP_HSyncEnd[i]) || in SiS_SenseLCDDDC()
10018 (SiS_Pr->CP_HSyncStart[i] > SiS_Pr->CP_HTotal[i]) || in SiS_SenseLCDDDC()
10019 (SiS_Pr->CP_HSyncEnd[i] > SiS_Pr->CP_HTotal[i]) || in SiS_SenseLCDDDC()
10020 (SiS_Pr->CP_VDisplay[i] > SiS_Pr->CP_VSyncStart[i]) || in SiS_SenseLCDDDC()
10021 (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VSyncEnd[i]) || in SiS_SenseLCDDDC()
10022 (SiS_Pr->CP_VDisplay[i] >= SiS_Pr->CP_VTotal[i]) || in SiS_SenseLCDDDC()
10023 (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VSyncEnd[i]) || in SiS_SenseLCDDDC()
10024 (SiS_Pr->CP_VSyncStart[i] > SiS_Pr->CP_VTotal[i]) || in SiS_SenseLCDDDC()
10025 (SiS_Pr->CP_VSyncEnd[i] > SiS_Pr->CP_VTotal[i]) || in SiS_SenseLCDDDC()
10026 (((pSiS->VBFlags & VB_301C) && (SiS_Pr->CP_Clock[i] > 162500)) || in SiS_SenseLCDDDC()
10027 ((!(pSiS->VBFlags & VB_301C)) && (SiS_Pr->CP_Clock[i] > 108200))) || in SiS_SenseLCDDDC()
10030 SiS_Pr->CP_DataValid[i] = FALSE; in SiS_SenseLCDDDC()
10034 SiS_Pr->CP_HaveCustomData = TRUE; in SiS_SenseLCDDDC()
10036 if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i]; in SiS_SenseLCDDDC()
10038 if((SiS_Pr->CP_MaxX == xres) && (SiS_Pr->CP_MaxY == yres)) { in SiS_SenseLCDDDC()
10039 SiS_Pr->CP_PreferredIndex = i; in SiS_SenseLCDDDC()
10042 SiS_Pr->CP_HSync_P[i] = (buffer[index + 17] & 0x02) ? TRUE : FALSE; in SiS_SenseLCDDDC()
10043 SiS_Pr->CP_VSync_P[i] = (buffer[index + 17] & 0x04) ? TRUE : FALSE; in SiS_SenseLCDDDC()
10044 SiS_Pr->CP_SyncValid[i] = TRUE; in SiS_SenseLCDDDC()
10046 SiS_Pr->CP_Vendor = buffer[2] | (buffer[1] << 8); in SiS_SenseLCDDDC()
10047 SiS_Pr->CP_Product = buffer[3] | (buffer[4] << 8); in SiS_SenseLCDDDC()
10073 if(SiS_Pr->CP_DataValid[i]) { in SiS_SenseLCDDDC()
10078 SiS_Pr->CP_HDisplay[i], SiS_Pr->CP_HSyncStart[i], in SiS_SenseLCDDDC()
10079 SiS_Pr->CP_HSyncEnd[i], SiS_Pr->CP_HTotal[i]); in SiS_SenseLCDDDC()
10082 SiS_Pr->CP_VDisplay[i], SiS_Pr->CP_VSyncStart[i], in SiS_SenseLCDDDC()
10083 SiS_Pr->CP_VSyncEnd[i], SiS_Pr->CP_VTotal[i]); in SiS_SenseLCDDDC()
10085 " Pixel clock: %3.3fMhz\n", (float)SiS_Pr->CP_Clock[i] / 1000); in SiS_SenseLCDDDC()
10088 SiS_Pr->CP_HDisplay[i], in SiS_SenseLCDDDC()
10089 SiS_Pr->CP_VDisplay[i]); in SiS_SenseLCDDDC()
10094 if(!SiS_Pr->CP_PreferredX) SiS_Pr->CP_PreferredX = SiS_Pr->CP_MaxX; in SiS_SenseLCDDDC()
10095 if(!SiS_Pr->CP_PreferredY) SiS_Pr->CP_PreferredY = SiS_Pr->CP_MaxY; in SiS_SenseLCDDDC()
10096 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x08); in SiS_SenseLCDDDC()
10097 SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,paneltype); in SiS_SenseLCDDDC()
10099 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0x0c,cr37); in SiS_SenseLCDDDC()
10100 SiS_Pr->PanelSelfDetected = TRUE; in SiS_SenseLCDDDC()
10106 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x32,~0x08); in SiS_SenseLCDDDC()
10107 SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,0x00); in SiS_SenseLCDDDC()
10113 SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS) in SiS_SenseVGA2DDC() argument
10122 if(SiS_InitDDCRegs(SiS_Pr, pSiS->VBFlags, pSiS->VGAEngine, 2, 0, FALSE) == 0xFFFF) return 0; in SiS_SenseVGA2DDC()
10124 SiS_Pr->SiS_DDC_SecAddr = 0x00; in SiS_SenseVGA2DDC()
10127 flag = SiS_ProbeDDC(SiS_Pr); in SiS_SenseVGA2DDC()
10129 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; /* EDID V2 (FP) */ in SiS_SenseVGA2DDC()
10132 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; /* EDID V2 (P&D-D Monitor) */ in SiS_SenseVGA2DDC()
10135 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; /* EDID V1 */ in SiS_SenseVGA2DDC()
10146 if(SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer)) { in SiS_SenseVGA2DDC()
10170 SiS_Pr->CP_Vendor = buffer[9] | (buffer[8] << 8); in SiS_SenseVGA2DDC()
10171 SiS_Pr->CP_Product = buffer[10] | (buffer[11] << 8); in SiS_SenseVGA2DDC()
10190 SiS_Pr->CP_Vendor = buffer[2] | (buffer[1] << 8); in SiS_SenseVGA2DDC()
10191 SiS_Pr->CP_Product = buffer[3] | (buffer[4] << 8); in SiS_SenseVGA2DDC()
10197 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x10); in SiS_SenseVGA2DDC()
10205 SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh) in SiS_SetCH70xxANDOR() argument
10209 tempbl = SiS_GetCH70xx(SiS_Pr,(tempax & 0x00FF)); in SiS_SetCH70xxANDOR()
10211 SiS_SetCH70xx(SiS_Pr,tempbl); in SiS_SetCH70xxANDOR()
10217 SiS_SetSwitchDDC2(SiS_Private *SiS_Pr) in SiS_SetSwitchDDC2() argument
10219 SiS_SetSCLKHigh(SiS_Pr); in SiS_SetSwitchDDC2()
10220 SiS_WaitRetrace1(SiS_Pr); in SiS_SetSwitchDDC2()
10222 SiS_SetSCLKLow(SiS_Pr); in SiS_SetSwitchDDC2()
10223 SiS_WaitRetrace1(SiS_Pr); in SiS_SetSwitchDDC2()
10227 SiS_ReadDDC1Bit(SiS_Private *SiS_Pr) in SiS_ReadDDC1Bit() argument
10229 SiS_WaitRetrace1(SiS_Pr); in SiS_ReadDDC1Bit()
10230 return((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1); in SiS_ReadDDC1Bit()
10236 SiS_SetStart(SiS_Private *SiS_Pr) in SiS_SetStart() argument
10238 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
10239 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStart()
10240 SiS_Pr->SiS_DDC_Index, in SiS_SetStart()
10241 SiS_Pr->SiS_DDC_NData, in SiS_SetStart()
10242 SiS_Pr->SiS_DDC_Data); /* SD->high */ in SiS_SetStart()
10243 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStart()
10244 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStart()
10245 SiS_Pr->SiS_DDC_Index, in SiS_SetStart()
10246 SiS_Pr->SiS_DDC_NData, in SiS_SetStart()
10248 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
10255 SiS_SetStop(SiS_Private *SiS_Pr) in SiS_SetStop() argument
10257 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStop()
10258 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStop()
10259 SiS_Pr->SiS_DDC_Index, in SiS_SetStop()
10260 SiS_Pr->SiS_DDC_NData, in SiS_SetStop()
10262 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStop()
10263 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStop()
10264 SiS_Pr->SiS_DDC_Index, in SiS_SetStop()
10265 SiS_Pr->SiS_DDC_NData, in SiS_SetStop()
10266 SiS_Pr->SiS_DDC_Data); /* SD->high = stop condition */ in SiS_SetStop()
10267 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->high) */ in SiS_SetStop()
10273 SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax) in SiS_WriteDDC2Data() argument
10279 SiS_SetSCLKLow(SiS_Pr); /* SC->low */ in SiS_WriteDDC2Data()
10281 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_WriteDDC2Data()
10282 SiS_Pr->SiS_DDC_Index, in SiS_WriteDDC2Data()
10283 SiS_Pr->SiS_DDC_NData, in SiS_WriteDDC2Data()
10284 SiS_Pr->SiS_DDC_Data); /* Write bit (1) to SD */ in SiS_WriteDDC2Data()
10286 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_WriteDDC2Data()
10287 SiS_Pr->SiS_DDC_Index, in SiS_WriteDDC2Data()
10288 SiS_Pr->SiS_DDC_NData, in SiS_WriteDDC2Data()
10291 SiS_SetSCLKHigh(SiS_Pr); /* SC->high */ in SiS_WriteDDC2Data()
10294 temp = SiS_CheckACK(SiS_Pr); /* Check acknowledge */ in SiS_WriteDDC2Data()
10299 SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax) in SiS_ReadDDC2Data() argument
10306 SiS_SetSCLKLow(SiS_Pr); in SiS_ReadDDC2Data()
10307 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_ReadDDC2Data()
10308 SiS_Pr->SiS_DDC_Index, in SiS_ReadDDC2Data()
10309 SiS_Pr->SiS_DDC_NData, in SiS_ReadDDC2Data()
10310 SiS_Pr->SiS_DDC_Data); in SiS_ReadDDC2Data()
10311 SiS_SetSCLKHigh(SiS_Pr); in SiS_ReadDDC2Data()
10312 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); in SiS_ReadDDC2Data()
10313 if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01; in SiS_ReadDDC2Data()
10319 SiS_SetSCLKLow(SiS_Private *SiS_Pr) in SiS_SetSCLKLow() argument
10321 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetSCLKLow()
10322 SiS_Pr->SiS_DDC_Index, in SiS_SetSCLKLow()
10323 SiS_Pr->SiS_DDC_NClk, in SiS_SetSCLKLow()
10325 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_SetSCLKLow()
10330 SiS_SetSCLKHigh(SiS_Private *SiS_Pr) in SiS_SetSCLKHigh() argument
10334 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetSCLKHigh()
10335 SiS_Pr->SiS_DDC_Index, in SiS_SetSCLKHigh()
10336 SiS_Pr->SiS_DDC_NClk, in SiS_SetSCLKHigh()
10337 SiS_Pr->SiS_DDC_Clk); /* SetSCLKHigh() */ in SiS_SetSCLKHigh()
10339 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); in SiS_SetSCLKHigh()
10340 } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); in SiS_SetSCLKHigh()
10347 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_SetSCLKHigh()
10354 SiS_CheckACK(SiS_Private *SiS_Pr) in SiS_CheckACK() argument
10358 SiS_SetSCLKLow(SiS_Pr); /* (SC->low) */ in SiS_CheckACK()
10359 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_CheckACK()
10360 SiS_Pr->SiS_DDC_Index, in SiS_CheckACK()
10361 SiS_Pr->SiS_DDC_NData, in SiS_CheckACK()
10362 SiS_Pr->SiS_DDC_Data); /* (SD->high) */ in SiS_CheckACK()
10363 SiS_SetSCLKHigh(SiS_Pr); /* SC->high = clock impulse for ack */ in SiS_CheckACK()
10364 tempah = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); /* Read SD */ in SiS_CheckACK()
10365 SiS_SetSCLKLow(SiS_Pr); /* SC->low = end of clock impulse */ in SiS_CheckACK()
10366 if(tempah & SiS_Pr->SiS_DDC_Data) return(1); /* Ack OK if bit = 0 */ in SiS_CheckACK()
10378 GetRAMDACromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in GetRAMDACromptr() argument
10385 if(SiS_Pr->SiS_VBType & VB_SIS301B302B) in GetRAMDACromptr()
10389 if(SiS_Pr->SiS_VBType & VB_SIS301B302B) in GetRAMDACromptr()
10396 GetLCDromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in GetLCDromptr() argument
10403 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) in GetLCDromptr()
10407 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) in GetLCDromptr()
10414 GetTVromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in GetTVromptr() argument
10421 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) in GetTVromptr()
10425 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) in GetTVromptr()
10432 GetLCDPtrIndexBIOS(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in GetLCDPtrIndexBIOS() argument
10436 if((IS_SIS650) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in GetLCDPtrIndexBIOS()
10437 if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) { in GetLCDPtrIndexBIOS()
10438 if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) { in GetLCDPtrIndexBIOS()
10441 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndexBIOS()
10442 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndexBIOS()
10448 index = SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F; in GetLCDPtrIndexBIOS()
10449 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) index -= 5; in GetLCDPtrIndexBIOS()
10450 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 6; in GetLCDPtrIndexBIOS()
10453 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndexBIOS()
10454 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndexBIOS()
10459 GetLCDPtrIndex(SiS_Private *SiS_Pr) in GetLCDPtrIndex() argument
10463 index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3; in GetLCDPtrIndex()
10464 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndex()
10465 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndex()
10470 GetTVPtrIndex(SiS_Private *SiS_Pr) in GetTVPtrIndex() argument
10475 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; in GetTVPtrIndex()
10476 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index = 2; in GetTVPtrIndex()
10478 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) index = 0; in GetTVPtrIndex()
10482 if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && in GetTVPtrIndex()
10483 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in GetTVPtrIndex()
10491 GetOEMTVPtr661_2_GEN(SiS_Private *SiS_Pr, int addme) in GetOEMTVPtr661_2_GEN() argument
10495 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; in GetOEMTVPtr661_2_GEN()
10496 if(SiS_Pr->SiS_TVMode & TVSetPALM) index = 2; in GetOEMTVPtr661_2_GEN()
10497 if(SiS_Pr->SiS_TVMode & TVSetPALN) index = 3; in GetOEMTVPtr661_2_GEN()
10498 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 6; in GetOEMTVPtr661_2_GEN()
10499 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in GetOEMTVPtr661_2_GEN()
10501 if(SiS_Pr->SiS_TVMode & TVSetPALM) index++; in GetOEMTVPtr661_2_GEN()
10502 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 7; in GetOEMTVPtr661_2_GEN()
10505 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in GetOEMTVPtr661_2_GEN()
10506 if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in GetOEMTVPtr661_2_GEN()
10507 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in GetOEMTVPtr661_2_GEN()
10517 GetOEMTVPtr661_2_OLD(SiS_Private *SiS_Pr) in GetOEMTVPtr661_2_OLD() argument
10519 return(GetOEMTVPtr661_2_GEN(SiS_Pr, 8)); in GetOEMTVPtr661_2_OLD()
10524 GetOEMTVPtr661_2_NEW(SiS_Private *SiS_Pr)
10526 return(GetOEMTVPtr661_2_GEN(SiS_Pr, 6));
10531 GetOEMTVPtr661(SiS_Private *SiS_Pr) in GetOEMTVPtr661() argument
10535 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 2; in GetOEMTVPtr661()
10536 if(SiS_Pr->SiS_ROMNew) { in GetOEMTVPtr661()
10537 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 4; in GetOEMTVPtr661()
10538 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 6; in GetOEMTVPtr661()
10539 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 8; in GetOEMTVPtr661()
10540 if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 10; in GetOEMTVPtr661()
10542 if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 4; in GetOEMTVPtr661()
10543 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6; in GetOEMTVPtr661()
10544 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8; in GetOEMTVPtr661()
10545 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10; in GetOEMTVPtr661()
10548 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) index++; in GetOEMTVPtr661()
10554 SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo) in SetDelayComp() argument
10560 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10561 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); in SetDelayComp()
10563 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f); in SetDelayComp()
10568 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { /* ------------ VGA */ in SetDelayComp()
10570 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10571 romptr = GetRAMDACromptr(SiS_Pr, HwInfo); in SetDelayComp()
10576 if(SiS_Pr->SiS_VBType & VB_SIS301B302B) { in SetDelayComp()
10586 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10591 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) { /* ---------- LCD/LCDA */ in SetDelayComp()
10597 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetDelayComp()
10598 if(SiS_Pr->PDC != -1) { in SetDelayComp()
10599 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f)); in SetDelayComp()
10600 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7)); in SetDelayComp()
10604 if(SiS_Pr->PDCA != -1) { in SetDelayComp()
10605 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0)); in SetDelayComp()
10606 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6)); in SetDelayComp()
10613 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) { in SetDelayComp()
10614 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10616 if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) { in SetDelayComp()
10619 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay); in SetDelayComp()
10622 if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x03; in SetDelayComp()
10623 else if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SetDelayComp()
10627 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay); in SetDelayComp()
10637 switch(SiS_Pr->SiS_CustomT) { in SetDelayComp()
10640 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SetDelayComp()
10654 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SetDelayComp()
10658 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10668 index = GetLCDPtrIndexBIOS(SiS_Pr, HwInfo); in SetDelayComp()
10669 myindex = GetLCDPtrIndex(SiS_Pr); in SetDelayComp()
10671 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in SetDelayComp()
10673 if(SiS_IsNotM650orLater(SiS_Pr, HwInfo)) { in SetDelayComp()
10675 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10690 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) in SetDelayComp()
10695 } else if(SiS_Pr->SiS_UseROM && in SetDelayComp()
10696 (!(SiS_Pr->SiS_ROMNew)) && in SetDelayComp()
10697 (SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) && in SetDelayComp()
10698 (SiS_Pr->SiS_LCDResInfo != Panel_1280x768) && in SetDelayComp()
10699 (SiS_Pr->SiS_LCDResInfo != Panel_1280x960)) { in SetDelayComp()
10702 romptr = GetLCDromptr(SiS_Pr, HwInfo); in SetDelayComp()
10706 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10714 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { in SetDelayComp()
10718 } else if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SetDelayComp()
10721 } else if(SiS_Pr->SiS_VBType & VB_SIS301B302B) { in SetDelayComp()
10730 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10731 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); in SetDelayComp()
10735 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* ------------ TV */ in SetDelayComp()
10737 index = GetTVPtrIndex(SiS_Pr); in SetDelayComp()
10739 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) { in SetDelayComp()
10741 if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) { in SetDelayComp()
10743 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10760 switch(SiS_Pr->SiS_CustomT) { in SetDelayComp()
10775 if(SiS_Pr->SiS_VBType & VB_SIS302LV) { in SetDelayComp()
10781 } else if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10783 romptr = GetTVromptr(SiS_Pr, HwInfo); in SetDelayComp()
10787 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10794 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SetDelayComp()
10800 if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02; in SetDelayComp()
10806 if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) { in SetDelayComp()
10815 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetDelayComp()
10817 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && dochiptest) { in SetDelayComp()
10819 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4; in SetDelayComp()
10829 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10833 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10839 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp()
10840 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10842 if(IS_SIS650 && (SiS_Pr->SiS_IF_DEF_CH70xx != 0)) { in SetDelayComp()
10844 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,delay); in SetDelayComp()
10846 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10855 SetAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetAntiFlicker() argument
10861 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p|TVSetYPbPr525p)) return; in SetAntiFlicker()
10864 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVFlickerIndex; in SetAntiFlicker()
10866 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVFlickerIndex; in SetAntiFlicker()
10868 temp = GetTVPtrIndex(SiS_Pr); in SetAntiFlicker()
10872 if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SetAntiFlicker()
10874 temp1 = GetOEMTVPtr661(SiS_Pr); in SetAntiFlicker()
10895 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8f,temp); /* index 0A D[6:4] */ in SetAntiFlicker()
10899 SetEdgeEnhance(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetEdgeEnhance() argument
10905 temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetEdgeEnhance()
10908 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex; in SetEdgeEnhance()
10910 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex; in SetEdgeEnhance()
10912 if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SetEdgeEnhance()
10918 temp1 = GetOEMTVPtr661(SiS_Pr); in SetEdgeEnhance()
10934 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x3A,0x1F,temp); /* index 0A D[7:5] */ in SetEdgeEnhance()
10938 SetYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetYFilter() argument
10944 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex; in SetYFilter()
10946 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex; in SetYFilter()
10949 temp = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetYFilter()
10951 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 1; /* NTSC-J uses PAL */ in SetYFilter()
10952 else if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 3; /* PAL-M */ in SetYFilter()
10953 else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 4; /* PAL-N */ in SetYFilter()
10954 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp = 1; /* HiVision uses PAL */ in SetYFilter()
10956 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SetYFilter()
10958 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); in SetYFilter()
10961 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); in SetYFilter()
10965 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter1[temp][index][j]); in SetYFilter()
10971 SetPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetPhaseIncr() argument
10978 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; in SetPhaseIncr()
10981 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) return; in SetPhaseIncr()
10983 if((HwInfo->jChipType >= SIS_661) || SiS_Pr->SiS_ROMNew) { in SetPhaseIncr()
10984 lindex = GetOEMTVPtr661_2_OLD(SiS_Pr) & 0xffff; in SetPhaseIncr()
10987 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS661_TVPhase[lindex + j]); in SetPhaseIncr()
10993 if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) return; in SetPhaseIncr()
10996 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SetPhaseIncr()
10998 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SetPhaseIncr()
11001 temp = GetTVPtrIndex(SiS_Pr); in SetPhaseIncr()
11005 if(SiS_Pr->SiS_UseROM) { in SetPhaseIncr()
11010 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SetPhaseIncr()
11015 if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode))) { in SetPhaseIncr()
11026 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetPhaseIncr()
11032 if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) in SetPhaseIncr()
11033 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); in SetPhaseIncr()
11034 else if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) in SetPhaseIncr()
11035 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr2[temp][index][j]); in SetPhaseIncr()
11037 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); in SetPhaseIncr()
11041 if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision))) { in SetPhaseIncr()
11042 if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPr525p | TVSetYPbPr750p))) && (ModeNo > 0x13)) { in SetPhaseIncr()
11045 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21); in SetPhaseIncr()
11046 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0); in SetPhaseIncr()
11047 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5); in SetPhaseIncr()
11048 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f); in SetPhaseIncr()
11050 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e); in SetPhaseIncr()
11051 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b); in SetPhaseIncr()
11052 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb); in SetPhaseIncr()
11053 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b); in SetPhaseIncr()
11060 SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SiS_OEM310Setting() argument
11063 SetDelayComp(SiS_Pr,HwInfo,ModeNo); in SiS_OEM310Setting()
11065 if(SiS_Pr->UseCustomMode) return; in SiS_OEM310Setting()
11067 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_OEM310Setting()
11068 SetAntiFlicker(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
11069 SetPhaseIncr(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
11070 SetYFilter(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
11071 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_OEM310Setting()
11072 SetEdgeEnhance(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
11078 SetDelayComp661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, in SetDelayComp661() argument
11084 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToRAMDAC))) in SetDelayComp661()
11089 if(SiS_Pr->SiS_ROMNew) { in SetDelayComp661()
11090 if((SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) || in SetDelayComp661()
11091 ((SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && in SetDelayComp661()
11092 (SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SetDelayComp661()
11094 if(SiS_Pr->UseCustomMode) { in SetDelayComp661()
11095 index = SiS_Pr->CSRClock; in SetDelayComp661()
11097 index = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RTI,HwInfo); in SetDelayComp661()
11098 index = SiS_Pr->SiS_VCLKData[index].CLOCK; in SetDelayComp661()
11102 if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) { in SetDelayComp661()
11107 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD)) { in SetDelayComp661()
11108 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
11109 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
11111 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
11112 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
11120 if(SiS_Pr->UseCustomMode) delay = 0x04; in SetDelayComp661()
11122 else delay = (SiS_Pr->SiS_RefIndex[RTI].Ext_PDC >> 4); in SetDelayComp661()
11125 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
11129 index = GetOEMTVPtr661(SiS_Pr); in SetDelayComp661()
11130 if(SiS_Pr->SiS_ROMNew) { in SetDelayComp661()
11137 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SetDelayComp661()
11141 if( (SiS_Pr->SiS_LCDResInfo != Panel_Custom) && in SetDelayComp661()
11142 ((romptr = GetLCDStructPtr661_2(SiS_Pr, HwInfo))) ) { in SetDelayComp661()
11151 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SetDelayComp661()
11152 if((SiS_Pr->PanelXRes <= 1024) && (SiS_Pr->PanelYRes <= 768)) { in SetDelayComp661()
11154 } else if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) { in SetDelayComp661()
11156 } else if((SiS_Pr->PanelXRes <= 1400) && (SiS_Pr->PanelYRes <= 1050)) { in SetDelayComp661()
11164 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->PDC != -1)) { in SetDelayComp661()
11165 delay = SiS_Pr->PDC & 0x1f; in SetDelayComp661()
11167 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) && (SiS_Pr->PDCA != -1)) { in SetDelayComp661()
11168 delay = (SiS_Pr->PDCA & 0x1f) << 8; in SetDelayComp661()
11175 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp661()
11177 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
11178 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
11180 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
11181 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
11186 SetCRT2SyncDither661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT RTI) in SetCRT2SyncDither661() argument
11191 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SetCRT2SyncDither661()
11194 infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2); in SetCRT2SyncDither661()
11195 } else if(SiS_Pr->UseCustomMode) { in SetCRT2SyncDither661()
11196 infoflag = SiS_Pr->CInfoFlag; in SetCRT2SyncDither661()
11198 infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag; in SetCRT2SyncDither661()
11202 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SetCRT2SyncDither661()
11203 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SetCRT2SyncDither661()
11211 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetCRT2SyncDither661()
11215 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp); in SetCRT2SyncDither661()
11219 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp); in SetCRT2SyncDither661()
11224 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp); in SetCRT2SyncDither661()
11231 SetPanelParms661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) in SetPanelParms661() argument
11236 if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) { in SetPanelParms661()
11237 if(SiS_Pr->LVDSHL != -1) { in SetPanelParms661()
11238 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SetPanelParms661()
11242 if(SiS_Pr->SiS_ROMNew) { in SetPanelParms661()
11244 if((romptr = GetLCDStructPtr661_2(SiS_Pr, HwInfo))) { in SetPanelParms661()
11245 if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) { in SetPanelParms661()
11248 if(SiS_Pr->LVDSHL != -1) { in SetPanelParms661()
11252 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1); in SetPanelParms661()
11254 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetPanelParms661()
11256 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1); in SetPanelParms661()
11264 SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SiS_OEM661Setting() argument
11267 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_OEM661Setting()
11269 SetDelayComp661(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,RRTI); in SiS_OEM661Setting()
11271 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_OEM661Setting()
11272 SetCRT2SyncDither661(SiS_Pr,HwInfo,ModeNo,RRTI); in SiS_OEM661Setting()
11273 SetPanelParms661(SiS_Pr,HwInfo); in SiS_OEM661Setting()
11276 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_OEM661Setting()
11277 SetPhaseIncr(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM661Setting()
11278 SetYFilter(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM661Setting()
11279 SetAntiFlicker(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM661Setting()
11280 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_OEM661Setting()
11281 SetEdgeEnhance(SiS_Pr,HwInfo,ModeNo,ModeIdIndex); in SiS_OEM661Setting()
11295 SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, in SiS_FinalizeLCD() argument
11301 if(!(SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) return; in SiS_FinalizeLCD()
11303 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
11304 if(SiS_Pr->LVDSHL != -1) { in SiS_FinalizeLCD()
11305 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SiS_FinalizeLCD()
11309 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; in SiS_FinalizeLCD()
11310 if(SiS_Pr->UseCustomMode) return; in SiS_FinalizeLCD()
11312 switch(SiS_Pr->SiS_CustomT) { in SiS_FinalizeLCD()
11321 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_FinalizeLCD()
11322 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_FinalizeLCD()
11324 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_FinalizeLCD()
11325 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_FinalizeLCD()
11329 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) { in SiS_FinalizeLCD()
11330 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { in SiS_FinalizeLCD()
11331 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02); in SiS_FinalizeLCD()
11333 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_FinalizeLCD()
11338 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { in SiS_FinalizeLCD()
11339 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
11341 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
11342 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
11348 if(SiS_Pr->SiS_CustomT == CUT_CLEVO10242) { in SiS_FinalizeLCD()
11349 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
11350 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
11351 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
11353 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
11355 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_FinalizeLCD()
11356 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
11358 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
11359 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
11360 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
11361 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
11369 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
11370 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
11372 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { in SiS_FinalizeLCD()
11373 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_FinalizeLCD()
11374 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_FinalizeLCD()
11375 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_FinalizeLCD()
11378 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_FinalizeLCD()
11379 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
11381 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
11384 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
11385 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_FinalizeLCD()
11386 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { in SiS_FinalizeLCD()
11387 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76); in SiS_FinalizeLCD()
11388 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
11390 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
11391 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
11392 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
11393 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
11395 if((SiS_Pr->Backup == TRUE) && (SiS_Pr->Backup_Mode == ModeNo)) { in SiS_FinalizeLCD()
11396 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); in SiS_FinalizeLCD()
11397 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); in SiS_FinalizeLCD()
11398 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); in SiS_FinalizeLCD()
11399 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17); in SiS_FinalizeLCD()
11400 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18); in SiS_FinalizeLCD()
11401 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19); in SiS_FinalizeLCD()
11402 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a); in SiS_FinalizeLCD()
11403 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b); in SiS_FinalizeLCD()
11404 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c); in SiS_FinalizeLCD()
11405 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d); in SiS_FinalizeLCD()
11406 } else if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { /* 1.10.8w */ in SiS_FinalizeLCD()
11407 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90); in SiS_FinalizeLCD()
11409 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11); in SiS_FinalizeLCD()
11411 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18); in SiS_FinalizeLCD()
11414 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
11416 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); /* 1.10.7u */ in SiS_FinalizeLCD()
11421 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); in SiS_FinalizeLCD()
11423 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp); in SiS_FinalizeLCD()
11428 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70); in SiS_FinalizeLCD()
11429 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff); in SiS_FinalizeLCD()
11430 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
11431 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
11434 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20); in SiS_FinalizeLCD()
11435 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a); in SiS_FinalizeLCD()
11436 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28); in SiS_FinalizeLCD()
11437 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00); in SiS_FinalizeLCD()
11438 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c); in SiS_FinalizeLCD()
11439 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
11443 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
11444 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
11445 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10); in SiS_FinalizeLCD()
11446 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
11447 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48); in SiS_FinalizeLCD()
11448 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
11451 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
11452 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
11455 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
11463 tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_FinalizeLCD()
11467 tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04); in SiS_FinalizeLCD()
11469 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
11470 if((resinfo == SIS_RI_1024x768) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) { in SiS_FinalizeLCD()
11471 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_FinalizeLCD()
11475 if(SiS_Pr->SiS_VGAVDE < 600) { in SiS_FinalizeLCD()
11476 tempax = 768 - SiS_Pr->SiS_VGAVDE; in SiS_FinalizeLCD()
11478 if(SiS_Pr->SiS_VGAVDE <= 480) tempax >>= 4; /* 1.10.7w; 1.10.6s: < 480; >>=1; */ in SiS_FinalizeLCD()
11485 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp); in SiS_FinalizeLCD()
11487 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp); in SiS_FinalizeLCD()
11499 SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMLCDData2() argument
11507 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SetOEMLCDData2()
11508 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SetOEMLCDData2()
11510 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SetOEMLCDData2()
11511 crt2crtc = SiS_Pr->SiS_RefIndex[RefTabIndex].Ext_CRT2CRTC; in SetOEMLCDData2()
11516 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SetOEMLCDData2()
11517 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf); in SetOEMLCDData2()
11520 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SetOEMLCDData2()
11523 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SetOEMLCDData2()
11526 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, in SetOEMLCDData2()
11533 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SetOEMLCDData2()
11535 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18); in SetOEMLCDData2()
11537 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); in SetOEMLCDData2()
11543 GetOEMLCDPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, int Flag) in GetOEMLCDPtr() argument
11558 tempbx = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f) - 2; in GetOEMLCDPtr()
11559 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 4; in GetOEMLCDPtr()
11560 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in GetOEMLCDPtr()
11561 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 3; in GetOEMLCDPtr()
11563 if(SiS_Pr->SiS_UseROM) { in GetOEMLCDPtr()
11565 tempbx = SiS_Pr->SiS_LCDTypeInfo; in GetOEMLCDPtr()
11568 if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11569 else tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11573 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; in GetOEMLCDPtr()
11580 if(SiS_Pr->SiS_UseROM) { in GetOEMLCDPtr()
11582 if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11585 tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11589 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; in GetOEMLCDPtr()
11590 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in GetOEMLCDPtr()
11593 tempbx = SiS_Pr->SiS_LCDTypeInfo << 2; in GetOEMLCDPtr()
11594 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; in GetOEMLCDPtr()
11595 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in GetOEMLCDPtr()
11601 SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMLCDDelay() argument
11607 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; in SetOEMLCDDelay()
11609 if(SiS_Pr->SiS_UseROM) { in SetOEMLCDDelay()
11622 if(SiS_Pr->PDC != -1) return; in SetOEMLCDDelay()
11624 temp = GetOEMLCDPtr(SiS_Pr,HwInfo, 0); in SetOEMLCDDelay()
11626 if(SiS_Pr->UseCustomMode) in SetOEMLCDDelay()
11629 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_LCDDelayIndex; in SetOEMLCDDelay()
11638 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetOEMLCDDelay()
11645 if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) { in SetOEMLCDDelay()
11655 if(SiS_Pr->SiS_UseROM) { in SetOEMLCDDelay()
11671 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* index 0A D[6:4] */ in SetOEMLCDDelay()
11675 SetOEMLCDData(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMLCDData() argument
11682 if (SiS_Pr->SiS_UseROM) { in SetOEMLCDData()
11688 temp = GetOEMLCDPtr(SiS_Pr,HwInfo, 1); in SetOEMLCDData()
11691 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDHIndex; in SetOEMLCDData()
11693 SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDHData[temp][index][j]); in SetOEMLCDData()
11697 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDVIndex; in SetOEMLCDData()
11702 SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDVData[temp][index][j]); in SetOEMLCDData()
11708 GetOEMTVPtr(SiS_Private *SiS_Pr) in GetOEMTVPtr() argument
11713 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) index += 4; in GetOEMTVPtr()
11714 if(SiS_Pr->SiS_VBType & VB_SISVB) { in GetOEMTVPtr()
11715 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) index += 2; in GetOEMTVPtr()
11716 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index += 3; in GetOEMTVPtr()
11717 else if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; in GetOEMTVPtr()
11719 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) index += 2; in GetOEMTVPtr()
11720 if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; in GetOEMTVPtr()
11726 SetOEMTVDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMTVDelay() argument
11732 if(SiS_Pr->SiS_UseROM) { in SetOEMTVDelay()
11738 temp = GetOEMTVPtr(SiS_Pr); in SetOEMTVDelay()
11740 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVDelayIndex; in SetOEMTVDelay()
11748 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetOEMTVDelay()
11755 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); in SetOEMTVDelay()
11759 SetOEMAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMAntiFlicker() argument
11765 if(SiS_Pr->SiS_UseROM) { in SetOEMAntiFlicker()
11771 temp = GetOEMTVPtr(SiS_Pr); in SetOEMAntiFlicker()
11773 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVFlickerIndex; in SetOEMAntiFlicker()
11784 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp); in SetOEMAntiFlicker()
11788 SetOEMPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMPhaseIncr() argument
11794 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) return; in SetOEMPhaseIncr()
11796 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPALN)) return; in SetOEMPhaseIncr()
11798 if(SiS_Pr->SiS_UseROM) { in SetOEMPhaseIncr()
11804 temp = GetOEMTVPtr(SiS_Pr); in SetOEMPhaseIncr()
11806 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVPhaseIndex; in SetOEMPhaseIncr()
11808 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SetOEMPhaseIncr()
11810 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase2[temp][index][j]); in SetOEMPhaseIncr()
11818 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetOEMPhaseIncr()
11822 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase1[temp][index][j]); in SetOEMPhaseIncr()
11829 SetOEMYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SetOEMYFilter() argument
11835 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVision | SetCRT2ToYPbPr525750)) return; in SetOEMYFilter()
11837 if(SiS_Pr->SiS_UseROM) { in SetOEMYFilter()
11843 temp = GetOEMTVPtr(SiS_Pr); in SetOEMYFilter()
11845 if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; in SetOEMYFilter()
11846 else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 9; in SetOEMYFilter()
11849 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVYFilterIndex; in SetOEMYFilter()
11851 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) { in SetOEMYFilter()
11853 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); in SetOEMYFilter()
11856 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); in SetOEMYFilter()
11859 if((romptr) && (!(SiS_Pr->SiS_TVMode & (TVSetPALM|TVSetPALN)))) { in SetOEMYFilter()
11864 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetOEMYFilter()
11868 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter1[temp][index][j]); in SetOEMYFilter()
11875 SiS_SearchVBModeID(SiS_Private *SiS_Pr, USHORT *ModeNo) in SiS_SearchVBModeID() argument
11878 UCHAR VGAINFO = SiS_Pr->SiS_VGAINFO; in SiS_SearchVBModeID()
11883 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == *ModeNo) break; in SiS_SearchVBModeID()
11884 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF) return 0; in SiS_SearchVBModeID()
11899 SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, in SiS_OEM300Setting() argument
11904 if(!SiS_Pr->UseCustomMode) { in SiS_OEM300Setting()
11905 OEMModeIdIndex = SiS_SearchVBModeID(SiS_Pr,&ModeNo); in SiS_OEM300Setting()
11909 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_OEM300Setting()
11910 SetOEMLCDDelay(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11911 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_OEM300Setting()
11912 SetOEMLCDData(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11915 if(SiS_Pr->UseCustomMode) return; in SiS_OEM300Setting()
11916 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_OEM300Setting()
11917 SetOEMTVDelay(SiS_Pr, HwInfo, ModeNo,OEMModeIdIndex); in SiS_OEM300Setting()
11918 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_OEM300Setting()
11919 SetOEMAntiFlicker(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11920 SetOEMPhaseIncr(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11921 SetOEMYFilter(SiS_Pr, HwInfo, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()