Lines Matching refs:SiS_Pr
367 static void SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr);
368 static void SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr);
369 static void SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr);
370 static void SiS_ChrontelDoSomething1(struct SiS_Private *SiS_Pr);
374 static bool SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr);
377 static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags,
380 static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr);
381 static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype,
383 static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr);
384 static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr);
385 static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr);
386 static unsigned short SiS_SetSCLKLow(struct SiS_Private *SiS_Pr);
387 static unsigned short SiS_SetSCLKHigh(struct SiS_Private *SiS_Pr);
388 static unsigned short SiS_ReadDDC2Data(struct SiS_Private *SiS_Pr);
389 static unsigned short SiS_WriteDDC2Data(struct SiS_Private *SiS_Pr, unsigned short tempax);
390 static unsigned short SiS_CheckACK(struct SiS_Private *SiS_Pr);
391 static unsigned short SiS_WriteDABDDC(struct SiS_Private *SiS_Pr);
392 static unsigned short SiS_PrepareReadDDC(struct SiS_Private *SiS_Pr);
393 static unsigned short SiS_PrepareDDC(struct SiS_Private *SiS_Pr);
394 static void SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno);
395 static unsigned short SiS_DoProbeDDC(struct SiS_Private *SiS_Pr);
398 static void SiS_OEM300Setting(struct SiS_Private *SiS_Pr,
400 static void SetOEMLCDData2(struct SiS_Private *SiS_Pr,
404 static void SiS_OEM310Setting(struct SiS_Private *SiS_Pr,
406 static void SiS_OEM661Setting(struct SiS_Private *SiS_Pr,
411 static unsigned short SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr);
412 static void SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val);
419 SiS_UnLockCRT2(struct SiS_Private *SiS_Pr) in SiS_UnLockCRT2() argument
421 if(SiS_Pr->ChipType == XGI_20) in SiS_UnLockCRT2()
423 else if(SiS_Pr->ChipType >= SIS_315H) in SiS_UnLockCRT2()
424 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_UnLockCRT2()
426 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); in SiS_UnLockCRT2()
431 SiS_LockCRT2(struct SiS_Private *SiS_Pr) in SiS_LockCRT2() argument
433 if(SiS_Pr->ChipType == XGI_20) in SiS_LockCRT2()
435 else if(SiS_Pr->ChipType >= SIS_315H) in SiS_LockCRT2()
436 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE); in SiS_LockCRT2()
438 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE); in SiS_LockCRT2()
446 SiS_SetRegSR11ANDOR(struct SiS_Private *SiS_Pr, unsigned short DataAND, unsigned short DataOR) in SiS_SetRegSR11ANDOR() argument
448 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetRegSR11ANDOR()
452 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR); in SiS_SetRegSR11ANDOR()
461 GetLCDStructPtr661(struct SiS_Private *SiS_Pr) in GetLCDStructPtr661() argument
463 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetLCDStructPtr661()
474 if((SiS_Pr->SiS_ROMNew) && in GetLCDStructPtr661()
475 ((SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected))) { in GetLCDStructPtr661()
477 if(SiS_Pr->ChipType < SIS_661) reg = 0x3c; in GetLCDStructPtr661()
480 idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26; in GetLCDStructPtr661()
495 GetLCDStructPtr661_2(struct SiS_Private *SiS_Pr) in GetLCDStructPtr661_2() argument
497 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetLCDStructPtr661_2()
507 if((SiS_Pr->SiS_ROMNew) && in GetLCDStructPtr661_2()
508 ((SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected))) { in GetLCDStructPtr661_2()
510 romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize); in GetLCDStructPtr661_2()
522 SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_AdjustCRT2Rate() argument
527 modeid = SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID; in SiS_AdjustCRT2Rate()
529 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_AdjustCRT2Rate()
531 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_AdjustCRT2Rate()
534 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_AdjustCRT2Rate()
536 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_AdjustCRT2Rate()
538 if(SiS_Pr->SiS_VBType & VB_SISRAMDAC202) { in SiS_AdjustCRT2Rate()
544 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_AdjustCRT2Rate()
547 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_AdjustCRT2Rate()
548 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_AdjustCRT2Rate()
549 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_AdjustCRT2Rate()
555 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_AdjustCRT2Rate()
559 …} else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750|SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCAR… in SiS_AdjustCRT2Rate()
562 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_AdjustCRT2Rate()
564 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_AdjustCRT2Rate()
565 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_AdjustCRT2Rate()
575 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_AdjustCRT2Rate()
576 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_AdjustCRT2Rate()
581 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_AdjustCRT2Rate()
588 for(; SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID == modeid; (*i)--) { in SiS_AdjustCRT2Rate()
589 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; in SiS_AdjustCRT2Rate()
598 if(SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID != modeid) break; in SiS_AdjustCRT2Rate()
599 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; in SiS_AdjustCRT2Rate()
610 SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_GetRatePtr() argument
626 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetRatePtr()
628 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetRatePtr()
631 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
632 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetRatePtr()
639 index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; in SiS_GetRatePtr()
644 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetRatePtr()
645 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetRatePtr()
646 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetRatePtr()
647 if(SiS_Pr->SiS_VBType & VB_NoLCD) index = 0; in SiS_GetRatePtr()
648 else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0; in SiS_GetRatePtr()
650 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_GetRatePtr()
651 if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetRatePtr()
652 temp = LCDRefreshIndex[SiS_GetBIOSLCDResInfo(SiS_Pr)]; in SiS_GetRatePtr()
657 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0; in SiS_GetRatePtr()
658 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
659 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0; in SiS_GetRatePtr()
664 RRTI = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; in SiS_GetRatePtr()
665 ModeNo = SiS_Pr->SiS_RefIndex[RRTI].ModeID; in SiS_GetRatePtr()
667 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetRatePtr()
668 if(!(SiS_Pr->SiS_VBInfo & DriverMode)) { in SiS_GetRatePtr()
669 if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) || in SiS_GetRatePtr()
670 (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) { in SiS_GetRatePtr()
678 if(SiS_Pr->SiS_RefIndex[RRTI + i].ModeID != ModeNo) break; in SiS_GetRatePtr()
679 temp = SiS_Pr->SiS_RefIndex[RRTI + i].Ext_InfoFlag; in SiS_GetRatePtr()
681 if(temp < SiS_Pr->SiS_ModeType) break; in SiS_GetRatePtr()
686 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_GetRatePtr()
687 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetRatePtr()
688 temp = SiS_Pr->SiS_RefIndex[RRTI + i - 1].Ext_InfoFlag; in SiS_GetRatePtr()
695 if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) { in SiS_GetRatePtr()
697 if(!(SiS_AdjustCRT2Rate(SiS_Pr, ModeNo, ModeIdIndex, RRTI, &i))) { in SiS_GetRatePtr()
710 SiS_SaveCRT2Info(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_SaveCRT2Info() argument
715 SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo); in SiS_SaveCRT2Info()
716 temp1 = (SiS_Pr->SiS_VBInfo & SetInSlaveMode) >> 8; in SiS_SaveCRT2Info()
718 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1); in SiS_SaveCRT2Info()
727 SiS_CR36BIOSWord23b(struct SiS_Private *SiS_Pr) in SiS_CR36BIOSWord23b() argument
729 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_CR36BIOSWord23b()
732 if(SiS_Pr->SiS_UseROM) { in SiS_CR36BIOSWord23b()
734 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23b()
743 SiS_CR36BIOSWord23d(struct SiS_Private *SiS_Pr) in SiS_CR36BIOSWord23d() argument
745 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_CR36BIOSWord23d()
748 if(SiS_Pr->SiS_UseROM) { in SiS_CR36BIOSWord23d()
750 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23d()
764 SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime) in SiS_DDC2Delay() argument
767 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); in SiS_DDC2Delay()
772 SiS_GenericDelay(struct SiS_Private *SiS_Pr, unsigned short delay) in SiS_GenericDelay() argument
774 SiS_DDC2Delay(SiS_Pr, delay * 36); in SiS_GenericDelay()
780 SiS_LongDelay(struct SiS_Private *SiS_Pr, unsigned short delay) in SiS_LongDelay() argument
783 SiS_GenericDelay(SiS_Pr, 6623); in SiS_LongDelay()
790 SiS_ShortDelay(struct SiS_Private *SiS_Pr, unsigned short delay) in SiS_ShortDelay() argument
793 SiS_GenericDelay(SiS_Pr, 66); in SiS_ShortDelay()
799 SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) in SiS_PanelDelay() argument
802 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_PanelDelay()
806 if(SiS_Pr->ChipType < SIS_315H) { in SiS_PanelDelay()
810 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
811 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_PanelDelay()
812 if(SiS_Pr->SiS_VBType & VB_SIS301) PanelID &= 0xf7; in SiS_PanelDelay()
813 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
821 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
823 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; in SiS_PanelDelay()
825 if(SiS_Pr->SiS_UseROM) { in SiS_PanelDelay()
832 SiS_ShortDelay(SiS_Pr, Delay); in SiS_PanelDelay()
840 if((SiS_Pr->ChipType >= SIS_661) || in SiS_PanelDelay()
841 (SiS_Pr->ChipType <= SIS_315PRO) || in SiS_PanelDelay()
842 (SiS_Pr->ChipType == SIS_330) || in SiS_PanelDelay()
843 (SiS_Pr->SiS_ROMNew)) { in SiS_PanelDelay()
846 SiS_DDC2Delay(SiS_Pr, 0x1000); in SiS_PanelDelay()
848 SiS_DDC2Delay(SiS_Pr, 0x4000); in SiS_PanelDelay()
851 } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* 315 series, LVDS; Special */ in SiS_PanelDelay()
853 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_PanelDelay()
854 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
855 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) { in SiS_PanelDelay()
856 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
858 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_PanelDelay()
868 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0]; in SiS_PanelDelay()
870 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1]; in SiS_PanelDelay()
872 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_PanelDelay()
882 SiS_ShortDelay(SiS_Pr, Delay); in SiS_PanelDelay()
885 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 315 series, all bridges */ in SiS_PanelDelay()
887 DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_PanelDelay()
889 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
891 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; in SiS_PanelDelay()
894 SiS_DDC2Delay(SiS_Pr, Delay); in SiS_PanelDelay()
905 SiS_PanelDelayLoop(struct SiS_Private *SiS_Pr, unsigned short DelayTime, unsigned short DelayLoop) in SiS_PanelDelayLoop() argument
909 SiS_PanelDelay(SiS_Pr, DelayTime); in SiS_PanelDelayLoop()
919 SiS_WaitRetrace1(struct SiS_Private *SiS_Pr) in SiS_WaitRetrace1() argument
923 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return; in SiS_WaitRetrace1()
924 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return; in SiS_WaitRetrace1()
927 while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog); in SiS_WaitRetrace1()
929 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); in SiS_WaitRetrace1()
934 SiS_WaitRetrace2(struct SiS_Private *SiS_Pr, unsigned short reg) in SiS_WaitRetrace2() argument
939 while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog); in SiS_WaitRetrace2()
941 while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog); in SiS_WaitRetrace2()
946 SiS_WaitVBRetrace(struct SiS_Private *SiS_Pr) in SiS_WaitVBRetrace() argument
948 if(SiS_Pr->ChipType < SIS_315H) { in SiS_WaitVBRetrace()
950 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_WaitVBRetrace()
951 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; in SiS_WaitVBRetrace()
953 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) { in SiS_WaitVBRetrace()
954 SiS_WaitRetrace1(SiS_Pr); in SiS_WaitVBRetrace()
956 SiS_WaitRetrace2(SiS_Pr, 0x25); in SiS_WaitVBRetrace()
961 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { in SiS_WaitVBRetrace()
962 SiS_WaitRetrace1(SiS_Pr); in SiS_WaitVBRetrace()
964 SiS_WaitRetrace2(SiS_Pr, 0x30); in SiS_WaitVBRetrace()
971 SiS_VBWait(struct SiS_Private *SiS_Pr) in SiS_VBWait() argument
978 tempal = SiS_GetRegByte(SiS_Pr->SiS_P3da); in SiS_VBWait()
992 SiS_VBLongWait(struct SiS_Private *SiS_Pr) in SiS_VBLongWait() argument
994 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_VBLongWait()
995 SiS_VBWait(SiS_Pr); in SiS_VBLongWait()
997 SiS_WaitRetrace1(SiS_Pr); in SiS_VBLongWait()
1007 SiS_Is301B(struct SiS_Private *SiS_Pr) in SiS_Is301B() argument
1009 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return true; in SiS_Is301B()
1015 SiS_CRT2IsLCD(struct SiS_Private *SiS_Pr) in SiS_CRT2IsLCD() argument
1017 if(SiS_Pr->ChipType == SIS_730) { in SiS_CRT2IsLCD()
1018 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return true; in SiS_CRT2IsLCD()
1020 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return true; in SiS_CRT2IsLCD()
1025 SiS_IsDualEdge(struct SiS_Private *SiS_Pr) in SiS_IsDualEdge() argument
1028 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsDualEdge()
1029 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { in SiS_IsDualEdge()
1030 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; in SiS_IsDualEdge()
1038 SiS_IsVAMode(struct SiS_Private *SiS_Pr) in SiS_IsVAMode() argument
1043 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsVAMode()
1044 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsVAMode()
1053 SiS_IsVAorLCD(struct SiS_Private *SiS_Pr) in SiS_IsVAorLCD() argument
1055 if(SiS_IsVAMode(SiS_Pr)) return true; in SiS_IsVAorLCD()
1056 if(SiS_CRT2IsLCD(SiS_Pr)) return true; in SiS_IsVAorLCD()
1062 SiS_IsDualLink(struct SiS_Private *SiS_Pr) in SiS_IsDualLink() argument
1065 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsDualLink()
1066 if((SiS_CRT2IsLCD(SiS_Pr)) || in SiS_IsDualLink()
1067 (SiS_IsVAMode(SiS_Pr))) { in SiS_IsDualLink()
1068 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return true; in SiS_IsDualLink()
1077 SiS_TVEnabled(struct SiS_Private *SiS_Pr) in SiS_TVEnabled() argument
1079 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return true; in SiS_TVEnabled()
1080 if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { in SiS_TVEnabled()
1081 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return true; in SiS_TVEnabled()
1089 SiS_LCDAEnabled(struct SiS_Private *SiS_Pr) in SiS_LCDAEnabled() argument
1091 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return true; in SiS_LCDAEnabled()
1098 SiS_WeHaveBacklightCtrl(struct SiS_Private *SiS_Pr) in SiS_WeHaveBacklightCtrl() argument
1100 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { in SiS_WeHaveBacklightCtrl()
1101 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return true; in SiS_WeHaveBacklightCtrl()
1109 SiS_IsNotM650orLater(struct SiS_Private *SiS_Pr) in SiS_IsNotM650orLater() argument
1113 if(SiS_Pr->ChipType == SIS_650) { in SiS_IsNotM650orLater()
1114 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; in SiS_IsNotM650orLater()
1118 } else if(SiS_Pr->ChipType >= SIS_661) return false; in SiS_IsNotM650orLater()
1125 SiS_IsYPbPr(struct SiS_Private *SiS_Pr) in SiS_IsYPbPr() argument
1127 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsYPbPr()
1129 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return true; in SiS_IsYPbPr()
1137 SiS_IsChScart(struct SiS_Private *SiS_Pr) in SiS_IsChScart() argument
1139 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsChScart()
1141 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return true; in SiS_IsChScart()
1149 SiS_IsTVOrYPbPrOrScart(struct SiS_Private *SiS_Pr) in SiS_IsTVOrYPbPrOrScart() argument
1153 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsTVOrYPbPrOrScart()
1154 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1156 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsTVOrYPbPrOrScart()
1160 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1169 SiS_IsLCDOrLCDA(struct SiS_Private *SiS_Pr) in SiS_IsLCDOrLCDA() argument
1173 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsLCDOrLCDA()
1174 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1176 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsLCDOrLCDA()
1179 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1187 SiS_HaveBridge(struct SiS_Private *SiS_Pr) in SiS_HaveBridge() argument
1191 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_HaveBridge()
1193 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_HaveBridge()
1194 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiS_HaveBridge()
1201 SiS_BridgeIsEnabled(struct SiS_Private *SiS_Pr) in SiS_BridgeIsEnabled() argument
1205 if(SiS_HaveBridge(SiS_Pr)) { in SiS_BridgeIsEnabled()
1206 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_BridgeIsEnabled()
1207 if(SiS_Pr->ChipType < SIS_315H) { in SiS_BridgeIsEnabled()
1219 SiS_BridgeInSlavemode(struct SiS_Private *SiS_Pr) in SiS_BridgeInSlavemode() argument
1223 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); in SiS_BridgeInSlavemode()
1235 SiS_SetChrontelGPIO(struct SiS_Private *SiS_Pr, unsigned short myvbinfo) in SiS_SetChrontelGPIO() argument
1240 if(!(SiS_Pr->SiS_ChSW)) return; in SiS_SetChrontelGPIO()
1242 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); in SiS_SetChrontelGPIO()
1258 SiS_GetVBInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetVBInfo() argument
1264 SiS_Pr->SiS_SetFlag = 0; in SiS_GetVBInfo()
1266 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetVBInfo()
1268 SiS_Pr->SiS_ModeType = modeflag & ModeTypeMask; in SiS_GetVBInfo()
1270 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetVBInfo()
1271 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetVBInfo()
1276 if(SiS_HaveBridge(SiS_Pr)) { in SiS_GetVBInfo()
1278 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_GetVBInfo()
1280 tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8; in SiS_GetVBInfo()
1285 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1286 if(SiS_Pr->SiS_VBType & VB_SISLCDA) { in SiS_GetVBInfo()
1289 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf); in SiS_GetVBInfo()
1291 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) { in SiS_GetVBInfo()
1293 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); in SiS_GetVBInfo()
1296 if(SiS_Pr->SiS_UseLCDA) { in SiS_GetVBInfo()
1297 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) { in SiS_GetVBInfo()
1298 if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) { in SiS_GetVBInfo()
1299 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA)); in SiS_GetVBInfo()
1304 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1310 if(SiS_Pr->ChipType >= SIS_661) { /* New CR layout */ in SiS_GetVBInfo()
1312 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & 0x04) { in SiS_GetVBInfo()
1313 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; in SiS_GetVBInfo()
1315 else if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { in SiS_GetVBInfo()
1321 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetVBInfo()
1322 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1326 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1336 if(!(SiS_Pr->SiS_VBType & VB_SISVGA2)) { in SiS_GetVBInfo()
1340 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetVBInfo()
1350 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1351 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1363 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1376 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetVBInfo()
1396 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1401 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1409 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1426 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_GetVBInfo()
1427 if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_GetVBInfo()
1428 ((SiS_Pr->SiS_VBType & VB_NoLCD) && (tempbx & SetCRT2ToLCD)) ) { in SiS_GetVBInfo()
1441 if(SiS_BridgeIsEnabled(SiS_Pr)) { in SiS_GetVBInfo()
1443 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_GetVBInfo()
1467 SiS_Pr->SiS_VBInfo = tempbx; in SiS_GetVBInfo()
1470 if(SiS_Pr->ChipType == SIS_630) { in SiS_GetVBInfo()
1471 SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); in SiS_GetVBInfo()
1477 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); in SiS_GetVBInfo()
1486 SiS_SetYPbPr(struct SiS_Private *SiS_Pr) in SiS_SetYPbPr() argument
1499 SiS_Pr->SiS_YPbPr = 0; in SiS_SetYPbPr()
1500 if(SiS_Pr->ChipType >= SIS_661) return; in SiS_SetYPbPr()
1502 if(SiS_Pr->SiS_VBType) { in SiS_SetYPbPr()
1503 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetYPbPr()
1504 SiS_Pr->SiS_YPbPr = YPbPrHiVision; in SiS_SetYPbPr()
1508 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetYPbPr()
1509 if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { in SiS_SetYPbPr()
1510 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetYPbPr()
1513 case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i; break; in SiS_SetYPbPr()
1514 case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p; break; in SiS_SetYPbPr()
1515 case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p; break; in SiS_SetYPbPr()
1516 case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break; in SiS_SetYPbPr()
1529 SiS_SetTVMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetTVMode() argument
1531 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetTVMode()
1533 unsigned char OutputSelect = *SiS_Pr->pSiS_OutputSelect; in SiS_SetTVMode()
1535 SiS_Pr->SiS_TVMode = 0; in SiS_SetTVMode()
1537 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; in SiS_SetTVMode()
1538 if(SiS_Pr->UseCustomMode) return; in SiS_SetTVMode()
1541 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetTVMode()
1544 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetTVMode()
1546 if(SiS_Pr->SiS_VBInfo & SetPALTV) SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1548 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1550 if((SiS_Pr->ChipType == SIS_630) || in SiS_SetTVMode()
1551 (SiS_Pr->ChipType == SIS_730)) { in SiS_SetTVMode()
1554 } else if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetTVMode()
1556 if(SiS_Pr->ChipType < XGI_20) { in SiS_SetTVMode()
1558 if(SiS_Pr->ChipType >= SIS_330) romindex = 0x11b; in SiS_SetTVMode()
1562 if(romindex && SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetTVMode()
1565 SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F); in SiS_SetTVMode()
1568 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,temp); in SiS_SetTVMode()
1569 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetTVMode()
1571 SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1572 SiS_Pr->SiS_TVMode &= ~TVSetPAL; in SiS_SetTVMode()
1574 SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1578 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1583 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1584 if(SiS_Pr->SiS_YPbPr == YPbPr750p) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1585 else if(SiS_Pr->SiS_YPbPr == YPbPr525p) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1586 else if(SiS_Pr->SiS_YPbPr == YPbPrHiVision) SiS_Pr->SiS_TVMode |= TVSetHiVision; in SiS_SetTVMode()
1587 else SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1588 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p | TVSetYPbPr525i)) { in SiS_SetTVMode()
1589 SiS_Pr->SiS_VBInfo &= ~SetCRT2ToHiVision; in SiS_SetTVMode()
1590 SiS_Pr->SiS_VBInfo |= SetCRT2ToYPbPr525750; in SiS_SetTVMode()
1591 } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { in SiS_SetTVMode()
1592 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1595 } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetTVMode()
1596 if(SiS_Pr->SiS_CHOverScan) { in SiS_SetTVMode()
1597 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetTVMode()
1598 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1599 if((temp & TVOverScan) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1600 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1602 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1603 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79); in SiS_SetTVMode()
1604 if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1605 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1608 if(SiS_Pr->SiS_CHSOverScan) { in SiS_SetTVMode()
1609 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1612 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1613 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetTVMode()
1614 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetTVMode()
1615 if(temp & EnablePALM) SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1616 else if(temp & EnablePALN) SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1619 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1627 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1629 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1631 SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1633 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1634 SiS_Pr->SiS_TVMode &= ~TVSetPAL; in SiS_SetTVMode()
1636 SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1640 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1643 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1644 if(SiS_Pr->SiS_CHOverScan) { in SiS_SetTVMode()
1645 if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1646 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1650 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1651 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetTVMode()
1653 if(temp1 == 0x00) SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1654 else if(temp1 == 0x20) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1655 else if(temp1 == 0x40) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1656 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1657 SiS_Pr->SiS_TVMode |= (TVSetHiVision | TVSetPAL); in SiS_SetTVMode()
1659 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750 | SetCRT2ToHiVision)) { in SiS_SetTVMode()
1661 SiS_Pr->SiS_TVMode |= TVAspect169; in SiS_SetTVMode()
1663 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39); in SiS_SetTVMode()
1665 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetHiVision)) { in SiS_SetTVMode()
1666 SiS_Pr->SiS_TVMode |= TVAspect169; in SiS_SetTVMode()
1668 SiS_Pr->SiS_TVMode |= TVAspect43LB; in SiS_SetTVMode()
1671 SiS_Pr->SiS_TVMode |= TVAspect43; in SiS_SetTVMode()
1678 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1680 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1682 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1683 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1684 SiS_Pr->SiS_TVMode &= ~(TVSetPALM | TVSetPALN | TVSetNTSCJ); in SiS_SetTVMode()
1685 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetTVMode()
1686 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525i | TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetTVMode()
1687 SiS_Pr->SiS_TVMode &= ~(TVSetPAL | TVSetNTSCJ | TVSetPALM | TVSetPALN); in SiS_SetTVMode()
1691 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetTVMode()
1692 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_SetTVMode()
1693 SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; in SiS_SetTVMode()
1697 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetTVMode()
1699 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_SetTVMode()
1700 SiS_Pr->SiS_TVMode |= TVSet525p1024; in SiS_SetTVMode()
1701 } else if(!(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p))) { in SiS_SetTVMode()
1702 SiS_Pr->SiS_TVMode |= TVSetNTSC1024; in SiS_SetTVMode()
1707 SiS_Pr->SiS_TVMode |= TVRPLLDIV2XO; in SiS_SetTVMode()
1708 if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) && in SiS_SetTVMode()
1709 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetTVMode()
1710 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1711 } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetTVMode()
1712 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1713 } else if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) { in SiS_SetTVMode()
1714 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetTVMode()
1715 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1721 SiS_Pr->SiS_VBInfo &= ~SetPALTV; in SiS_SetTVMode()
1729 SiS_GetBIOSLCDResInfo(struct SiS_Private *SiS_Pr) in SiS_GetBIOSLCDResInfo() argument
1731 unsigned short temp = SiS_Pr->SiS_LCDResInfo; in SiS_GetBIOSLCDResInfo()
1742 SiS_GetLCDInfoBIOS(struct SiS_Private *SiS_Pr) in SiS_GetLCDInfoBIOS() argument
1748 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { in SiS_GetLCDInfoBIOS()
1749 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { in SiS_GetLCDInfoBIOS()
1750 SiS_Pr->SiS_NeedRomModeData = true; in SiS_GetLCDInfoBIOS()
1751 SiS_Pr->PanelHT = temp; in SiS_GetLCDInfoBIOS()
1753 if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) { in SiS_GetLCDInfoBIOS()
1754 SiS_Pr->SiS_NeedRomModeData = true; in SiS_GetLCDInfoBIOS()
1755 SiS_Pr->PanelVT = temp; in SiS_GetLCDInfoBIOS()
1757 SiS_Pr->PanelHRS = SISGETROMW(10); in SiS_GetLCDInfoBIOS()
1758 SiS_Pr->PanelHRE = SISGETROMW(12); in SiS_GetLCDInfoBIOS()
1759 SiS_Pr->PanelVRS = SISGETROMW(14); in SiS_GetLCDInfoBIOS()
1760 SiS_Pr->PanelVRE = SISGETROMW(16); in SiS_GetLCDInfoBIOS()
1761 SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; in SiS_GetLCDInfoBIOS()
1762 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].CLOCK = in SiS_GetLCDInfoBIOS()
1763 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].CLOCK = (unsigned short)((unsigned char)ROMAddr[18]); in SiS_GetLCDInfoBIOS()
1764 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2B = in SiS_GetLCDInfoBIOS()
1765 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; in SiS_GetLCDInfoBIOS()
1766 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = in SiS_GetLCDInfoBIOS()
1767 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; in SiS_GetLCDInfoBIOS()
1774 SiS_CheckScaling(struct SiS_Private *SiS_Pr, unsigned short resinfo, in SiS_CheckScaling() argument
1780 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) || in SiS_CheckScaling()
1781 (SiS_Pr->UsePanelScaler == -1)) { in SiS_CheckScaling()
1782 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_CheckScaling()
1790 SiS_GetLCDResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_GetLCDResInfo() argument
1795 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_GetLCDResInfo()
1804 SiS_Pr->SiS_LCDResInfo = 0; in SiS_GetLCDResInfo()
1805 SiS_Pr->SiS_LCDTypeInfo = 0; in SiS_GetLCDResInfo()
1806 SiS_Pr->SiS_LCDInfo = 0; in SiS_GetLCDResInfo()
1807 SiS_Pr->PanelHRS = 999; /* HSync start */ in SiS_GetLCDResInfo()
1808 SiS_Pr->PanelHRE = 999; /* HSync end */ in SiS_GetLCDResInfo()
1809 SiS_Pr->PanelVRS = 999; /* VSync start */ in SiS_GetLCDResInfo()
1810 SiS_Pr->PanelVRE = 999; /* VSync end */ in SiS_GetLCDResInfo()
1811 SiS_Pr->SiS_NeedRomModeData = false; in SiS_GetLCDResInfo()
1814 SiS_Pr->Alternate1600x1200 = false; in SiS_GetLCDResInfo()
1816 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return; in SiS_GetLCDResInfo()
1818 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetLCDResInfo()
1820 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetLCDResInfo()
1821 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetLCDResInfo()
1822 modexres = SiS_Pr->SiS_ModeResInfo[resinfo].HTotal; in SiS_GetLCDResInfo()
1823 modeyres = SiS_Pr->SiS_ModeResInfo[resinfo].VTotal; in SiS_GetLCDResInfo()
1826 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_GetLCDResInfo()
1831 if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_GetLCDResInfo()
1832 SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; in SiS_GetLCDResInfo()
1833 } else if((SiS_Pr->ChipType < SIS_315H) || (SiS_Pr->ChipType >= SIS_661)) { in SiS_GetLCDResInfo()
1834 SiS_Pr->SiS_LCDTypeInfo = temp >> 4; in SiS_GetLCDResInfo()
1836 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; in SiS_GetLCDResInfo()
1840 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
1842 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_GetLCDResInfo()
1852 if(SiS_Pr->ChipType == SIS_550) { in SiS_GetLCDResInfo()
1856 } else if(SiS_Pr->ChipType >= SIS_661) { in SiS_GetLCDResInfo()
1861 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* SiS LVDS */ in SiS_GetLCDResInfo()
1865 if(SiS_Pr->SiS_ROMNew) { in SiS_GetLCDResInfo()
1872 SiS_Pr->SiS_LCDResInfo = temp; in SiS_GetLCDResInfo()
1875 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1876 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetLCDResInfo()
1877 SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; in SiS_GetLCDResInfo()
1878 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { in SiS_GetLCDResInfo()
1879 SiS_Pr->SiS_LCDResInfo = Panel_848x480; in SiS_GetLCDResInfo()
1880 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetLCDResInfo()
1881 SiS_Pr->SiS_LCDResInfo = Panel_856x480; in SiS_GetLCDResInfo()
1886 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1887 if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301) in SiS_GetLCDResInfo()
1888 SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301; in SiS_GetLCDResInfo()
1890 if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS) in SiS_GetLCDResInfo()
1891 SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS; in SiS_GetLCDResInfo()
1894 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_GetLCDResInfo()
1895 SiS_Pr->SiS_LCDInfo = temp & ~0x000e; in SiS_GetLCDResInfo()
1899 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
1904 SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; in SiS_GetLCDResInfo()
1907 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1910 panelcanscale = (bool)(SiS_Pr->SiS_LCDInfo & DontExpandLCD); in SiS_GetLCDResInfo()
1912 if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; in SiS_GetLCDResInfo()
1913 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1917 if(SiS_Pr->ChipType >= SIS_661) { in SiS_GetLCDResInfo()
1918 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1919 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1921 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_GetLCDResInfo()
1922 if(SiS_Pr->SiS_ROMNew) { in SiS_GetLCDResInfo()
1923 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1924 } else if((myptr = GetLCDStructPtr661(SiS_Pr))) { in SiS_GetLCDResInfo()
1925 if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1928 } else if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetLCDResInfo()
1929 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1930 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1932 if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) { in SiS_GetLCDResInfo()
1933 SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit); in SiS_GetLCDResInfo()
1934 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_GetLCDResInfo()
1935 if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; in SiS_GetLCDResInfo()
1936 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_GetLCDResInfo()
1937 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1939 } else if(!(SiS_Pr->SiS_ROMNew)) { in SiS_GetLCDResInfo()
1940 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_GetLCDResInfo()
1941 if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) && in SiS_GetLCDResInfo()
1942 (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) { in SiS_GetLCDResInfo()
1943 SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1945 if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_GetLCDResInfo()
1946 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_GetLCDResInfo()
1947 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || in SiS_GetLCDResInfo()
1948 (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) { in SiS_GetLCDResInfo()
1949 SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1957 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetLCDResInfo()
1959 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1960 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1961 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_GetLCDResInfo()
1963 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1966 if(panelcanscale) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1967 if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1971 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1972 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
1974 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
1977 case Panel_320x240_3: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1978 SiS_Pr->PanelVRS = 24; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1979 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1980 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1982 case Panel_640x480: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1983 SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1984 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1985 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1987 case Panel_800x600: SiS_Pr->PanelXRes = 800; SiS_Pr->PanelYRes = 600; in SiS_GetLCDResInfo()
1988 SiS_Pr->PanelHT = 1056; SiS_Pr->PanelVT = 628; in SiS_GetLCDResInfo()
1989 SiS_Pr->PanelHRS = 40; SiS_Pr->PanelHRE = 128; in SiS_GetLCDResInfo()
1990 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 4; in SiS_GetLCDResInfo()
1991 SiS_Pr->PanelVCLKIdx300 = VCLK40; in SiS_GetLCDResInfo()
1992 SiS_Pr->PanelVCLKIdx315 = VCLK40; in SiS_GetLCDResInfo()
1994 case Panel_1024x600: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 600; in SiS_GetLCDResInfo()
1995 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 800; in SiS_GetLCDResInfo()
1996 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
1997 SiS_Pr->PanelVRS = 2 /* 88 */ ; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1998 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1999 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
2001 case Panel_1024x768: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2002 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2003 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
2004 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2005 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
2006 SiS_Pr->PanelHRS = 23; in SiS_GetLCDResInfo()
2007 SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
2009 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
2010 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
2011 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2013 case Panel_1152x768: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2014 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2015 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
2016 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2017 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
2018 SiS_Pr->PanelHRS = 23; in SiS_GetLCDResInfo()
2019 SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
2021 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
2022 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
2024 case Panel_1152x864: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 864; in SiS_GetLCDResInfo()
2026 case Panel_1280x720: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 720; in SiS_GetLCDResInfo()
2027 SiS_Pr->PanelHT = 1650; SiS_Pr->PanelVT = 750; in SiS_GetLCDResInfo()
2028 SiS_Pr->PanelHRS = 110; SiS_Pr->PanelHRE = 40; in SiS_GetLCDResInfo()
2029 SiS_Pr->PanelVRS = 5; SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
2030 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x720; in SiS_GetLCDResInfo()
2032 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2034 case Panel_1280x768: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2035 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
2036 SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2037 SiS_Pr->PanelVCLKIdx300 = VCLK81_300; /* ? */ in SiS_GetLCDResInfo()
2038 SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */ in SiS_GetLCDResInfo()
2040 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; in SiS_GetLCDResInfo()
2041 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2042 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2043 SiS_Pr->PanelVCLKIdx300 = VCLK81_300; in SiS_GetLCDResInfo()
2044 SiS_Pr->PanelVCLKIdx315 = VCLK81_315; in SiS_GetLCDResInfo()
2047 case Panel_1280x768_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2048 SiS_Pr->PanelHT = 1660; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2049 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2050 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2051 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2; in SiS_GetLCDResInfo()
2052 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2054 case Panel_1280x800: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; in SiS_GetLCDResInfo()
2055 SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 816; in SiS_GetLCDResInfo()
2056 SiS_Pr->PanelHRS = 21; SiS_Pr->PanelHRE = 24; in SiS_GetLCDResInfo()
2057 SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2058 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315; in SiS_GetLCDResInfo()
2059 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2061 case Panel_1280x800_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; in SiS_GetLCDResInfo()
2062 SiS_Pr->PanelHT = 1552; SiS_Pr->PanelVT = 812; in SiS_GetLCDResInfo()
2063 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2064 SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2065 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315_2; in SiS_GetLCDResInfo()
2066 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2068 case Panel_1280x854: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 854; in SiS_GetLCDResInfo()
2069 SiS_Pr->PanelHT = 1664; SiS_Pr->PanelVT = 861; in SiS_GetLCDResInfo()
2070 SiS_Pr->PanelHRS = 16; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2071 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2072 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x854; in SiS_GetLCDResInfo()
2073 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2075 case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960; in SiS_GetLCDResInfo()
2076 SiS_Pr->PanelHT = 1800; SiS_Pr->PanelVT = 1000; in SiS_GetLCDResInfo()
2077 SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; in SiS_GetLCDResInfo()
2078 SiS_Pr->PanelVCLKIdx315 = VCLK108_3_315; in SiS_GetLCDResInfo()
2080 SiS_Pr->PanelVCLKIdx300 = VCLK100_300; in SiS_GetLCDResInfo()
2081 SiS_Pr->PanelVCLKIdx315 = VCLK100_315; in SiS_GetLCDResInfo()
2084 case Panel_1280x1024: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024; in SiS_GetLCDResInfo()
2085 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2086 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2087 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2088 SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; in SiS_GetLCDResInfo()
2089 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
2090 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2092 case Panel_1400x1050: SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050; in SiS_GetLCDResInfo()
2093 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2094 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2095 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2096 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
2097 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2099 case Panel_1600x1200: SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200; in SiS_GetLCDResInfo()
2100 SiS_Pr->PanelHT = 2160; SiS_Pr->PanelVT = 1250; in SiS_GetLCDResInfo()
2101 SiS_Pr->PanelHRS = 64; SiS_Pr->PanelHRE = 192; in SiS_GetLCDResInfo()
2102 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2103 SiS_Pr->PanelVCLKIdx315 = VCLK162_315; in SiS_GetLCDResInfo()
2104 if(SiS_Pr->SiS_VBType & VB_SISTMDSLCDA) { in SiS_GetLCDResInfo()
2105 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_GetLCDResInfo()
2106 SiS_Pr->PanelHT = 1760; SiS_Pr->PanelVT = 1235; in SiS_GetLCDResInfo()
2107 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 32; in SiS_GetLCDResInfo()
2108 SiS_Pr->PanelVRS = 2; SiS_Pr->PanelVRE = 4; in SiS_GetLCDResInfo()
2109 SiS_Pr->PanelVCLKIdx315 = VCLK130_315; in SiS_GetLCDResInfo()
2110 SiS_Pr->Alternate1600x1200 = true; in SiS_GetLCDResInfo()
2112 } else if(SiS_Pr->SiS_IF_DEF_LVDS) { in SiS_GetLCDResInfo()
2113 SiS_Pr->PanelHT = 2048; SiS_Pr->PanelVT = 1320; in SiS_GetLCDResInfo()
2114 SiS_Pr->PanelHRS = SiS_Pr->PanelHRE = 999; in SiS_GetLCDResInfo()
2115 SiS_Pr->PanelVRS = SiS_Pr->PanelVRE = 999; in SiS_GetLCDResInfo()
2117 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2119 case Panel_1680x1050: SiS_Pr->PanelXRes = 1680; SiS_Pr->PanelYRes = 1050; in SiS_GetLCDResInfo()
2120 SiS_Pr->PanelHT = 1900; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2121 SiS_Pr->PanelHRS = 26; SiS_Pr->PanelHRE = 76; in SiS_GetLCDResInfo()
2122 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2123 SiS_Pr->PanelVCLKIdx315 = VCLK121_315; in SiS_GetLCDResInfo()
2124 SiS_GetLCDInfoBIOS(SiS_Pr); in SiS_GetLCDResInfo()
2126 case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; in SiS_GetLCDResInfo()
2127 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2129 case Panel_848x480: SiS_Pr->PanelXRes = 848; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
2130 SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; in SiS_GetLCDResInfo()
2132 case Panel_856x480: SiS_Pr->PanelXRes = 856; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
2133 SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; in SiS_GetLCDResInfo()
2135 case Panel_Custom: SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX; in SiS_GetLCDResInfo()
2136 SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY; in SiS_GetLCDResInfo()
2137 SiS_Pr->PanelHT = SiS_Pr->CHTotal; in SiS_GetLCDResInfo()
2138 SiS_Pr->PanelVT = SiS_Pr->CVTotal; in SiS_GetLCDResInfo()
2139 if(SiS_Pr->CP_PreferredIndex != -1) { in SiS_GetLCDResInfo()
2140 SiS_Pr->PanelXRes = SiS_Pr->CP_HDisplay[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2141 SiS_Pr->PanelYRes = SiS_Pr->CP_VDisplay[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2142 SiS_Pr->PanelHT = SiS_Pr->CP_HTotal[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2143 SiS_Pr->PanelVT = SiS_Pr->CP_VTotal[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2144 SiS_Pr->PanelHRS = SiS_Pr->CP_HSyncStart[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2145 SiS_Pr->PanelHRE = SiS_Pr->CP_HSyncEnd[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2146 SiS_Pr->PanelVRS = SiS_Pr->CP_VSyncStart[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2147 SiS_Pr->PanelVRE = SiS_Pr->CP_VSyncEnd[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2148 SiS_Pr->PanelHRS -= SiS_Pr->PanelXRes; in SiS_GetLCDResInfo()
2149 SiS_Pr->PanelHRE -= SiS_Pr->PanelHRS; in SiS_GetLCDResInfo()
2150 SiS_Pr->PanelVRS -= SiS_Pr->PanelYRes; in SiS_GetLCDResInfo()
2151 SiS_Pr->PanelVRE -= SiS_Pr->PanelVRS; in SiS_GetLCDResInfo()
2152 if(SiS_Pr->CP_PrefClock) { in SiS_GetLCDResInfo()
2154 SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; in SiS_GetLCDResInfo()
2155 SiS_Pr->PanelVCLKIdx300 = VCLK_CUSTOM_300; in SiS_GetLCDResInfo()
2156 if(SiS_Pr->ChipType < SIS_315H) idx = VCLK_CUSTOM_300; in SiS_GetLCDResInfo()
2158 SiS_Pr->SiS_VCLKData[idx].CLOCK = in SiS_GetLCDResInfo()
2159 SiS_Pr->SiS_VBVCLKData[idx].CLOCK = SiS_Pr->CP_PrefClock; in SiS_GetLCDResInfo()
2160 SiS_Pr->SiS_VCLKData[idx].SR2B = in SiS_GetLCDResInfo()
2161 SiS_Pr->SiS_VBVCLKData[idx].Part4_A = SiS_Pr->CP_PrefSR2B; in SiS_GetLCDResInfo()
2162 SiS_Pr->SiS_VCLKData[idx].SR2C = in SiS_GetLCDResInfo()
2163 SiS_Pr->SiS_VBVCLKData[idx].Part4_B = SiS_Pr->CP_PrefSR2C; in SiS_GetLCDResInfo()
2167 default: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2168 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2173 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_GetLCDResInfo()
2174 (SiS_Pr->SiS_IF_DEF_DSTN) || in SiS_GetLCDResInfo()
2175 (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_GetLCDResInfo()
2176 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_GetLCDResInfo()
2177 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLCDResInfo()
2178 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { in SiS_GetLCDResInfo()
2179 SiS_Pr->PanelHRS = 999; in SiS_GetLCDResInfo()
2180 SiS_Pr->PanelHRE = 999; in SiS_GetLCDResInfo()
2183 if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_GetLCDResInfo()
2184 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_GetLCDResInfo()
2185 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLCDResInfo()
2186 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { in SiS_GetLCDResInfo()
2187 SiS_Pr->PanelVRS = 999; in SiS_GetLCDResInfo()
2188 SiS_Pr->PanelVRE = 999; in SiS_GetLCDResInfo()
2192 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_GetLCDResInfo()
2194 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (modeflag & NoSupportLCDScale)) { in SiS_GetLCDResInfo()
2196 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2199 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
2204 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2211 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2220 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2229 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2230 if(SiS_Pr->PanelHT == 1650) { in SiS_GetLCDResInfo()
2231 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2241 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2243 case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2244 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2256 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2265 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2268 case SIS_RI_1280x768: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2269 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2281 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2285 case SIS_RI_1280x800: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2286 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2299 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2309 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2319 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2321 case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2322 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2325 case SIS_RI_1280x1024: SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2337 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2347 SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); in SiS_GetLCDResInfo()
2354 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
2355 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetLCDResInfo()
2356 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ in SiS_GetLCDResInfo()
2360 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
2361 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
2362 if(SiS_Pr->SiS_UseROM) { in SiS_GetLCDResInfo()
2365 SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); in SiS_GetLCDResInfo()
2369 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_GetLCDResInfo()
2370 if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) { in SiS_GetLCDResInfo()
2371 SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); in SiS_GetLCDResInfo()
2379 if(modexres == SiS_Pr->PanelXRes && modeyres == SiS_Pr->PanelYRes) { in SiS_GetLCDResInfo()
2380 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2383 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_GetLCDResInfo()
2384 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
2387 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
2389 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
2393 if(SiS_Pr->CenterScreen == -1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2396 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2399 if((!SiS_Pr->CP_PrefClock) || in SiS_GetLCDResInfo()
2400 (modexres > SiS_Pr->PanelXRes) || (modeyres > SiS_Pr->PanelYRes)) { in SiS_GetLCDResInfo()
2401 SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
2406 if((SiS_Pr->UseCustomMode) || (SiS_Pr->SiS_CustomT == CUT_UNKNOWNLCD)) { in SiS_GetLCDResInfo()
2407 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
2411 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLCDResInfo()
2412 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2416 if(!((SiS_Pr->ChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) { in SiS_GetLCDResInfo()
2418 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetLCDResInfo()
2419 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { in SiS_GetLCDResInfo()
2421 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_GetLCDResInfo()
2422 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2425 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { in SiS_GetLCDResInfo()
2426 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLCDResInfo()
2428 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2437 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 1) { in SiS_GetLCDResInfo()
2438 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2439 } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
2440 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2441 } else if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) { in SiS_GetLCDResInfo()
2442 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2444 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLCDResInfo()
2445 if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2446 } else if(SiS_Pr->SiS_LCDResInfo == Panel_800x600) { in SiS_GetLCDResInfo()
2447 if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2455 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetLCDResInfo()
2456 if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) { in SiS_GetLCDResInfo()
2457 SiS_Pr->SiS_SetFlag |= LCDVESATiming; in SiS_GetLCDResInfo()
2460 SiS_Pr->SiS_SetFlag |= LCDVESATiming; in SiS_GetLCDResInfo()
2465 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); in SiS_GetLCDResInfo()
2474 SiS_GetVCLK2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetVCLK2Ptr() argument
2482 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_GetVCLK2Ptr()
2483 CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetVCLK2Ptr()
2484 VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03; in SiS_GetVCLK2Ptr()
2487 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetVCLK2Ptr()
2488 CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetVCLK2Ptr()
2489 VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; in SiS_GetVCLK2Ptr()
2490 VCLKIndexGENCRT = SiS_GetRefCRTVCLK(SiS_Pr, RefreshRateTableIndex, in SiS_GetVCLK2Ptr()
2491 (SiS_Pr->SiS_SetFlag & ProgrammingCRT2) ? SiS_Pr->SiS_UseWideCRT2 : SiS_Pr->SiS_UseWide); in SiS_GetVCLK2Ptr()
2494 if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 30x/B/LV */ in SiS_GetVCLK2Ptr()
2496 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetVCLK2Ptr()
2499 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /* LCD */ in SiS_GetVCLK2Ptr()
2501 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2502 VCLKIndex = SiS_Pr->PanelVCLKIdx300; in SiS_GetVCLK2Ptr()
2503 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_GetVCLK2Ptr()
2507 VCLKIndex = SiS_Pr->PanelVCLKIdx315; in SiS_GetVCLK2Ptr()
2508 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_GetVCLK2Ptr()
2525 if(SiS_Pr->ChipType <= SIS_315PRO) { in SiS_GetVCLK2Ptr()
2526 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42; in SiS_GetVCLK2Ptr()
2528 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00; in SiS_GetVCLK2Ptr()
2531 if(SiS_Pr->ChipType <= SIS_315PRO) { in SiS_GetVCLK2Ptr()
2539 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* TV */ in SiS_GetVCLK2Ptr()
2541 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetVCLK2Ptr()
2542 if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = HiTVVCLKDIV2; in SiS_GetVCLK2Ptr()
2544 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) VCLKIndex = HiTVSimuVCLK; in SiS_GetVCLK2Ptr()
2545 } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) VCLKIndex = YPbPr750pVCLK; in SiS_GetVCLK2Ptr()
2546 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) VCLKIndex = TVVCLKDIV2; in SiS_GetVCLK2Ptr()
2547 else if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = TVVCLKDIV2; in SiS_GetVCLK2Ptr()
2550 if(SiS_Pr->ChipType < SIS_315H) VCLKIndex += TVCLKBASE_300; in SiS_GetVCLK2Ptr()
2556 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2558 if( (SiS_Pr->ChipType == SIS_630) && in SiS_GetVCLK2Ptr()
2559 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_GetVCLK2Ptr()
2571 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2573 if( (SiS_Pr->ChipType != SIS_630) && in SiS_GetVCLK2Ptr()
2574 (SiS_Pr->ChipType != SIS_300) ) { in SiS_GetVCLK2Ptr()
2585 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetVCLK2Ptr()
2587 if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) { in SiS_GetVCLK2Ptr()
2591 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2592 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetVCLK2Ptr()
2594 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetVCLK2Ptr()
2595 if(SiS_Pr->SiS_CHSOverScan) tempbx = 8; in SiS_GetVCLK2Ptr()
2597 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_GetVCLK2Ptr()
2599 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2600 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_GetVCLK2Ptr()
2602 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2606 case 0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC; break; in SiS_GetVCLK2Ptr()
2607 case 1: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKONTSC; break; in SiS_GetVCLK2Ptr()
2608 case 2: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPAL; break; in SiS_GetVCLK2Ptr()
2609 case 3: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; in SiS_GetVCLK2Ptr()
2610 case 4: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALM; break; in SiS_GetVCLK2Ptr()
2611 case 5: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALM; break; in SiS_GetVCLK2Ptr()
2612 case 6: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALN; break; in SiS_GetVCLK2Ptr()
2613 case 7: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALN; break; in SiS_GetVCLK2Ptr()
2614 case 8: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKSOPAL; break; in SiS_GetVCLK2Ptr()
2615 default: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; in SiS_GetVCLK2Ptr()
2619 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetVCLK2Ptr()
2621 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2622 VCLKIndex = SiS_Pr->PanelVCLKIdx300; in SiS_GetVCLK2Ptr()
2624 VCLKIndex = SiS_Pr->PanelVCLKIdx315; in SiS_GetVCLK2Ptr()
2629 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2632 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetVCLK2Ptr()
2633 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2646 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2648 if( (SiS_Pr->ChipType == SIS_630) && in SiS_GetVCLK2Ptr()
2649 (SiS_Pr->ChipRevision >= 0x30) ) { in SiS_GetVCLK2Ptr()
2659 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2661 if( (SiS_Pr->ChipType != SIS_630) && in SiS_GetVCLK2Ptr()
2662 (SiS_Pr->ChipType != SIS_300) ) { in SiS_GetVCLK2Ptr()
2666 if(SiS_Pr->ChipType == SIS_730) { in SiS_GetVCLK2Ptr()
2686 SiS_SetCRT2ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetCRT2ModeRegs() argument
2694 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2ModeRegs()
2698 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2ModeRegs()
2700 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetCRT2ModeRegs()
2702 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); in SiS_SetCRT2ModeRegs()
2703 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7); in SiS_SetCRT2ModeRegs()
2707 for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0); in SiS_SetCRT2ModeRegs()
2708 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
2709 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F); in SiS_SetCRT2ModeRegs()
2712 tempcl = SiS_Pr->SiS_ModeType; in SiS_SetCRT2ModeRegs()
2714 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2ModeRegs()
2719 if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_SetCRT2ModeRegs()
2720 tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32); in SiS_SetCRT2ModeRegs()
2723 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2ModeRegs()
2727 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl); in SiS_SetCRT2ModeRegs()
2737 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; in SiS_SetCRT2ModeRegs()
2754 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; in SiS_SetCRT2ModeRegs()
2760 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2762 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2ModeRegs()
2763 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2766 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2ModeRegs()
2767 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2768 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2770 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2772 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2778 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2781 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ModeRegs()
2784 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2ModeRegs()
2786 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetCRT2ModeRegs()
2791 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2ModeRegs()
2793 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2796 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2801 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x08; in SiS_SetCRT2ModeRegs()
2802 else if(!(SiS_IsDualEdge(SiS_Pr))) tempah |= 0x08; in SiS_SetCRT2ModeRegs()
2803 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2808 if((SiS_Pr->SiS_ModeType == ModeVGA) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { in SiS_SetCRT2ModeRegs()
2813 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2814 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah &= ~0x80; in SiS_SetCRT2ModeRegs()
2817 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2818 if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p))) { in SiS_SetCRT2ModeRegs()
2819 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT2ModeRegs()
2825 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah); in SiS_SetCRT2ModeRegs()
2828 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2829 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah = 0; in SiS_SetCRT2ModeRegs()
2832 if(SiS_IsDualLink(SiS_Pr)) tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2834 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2835 if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) { in SiS_SetCRT2ModeRegs()
2840 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah); in SiS_SetCRT2ModeRegs()
2844 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
2849 if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { in SiS_SetCRT2ModeRegs()
2850 if(SiS_Pr->SiS_VBInfo & DriverMode) { in SiS_SetCRT2ModeRegs()
2855 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2857 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah ^= 0x01; in SiS_SetCRT2ModeRegs()
2859 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 1; in SiS_SetCRT2ModeRegs()
2861 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2868 if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { in SiS_SetCRT2ModeRegs()
2873 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2875 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2884 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2886 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
2905 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2907 if(SiS_IsDualEdge(SiS_Pr)) { in SiS_SetCRT2ModeRegs()
2911 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2923 if((IS_SIS740) || (SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_SetCRT2ModeRegs()
2926 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || in SiS_SetCRT2ModeRegs()
2927 ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) { in SiS_SetCRT2ModeRegs()
2931 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah); in SiS_SetCRT2ModeRegs()
2932 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl); in SiS_SetCRT2ModeRegs()
2933 } else if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2935 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf); /* For 301 */ in SiS_SetCRT2ModeRegs()
2936 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2937 } else if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_SetCRT2ModeRegs()
2938 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xLV */ in SiS_SetCRT2ModeRegs()
2939 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); in SiS_SetCRT2ModeRegs()
2940 } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { /* For 301B-DH */ in SiS_SetCRT2ModeRegs()
2943 if(SiS_Pr->SiS_TVBlue == 0) { in SiS_SetCRT2ModeRegs()
2945 } else if(SiS_Pr->SiS_TVBlue == -1) { in SiS_SetCRT2ModeRegs()
2951 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2952 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2956 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2958 if(SiS_IsDualEdge(SiS_Pr)) { in SiS_SetCRT2ModeRegs()
2962 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2963 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2968 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00; in SiS_SetCRT2ModeRegs()
2969 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah); in SiS_SetCRT2ModeRegs()
2973 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2975 if(!(SiS_IsDualEdge(SiS_Pr))) tempah = 0x80; in SiS_SetCRT2ModeRegs()
2977 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2982 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2ModeRegs()
2985 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2987 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || in SiS_SetCRT2ModeRegs()
2988 ((SiS_Pr->SiS_VBType & VB_NoLCD) && in SiS_SetCRT2ModeRegs()
2989 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD))) { in SiS_SetCRT2ModeRegs()
2990 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F); in SiS_SetCRT2ModeRegs()
2992 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80); in SiS_SetCRT2ModeRegs()
2998 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2ModeRegs()
2999 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x0D,0x80); in SiS_SetCRT2ModeRegs()
3000 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { in SiS_SetCRT2ModeRegs()
3001 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3A,0xC0); in SiS_SetCRT2ModeRegs()
3008 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
3010 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2ModeRegs()
3014 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
3016 if(SiS_IsDualEdge(SiS_Pr)) tempbl = 0xff; in SiS_SetCRT2ModeRegs()
3018 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
3020 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2ModeRegs()
3021 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3024 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3026 } else if(SiS_Pr->ChipType == SIS_550) { in SiS_SetCRT2ModeRegs()
3028 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3029 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3045 SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_GetResInfo() argument
3048 return ((unsigned short)SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo); in SiS_GetResInfo()
3050 return ((unsigned short)SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO); in SiS_GetResInfo()
3054 SiS_GetCRT2ResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_GetCRT2ResInfo() argument
3058 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2ResInfo()
3059 xres = SiS_Pr->CHDisplay; in SiS_GetCRT2ResInfo()
3060 if(SiS_Pr->CModeFlag & HalfDCLK) xres <<= 1; in SiS_GetCRT2ResInfo()
3061 SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; in SiS_GetCRT2ResInfo()
3063 SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = SiS_Pr->CVDisplay; in SiS_GetCRT2ResInfo()
3067 resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex); in SiS_GetCRT2ResInfo()
3070 xres = SiS_Pr->SiS_StResInfo[resindex].HTotal; in SiS_GetCRT2ResInfo()
3071 yres = SiS_Pr->SiS_StResInfo[resindex].VTotal; in SiS_GetCRT2ResInfo()
3073 xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal; in SiS_GetCRT2ResInfo()
3074 yres = SiS_Pr->SiS_ModeResInfo[resindex].VTotal; in SiS_GetCRT2ResInfo()
3075 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetCRT2ResInfo()
3078 if(!SiS_Pr->SiS_IF_DEF_DSTN && !SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_GetCRT2ResInfo()
3080 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) { in SiS_GetCRT2ResInfo()
3081 if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetCRT2ResInfo()
3084 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) { in SiS_GetCRT2ResInfo()
3094 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_GetCRT2ResInfo()
3096 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetCRT2ResInfo()
3097 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2ResInfo()
3099 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2ResInfo()
3100 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2ResInfo()
3108 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2ResInfo()
3113 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_GetCRT2ResInfo()
3118 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2ResInfo()
3127 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2ResInfo()
3128 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) { in SiS_GetCRT2ResInfo()
3133 if(SiS_Pr->SiS_SetFlag & SetDOSMode) { in SiS_GetCRT2ResInfo()
3135 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetCRT2ResInfo()
3136 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3138 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3140 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) yres = 480; in SiS_GetCRT2ResInfo()
3144 SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; in SiS_GetCRT2ResInfo()
3145 SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres; in SiS_GetCRT2ResInfo()
3153 SiS_GetCRT2Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetCRT2Ptr() argument
3160 tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2Ptr()
3162 tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetCRT2Ptr()
3163 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetCRT2Ptr()
3166 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) { in SiS_GetCRT2Ptr()
3168 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { /* LCD */ in SiS_GetCRT2Ptr()
3170 tempbx = SiS_Pr->SiS_LCDResInfo; in SiS_GetCRT2Ptr()
3171 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 32; in SiS_GetCRT2Ptr()
3174 if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) { in SiS_GetCRT2Ptr()
3177 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x800) || in SiS_GetCRT2Ptr()
3178 (SiS_Pr->SiS_LCDResInfo == Panel_1280x800_2) || in SiS_GetCRT2Ptr()
3179 (SiS_Pr->SiS_LCDResInfo == Panel_1280x854)) { in SiS_GetCRT2Ptr()
3183 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetCRT2Ptr()
3189 tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; in SiS_GetCRT2Ptr()
3194 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_GetCRT2Ptr()
3195 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_GetCRT2Ptr()
3196 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2Ptr()
3198 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; in SiS_GetCRT2Ptr()
3206 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetCRT2Ptr()
3209 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetCRT2Ptr()
3211 if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) tempbx = 14; in SiS_GetCRT2Ptr()
3213 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3214 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempbx = 7; in SiS_GetCRT2Ptr()
3215 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempbx = 6; in SiS_GetCRT2Ptr()
3217 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; in SiS_GetCRT2Ptr()
3219 if(SiS_Pr->SiS_TVMode & TVSetPAL) tempbx = 3; in SiS_GetCRT2Ptr()
3221 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; in SiS_GetCRT2Ptr()
3229 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) { in SiS_GetCRT2Ptr()
3233 if(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetPALN)) tempal = 9; in SiS_GetCRT2Ptr()
3239 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3240 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 8; in SiS_GetCRT2Ptr()
3249 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3250 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempal = 8; in SiS_GetCRT2Ptr()
3254 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3255 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 9; in SiS_GetCRT2Ptr()
3268 if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetCRT2Ptr()
3271 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetCRT2Ptr()
3273 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetCRT2Ptr()
3274 if(SiS_Pr->SiS_CHSOverScan) tempbx = 99; in SiS_GetCRT2Ptr()
3276 if(SiS_Pr->SiS_TVMode & TVSetPALM) tempbx = 94; in SiS_GetCRT2Ptr()
3277 else if(SiS_Pr->SiS_TVMode & TVSetPALN) tempbx = 96; in SiS_GetCRT2Ptr()
3280 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++; in SiS_GetCRT2Ptr()
3285 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Ptr()
3303 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Ptr()
3310 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
3313 if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 30; in SiS_GetCRT2Ptr()
3316 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SiS_GetCRT2Ptr()
3318 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
3319 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetCRT2Ptr()
3321 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
3333 SiS_GetRAMDAC2DATA(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetRAMDAC2DATA() argument
3339 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetRAMDAC2DATA()
3340 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetRAMDAC2DATA()
3344 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetRAMDAC2DATA()
3345 index = SiS_GetModePtr(SiS_Pr,ModeNo,ModeIdIndex); in SiS_GetRAMDAC2DATA()
3347 tempax = SiS_Pr->SiS_StandTable[index].CRTC[0]; in SiS_GetRAMDAC2DATA()
3348 tempbx = SiS_Pr->SiS_StandTable[index].CRTC[6]; in SiS_GetRAMDAC2DATA()
3349 temp1 = SiS_Pr->SiS_StandTable[index].CRTC[7]; in SiS_GetRAMDAC2DATA()
3355 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetRAMDAC2DATA()
3356 index = SiS_GetRefCRT1CRTC(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWideCRT2); in SiS_GetRAMDAC2DATA()
3358 tempax = SiS_Pr->SiS_CRT1Table[index].CR[0]; in SiS_GetRAMDAC2DATA()
3359 tempax |= (SiS_Pr->SiS_CRT1Table[index].CR[14] << 8); in SiS_GetRAMDAC2DATA()
3361 tempbx = SiS_Pr->SiS_CRT1Table[index].CR[6]; in SiS_GetRAMDAC2DATA()
3362 tempcx = SiS_Pr->SiS_CRT1Table[index].CR[13] << 8; in SiS_GetRAMDAC2DATA()
3366 temp1 = SiS_Pr->SiS_CRT1Table[index].CR[7]; in SiS_GetRAMDAC2DATA()
3381 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetRAMDAC2DATA()
3382 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = tempbx; in SiS_GetRAMDAC2DATA()
3386 SiS_CalcPanelLinkTiming(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_CalcPanelLinkTiming() argument
3391 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcPanelLinkTiming()
3392 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_CalcPanelLinkTiming()
3393 if(SiS_Pr->UseCustomMode) { in SiS_CalcPanelLinkTiming()
3394 ResIndex = SiS_Pr->CHTotal; in SiS_CalcPanelLinkTiming()
3395 if(SiS_Pr->CModeFlag & HalfDCLK) ResIndex <<= 1; in SiS_CalcPanelLinkTiming()
3396 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = ResIndex; in SiS_CalcPanelLinkTiming()
3397 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_CalcPanelLinkTiming()
3400 ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_CalcPanelLinkTiming()
3402 ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; in SiS_CalcPanelLinkTiming()
3405 if(SiS_Pr->Alternate1600x1200) ResIndex = 0x20; /* 1600x1200 LCDA */ in SiS_CalcPanelLinkTiming()
3406 else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) ResIndex = 0x21; /* 1600x1200 LVDS */ in SiS_CalcPanelLinkTiming()
3408 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAHT; in SiS_CalcPanelLinkTiming()
3409 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAVT; in SiS_CalcPanelLinkTiming()
3410 SiS_Pr->SiS_HT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDHT; in SiS_CalcPanelLinkTiming()
3411 SiS_Pr->SiS_VT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDVT; in SiS_CalcPanelLinkTiming()
3414 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_CalcPanelLinkTiming()
3415 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_CalcPanelLinkTiming()
3419 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; in SiS_CalcPanelLinkTiming()
3420 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; in SiS_CalcPanelLinkTiming()
3421 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_CalcPanelLinkTiming()
3422 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_CalcPanelLinkTiming()
3423 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT - (SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE); in SiS_CalcPanelLinkTiming()
3424 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT - (SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE); in SiS_CalcPanelLinkTiming()
3429 SiS_GetCRT2DataLVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetCRT2DataLVDS() argument
3435 SiS_GetCRT2ResInfo(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetCRT2DataLVDS()
3437 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2DataLVDS()
3438 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2DataLVDS()
3439 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2DataLVDS()
3440 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2DataLVDS()
3441 SiS_Pr->SiS_RVBHRS = 50; in SiS_GetCRT2DataLVDS()
3442 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2DataLVDS()
3443 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2DataLVDS()
3444 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2DataLVDS()
3445 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2DataLVDS()
3446 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2DataLVDS()
3449 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetCRT2DataLVDS()
3452 SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2DataLVDS()
3453 SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetCRT2DataLVDS()
3459 backup = SiS_Pr->SiS_IF_DEF_LVDS; in SiS_GetCRT2DataLVDS()
3460 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2DataLVDS()
3461 SiS_Pr->SiS_IF_DEF_LVDS = 1; in SiS_GetCRT2DataLVDS()
3464 SiS_GetCRT2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_GetCRT2DataLVDS()
3467 SiS_Pr->SiS_IF_DEF_LVDS = backup; in SiS_GetCRT2DataLVDS()
3470 case 10: LVDSData = SiS_Pr->SiS_LVDS320x240Data_1; break; in SiS_GetCRT2DataLVDS()
3471 case 14: LVDSData = SiS_Pr->SiS_LVDS320x240Data_2; break; in SiS_GetCRT2DataLVDS()
3472 case 12: LVDSData = SiS_Pr->SiS_LVDS640x480Data_1; break; in SiS_GetCRT2DataLVDS()
3473 case 16: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; in SiS_GetCRT2DataLVDS()
3474 case 18: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; in SiS_GetCRT2DataLVDS()
3475 case 20: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; in SiS_GetCRT2DataLVDS()
3477 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; in SiS_GetCRT2DataLVDS()
3478 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; in SiS_GetCRT2DataLVDS()
3479 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; in SiS_GetCRT2DataLVDS()
3480 case 84: LVDSData = SiS_Pr->SiS_LVDS848x480Data_1; break; in SiS_GetCRT2DataLVDS()
3481 case 85: LVDSData = SiS_Pr->SiS_LVDS848x480Data_2; break; in SiS_GetCRT2DataLVDS()
3483 case 90: LVDSData = SiS_Pr->SiS_CHTVUNTSCData; break; in SiS_GetCRT2DataLVDS()
3484 case 91: LVDSData = SiS_Pr->SiS_CHTVONTSCData; break; in SiS_GetCRT2DataLVDS()
3485 case 92: LVDSData = SiS_Pr->SiS_CHTVUPALData; break; in SiS_GetCRT2DataLVDS()
3486 case 93: LVDSData = SiS_Pr->SiS_CHTVOPALData; break; in SiS_GetCRT2DataLVDS()
3487 case 94: LVDSData = SiS_Pr->SiS_CHTVUPALMData; break; in SiS_GetCRT2DataLVDS()
3488 case 95: LVDSData = SiS_Pr->SiS_CHTVOPALMData; break; in SiS_GetCRT2DataLVDS()
3489 case 96: LVDSData = SiS_Pr->SiS_CHTVUPALNData; break; in SiS_GetCRT2DataLVDS()
3490 case 97: LVDSData = SiS_Pr->SiS_CHTVOPALNData; break; in SiS_GetCRT2DataLVDS()
3491 case 99: LVDSData = SiS_Pr->SiS_CHTVSOPALData; break; in SiS_GetCRT2DataLVDS()
3495 SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT; in SiS_GetCRT2DataLVDS()
3496 SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT; in SiS_GetCRT2DataLVDS()
3497 SiS_Pr->SiS_HT = (LVDSData+ResIndex)->LCDHT; in SiS_GetCRT2DataLVDS()
3498 SiS_Pr->SiS_VT = (LVDSData+ResIndex)->LCDVT; in SiS_GetCRT2DataLVDS()
3500 SiS_CalcPanelLinkTiming(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2DataLVDS()
3503 if( (!(SiS_Pr->SiS_VBType & VB_SISVB)) && in SiS_GetCRT2DataLVDS()
3504 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && in SiS_GetCRT2DataLVDS()
3505 (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) ) { in SiS_GetCRT2DataLVDS()
3506 if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || in SiS_GetCRT2DataLVDS()
3507 (SiS_Pr->SiS_SetFlag & SetDOSMode) ) { in SiS_GetCRT2DataLVDS()
3508 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; in SiS_GetCRT2DataLVDS()
3509 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; in SiS_GetCRT2DataLVDS()
3511 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetCRT2DataLVDS()
3513 SiS_Pr->SiS_HDE = 1280; in SiS_GetCRT2DataLVDS()
3514 SiS_Pr->SiS_VDE = 1024; in SiS_GetCRT2DataLVDS()
3524 SiS_GetCRT2Data301(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetCRT2Data301() argument
3537 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetCRT2Data301()
3538 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_GetCRT2Data301()
3539 } else if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3540 modeflag = SiS_Pr->CModeFlag; in SiS_GetCRT2Data301()
3543 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetCRT2Data301()
3544 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetCRT2Data301()
3546 resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; in SiS_GetCRT2Data301()
3547 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && in SiS_GetCRT2Data301()
3548 (SiS_Pr->SiS_SetFlag & LCDVESATiming) && in SiS_GetCRT2Data301()
3550 (SiS_Pr->SiS_NeedRomModeData) ) { in SiS_GetCRT2Data301()
3551 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { in SiS_GetCRT2Data301()
3554 ROMAddr = SiS_Pr->VirtualRomBase; in SiS_GetCRT2Data301()
3561 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2Data301()
3562 SiS_Pr->SiS_RVBHRS = 50; in SiS_GetCRT2Data301()
3563 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2Data301()
3564 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2Data301()
3565 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2Data301()
3566 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2Data301()
3567 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3569 SiS_GetCRT2ResInfo(SiS_Pr,ModeNo,ModeIdIndex); in SiS_GetCRT2Data301()
3571 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_GetCRT2Data301()
3573 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3575 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3576 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3577 SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3578 SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3580 tempax = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3582 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetCRT2Data301()
3583 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3587 SiS_GetRAMDAC2DATA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2Data301()
3591 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetCRT2Data301()
3593 SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex, in SiS_GetCRT2Data301()
3597 case 2: TVPtr = SiS_Pr->SiS_ExtHiTVData; break; in SiS_GetCRT2Data301()
3598 case 3: TVPtr = SiS_Pr->SiS_ExtPALData; break; in SiS_GetCRT2Data301()
3599 case 4: TVPtr = SiS_Pr->SiS_ExtNTSCData; break; in SiS_GetCRT2Data301()
3600 case 5: TVPtr = SiS_Pr->SiS_Ext525iData; break; in SiS_GetCRT2Data301()
3601 case 6: TVPtr = SiS_Pr->SiS_Ext525pData; break; in SiS_GetCRT2Data301()
3602 case 7: TVPtr = SiS_Pr->SiS_Ext750pData; break; in SiS_GetCRT2Data301()
3603 case 8: TVPtr = SiS_Pr->SiS_StPALData; break; in SiS_GetCRT2Data301()
3604 case 9: TVPtr = SiS_Pr->SiS_StNTSCData; break; in SiS_GetCRT2Data301()
3605 case 10: TVPtr = SiS_Pr->SiS_St525iData; break; in SiS_GetCRT2Data301()
3606 case 11: TVPtr = SiS_Pr->SiS_St525pData; break; in SiS_GetCRT2Data301()
3607 case 12: TVPtr = SiS_Pr->SiS_St750pData; break; in SiS_GetCRT2Data301()
3608 case 13: TVPtr = SiS_Pr->SiS_St1HiTVData; break; in SiS_GetCRT2Data301()
3609 case 14: TVPtr = SiS_Pr->SiS_St2HiTVData; break; in SiS_GetCRT2Data301()
3610 default: TVPtr = SiS_Pr->SiS_StPALData; break; in SiS_GetCRT2Data301()
3613 SiS_Pr->SiS_RVBHCMAX = (TVPtr+ResIndex)->RVBHCMAX; in SiS_GetCRT2Data301()
3614 SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT; in SiS_GetCRT2Data301()
3615 SiS_Pr->SiS_VGAHT = (TVPtr+ResIndex)->VGAHT; in SiS_GetCRT2Data301()
3616 SiS_Pr->SiS_VGAVT = (TVPtr+ResIndex)->VGAVT; in SiS_GetCRT2Data301()
3617 SiS_Pr->SiS_HDE = (TVPtr+ResIndex)->TVHDE; in SiS_GetCRT2Data301()
3618 SiS_Pr->SiS_VDE = (TVPtr+ResIndex)->TVVDE; in SiS_GetCRT2Data301()
3619 SiS_Pr->SiS_RVBHRS2 = (TVPtr+ResIndex)->RVBHRS2 & 0x0fff; in SiS_GetCRT2Data301()
3621 SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->HALFRVBHRS; in SiS_GetCRT2Data301()
3622 if(SiS_Pr->SiS_RVBHRS2) { in SiS_GetCRT2Data301()
3623 SiS_Pr->SiS_RVBHRS2 = ((SiS_Pr->SiS_RVBHRS2 + 3) >> 1) - 3; in SiS_GetCRT2Data301()
3625 if((TVPtr+ResIndex)->RVBHRS2 & 0x8000) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3626 else SiS_Pr->SiS_RVBHRS2 += tempax; in SiS_GetCRT2Data301()
3629 SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->RVBHRS; in SiS_GetCRT2Data301()
3631 SiS_Pr->SiS_NewFlickerMode = ((TVPtr+ResIndex)->FlickerMode) << 7; in SiS_GetCRT2Data301()
3633 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetCRT2Data301()
3639 SiS_Pr->SiS_NewFlickerMode = 0x40; in SiS_GetCRT2Data301()
3642 if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; in SiS_GetCRT2Data301()
3644 SiS_Pr->SiS_HT = ExtHiTVHT; in SiS_GetCRT2Data301()
3645 SiS_Pr->SiS_VT = ExtHiTVVT; in SiS_GetCRT2Data301()
3646 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetCRT2Data301()
3647 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_GetCRT2Data301()
3648 SiS_Pr->SiS_HT = StHiTVHT; in SiS_GetCRT2Data301()
3649 SiS_Pr->SiS_VT = StHiTVVT; in SiS_GetCRT2Data301()
3653 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Data301()
3655 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_GetCRT2Data301()
3656 SiS_Pr->SiS_HT = 1650; in SiS_GetCRT2Data301()
3657 SiS_Pr->SiS_VT = 750; in SiS_GetCRT2Data301()
3658 } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_GetCRT2Data301()
3659 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3660 if(SiS_Pr->SiS_TVMode & TVSet525p1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3661 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3663 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3664 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3665 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3670 SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE; in SiS_GetCRT2Data301()
3671 SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE; in SiS_GetCRT2Data301()
3672 SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE; in SiS_GetCRT2Data301()
3673 SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE; in SiS_GetCRT2Data301()
3676 SiS_Pr->SiS_RY1COE = 0x00; in SiS_GetCRT2Data301()
3677 SiS_Pr->SiS_RY2COE = 0xf4; in SiS_GetCRT2Data301()
3678 SiS_Pr->SiS_RY3COE = 0x10; in SiS_GetCRT2Data301()
3679 SiS_Pr->SiS_RY4COE = 0x38; in SiS_GetCRT2Data301()
3682 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_GetCRT2Data301()
3683 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3684 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3685 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3687 SiS_Pr->SiS_HT = PALHT; in SiS_GetCRT2Data301()
3688 SiS_Pr->SiS_VT = PALVT; in SiS_GetCRT2Data301()
3693 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetCRT2Data301()
3695 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3696 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3698 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3700 SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3701 SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3703 tempax = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3705 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetCRT2Data301()
3706 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3712 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_GetCRT2Data301()
3714 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3715 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3716 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3717 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3720 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { in SiS_GetCRT2Data301()
3723 SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; in SiS_GetCRT2Data301()
3724 SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; in SiS_GetCRT2Data301()
3725 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); in SiS_GetCRT2Data301()
3726 SiS_Pr->SiS_VGAVT = (ROMAddr[romptr+4] << 4) | ((ROMAddr[romptr+3] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3727 SiS_Pr->SiS_HT = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8); in SiS_GetCRT2Data301()
3728 SiS_Pr->SiS_VT = (ROMAddr[romptr+7] << 4) | ((ROMAddr[romptr+6] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3729 SiS_Pr->SiS_RVBHRS2 = ROMAddr[romptr+8] | ((ROMAddr[romptr+9] & 0x0f) << 8); in SiS_GetCRT2Data301()
3730 if((SiS_Pr->SiS_RVBHRS2) && (modeflag & HalfDCLK)) { in SiS_GetCRT2Data301()
3731 SiS_Pr->SiS_RVBHRS2 = ((SiS_Pr->SiS_RVBHRS2 + 3) >> 1) - 3; in SiS_GetCRT2Data301()
3733 if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3734 else SiS_Pr->SiS_RVBHRS2 += tempax; in SiS_GetCRT2Data301()
3736 if(SiS_Pr->SiS_VGAHT) gotit = true; in SiS_GetCRT2Data301()
3738 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetCRT2Data301()
3739 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetCRT2Data301()
3740 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3741 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3742 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3743 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3744 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3745 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3746 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3755 SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex, in SiS_GetCRT2Data301()
3759 case Panel_1024x768 : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; in SiS_GetCRT2Data301()
3760 case Panel_1024x768 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data; break; in SiS_GetCRT2Data301()
3762 case Panel_1280x720 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x720Data; break; in SiS_GetCRT2Data301()
3763 case Panel_1280x768_2 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x768_2Data; break; in SiS_GetCRT2Data301()
3764 case Panel_1280x768_2+ 32: LCDPtr = SiS_Pr->SiS_StLCD1280x768_2Data; break; in SiS_GetCRT2Data301()
3766 case Panel_1280x800 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x800Data; break; in SiS_GetCRT2Data301()
3768 case Panel_1280x800_2+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x800_2Data; break; in SiS_GetCRT2Data301()
3770 case Panel_1280x854 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x854Data; break; in SiS_GetCRT2Data301()
3772 case Panel_1280x960 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data; break; in SiS_GetCRT2Data301()
3773 case Panel_1280x1024 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data; break; in SiS_GetCRT2Data301()
3774 case Panel_1280x1024 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; in SiS_GetCRT2Data301()
3775 case Panel_1400x1050 : LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data; break; in SiS_GetCRT2Data301()
3776 case Panel_1400x1050 + 32: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data; break; in SiS_GetCRT2Data301()
3777 case Panel_1600x1200 : LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data; break; in SiS_GetCRT2Data301()
3778 case Panel_1600x1200 + 32: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data; break; in SiS_GetCRT2Data301()
3780 case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; in SiS_GetCRT2Data301()
3781 case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; in SiS_GetCRT2Data301()
3784 case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; in SiS_GetCRT2Data301()
3786 default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; in SiS_GetCRT2Data301()
3789 SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; in SiS_GetCRT2Data301()
3790 SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; in SiS_GetCRT2Data301()
3791 SiS_Pr->SiS_VGAHT = (LCDPtr+ResIndex)->VGAHT; in SiS_GetCRT2Data301()
3792 SiS_Pr->SiS_VGAVT = (LCDPtr+ResIndex)->VGAVT; in SiS_GetCRT2Data301()
3793 SiS_Pr->SiS_HT = (LCDPtr+ResIndex)->LCDHT; in SiS_GetCRT2Data301()
3794 SiS_Pr->SiS_VT = (LCDPtr+ResIndex)->LCDVT; in SiS_GetCRT2Data301()
3798 tempax = SiS_Pr->PanelXRes; in SiS_GetCRT2Data301()
3799 tempbx = SiS_Pr->PanelYRes; in SiS_GetCRT2Data301()
3801 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Data301()
3803 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_GetCRT2Data301()
3804 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetCRT2Data301()
3805 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; in SiS_GetCRT2Data301()
3806 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; in SiS_GetCRT2Data301()
3809 if (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527; in SiS_GetCRT2Data301()
3810 else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620; in SiS_GetCRT2Data301()
3811 else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775; in SiS_GetCRT2Data301()
3812 else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775; in SiS_GetCRT2Data301()
3813 else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; in SiS_GetCRT2Data301()
3814 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; in SiS_GetCRT2Data301()
3818 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 700; in SiS_GetCRT2Data301()
3819 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 800; in SiS_GetCRT2Data301()
3820 else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960; in SiS_GetCRT2Data301()
3823 if (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768; in SiS_GetCRT2Data301()
3824 else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800; in SiS_GetCRT2Data301()
3825 else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864; in SiS_GetCRT2Data301()
3828 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2Data301()
3829 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 875; in SiS_GetCRT2Data301()
3830 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 1000; in SiS_GetCRT2Data301()
3835 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetCRT2Data301()
3836 tempax = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3837 tempbx = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3840 SiS_Pr->SiS_HDE = tempax; in SiS_GetCRT2Data301()
3841 SiS_Pr->SiS_VDE = tempbx; in SiS_GetCRT2Data301()
3847 SiS_GetCRT2Data(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetCRT2Data() argument
3851 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2Data()
3853 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_GetCRT2Data()
3854 SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2Data()
3856 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2Data()
3858 SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2Data()
3860 SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2Data()
3866 SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_GetCRT2Data()
3876 SiS_GetLVDSDesPtr(struct SiS_Private *SiS_Pr) in SiS_GetLVDSDesPtr() argument
3881 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetLVDSDesPtr()
3883 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesPtr()
3884 if(SiS_Pr->SiS_LCDTypeInfo == 4) { in SiS_GetLVDSDesPtr()
3885 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetLVDSDesPtr()
3886 PanelDesPtr = SiS_Pr->SiS_PanelType04_1a; in SiS_GetLVDSDesPtr()
3887 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesPtr()
3888 PanelDesPtr = SiS_Pr->SiS_PanelType04_2a; in SiS_GetLVDSDesPtr()
3890 } else if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SiS_GetLVDSDesPtr()
3891 PanelDesPtr = SiS_Pr->SiS_PanelType04_1b; in SiS_GetLVDSDesPtr()
3892 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesPtr()
3893 PanelDesPtr = SiS_Pr->SiS_PanelType04_2b; in SiS_GetLVDSDesPtr()
3904 SiS_GetLVDSDesData(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetLVDSDesData() argument
3910 SiS_Pr->SiS_LCDHDES = 0; in SiS_GetLVDSDesData()
3911 SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
3914 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetLVDSDesData()
3917 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_GetLVDSDesData()
3918 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLVDSDesData()
3919 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3920 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3927 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
3928 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480 && SiS_Pr->SiS_LCDTypeInfo == 3) { in SiS_GetLVDSDesData()
3929 SiS_Pr->SiS_LCDHDES = 8; in SiS_GetLVDSDesData()
3930 if (SiS_Pr->SiS_VGAVDE >= 480) SiS_Pr->SiS_LCDVDES = 512; in SiS_GetLVDSDesData()
3931 else if(SiS_Pr->SiS_VGAVDE >= 400) SiS_Pr->SiS_LCDVDES = 436; in SiS_GetLVDSDesData()
3932 else if(SiS_Pr->SiS_VGAVDE >= 350) SiS_Pr->SiS_LCDVDES = 440; in SiS_GetLVDSDesData()
3939 if( (SiS_Pr->UseCustomMode) || in SiS_GetLVDSDesData()
3940 (SiS_Pr->SiS_LCDResInfo == Panel_Custom) || in SiS_GetLVDSDesData()
3941 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLVDSDesData()
3942 (SiS_Pr->SiS_CustomT == CUT_PANEL856) || in SiS_GetLVDSDesData()
3943 (SiS_Pr->SiS_LCDInfo & LCDPass11) ) { in SiS_GetLVDSDesData()
3947 if(ModeNo <= 0x13) ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSDesData()
3948 else ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetLVDSDesData()
3950 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSDesData()
3953 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesData()
3955 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { in SiS_GetLVDSDesData()
3956 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); in SiS_GetLVDSDesData()
3958 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3959 SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); in SiS_GetLVDSDesData()
3962 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3963 switch(SiS_Pr->SiS_CustomT) { in SiS_GetLVDSDesData()
3967 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLVDSDesData()
3968 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3972 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
3974 if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) { in SiS_GetLVDSDesData()
3975 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3981 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3989 if((SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSDesData()
3991 if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) { in SiS_GetLVDSDesData()
3992 if(ResIndex <= 3) SiS_Pr->SiS_LCDHDES = 256; in SiS_GetLVDSDesData()
3995 } else if((PanelDesPtr = SiS_GetLVDSDesPtr(SiS_Pr))) { in SiS_GetLVDSDesData()
3997 SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES; in SiS_GetLVDSDesData()
3998 SiS_Pr->SiS_LCDVDES = (PanelDesPtr+ResIndex)->LCDVDES; in SiS_GetLVDSDesData()
4000 } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesData()
4002 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { in SiS_GetLVDSDesData()
4003 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); in SiS_GetLVDSDesData()
4005 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4006 SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); in SiS_GetLVDSDesData()
4008 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
4009 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4011 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
4015 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT; in SiS_GetLVDSDesData()
4018 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4026 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
4028 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
4030 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4031 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4033 SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT + 3; in SiS_GetLVDSDesData()
4034 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT; in SiS_GetLVDSDesData()
4035 if(SiS_Pr->SiS_VGAVDE == 400) SiS_Pr->SiS_LCDVDES -= 2; in SiS_GetLVDSDesData()
4036 else SiS_Pr->SiS_LCDVDES -= 4; in SiS_GetLVDSDesData()
4040 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4041 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4043 SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT - 1; in SiS_GetLVDSDesData()
4044 if(SiS_Pr->SiS_VGAVDE <= 400) SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 8; in SiS_GetLVDSDesData()
4045 if(SiS_Pr->SiS_VGAVDE <= 350) SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 12; in SiS_GetLVDSDesData()
4050 if( (SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) && in SiS_GetLVDSDesData()
4051 (SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) ) { in SiS_GetLVDSDesData()
4052 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4054 SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT - 1; in SiS_GetLVDSDesData()
4059 switch(SiS_Pr->SiS_LCDTypeInfo) { in SiS_GetLVDSDesData()
4061 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
4064 SiS_Pr->SiS_LCDHDES = 8; in SiS_GetLVDSDesData()
4065 if (SiS_Pr->SiS_VGAVDE >= 480) SiS_Pr->SiS_LCDVDES = 512; in SiS_GetLVDSDesData()
4066 else if(SiS_Pr->SiS_VGAVDE >= 400) SiS_Pr->SiS_LCDVDES = 436; in SiS_GetLVDSDesData()
4067 else if(SiS_Pr->SiS_VGAVDE >= 350) SiS_Pr->SiS_LCDVDES = 440; in SiS_GetLVDSDesData()
4073 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
4076 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4077 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4083 SiS_Pr->SiS_LCDVDES = 524; in SiS_GetLVDSDesData()
4090 if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLVDSDesData()
4091 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSDesData()
4092 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSDesData()
4093 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 632; in SiS_GetLVDSDesData()
4094 } else if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetLVDSDesData()
4095 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { in SiS_GetLVDSDesData()
4096 if(SiS_Pr->SiS_LCDResInfo >= Panel_1024x768) { in SiS_GetLVDSDesData()
4097 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
4098 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; in SiS_GetLVDSDesData()
4101 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; in SiS_GetLVDSDesData()
4102 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; in SiS_GetLVDSDesData()
4103 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; in SiS_GetLVDSDesData()
4105 SiS_Pr->SiS_LCDHDES = 320; in SiS_GetLVDSDesData()
4106 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 632; in SiS_GetLVDSDesData()
4107 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 542; in SiS_GetLVDSDesData()
4124 SiS_HandlePWD(struct SiS_Private *SiS_Pr) in SiS_HandlePWD() argument
4128 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_HandlePWD()
4129 unsigned short romptr = GetLCDStructPtr661_2(SiS_Pr); in SiS_HandlePWD()
4130 unsigned char drivermode = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40; in SiS_HandlePWD()
4133 if( (SiS_Pr->SiS_VBType & VB_SISPWD) && in SiS_HandlePWD()
4135 (SiS_Pr->SiS_PWDOffset) ) { in SiS_HandlePWD()
4136 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2b,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 0]); in SiS_HandlePWD()
4137 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2c,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 1]); in SiS_HandlePWD()
4138 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2d,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 2]); in SiS_HandlePWD()
4139 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2e,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 3]); in SiS_HandlePWD()
4140 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2f,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 4]); in SiS_HandlePWD()
4146 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); in SiS_HandlePWD()
4158 SiS_DisableBridge(struct SiS_Private *SiS_Pr) in SiS_DisableBridge() argument
4165 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_DisableBridge()
4167 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* ===== For 30xB/C/LV ===== */ in SiS_DisableBridge()
4169 if(SiS_Pr->ChipType < SIS_315H) { in SiS_DisableBridge()
4173 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_DisableBridge()
4174 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4175 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_DisableBridge()
4177 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4179 SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4181 if(SiS_Is301B(SiS_Pr)) { in SiS_DisableBridge()
4182 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f); in SiS_DisableBridge()
4183 SiS_ShortDelay(SiS_Pr,1); in SiS_DisableBridge()
4185 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); in SiS_DisableBridge()
4186 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4187 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4188 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4189 SiS_UnLockCRT2(SiS_Pr); in SiS_DisableBridge()
4190 if(!(SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SiS_DisableBridge()
4191 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4192 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4194 if( (!(SiS_CRT2IsLCD(SiS_Pr))) || in SiS_DisableBridge()
4195 (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { in SiS_DisableBridge()
4196 SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4197 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4198 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4200 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4211 bool custom1 = (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || in SiS_DisableBridge()
4212 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400); in SiS_DisableBridge()
4214 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; in SiS_DisableBridge()
4216 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4219 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_DisableBridge()
4220 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { in SiS_DisableBridge()
4221 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_DisableBridge()
4226 didpwd = SiS_HandlePWD(SiS_Pr); in SiS_DisableBridge()
4229 (SiS_IsVAMode(SiS_Pr)) || in SiS_DisableBridge()
4230 (!(SiS_IsDualEdge(SiS_Pr))) ) { in SiS_DisableBridge()
4232 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfe); in SiS_DisableBridge()
4233 if(custom1) SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4235 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfc); in SiS_DisableBridge()
4240 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_DisableBridge()
4241 SiS_DDC2Delay(SiS_Pr,0xe000); in SiS_DisableBridge()
4242 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_DisableBridge()
4243 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_DisableBridge()
4245 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_DisableBridge()
4247 SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4252 if(!(SiS_IsNotM650orLater(SiS_Pr))) { in SiS_DisableBridge()
4255 if(SiS_IsVAMode(SiS_Pr)) tempah = 0xf7; in SiS_DisableBridge()
4256 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_DisableBridge()
4260 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4261 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10); in SiS_DisableBridge()
4265 if(SiS_IsDualEdge(SiS_Pr)) { in SiS_DisableBridge()
4267 if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0xbf; in SiS_DisableBridge()
4269 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_DisableBridge()
4271 if((SiS_IsVAMode(SiS_Pr)) || in SiS_DisableBridge()
4272 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4274 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4275 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4276 SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4278 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4279 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF); in SiS_DisableBridge()
4283 if((!(SiS_IsVAMode(SiS_Pr))) || in SiS_DisableBridge()
4284 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4286 if(!(SiS_IsDualEdge(SiS_Pr))) { in SiS_DisableBridge()
4287 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf); in SiS_DisableBridge()
4288 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4290 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4292 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4293 SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4296 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4297 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4298 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4299 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4300 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4304 if(SiS_IsNotM650orLater(SiS_Pr)) { in SiS_DisableBridge()
4305 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4308 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4310 if( (!(SiS_IsVAMode(SiS_Pr))) && in SiS_DisableBridge()
4311 (!(SiS_CRT2IsLCD(SiS_Pr))) && in SiS_DisableBridge()
4312 (!(SiS_IsDualEdge(SiS_Pr))) ) { in SiS_DisableBridge()
4314 if(custom1) SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4316 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4318 if(custom1) SiS_PanelDelay(SiS_Pr, 4); in SiS_DisableBridge()
4322 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_DisableBridge()
4323 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_DisableBridge()
4324 if(SiS_IsVAorLCD(SiS_Pr)) { in SiS_DisableBridge()
4325 SiS_PanelDelayLoop(SiS_Pr, 3, 20); in SiS_DisableBridge()
4338 if(SiS_Pr->ChipType < SIS_315H) { in SiS_DisableBridge()
4340 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_DisableBridge()
4341 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4342 SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4347 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); /* disable VB */ in SiS_DisableBridge()
4348 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4350 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_DisableBridge()
4351 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4354 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); /* disable lock mode */ in SiS_DisableBridge()
4356 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_DisableBridge()
4357 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4358 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4359 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_DisableBridge()
4360 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4363 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ in SiS_DisableBridge()
4364 if( (!(SiS_CRT2IsLCD(SiS_Pr))) || in SiS_DisableBridge()
4365 (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { in SiS_DisableBridge()
4366 SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4367 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4376 if(SiS_Pr->ChipType < SIS_315H) { in SiS_DisableBridge()
4380 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_DisableBridge()
4381 SiS_SetCH700x(SiS_Pr,0x0E,0x09); in SiS_DisableBridge()
4384 if(SiS_Pr->ChipType == SIS_730) { in SiS_DisableBridge()
4385 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4386 SiS_WaitVBRetrace(SiS_Pr); in SiS_DisableBridge()
4388 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_DisableBridge()
4389 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4390 SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4393 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4394 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_DisableBridge()
4395 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_DisableBridge()
4396 SiS_WaitVBRetrace(SiS_Pr); in SiS_DisableBridge()
4397 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) { in SiS_DisableBridge()
4398 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4400 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4401 SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4407 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4409 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4411 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4412 SiS_UnLockCRT2(SiS_Pr); in SiS_DisableBridge()
4413 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4414 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4416 if( (!(SiS_CRT2IsLCD(SiS_Pr))) || in SiS_DisableBridge()
4417 (!(SiS_CR36BIOSWord23d(SiS_Pr))) ) { in SiS_DisableBridge()
4418 SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4419 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4428 if(!(SiS_IsNotM650orLater(SiS_Pr))) { in SiS_DisableBridge()
4430 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18); in SiS_DisableBridge()
4434 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4436 if(SiS_Pr->ChipType == SIS_740) { in SiS_DisableBridge()
4437 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_DisableBridge()
4439 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_DisableBridge()
4440 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_DisableBridge()
4443 if( (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4444 (SiS_IsTVOrYPbPrOrScart(SiS_Pr)) ) { in SiS_DisableBridge()
4445 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_DisableBridge()
4449 if( (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4450 (SiS_IsVAMode(SiS_Pr)) ) { in SiS_DisableBridge()
4451 SiS_Chrontel701xBLOff(SiS_Pr); in SiS_DisableBridge()
4452 SiS_Chrontel701xOff(SiS_Pr); in SiS_DisableBridge()
4455 if(SiS_Pr->ChipType != SIS_740) { in SiS_DisableBridge()
4456 if( (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4457 (SiS_IsTVOrYPbPrOrScart(SiS_Pr)) ) { in SiS_DisableBridge()
4458 SiS_SetCH701x(SiS_Pr,0x49,0x01); in SiS_DisableBridge()
4464 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4465 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4466 SiS_PanelDelay(SiS_Pr, 3); in SiS_DisableBridge()
4469 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4470 (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4471 (!(SiS_IsTVOrYPbPrOrScart(SiS_Pr))) ) { in SiS_DisableBridge()
4472 SiS_DisplayOff(SiS_Pr); in SiS_DisableBridge()
4475 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4476 (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4477 (!(SiS_IsVAMode(SiS_Pr))) ) { in SiS_DisableBridge()
4478 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4481 if(SiS_Pr->ChipType == SIS_740) { in SiS_DisableBridge()
4482 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4485 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4487 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4488 (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4489 (!(SiS_IsVAMode(SiS_Pr))) ) { in SiS_DisableBridge()
4490 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4493 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4494 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_DisableBridge()
4495 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4496 if(SiS_Pr->ChipType == SIS_550) { in SiS_DisableBridge()
4497 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf); in SiS_DisableBridge()
4498 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef); in SiS_DisableBridge()
4502 if(SiS_Pr->ChipType == SIS_740) { in SiS_DisableBridge()
4503 if(SiS_IsLCDOrLCDA(SiS_Pr)) { in SiS_DisableBridge()
4504 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4506 } else if(SiS_IsVAMode(SiS_Pr)) { in SiS_DisableBridge()
4507 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4511 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4512 if(SiS_IsDualEdge(SiS_Pr)) { in SiS_DisableBridge()
4515 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_DisableBridge()
4519 SiS_UnLockCRT2(SiS_Pr); in SiS_DisableBridge()
4521 if(SiS_Pr->ChipType == SIS_550) { in SiS_DisableBridge()
4522 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/ in SiS_DisableBridge()
4523 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */ in SiS_DisableBridge()
4524 } else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4525 (!(SiS_IsDualEdge(SiS_Pr))) || in SiS_DisableBridge()
4526 (!(SiS_IsVAMode(SiS_Pr))) ) { in SiS_DisableBridge()
4527 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_DisableBridge()
4530 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4531 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_DisableBridge()
4532 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { in SiS_DisableBridge()
4533 SiS_PanelDelay(SiS_Pr, 2); in SiS_DisableBridge()
4534 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4557 SiS_EnableBridge(struct SiS_Private *SiS_Pr) in SiS_EnableBridge() argument
4565 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_EnableBridge()
4567 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* ====== For 301B et al ====== */ in SiS_EnableBridge()
4569 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4573 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
4574 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4575 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4576 } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_EnableBridge()
4577 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4579 if(SiS_Pr->SiS_VBType & (VB_SISLVDS | VB_NoLCD)) { in SiS_EnableBridge()
4580 if(!(SiS_CR36BIOSWord23d(SiS_Pr))) { in SiS_EnableBridge()
4581 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
4586 if((SiS_Pr->SiS_VBType & VB_NoLCD) && in SiS_EnableBridge()
4587 (SiS_CRT2IsLCD(SiS_Pr))) { in SiS_EnableBridge()
4589 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* Enable CRT2 */ in SiS_EnableBridge()
4590 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4591 SiS_UnLockCRT2(SiS_Pr); in SiS_EnableBridge()
4592 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
4593 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4594 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
4596 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
4598 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
4599 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4600 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_EnableBridge()
4601 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
4603 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
4604 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
4610 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4611 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4612 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4615 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4616 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4617 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4618 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0); in SiS_EnableBridge()
4619 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4620 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4621 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
4622 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4623 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_EnableBridge()
4624 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
4626 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4646 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4647 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef); in SiS_EnableBridge()
4649 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4650 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4655 if(!(SiS_IsNotM650orLater(SiS_Pr))) { in SiS_EnableBridge()
4658 if(SiS_LCDAEnabled(SiS_Pr)) { in SiS_EnableBridge()
4659 if(SiS_TVEnabled(SiS_Pr)) tempah = 0x18; in SiS_EnableBridge()
4662 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_EnableBridge()
4666 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4668 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_EnableBridge()
4669 SiS_DisplayOff(SiS_Pr); in SiS_EnableBridge()
4670 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_EnableBridge()
4672 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_EnableBridge()
4675 didpwd = SiS_HandlePWD(SiS_Pr); in SiS_EnableBridge()
4677 if(SiS_IsVAorLCD(SiS_Pr)) { in SiS_EnableBridge()
4679 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_EnableBridge()
4680 SiS_PanelDelayLoop(SiS_Pr, 3, 2); in SiS_EnableBridge()
4681 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4682 SiS_PanelDelayLoop(SiS_Pr, 3, 2); in SiS_EnableBridge()
4683 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4684 SiS_GenericDelay(SiS_Pr, 17664); in SiS_EnableBridge()
4688 SiS_PanelDelayLoop(SiS_Pr, 3, 2); in SiS_EnableBridge()
4689 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4690 SiS_GenericDelay(SiS_Pr, 17664); in SiS_EnableBridge()
4695 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { in SiS_EnableBridge()
4696 SiS_PanelDelayLoop(SiS_Pr, 3, 10); in SiS_EnableBridge()
4702 if(!(SiS_IsVAMode(SiS_Pr))) { in SiS_EnableBridge()
4704 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; in SiS_EnableBridge()
4705 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4706 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4708 if(!(SiS_LCDAEnabled(SiS_Pr))) temp |= 0x20; in SiS_EnableBridge()
4711 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4713 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4715 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
4716 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4718 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4719 SiS_PanelDelay(SiS_Pr, 2); in SiS_EnableBridge()
4724 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_EnableBridge()
4728 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20); in SiS_EnableBridge()
4729 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4731 if(SiS_Pr->SiS_VBType & VB_SISPOWER) { in SiS_EnableBridge()
4732 if( (SiS_LCDAEnabled(SiS_Pr)) || in SiS_EnableBridge()
4733 (SiS_CRT2IsLCD(SiS_Pr)) ) { in SiS_EnableBridge()
4735 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f); in SiS_EnableBridge()
4737 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x7f); in SiS_EnableBridge()
4742 if(SiS_IsDualEdge(SiS_Pr)) { in SiS_EnableBridge()
4744 if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0x40; in SiS_EnableBridge()
4746 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_EnableBridge()
4748 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4750 SiS_PanelDelay(SiS_Pr, 2); in SiS_EnableBridge()
4752 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10); in SiS_EnableBridge()
4753 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4755 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { in SiS_EnableBridge()
4757 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4758 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4759 SiS_GenericDelay(SiS_Pr, 2048); in SiS_EnableBridge()
4762 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c); in SiS_EnableBridge()
4764 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4766 cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_EnableBridge()
4768 if(SiS_Pr->SiS_ROMNew) { in SiS_EnableBridge()
4769 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_EnableBridge()
4770 unsigned short romptr = GetLCDStructPtr661_2(SiS_Pr); in SiS_EnableBridge()
4772 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4773 SiS_Pr->EMI_30 = 0; in SiS_EnableBridge()
4774 SiS_Pr->EMI_31 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 0]; in SiS_EnableBridge()
4775 SiS_Pr->EMI_32 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 1]; in SiS_EnableBridge()
4776 SiS_Pr->EMI_33 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 2]; in SiS_EnableBridge()
4777 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; in SiS_EnableBridge()
4779 SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = true; in SiS_EnableBridge()
4794 if(SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4795 r30 = SiS_Pr->EMI_30; r31 = SiS_Pr->EMI_31; in SiS_EnableBridge()
4796 r32 = SiS_Pr->EMI_32; r33 = SiS_Pr->EMI_33; in SiS_EnableBridge()
4808 if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) { in SiS_EnableBridge()
4812 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40; in SiS_EnableBridge()
4813 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4821 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40; in SiS_EnableBridge()
4822 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4824 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_EnableBridge()
4831 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4833 if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { in SiS_EnableBridge()
4840 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4847 if(!SiS_Pr->OverruleEMI) { in SiS_EnableBridge()
4849 if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { in SiS_EnableBridge()
4856 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_EnableBridge()
4863 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_EnableBridge()
4874 if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) { in SiS_EnableBridge()
4875 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4876 SiS_GenericDelay(SiS_Pr, 2048); in SiS_EnableBridge()
4878 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31); in SiS_EnableBridge()
4879 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32); in SiS_EnableBridge()
4880 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33); in SiS_EnableBridge()
4883 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_EnableBridge()
4886 if( (SiS_LCDAEnabled(SiS_Pr)) || in SiS_EnableBridge()
4887 (SiS_CRT2IsLCD(SiS_Pr)) ) { in SiS_EnableBridge()
4890 SiS_PanelDelayLoop(SiS_Pr, 3, 5); in SiS_EnableBridge()
4892 SiS_PanelDelayLoop(SiS_Pr, 3, 5); in SiS_EnableBridge()
4895 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
4896 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
4897 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_EnableBridge()
4898 SiS_GenericDelay(SiS_Pr, 1280); in SiS_EnableBridge()
4900 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); /* Enable */ in SiS_EnableBridge()
4908 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { in SiS_EnableBridge()
4909 if(SiS_IsVAorLCD(SiS_Pr)) { in SiS_EnableBridge()
4910 SiS_PanelDelayLoop(SiS_Pr, 3, 10); in SiS_EnableBridge()
4912 SiS_PanelDelayLoop(SiS_Pr, 3, 10); in SiS_EnableBridge()
4914 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
4915 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4916 SiS_GenericDelay(SiS_Pr, 2048); in SiS_EnableBridge()
4917 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
4920 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4922 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x03); in SiS_EnableBridge()
4927 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_EnableBridge()
4928 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4929 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff); in SiS_EnableBridge()
4933 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { in SiS_EnableBridge()
4934 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4943 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4944 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
4945 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4946 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
4950 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4951 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
4952 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4955 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4957 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4959 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_EnableBridge()
4960 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
4962 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); /* BVBDOENABLE=1 */ in SiS_EnableBridge()
4966 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4968 SiS_VBLongWait(SiS_Pr); in SiS_EnableBridge()
4969 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
4970 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_EnableBridge()
4971 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4973 SiS_VBLongWait(SiS_Pr); in SiS_EnableBridge()
4975 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4976 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
4977 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
4978 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
4986 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4990 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
4991 if(SiS_Pr->ChipType == SIS_730) { in SiS_EnableBridge()
4992 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
4993 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
4994 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
4996 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4997 if(!(SiS_CR36BIOSWord23d(SiS_Pr))) { in SiS_EnableBridge()
4998 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
5002 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5003 SiS_DisplayOn(SiS_Pr); in SiS_EnableBridge()
5004 SiS_UnLockCRT2(SiS_Pr); in SiS_EnableBridge()
5005 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
5006 if(SiS_BridgeInSlavemode(SiS_Pr)) { in SiS_EnableBridge()
5007 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
5009 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
5012 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_EnableBridge()
5013 if(!(SiS_CRT2IsLCD(SiS_Pr))) { in SiS_EnableBridge()
5014 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
5015 SiS_SetCH700x(SiS_Pr,0x0E,0x0B); in SiS_EnableBridge()
5019 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
5020 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
5021 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
5022 if(!(SiS_CR36BIOSWord23b(SiS_Pr))) { in SiS_EnableBridge()
5023 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
5024 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
5026 SiS_WaitVBRetrace(SiS_Pr); in SiS_EnableBridge()
5027 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
5038 if(!(SiS_IsNotM650orLater(SiS_Pr))) { in SiS_EnableBridge()
5040 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18); in SiS_EnableBridge()
5044 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5045 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
5046 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
5047 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
5051 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5052 SiS_UnLockCRT2(SiS_Pr); in SiS_EnableBridge()
5054 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_EnableBridge()
5056 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5057 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_EnableBridge()
5059 SiS_Chrontel701xBLOff(SiS_Pr); in SiS_EnableBridge()
5062 if(SiS_Pr->ChipType != SIS_550) { in SiS_EnableBridge()
5063 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
5066 if(SiS_Pr->ChipType == SIS_740) { in SiS_EnableBridge()
5067 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5068 if(SiS_IsLCDOrLCDA(SiS_Pr)) { in SiS_EnableBridge()
5069 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5074 temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
5076 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); in SiS_EnableBridge()
5079 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5081 SiS_Chrontel701xBLOn(SiS_Pr); in SiS_EnableBridge()
5085 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5086 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
5087 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5088 if(SiS_Pr->ChipType == SIS_550) { in SiS_EnableBridge()
5089 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40); in SiS_EnableBridge()
5090 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10); in SiS_EnableBridge()
5093 } else if(SiS_IsVAMode(SiS_Pr)) { in SiS_EnableBridge()
5094 if(SiS_Pr->ChipType != SIS_740) { in SiS_EnableBridge()
5095 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5099 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { in SiS_EnableBridge()
5100 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
5103 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5104 if(SiS_IsTVOrYPbPrOrScart(SiS_Pr)) { in SiS_EnableBridge()
5105 SiS_Chrontel701xOn(SiS_Pr); in SiS_EnableBridge()
5107 if( (SiS_IsVAMode(SiS_Pr)) || in SiS_EnableBridge()
5108 (SiS_IsLCDOrLCDA(SiS_Pr)) ) { in SiS_EnableBridge()
5109 SiS_ChrontelDoSomething1(SiS_Pr); in SiS_EnableBridge()
5113 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5114 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { in SiS_EnableBridge()
5115 if( (SiS_IsVAMode(SiS_Pr)) || in SiS_EnableBridge()
5116 (SiS_IsLCDOrLCDA(SiS_Pr)) ) { in SiS_EnableBridge()
5117 SiS_Chrontel701xBLOn(SiS_Pr); in SiS_EnableBridge()
5118 SiS_ChrontelInitTVVSync(SiS_Pr); in SiS_EnableBridge()
5121 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5122 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr))) { in SiS_EnableBridge()
5123 if(SiS_CRT2IsLCD(SiS_Pr)) { in SiS_EnableBridge()
5124 SiS_PanelDelay(SiS_Pr, 1); in SiS_EnableBridge()
5125 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
5144 SiS_SetCRT2Offset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetCRT2Offset() argument
5150 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return; in SiS_SetCRT2Offset()
5152 offset = SiS_GetOffset(SiS_Pr,ModeNo,ModeIdIndex,RRTI); in SiS_SetCRT2Offset()
5154 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF)); in SiS_SetCRT2Offset()
5155 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8)); in SiS_SetCRT2Offset()
5159 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp); in SiS_SetCRT2Offset()
5164 SiS_SetCRT2Sync(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short RefreshRateTableI… in SiS_SetCRT2Sync() argument
5170 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2Sync()
5171 infoflag = SiS_Pr->CInfoFlag; in SiS_SetCRT2Sync()
5173 infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; in SiS_SetCRT2Sync()
5176 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* LVDS */ in SiS_SetCRT2Sync()
5178 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Sync()
5180 } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) { in SiS_SetCRT2Sync()
5181 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
5185 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5186 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5187 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_SetCRT2Sync()
5188 (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2Sync()
5191 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_SetCRT2Sync()
5192 (SiS_Pr->SiS_IF_DEF_DSTN) || in SiS_SetCRT2Sync()
5193 (SiS_Pr->SiS_IF_DEF_TRUMPION) || in SiS_SetCRT2Sync()
5194 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_SetCRT2Sync()
5195 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { in SiS_SetCRT2Sync()
5198 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_SetCRT2Sync()
5199 (SiS_Pr->SiS_IF_DEF_DSTN) ) { in SiS_SetCRT2Sync()
5203 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Sync()
5204 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2Sync()
5207 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah); in SiS_SetCRT2Sync()
5210 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0); in SiS_SetCRT2Sync()
5213 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5216 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2Sync()
5218 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2Sync()
5222 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* 630 - 301B(-DH) */ in SiS_SetCRT2Sync()
5226 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5227 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
5228 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
5234 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5236 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5237 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetCRT2Sync()
5238 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5244 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5245 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5255 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* 315 - LVDS */ in SiS_SetCRT2Sync()
5258 if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) && in SiS_SetCRT2Sync()
5259 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetCRT2Sync()
5261 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
5262 tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6); in SiS_SetCRT2Sync()
5264 } else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400) && in SiS_SetCRT2Sync()
5265 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050)) { in SiS_SetCRT2Sync()
5269 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_SetCRT2Sync()
5272 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04; in SiS_SetCRT2Sync()
5276 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5277 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) tempah |= 0xc0; in SiS_SetCRT2Sync()
5278 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5279 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2Sync()
5280 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5281 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5288 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2Sync()
5290 if((SiS_Pr->SiS_VBType & VB_SIS30xC) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2Sync()
5292 tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetCRT2Sync()
5295 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetCRT2Sync()
5296 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetCRT2Sync()
5297 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
5298 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
5306 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5307 if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_SetCRT2Sync()
5309 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah |= 0xc0; in SiS_SetCRT2Sync()
5311 if((SiS_Pr->SiS_VBType & VB_SIS30xC) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2Sync()
5314 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah); in SiS_SetCRT2Sync()
5316 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5317 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2Sync()
5318 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5319 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5333 SiS_SetCRT2FIFO_300(struct SiS_Private *SiS_Pr,unsigned short ModeNo) in SiS_SetCRT2FIFO_300() argument
5335 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2FIFO_300()
5344 SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate; in SiS_SetCRT2FIFO_300()
5346 if(!SiS_Pr->CRT1UsesCustomMode) { in SiS_SetCRT2FIFO_300()
5348 CRT1ModeNo = SiS_Pr->SiS_CRT1Mode; /* get CRT1 ModeNo */ in SiS_SetCRT2FIFO_300()
5349 SiS_SearchModeID(SiS_Pr, &CRT1ModeNo, &modeidindex); in SiS_SetCRT2FIFO_300()
5350 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT2FIFO_300()
5351 SiS_Pr->SiS_SelectCRT2Rate = 0; in SiS_SetCRT2FIFO_300()
5352 refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT1ModeNo, modeidindex); in SiS_SetCRT2FIFO_300()
5356 index = SiS_GetRefCRTVCLK(SiS_Pr, refreshratetableindex, SiS_Pr->SiS_UseWide); in SiS_SetCRT2FIFO_300()
5357 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetCRT2FIFO_300()
5360 colorth = SiS_GetColorDepth(SiS_Pr,CRT1ModeNo,modeidindex) >> 1; in SiS_SetCRT2FIFO_300()
5369 VCLK = SiS_Pr->CSRClock_CRT1; in SiS_SetCRT2FIFO_300()
5372 colorth = colortharray[((SiS_Pr->CModeFlag_CRT1 & ModeTypeMask) - 2)]; in SiS_SetCRT2FIFO_300()
5378 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT2FIFO_300()
5379 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A); in SiS_SetCRT2FIFO_300()
5381 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A); in SiS_SetCRT2FIFO_300()
5384 MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK; in SiS_SetCRT2FIFO_300()
5386 temp = ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) >> 6) & 0x03) << 1; in SiS_SetCRT2FIFO_300()
5396 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT2FIFO_300()
5398 SiS_GetFIFOThresholdIndex300(SiS_Pr, &tempbx, &tempcl); in SiS_SetCRT2FIFO_300()
5403 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); in SiS_SetCRT2FIFO_300()
5404 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); in SiS_SetCRT2FIFO_300()
5406 if(SiS_Pr->ChipType == SIS_730) { in SiS_SetCRT2FIFO_300()
5424 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80) index += 12; in SiS_SetCRT2FIFO_300()
5428 data = SiS_GetLatencyFactor630(SiS_Pr, index) + 15; in SiS_SetCRT2FIFO_300()
5429 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80)) data += 5; in SiS_SetCRT2FIFO_300()
5435 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2FIFO_300()
5436 SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; in SiS_SetCRT2FIFO_300()
5438 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2FIFO_300()
5441 SiS_SearchModeID(SiS_Pr, &CRT2ModeNo, &modeidindex); in SiS_SetCRT2FIFO_300()
5443 refreshratetableindex = SiS_GetRatePtr(SiS_Pr, CRT2ModeNo, modeidindex); in SiS_SetCRT2FIFO_300()
5446 index = SiS_GetVCLK2Ptr(SiS_Pr, CRT2ModeNo, modeidindex, refreshratetableindex); in SiS_SetCRT2FIFO_300()
5447 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetCRT2FIFO_300()
5449 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2FIFO_300()
5450 if(SiS_Pr->SiS_UseROM) { in SiS_SetCRT2FIFO_300()
5461 VCLK = SiS_Pr->CSRClock; in SiS_SetCRT2FIFO_300()
5466 colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex) >> 1; in SiS_SetCRT2FIFO_300()
5477 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT2FIFO_300()
5479 if((data <= 0x0f) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) in SiS_SetCRT2FIFO_300()
5483 if(( (SiS_Pr->ChipType == SIS_630) || in SiS_SetCRT2FIFO_300()
5484 (SiS_Pr->ChipType == SIS_730) ) && in SiS_SetCRT2FIFO_300()
5485 (SiS_Pr->ChipRevision >= 0x30)) in SiS_SetCRT2FIFO_300()
5488 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp); in SiS_SetCRT2FIFO_300()
5490 if((SiS_Pr->ChipType == SIS_630) && in SiS_SetCRT2FIFO_300()
5491 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetCRT2FIFO_300()
5494 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data); in SiS_SetCRT2FIFO_300()
5498 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2FIFO_300()
5499 SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; in SiS_SetCRT2FIFO_300()
5508 SiS_SetCRT2FIFO_310(struct SiS_Private *SiS_Pr) in SiS_SetCRT2FIFO_310() argument
5510 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B); in SiS_SetCRT2FIFO_310()
5511 if( (SiS_Pr->ChipType == SIS_760) && in SiS_SetCRT2FIFO_310()
5512 (SiS_Pr->SiS_SysFlags & SF_760LFB) && in SiS_SetCRT2FIFO_310()
5513 (SiS_Pr->SiS_ModeType == Mode32Bpp) && in SiS_SetCRT2FIFO_310()
5514 (SiS_Pr->SiS_VGAHDE >= 1280) && in SiS_SetCRT2FIFO_310()
5515 (SiS_Pr->SiS_VGAVDE >= 1024) ) { in SiS_SetCRT2FIFO_310()
5516 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03); in SiS_SetCRT2FIFO_310()
5517 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b); in SiS_SetCRT2FIFO_310()
5518 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5519 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_SetCRT2FIFO_310()
5520 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5521 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e); in SiS_SetCRT2FIFO_310()
5523 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04); in SiS_SetCRT2FIFO_310()
5530 SiS_GetVGAHT2(struct SiS_Private *SiS_Pr) in SiS_GetVGAHT2() argument
5534 tempbx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX; in SiS_GetVGAHT2()
5535 tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT; in SiS_GetVGAHT2()
5536 tempax = (tempax * SiS_Pr->SiS_HT) / tempbx; in SiS_GetVGAHT2()
5542 SiS_SetGroup1_301(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex, in SiS_SetGroup1_301() argument
5556 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1_301()
5557 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1_301()
5558 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1_301()
5559 xres = SiS_Pr->CHDisplay; in SiS_SetGroup1_301()
5561 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1_301()
5562 xres = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes; in SiS_SetGroup1_301()
5567 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_301()
5569 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04); in SiS_SetGroup1_301()
5573 SiS_Pr->CHTotal = 8224; /* Max HT, 0x2020, results in 0x3ff in registers */ in SiS_SetGroup1_301()
5575 SiS_Pr->CHDisplay = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup1_301()
5576 if(modeflag & HalfDCLK) SiS_Pr->CHDisplay >>= 1; in SiS_SetGroup1_301()
5578 SiS_Pr->CHBlankStart = SiS_Pr->CHDisplay; in SiS_SetGroup1_301()
5579 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup1_301()
5580 SiS_Pr->CHBlankStart += 16; in SiS_SetGroup1_301()
5583 SiS_Pr->CHBlankEnd = 32; in SiS_SetGroup1_301()
5584 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1_301()
5585 if(xres == 1600) SiS_Pr->CHBlankEnd += 80; in SiS_SetGroup1_301()
5588 temp = SiS_Pr->SiS_VGAHT - 96; in SiS_SetGroup1_301()
5590 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetGroup1_301()
5591 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x04); in SiS_SetGroup1_301()
5592 temp |= ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0xc0) << 2); in SiS_SetGroup1_301()
5596 if(SiS_Pr->SiS_RVBHRS2) temp = SiS_Pr->SiS_RVBHRS2; in SiS_SetGroup1_301()
5598 SiS_Pr->CHSyncStart = temp; in SiS_SetGroup1_301()
5600 SiS_Pr->CHSyncEnd = 0xffe8; /* results in 0x2000 in registers */ in SiS_SetGroup1_301()
5602 SiS_Pr->CVTotal = 2049; /* Max VT, 0x0801, results in 0x7ff in registers */ in SiS_SetGroup1_301()
5604 VGAVDE = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_301()
5612 SiS_Pr->CVDisplay = VGAVDE; in SiS_SetGroup1_301()
5614 SiS_Pr->CVBlankStart = SiS_Pr->CVDisplay; in SiS_SetGroup1_301()
5616 SiS_Pr->CVBlankEnd = 1; in SiS_SetGroup1_301()
5617 if(ModeNo == 0x3c) SiS_Pr->CVBlankEnd = 226; in SiS_SetGroup1_301()
5619 temp = (SiS_Pr->SiS_VGAVT - VGAVDE) >> 1; in SiS_SetGroup1_301()
5620 SiS_Pr->CVSyncStart = VGAVDE + temp; in SiS_SetGroup1_301()
5623 SiS_Pr->CVSyncEnd = SiS_Pr->CVSyncStart + temp; in SiS_SetGroup1_301()
5625 SiS_CalcCRRegisters(SiS_Pr, 0); in SiS_SetGroup1_301()
5626 SiS_Pr->CCRT1CRTC[16] &= ~0xE0; in SiS_SetGroup1_301()
5629 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[i]); in SiS_SetGroup1_301()
5632 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); in SiS_SetGroup1_301()
5635 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); in SiS_SetGroup1_301()
5638 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); in SiS_SetGroup1_301()
5641 temp = SiS_Pr->CCRT1CRTC[16] & 0xE0; in SiS_SetGroup1_301()
5642 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x0E],0x1F,temp); in SiS_SetGroup1_301()
5644 temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5; in SiS_SetGroup1_301()
5646 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x09],0x5F,temp); in SiS_SetGroup1_301()
5649 temp |= (SiS_GetReg(SiS_Pr->SiS_P3c4,0x01) & 0x01); in SiS_SetGroup1_301()
5651 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* SR01: HalfDCLK[3], 8/9 div dotclock[… in SiS_SetGroup1_301()
5653 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00); /* CR14: (text mode: underline location… in SiS_SetGroup1_301()
5654 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00); /* CR17: n/a */ in SiS_SetGroup1_301()
5657 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup1_301()
5658 temp = (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) << 7; in SiS_SetGroup1_301()
5660 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* SR0E, dither[7] */ in SiS_SetGroup1_301()
5662 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetGroup1_301()
5663 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ in SiS_SetGroup1_301()
5671 SiS_SetGroup1_LVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetGroup1_LVDS() argument
5686 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1_LVDS()
5687 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup1_LVDS()
5689 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup1_LVDS()
5691 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1_LVDS()
5692 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1_LVDS()
5694 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1_LVDS()
5695 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1_LVDS()
5697 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetGroup1_LVDS()
5702 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_SetGroup1_LVDS()
5707 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetGroup1_LVDS()
5711 if((SiS_Pr->ChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) { in SiS_SetGroup1_LVDS()
5712 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) { in SiS_SetGroup1_LVDS()
5718 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5720 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5723 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5724 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03); in SiS_SetGroup1_LVDS()
5725 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1_LVDS()
5726 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5730 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5731 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00); in SiS_SetGroup1_LVDS()
5732 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1_LVDS()
5733 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f); in SiS_SetGroup1_LVDS()
5734 if(SiS_Pr->SiS_VBType & VB_SIS30xC) { in SiS_SetGroup1_LVDS()
5735 if((SiS_Pr->SiS_LCDResInfo == Panel_1024x768) || in SiS_SetGroup1_LVDS()
5736 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetGroup1_LVDS()
5737 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20); in SiS_SetGroup1_LVDS()
5747 tempax = SiS_Pr->SiS_LCDHDES; in SiS_SetGroup1_LVDS()
5749 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5750 if(!SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
5751 if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) && in SiS_SetGroup1_LVDS()
5752 (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { in SiS_SetGroup1_LVDS()
5760 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* BPLHDESKEW[2:0] */ in SiS_SetGroup1_LVDS()
5762 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* BPLHDESKEW[10:3] */ in SiS_SetGroup1_LVDS()
5764 tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
5765 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5766 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5767 tempbx = SiS_Pr->PanelXRes; in SiS_SetGroup1_LVDS()
5769 if((SiS_Pr->SiS_LCDResInfo == Panel_320x240_1) || in SiS_SetGroup1_LVDS()
5770 (SiS_Pr->SiS_LCDResInfo == Panel_320x240_2) || in SiS_SetGroup1_LVDS()
5771 (SiS_Pr->SiS_LCDResInfo == Panel_320x240_3)) { in SiS_SetGroup1_LVDS()
5777 if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5782 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* BPLHDEE */ in SiS_SetGroup1_LVDS()
5784 tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2; in SiS_SetGroup1_LVDS()
5786 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5787 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5788 if(SiS_Pr->PanelHRS != 999) tempcx = SiS_Pr->PanelHRS; in SiS_SetGroup1_LVDS()
5793 if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5796 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5797 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5798 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5819 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp); /* BPLHRS */ in SiS_SetGroup1_LVDS()
5821 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5823 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5825 if(SiS_Pr->PanelHRE != 999) { in SiS_SetGroup1_LVDS()
5826 temp = tempcx + SiS_Pr->PanelHRE; in SiS_SetGroup1_LVDS()
5827 if(temp >= SiS_Pr->SiS_HT) temp -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5837 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp); /* BPLHRE */ in SiS_SetGroup1_LVDS()
5841 tempax = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5842 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5843 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5844 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup1_LVDS()
5848 tempbx = SiS_Pr->SiS_LCDVDES + tempax; in SiS_SetGroup1_LVDS()
5849 if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; in SiS_SetGroup1_LVDS()
5853 tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5854 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1_LVDS()
5855 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5856 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5857 tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->PanelYRes; in SiS_SetGroup1_LVDS()
5864 if( (SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && in SiS_SetGroup1_LVDS()
5865 (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) && in SiS_SetGroup1_LVDS()
5866 (SiS_Pr->PanelVRS != 999) ) { in SiS_SetGroup1_LVDS()
5867 tempcx = SiS_Pr->PanelVRS; in SiS_SetGroup1_LVDS()
5872 if(SiS_Pr->ChipType < SIS_315H) tempbx++; in SiS_SetGroup1_LVDS()
5876 if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; in SiS_SetGroup1_LVDS()
5879 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5880 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); /* BPLVRS */ in SiS_SetGroup1_LVDS()
5889 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5890 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5891 if(SiS_Pr->PanelVRE != 999) tempcx = SiS_Pr->PanelVRE; in SiS_SetGroup1_LVDS()
5897 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); /* BPLVRE */ in SiS_SetGroup1_LVDS()
5900 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
5901 if(SiS_Pr->SiS_HDE != 640) { in SiS_SetGroup1_LVDS()
5902 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5904 } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5905 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) temp |= 0x40; in SiS_SetGroup1_LVDS()
5907 if((SiS_Pr->ChipType >= SIS_315H) || in SiS_SetGroup1_LVDS()
5908 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetGroup1_LVDS()
5910 if((SiS_Pr->SiS_IF_DEF_CH70xx == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup1_LVDS()
5911 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03) temp |= 0x80; in SiS_SetGroup1_LVDS()
5914 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup1_LVDS()
5915 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1_LVDS()
5916 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80; in SiS_SetGroup1_LVDS()
5918 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80; in SiS_SetGroup1_LVDS()
5922 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp); in SiS_SetGroup1_LVDS()
5926 tempcx = SiS_Pr->SiS_LCDVDES; /* BPLVDES */ in SiS_SetGroup1_LVDS()
5928 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5929 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_SetGroup1_LVDS()
5931 tempbx = SiS_Pr->SiS_VGAVDE - 1; in SiS_SetGroup1_LVDS()
5932 tempcx = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5935 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5940 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5942 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup1_LVDS()
5948 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1_LVDS()
5949 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5959 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp); in SiS_SetGroup1_LVDS()
5960 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx); in SiS_SetGroup1_LVDS()
5961 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx); in SiS_SetGroup1_LVDS()
5965 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1_LVDS()
5968 tempeax = SiS_Pr->SiS_VGAVDE << 6; in SiS_SetGroup1_LVDS()
5969 temp = (tempeax % (unsigned int)SiS_Pr->SiS_VDE); in SiS_SetGroup1_LVDS()
5970 tempeax = tempeax / (unsigned int)SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5973 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F; in SiS_SetGroup1_LVDS()
5976 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ in SiS_SetGroup1_LVDS()
5983 tempeax = SiS_Pr->SiS_VGAVDE << 18; in SiS_SetGroup1_LVDS()
5984 tempebx = SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5991 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp); in SiS_SetGroup1_LVDS()
5993 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp); in SiS_SetGroup1_LVDS()
5995 if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04; in SiS_SetGroup1_LVDS()
5996 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp); in SiS_SetGroup1_LVDS()
5998 if(SiS_Pr->SiS_VBType & VB_SISPART4SCALER) { in SiS_SetGroup1_LVDS()
6000 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp); in SiS_SetGroup1_LVDS()
6002 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp); in SiS_SetGroup1_LVDS()
6004 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp); in SiS_SetGroup1_LVDS()
6006 if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08; in SiS_SetGroup1_LVDS()
6007 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp); in SiS_SetGroup1_LVDS()
6015 tempeax = SiS_Pr->SiS_VGAHDE; /* 1f = ( (VGAHDE * 65536) / ( (VGAHDE * 65536) / HDE ) ) - 1*/ in SiS_SetGroup1_LVDS()
6020 if(SiS_Pr->SiS_HDE == tempeax) { in SiS_SetGroup1_LVDS()
6023 tempecx = tempebx / SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
6024 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6025 if(tempebx % SiS_Pr->SiS_HDE) tempecx++; in SiS_SetGroup1_LVDS()
6029 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6032 tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1; in SiS_SetGroup1_LVDS()
6036 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp); in SiS_SetGroup1_LVDS()
6038 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6039 tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact; in SiS_SetGroup1_LVDS()
6042 tempeax = SiS_Pr->SiS_VGAVDE << 6; in SiS_SetGroup1_LVDS()
6048 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tempbx--; in SiS_SetGroup1_LVDS()
6049 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) { in SiS_SetGroup1_LVDS()
6050 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) tempbx = 1; in SiS_SetGroup1_LVDS()
6051 else if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempbx = 1; in SiS_SetGroup1_LVDS()
6056 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp); in SiS_SetGroup1_LVDS()
6057 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx); in SiS_SetGroup1_LVDS()
6064 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp); in SiS_SetGroup1_LVDS()
6066 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); in SiS_SetGroup1_LVDS()
6069 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6070 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1_LVDS()
6071 if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SISLVDS)) { in SiS_SetGroup1_LVDS()
6072 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_SetGroup1_LVDS()
6076 if(SiS_Pr->ChipType == SIS_740) { in SiS_SetGroup1_LVDS()
6077 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_SetGroup1_LVDS()
6079 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23); in SiS_SetGroup1_LVDS()
6087 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
6088 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetGroup1_LVDS()
6095 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1_LVDS()
6098 if(SiS_Pr->SiS_LCDTypeInfo == 0x0e) j += 7; in SiS_SetGroup1_LVDS()
6102 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf); in SiS_SetGroup1_LVDS()
6104 SiS_SetTrumpionBlock(SiS_Pr, trumpdata); in SiS_SetGroup1_LVDS()
6106 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
6109 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode13[0]); in SiS_SetGroup1_LVDS()
6113 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_1[0]); in SiS_SetGroup1_LVDS()
6114 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_2[0]); in SiS_SetGroup1_LVDS()
6118 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_SetGroup1_LVDS()
6123 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
6124 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); in SiS_SetGroup1_LVDS()
6125 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); in SiS_SetGroup1_LVDS()
6126 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00); in SiS_SetGroup1_LVDS()
6127 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87); in SiS_SetGroup1_LVDS()
6128 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A); in SiS_SetGroup1_LVDS()
6129 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B); in SiS_SetGroup1_LVDS()
6130 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03); in SiS_SetGroup1_LVDS()
6131 tempax = SiS_Pr->SiS_HDE; /* Blps = lcdhdee(lcdhdes+HDE) + 64 */ in SiS_SetGroup1_LVDS()
6132 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6133 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6134 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6136 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,tempax & 0xff); in SiS_SetGroup1_LVDS()
6138 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp); in SiS_SetGroup1_LVDS()
6140 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,tempax & 0xff); in SiS_SetGroup1_LVDS()
6141 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00); /* Bflml = 0 */ in SiS_SetGroup1_LVDS()
6142 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x007); in SiS_SetGroup1_LVDS()
6144 tempax = SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
6145 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6146 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6147 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6149 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,tempax & 0xff); in SiS_SetGroup1_LVDS()
6151 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp); in SiS_SetGroup1_LVDS()
6153 tempeax = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
6154 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6155 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6156 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempeax >>= 1; in SiS_SetGroup1_LVDS()
6162 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,temp); in SiS_SetGroup1_LVDS()
6163 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00); /* BDxWadrst0 */ in SiS_SetGroup1_LVDS()
6164 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00); in SiS_SetGroup1_LVDS()
6165 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10); in SiS_SetGroup1_LVDS()
6166 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x040); in SiS_SetGroup1_LVDS()
6168 tempax = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
6169 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6170 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6171 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6175 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp); in SiS_SetGroup1_LVDS()
6177 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x44, 0x07, temp); in SiS_SetGroup1_LVDS()
6179 tempax = SiS_Pr->SiS_VDE; /* BDxWadrst1 = BDxWadrst0 + BDxWadroff * VDE */ in SiS_SetGroup1_LVDS()
6180 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6181 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6182 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6185 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp); in SiS_SetGroup1_LVDS()
6187 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp); in SiS_SetGroup1_LVDS()
6189 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp); in SiS_SetGroup1_LVDS()
6191 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x3C, 0x7F, temp); in SiS_SetGroup1_LVDS()
6193 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03); in SiS_SetGroup1_LVDS()
6194 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50); in SiS_SetGroup1_LVDS()
6195 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00); in SiS_SetGroup1_LVDS()
6196 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01); in SiS_SetGroup1_LVDS()
6197 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38); in SiS_SetGroup1_LVDS()
6199 if(SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_SetGroup1_LVDS()
6200 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02); in SiS_SetGroup1_LVDS()
6201 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00); in SiS_SetGroup1_LVDS()
6202 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00); in SiS_SetGroup1_LVDS()
6203 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c); in SiS_SetGroup1_LVDS()
6204 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00); in SiS_SetGroup1_LVDS()
6205 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00); in SiS_SetGroup1_LVDS()
6206 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80); in SiS_SetGroup1_LVDS()
6207 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0); in SiS_SetGroup1_LVDS()
6208 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00); in SiS_SetGroup1_LVDS()
6209 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0); in SiS_SetGroup1_LVDS()
6210 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00); in SiS_SetGroup1_LVDS()
6211 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10); in SiS_SetGroup1_LVDS()
6212 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00); in SiS_SetGroup1_LVDS()
6213 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00); in SiS_SetGroup1_LVDS()
6214 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10); in SiS_SetGroup1_LVDS()
6215 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25); in SiS_SetGroup1_LVDS()
6216 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80); in SiS_SetGroup1_LVDS()
6217 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14); in SiS_SetGroup1_LVDS()
6218 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03); in SiS_SetGroup1_LVDS()
6219 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); in SiS_SetGroup1_LVDS()
6227 SiS_SetGroup1(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetGroup1() argument
6231 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetGroup1()
6239 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1()
6240 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetGroup1()
6245 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1()
6246 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6247 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1()
6249 CRT1Index = SiS_GetRefCRT1CRTC(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWideCRT2); in SiS_SetGroup1()
6250 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1()
6251 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1()
6254 SiS_SetCRT2Offset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetGroup1()
6256 if( ! ((SiS_Pr->ChipType >= SIS_315H) && in SiS_SetGroup1()
6257 (SiS_Pr->SiS_IF_DEF_LVDS == 1) && in SiS_SetGroup1()
6258 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { in SiS_SetGroup1()
6260 if(SiS_Pr->ChipType < SIS_315H ) { in SiS_SetGroup1()
6262 SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo); in SiS_SetGroup1()
6266 SiS_SetCRT2FIFO_310(SiS_Pr); in SiS_SetGroup1()
6272 if(SiS_Pr->ChipType < SIS_315H ) { in SiS_SetGroup1()
6276 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6277 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6279 temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4; in SiS_SetGroup1()
6280 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6282 temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6283 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6285 pushbx = SiS_Pr->SiS_VGAHDE + 12; /* bx BTVGA2HRS 0x0B,0x0C */ in SiS_SetGroup1()
6286 tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2; in SiS_SetGroup1()
6299 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6301 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6304 tempax = SiS_Pr->SiS_VGAHDE >> 1; in SiS_SetGroup1()
6305 tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax; in SiS_SetGroup1()
6306 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup1()
6307 tempcx = SiS_Pr->SiS_HT - tempax; in SiS_SetGroup1()
6312 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6314 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6316 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6317 tempbx = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup1()
6326 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6335 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6336 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetGroup1()
6337 if((SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || in SiS_SetGroup1()
6338 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetGroup1()
6352 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6354 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6355 tempbx = SiS_Pr->CHSyncStart + bridgeadd; in SiS_SetGroup1()
6356 tempcx = SiS_Pr->CHSyncEnd + bridgeadd; in SiS_SetGroup1()
6357 tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1()
6363 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_SetGroup1()
6365 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6366 cr4 = SiS_Pr->CCRT1CRTC[4]; in SiS_SetGroup1()
6367 cr14 = SiS_Pr->CCRT1CRTC[14]; in SiS_SetGroup1()
6368 cr5 = SiS_Pr->CCRT1CRTC[5]; in SiS_SetGroup1()
6369 cr15 = SiS_Pr->CCRT1CRTC[15]; in SiS_SetGroup1()
6371 cr4 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4]; in SiS_SetGroup1()
6372 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14]; in SiS_SetGroup1()
6373 cr5 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5]; in SiS_SetGroup1()
6374 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15]; in SiS_SetGroup1()
6382 tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1()
6388 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSet525p1024)) { in SiS_SetGroup1()
6395 … SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx); /* CRT2 Horizontal Retrace Start */ in SiS_SetGroup1()
6397 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx); /* CRT2 Horizontal Retrace End */ in SiS_SetGroup1()
6400 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* Overflow */ in SiS_SetGroup1()
6404 tempcx = SiS_Pr->SiS_VGAVT - 1; in SiS_SetGroup1()
6407 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetGroup1()
6408 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetGroup1()
6409 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1()
6410 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6411 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { in SiS_SetGroup1()
6418 } else if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1()
6422 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); /* CRT2 Vertical Total */ in SiS_SetGroup1()
6424 tempbx = SiS_Pr->SiS_VGAVDE - 1; in SiS_SetGroup1()
6425 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx); /* CRT2 Vertical Display Enable End */ in SiS_SetGroup1()
6428 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp); /* Overflow */ in SiS_SetGroup1()
6430 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { in SiS_SetGroup1()
6442 …tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x1… in SiS_SetGroup1()
6443 …tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 … in SiS_SetGroup1()
6446 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6447 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6448 tempbx = SiS_Pr->CVSyncStart; in SiS_SetGroup1()
6449 tempcx = SiS_Pr->CVSyncEnd; in SiS_SetGroup1()
6451 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_SetGroup1()
6453 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6454 cr8 = SiS_Pr->CCRT1CRTC[8]; in SiS_SetGroup1()
6455 cr7 = SiS_Pr->CCRT1CRTC[7]; in SiS_SetGroup1()
6456 cr13 = SiS_Pr->CCRT1CRTC[13]; in SiS_SetGroup1()
6457 tempcx = SiS_Pr->CCRT1CRTC[9]; in SiS_SetGroup1()
6459 cr8 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8]; in SiS_SetGroup1()
6460 cr7 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7]; in SiS_SetGroup1()
6461 cr13 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13]; in SiS_SetGroup1()
6462 tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9]; in SiS_SetGroup1()
6470 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx); /* CRT2 Vertical Retrace Start */ in SiS_SetGroup1()
6473 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp); /* CRT2 Vert. Retrace End; Overflow */ in SiS_SetGroup1()
6477 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1()
6481 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6483 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetGroup1()
6485 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) temp = 0x2c; in SiS_SetGroup1()
6486 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6488 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetGroup1()
6489 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6491 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) temp = 0x24; in SiS_SetGroup1()
6492 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) temp = 0x2c; in SiS_SetGroup1()
6493 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x08; in SiS_SetGroup1()
6494 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup1()
6495 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) temp = 0x2c; in SiS_SetGroup1()
6498 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1()
6500 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) in SiS_SetGroup1()
6502 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) in SiS_SetGroup1()
6504 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) in SiS_SetGroup1()
6510 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1()
6511 if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC; in SiS_SetGroup1()
6516 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup1()
6517 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04; in SiS_SetGroup1()
6519 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1()
6524 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1()
6525 if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC; in SiS_SetGroup1()
6531 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Softw… in SiS_SetGroup1()
6539 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetGroup1()
6541 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetGroup1()
6543 if(SiS_Pr->ChipType == SIS_740) temp = 0x03; in SiS_SetGroup1()
6546 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a; in SiS_SetGroup1()
6548 if(SiS_Pr->ChipType == SIS_650) { in SiS_SetGroup1()
6549 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6550 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F; in SiS_SetGroup1()
6554 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_SetGroup1()
6557 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetGroup1()
6562 … SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp); /* Panel Link Delay Compensation */ in SiS_SetGroup1()
6570 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); in SiS_SetGroup1()
6578 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6579 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetGroup1()
6581 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetGroup1()
6582 } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup1()
6583 SiS_SetGroup1_301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetGroup1()
6586 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1()
6587 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetGroup1()
6589 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6590 if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1()
6591 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex,RefreshRateTableIndex); in SiS_SetGroup1()
6594 SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex,RefreshRateTableIndex); in SiS_SetGroup1()
6606 SiS_GetGroup2CLVXPtr(struct SiS_Private *SiS_Pr, int tabletype) in SiS_GetGroup2CLVXPtr() argument
6611 a = SiS_Pr->SiS_VGAHDE; in SiS_GetGroup2CLVXPtr()
6612 b = SiS_Pr->SiS_HDE; in SiS_GetGroup2CLVXPtr()
6614 a = SiS_Pr->SiS_VGAVDE; in SiS_GetGroup2CLVXPtr()
6615 b = SiS_Pr->SiS_VDE; in SiS_GetGroup2CLVXPtr()
6623 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetGroup2CLVXPtr()
6628 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetGroup2CLVXPtr()
6629 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) tableptr = SiS_Part2CLVX_3; in SiS_GetGroup2CLVXPtr()
6630 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tableptr = SiS_Part2CLVX_3; in SiS_GetGroup2CLVXPtr()
6632 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetGroup2CLVXPtr()
6646 SiS_SetGroup2_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetGroup2_C_ELV() argument
6653 if(!(SiS_Pr->SiS_VBType & VB_SISTAP4SCALER)) return; in SiS_SetGroup2_C_ELV()
6655 tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 0); in SiS_SetGroup2_C_ELV()
6657 SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]); in SiS_SetGroup2_C_ELV()
6659 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2_C_ELV()
6660 tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 1); in SiS_SetGroup2_C_ELV()
6662 SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]); in SiS_SetGroup2_C_ELV()
6666 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04; in SiS_SetGroup2_C_ELV()
6667 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); in SiS_SetGroup2_C_ELV()
6671 SiS_GetCRT2Part2Ptr(struct SiS_Private *SiS_Pr,unsigned short ModeNo,unsigned short ModeIdIndex, in SiS_GetCRT2Part2Ptr() argument
6676 if(SiS_Pr->ChipType < SIS_315H) return false; in SiS_GetCRT2Part2Ptr()
6679 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2Part2Ptr()
6681 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetCRT2Part2Ptr()
6686 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Part2Ptr()
6687 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2Part2Ptr()
6692 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_GetCRT2Part2Ptr()
6693 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Part2Ptr()
6694 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) (*CRT2Index) = 206; in SiS_GetCRT2Part2Ptr()
6703 SiS_Group2LCDSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short crt2crtc) in SiS_Group2LCDSpecial() argument
6711 if(!SiS_Pr->UseCustomMode) { in SiS_Group2LCDSpecial()
6712 if( ( ( (SiS_Pr->ChipType == SIS_630) || in SiS_Group2LCDSpecial()
6713 (SiS_Pr->ChipType == SIS_730) ) && in SiS_Group2LCDSpecial()
6714 (SiS_Pr->ChipRevision > 2) ) && in SiS_Group2LCDSpecial()
6715 (SiS_Pr->SiS_LCDResInfo == Panel_1024x768) && in SiS_Group2LCDSpecial()
6716 (!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) && in SiS_Group2LCDSpecial()
6717 (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) { in SiS_Group2LCDSpecial()
6719 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9); in SiS_Group2LCDSpecial()
6720 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC); in SiS_Group2LCDSpecial()
6721 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6); in SiS_Group2LCDSpecial()
6723 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B); in SiS_Group2LCDSpecial()
6724 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13); in SiS_Group2LCDSpecial()
6725 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5); in SiS_Group2LCDSpecial()
6726 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08); in SiS_Group2LCDSpecial()
6727 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2); in SiS_Group2LCDSpecial()
6731 if(SiS_Pr->ChipType < SIS_315H) { in SiS_Group2LCDSpecial()
6732 if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) { in SiS_Group2LCDSpecial()
6735 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_Group2LCDSpecial()
6736 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_Group2LCDSpecial()
6742 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff); in SiS_Group2LCDSpecial()
6745 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_Group2LCDSpecial()
6746 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_Group2LCDSpecial()
6748 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28); in SiS_Group2LCDSpecial()
6752 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18); in SiS_Group2LCDSpecial()
6753 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]); in SiS_Group2LCDSpecial()
6761 SiS_Set300Part2Regs(struct SiS_Private *SiS_Pr, unsigned short ModeIdIndex, unsigned short RefreshR… in SiS_Set300Part2Regs() argument
6768 if(SiS_Pr->ChipType != SIS_300) return; in SiS_Set300Part2Regs()
6769 if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return; in SiS_Set300Part2Regs()
6770 if(SiS_Pr->UseCustomMode) return; in SiS_Set300Part2Regs()
6773 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_Set300Part2Regs()
6775 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_Set300Part2Regs()
6779 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; in SiS_Set300Part2Regs()
6780 else CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2; in SiS_Set300Part2Regs()
6784 CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; in SiS_Set300Part2Regs()
6788 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_Set300Part2Regs()
6789 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_Set300Part2Regs()
6791 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6794 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6797 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6799 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_Set300Part2Regs()
6800 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_Set300Part2Regs()
6805 SiS_SetTVSpecial(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_SetTVSpecial() argument
6807 if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return; in SiS_SetTVSpecial()
6808 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) return; in SiS_SetTVSpecial()
6809 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) return; in SiS_SetTVSpecial()
6811 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetTVSpecial()
6812 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetTVSpecial()
6820 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,specialtv[j]); in SiS_SetTVSpecial()
6822 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72); in SiS_SetTVSpecial()
6823 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750)) { in SiS_SetTVSpecial()
6824 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetTVSpecial()
6825 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); in SiS_SetTVSpecial()
6826 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b); in SiS_SetTVSpecial()
6828 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); /* 15 */ in SiS_SetTVSpecial()
6829 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a); /* 1b */ in SiS_SetTVSpecial()
6836 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 21 */ in SiS_SetTVSpecial()
6837 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 5a */ in SiS_SetTVSpecial()
6839 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a); /* 21 */ in SiS_SetTVSpecial()
6840 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53); /* 5a */ in SiS_SetTVSpecial()
6846 SiS_SetGroup2_Tail(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_SetGroup2_Tail() argument
6850 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_SetGroup2_Tail()
6851 if(SiS_Pr->SiS_VGAVDE == 525) { in SiS_SetGroup2_Tail()
6853 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2_Tail()
6855 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) temp += 2; in SiS_SetGroup2_Tail()
6857 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6858 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3); in SiS_SetGroup2_Tail()
6859 } else if(SiS_Pr->SiS_VGAVDE == 420) { in SiS_SetGroup2_Tail()
6861 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2_Tail()
6863 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) temp++; in SiS_SetGroup2_Tail()
6865 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6869 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup2_Tail()
6870 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { in SiS_SetGroup2_Tail()
6871 if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SiS_SetGroup2_Tail()
6872 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03); in SiS_SetGroup2_Tail()
6877 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp); in SiS_SetGroup2_Tail()
6881 if((SiS_Pr->SiS_PanelXRes == 1280) && (SiS_Pr->SiS_PanelYRes == 768)) { in SiS_SetGroup2_Tail()
6882 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { in SiS_SetGroup2_Tail()
6883 if(((SiS_Pr->SiS_HDE == 640) && (SiS_Pr->SiS_VDE == 480)) || in SiS_SetGroup2_Tail()
6884 ((SiS_Pr->SiS_HDE == 320) && (SiS_Pr->SiS_VDE == 240))) { in SiS_SetGroup2_Tail()
6905 SiS_SetGroup2(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetGroup2() argument
6917 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup2()
6921 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup2()
6922 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup2()
6923 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
6924 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup2()
6927 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup2()
6928 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetGroup2()
6932 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08; in SiS_SetGroup2()
6933 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04; in SiS_SetGroup2()
6934 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) temp |= 0x02; in SiS_SetGroup2()
6935 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp |= 0x01; in SiS_SetGroup2()
6937 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) temp |= 0x10; in SiS_SetGroup2()
6939 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp); in SiS_SetGroup2()
6942 TimingPoint = SiS_Pr->SiS_PALTiming; in SiS_SetGroup2()
6945 if( (SiS_Pr->SiS_VBType & VB_SIS30xBLV) && in SiS_SetGroup2()
6946 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in SiS_SetGroup2()
6947 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { in SiS_SetGroup2()
6951 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
6953 TimingPoint = SiS_Pr->SiS_HiTVExtTiming; in SiS_SetGroup2()
6954 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
6955 TimingPoint = SiS_Pr->SiS_HiTVSt2Timing; in SiS_SetGroup2()
6956 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup2()
6957 TimingPoint = SiS_Pr->SiS_HiTVSt1Timing; in SiS_SetGroup2()
6961 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
6964 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) i = 2; in SiS_SetGroup2()
6965 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) i = 1; in SiS_SetGroup2()
6971 } else if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
6977 TimingPoint = SiS_Pr->SiS_NTSCTiming; in SiS_SetGroup2()
6978 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetNTSCJ) ? 0x01 : 0x00; /* SiS_PALPhase : SiS_NTSCPhase */ in SiS_SetGroup2()
6983 if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) { in SiS_SetGroup2()
6984 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetPALM) ? 0x02 : 0x03; /* SiS_PALMPhase : SiS_PALNPhase */ in SiS_SetGroup2()
6988 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetGroup2()
6989 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
6991 } else if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetGroup2()
6999 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS_TVPhase[(PhaseIndex * 4) + j]); in SiS_SetGroup2()
7003 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
7006 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
7009 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2()
7010 if(SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetGroup2()
7011 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F); in SiS_SetGroup2()
7015 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode); in SiS_SetGroup2()
7017 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE); in SiS_SetGroup2()
7018 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE); in SiS_SetGroup2()
7019 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE); in SiS_SetGroup2()
7020 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE); in SiS_SetGroup2()
7022 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempax = 950; in SiS_SetGroup2()
7023 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempax = 680; in SiS_SetGroup2()
7024 else if(SiS_Pr->SiS_TVMode & TVSetPAL) tempax = 520; in SiS_SetGroup2()
7027 if( ((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) && (SiS_Pr->SiS_VDE <= tempax)) || in SiS_SetGroup2()
7028 ( (SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) && in SiS_SetGroup2()
7029 ((SiS_Pr->SiS_VGAHDE == 1024) || (SiS_Pr->SiS_VDE <= tempax)) ) ) { in SiS_SetGroup2()
7031 tempax -= SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7033 if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) { in SiS_SetGroup2()
7039 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7042 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7044 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) { in SiS_SetGroup2()
7045 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
7046 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); in SiS_SetGroup2()
7047 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); in SiS_SetGroup2()
7049 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17); in SiS_SetGroup2()
7050 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d); in SiS_SetGroup2()
7056 tempcx = SiS_Pr->SiS_HT; in SiS_SetGroup2()
7057 if(SiS_IsDualLink(SiS_Pr)) tempcx >>= 1; in SiS_SetGroup2()
7059 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) tempcx--; in SiS_SetGroup2()
7060 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx); in SiS_SetGroup2()
7061 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f)); in SiS_SetGroup2()
7063 tempcx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup2()
7064 if(SiS_IsDualLink(SiS_Pr)) tempcx >>= 1; in SiS_SetGroup2()
7066 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; in SiS_SetGroup2()
7067 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7071 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx); in SiS_SetGroup2()
7072 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7075 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7079 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0)); in SiS_SetGroup2()
7083 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx); in SiS_SetGroup2()
7084 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0)); in SiS_SetGroup2()
7087 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; in SiS_SetGroup2()
7088 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7090 tempcx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup2()
7091 if(SiS_IsDualLink(SiS_Pr)) tempcx >>= 1; in SiS_SetGroup2()
7094 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7097 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup2()
7098 tempcx = SiS_GetVGAHT2(SiS_Pr) - 1; in SiS_SetGroup2()
7100 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx); in SiS_SetGroup2()
7102 tempbx = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7103 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup2()
7104 if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746; in SiS_SetGroup2()
7105 if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746; in SiS_SetGroup2()
7106 if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853; in SiS_SetGroup2()
7107 } else if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && in SiS_SetGroup2()
7108 (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p))) ) { in SiS_SetGroup2()
7110 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup2()
7111 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup2()
7113 } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
7114 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2()
7119 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
7120 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7123 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetGroup2()
7129 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx); in SiS_SetGroup2()
7133 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { in SiS_SetGroup2()
7135 if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20; in SiS_SetGroup2()
7137 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp); in SiS_SetGroup2()
7139 if(SiS_Pr->SiS_VBType & VB_SISPART4OVERFLOW) { in SiS_SetGroup2()
7140 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5)); in SiS_SetGroup2()
7143 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetGroup2()
7144 tempbx = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7145 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && in SiS_SetGroup2()
7146 (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) ) { in SiS_SetGroup2()
7151 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp); in SiS_SetGroup2()
7152 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx); in SiS_SetGroup2()
7154 if(SiS_Pr->SiS_VBType & VB_SISPART4OVERFLOW) { in SiS_SetGroup2()
7155 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4)); in SiS_SetGroup2()
7161 if(SiS_Pr->SiS_VGAHDE >= SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7168 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2()
7169 if(SiS_Pr->SiS_VGAHDE >= 960) { in SiS_SetGroup2()
7170 if((!(modeflag & HalfDCLK)) || (SiS_Pr->ChipType < SIS_315H)) { in SiS_SetGroup2()
7172 if(SiS_Pr->SiS_VGAHDE >= 1280) { in SiS_SetGroup2()
7184 longtemp = ((SiS_Pr->SiS_VGAHDE * tempch) / tempcl) << 13; in SiS_SetGroup2()
7185 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) longtemp <<= 3; in SiS_SetGroup2()
7186 tempax = longtemp / SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7187 if(longtemp % SiS_Pr->SiS_HDE) tempax++; in SiS_SetGroup2()
7192 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax); in SiS_SetGroup2()
7193 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx); in SiS_SetGroup2()
7195 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetGroup2()
7199 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,tempcx); in SiS_SetGroup2()
7201 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
7208 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx); in SiS_SetGroup2()
7209 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx); in SiS_SetGroup2()
7212 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
7214 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp |= 0x20; in SiS_SetGroup2()
7215 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40; in SiS_SetGroup2()
7217 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp); in SiS_SetGroup2()
7219 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); in SiS_SetGroup2()
7220 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3)); in SiS_SetGroup2()
7222 SiS_SetTVSpecial(SiS_Pr, ModeNo); in SiS_SetGroup2()
7224 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { in SiS_SetGroup2()
7226 if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; in SiS_SetGroup2()
7227 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp); in SiS_SetGroup2()
7232 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
7233 if(!(SiS_Pr->SiS_TVMode & TVSetNTSC1024)) { in SiS_SetGroup2()
7234 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_SetGroup2()
7235 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1)); in SiS_SetGroup2()
7237 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF); in SiS_SetGroup2()
7240 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7241 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup2()
7242 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00); in SiS_SetGroup2()
7246 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) return; in SiS_SetGroup2()
7250 tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7251 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; in SiS_SetGroup2()
7253 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx); in SiS_SetGroup2()
7254 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7257 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetGroup2()
7258 if(SiS_Pr->SiS_ModeType == ModeEGA) { in SiS_SetGroup2()
7259 if(SiS_Pr->SiS_VGAHDE >= 1024) { in SiS_SetGroup2()
7261 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_SetGroup2()
7267 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp); in SiS_SetGroup2()
7269 tempbx = SiS_Pr->SiS_VDE - 1; in SiS_SetGroup2()
7270 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx); in SiS_SetGroup2()
7271 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07)); in SiS_SetGroup2()
7273 tempcx = SiS_Pr->SiS_VT - 1; in SiS_SetGroup2()
7274 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx); in SiS_SetGroup2()
7276 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup2()
7278 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { in SiS_SetGroup2()
7282 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp); in SiS_SetGroup2()
7284 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0); in SiS_SetGroup2()
7285 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0); in SiS_SetGroup2()
7287 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); in SiS_SetGroup2()
7288 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); in SiS_SetGroup2()
7291 if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_SetGroup2()
7296 case 200: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; break; in SiS_SetGroup2()
7299 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_SetGroup2()
7300 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_SetGroup2()
7302 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7305 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7308 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7310 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_SetGroup2()
7311 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_SetGroup2()
7313 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); in SiS_SetGroup2()
7323 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7324 if((SiS_Pr->SiS_LCDInfo & LCDPass11) || (SiS_Pr->PanelYRes == SiS_Pr->SiS_VDE)) { in SiS_SetGroup2()
7325 tempbx = SiS_Pr->SiS_VDE - 1; in SiS_SetGroup2()
7326 tempcx = SiS_Pr->SiS_VT - 1; in SiS_SetGroup2()
7328 tempbx = SiS_Pr->SiS_VDE + ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); in SiS_SetGroup2()
7329 tempcx = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); in SiS_SetGroup2()
7332 tempbx = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7333 tempcx = SiS_Pr->SiS_VT; in SiS_SetGroup2()
7335 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7336 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7338 if(SiS_Pr->PanelYRes < SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7341 tempax -= SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7351 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ in SiS_SetGroup2()
7352 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ in SiS_SetGroup2()
7356 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7358 tempax = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7359 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7360 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7362 tempcx = (SiS_Pr->SiS_VT - tempax) >> 4; in SiS_SetGroup2()
7363 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7364 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7365 tempcx = (SiS_Pr->SiS_VT - tempax) / 10; in SiS_SetGroup2()
7369 tempbx = ((SiS_Pr->SiS_VT + SiS_Pr->SiS_VDE) >> 1) - 1; in SiS_SetGroup2()
7370 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7371 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7372 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { /* ? */ in SiS_SetGroup2()
7373 tempax = SiS_Pr->SiS_VT - SiS_Pr->PanelYRes; in SiS_SetGroup2()
7379 if(tempbx <= SiS_Pr->SiS_VDE) tempbx = SiS_Pr->SiS_VDE + 1; in SiS_SetGroup2()
7383 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup2()
7385 if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (crt2crtc == 6)) { in SiS_SetGroup2()
7386 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_SetGroup2()
7395 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7396 tempbx = SiS_Pr->CVSyncStart; in SiS_SetGroup2()
7399 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ in SiS_SetGroup2()
7405 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7407 temp |= (SiS_Pr->CVSyncEnd & 0x0f); in SiS_SetGroup2()
7410 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7413 SiS_Group2LCDSpecial(SiS_Pr, ModeNo, crt2crtc); in SiS_SetGroup2()
7417 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) bridgeoffset += 2; in SiS_SetGroup2()
7418 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) bridgeoffset += 2; /* OK for Averatec 1280x800 (301C) */ in SiS_SetGroup2()
7419 if(SiS_IsDualLink(SiS_Pr)) bridgeoffset++; in SiS_SetGroup2()
7420 else if(SiS_Pr->SiS_VBType & VB_SIS302LV) bridgeoffset++; /* OK for Asus A4L 1280x800 */ in SiS_SetGroup2()
7424 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7425 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7426 temp = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); in SiS_SetGroup2()
7427 if(SiS_IsDualLink(SiS_Pr)) temp >>= 1; in SiS_SetGroup2()
7431 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp); /* lcdhdes */ in SiS_SetGroup2()
7432 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0)); in SiS_SetGroup2()
7434 tempcx = SiS_Pr->SiS_HT; in SiS_SetGroup2()
7435 tempax = tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7436 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7437 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7438 tempax = SiS_Pr->PanelXRes; in SiS_SetGroup2()
7439 tempbx = SiS_Pr->PanelXRes - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); in SiS_SetGroup2()
7442 if(SiS_IsDualLink(SiS_Pr)) { in SiS_SetGroup2()
7450 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ in SiS_SetGroup2()
7451 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f)); in SiS_SetGroup2()
7458 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetGroup2()
7459 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7460 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetGroup2()
7461 if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47; in SiS_SetGroup2()
7466 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7467 tempbx = SiS_Pr->CHSyncStart; in SiS_SetGroup2()
7469 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; in SiS_SetGroup2()
7473 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ in SiS_SetGroup2()
7474 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7479 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7480 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) tempcx >>= 2; in SiS_SetGroup2()
7484 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7485 tempbx = SiS_Pr->CHSyncEnd; in SiS_SetGroup2()
7487 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; in SiS_SetGroup2()
7491 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ in SiS_SetGroup2()
7493 SiS_SetGroup2_Tail(SiS_Pr, ModeNo); in SiS_SetGroup2()
7496 SiS_Set300Part2Regs(SiS_Pr, ModeIdIndex, RefreshRateTableIndex, ModeNo); in SiS_SetGroup2()
7508 SiS_SetGroup3(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetGroup3() argument
7513 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup3()
7516 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00); in SiS_SetGroup3()
7521 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup3()
7522 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7523 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7525 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5); in SiS_SetGroup3()
7526 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7); in SiS_SetGroup3()
7529 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup3()
7530 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7531 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7532 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8); in SiS_SetGroup3()
7536 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup3()
7537 tempdi = SiS_Pr->SiS_HiTVGroup3Data; in SiS_SetGroup3()
7538 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup3()
7539 tempdi = SiS_Pr->SiS_HiTVGroup3Simu; in SiS_SetGroup3()
7541 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup3()
7542 if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) { in SiS_SetGroup3()
7544 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempdi = SiS_HiTVGroup3_2; in SiS_SetGroup3()
7549 SiS_SetReg(SiS_Pr->SiS_Part3Port,i,tempdi[i]); in SiS_SetGroup3()
7551 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { in SiS_SetGroup3()
7552 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_SetGroup3()
7553 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f); in SiS_SetGroup3()
7570 SiS_ShiftXPos(struct SiS_Private *SiS_Pr, int shift)
7574 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f);
7575 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20);
7577 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp);
7578 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0));
7579 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f;
7581 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f));
7582 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
7583 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42);
7585 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp);
7586 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0));
7591 SiS_SetGroup4_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetGroup4_C_ELV() argument
7594 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetGroup4_C_ELV()
7596 if(!(SiS_Pr->SiS_VBType & VB_SIS30xCLV)) return; in SiS_SetGroup4_C_ELV()
7597 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) return; in SiS_SetGroup4_C_ELV()
7599 if(SiS_Pr->ChipType >= XGI_20) return; in SiS_SetGroup4_C_ELV()
7601 if((SiS_Pr->ChipType >= SIS_661) && (SiS_Pr->SiS_ROMNew)) { in SiS_SetGroup4_C_ELV()
7605 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08); in SiS_SetGroup4_C_ELV()
7606 temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a); in SiS_SetGroup4_C_ELV()
7608 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf); in SiS_SetGroup4_C_ELV()
7609 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc); in SiS_SetGroup4_C_ELV()
7610 if((SiS_Pr->ChipType < SIS_661) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetGroup4_C_ELV()
7611 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8); in SiS_SetGroup4_C_ELV()
7613 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb); in SiS_SetGroup4_C_ELV()
7614 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp = 0x0000; in SiS_SetGroup4_C_ELV()
7615 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp = 0x0002; in SiS_SetGroup4_C_ELV()
7616 else if(SiS_Pr->SiS_TVMode & TVSetHiVision) temp = 0x0400; in SiS_SetGroup4_C_ELV()
7618 if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_SetGroup4_C_ELV()
7620 if(SiS_Pr->SiS_TVMode & TVAspect43) temp1 = 4; in SiS_SetGroup4_C_ELV()
7621 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1); in SiS_SetGroup4_C_ELV()
7622 if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7623 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7624 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7626 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x39,0xfd); in SiS_SetGroup4_C_ELV()
7629 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03; in SiS_SetGroup4_C_ELV()
7632 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7633 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7635 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3b,0xfd); in SiS_SetGroup4_C_ELV()
7640 if(SiS_Pr->ChipType >= SIS_661) { /* ? */ in SiS_SetGroup4_C_ELV()
7641 if(SiS_Pr->SiS_TVMode & TVAspect43) { in SiS_SetGroup4_C_ELV()
7642 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_SetGroup4_C_ELV()
7644 SiS_ShiftXPos(SiS_Pr, 97); in SiS_SetGroup4_C_ELV()
7646 SiS_ShiftXPos(SiS_Pr, 111); in SiS_SetGroup4_C_ELV()
7648 } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { in SiS_SetGroup4_C_ELV()
7649 SiS_ShiftXPos(SiS_Pr, 136); in SiS_SetGroup4_C_ELV()
7661 SiS_SetCRT2VCLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetCRT2VCLK() argument
7666 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2VCLK()
7667 reg1 = SiS_Pr->CSR2B; in SiS_SetCRT2VCLK()
7668 reg2 = SiS_Pr->CSR2C; in SiS_SetCRT2VCLK()
7670 vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2VCLK()
7671 reg1 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A; in SiS_SetCRT2VCLK()
7672 reg2 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B; in SiS_SetCRT2VCLK()
7675 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2VCLK()
7676 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSet525p1024)) { in SiS_SetCRT2VCLK()
7677 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57); in SiS_SetCRT2VCLK()
7678 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46); in SiS_SetCRT2VCLK()
7679 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6); in SiS_SetCRT2VCLK()
7681 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7682 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7685 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01); in SiS_SetCRT2VCLK()
7686 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7687 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7689 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00); in SiS_SetCRT2VCLK()
7691 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20; in SiS_SetCRT2VCLK()
7692 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp); in SiS_SetCRT2VCLK()
7696 SiS_SetDualLinkEtc(struct SiS_Private *SiS_Pr) in SiS_SetDualLinkEtc() argument
7698 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetDualLinkEtc()
7699 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_SetDualLinkEtc()
7700 if((SiS_CRT2IsLCD(SiS_Pr)) || in SiS_SetDualLinkEtc()
7701 (SiS_IsVAMode(SiS_Pr))) { in SiS_SetDualLinkEtc()
7702 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) { in SiS_SetDualLinkEtc()
7703 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); in SiS_SetDualLinkEtc()
7705 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20); in SiS_SetDualLinkEtc()
7710 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_SetDualLinkEtc()
7711 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_SetDualLinkEtc()
7713 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_SetDualLinkEtc()
7715 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_SetDualLinkEtc()
7720 SiS_SetGroup4(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetGroup4() argument
7727 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup4()
7728 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup4()
7729 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup4()
7730 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup4()
7733 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup4()
7734 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup4()
7737 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup4()
7738 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_SetGroup4()
7739 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup4()
7740 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7745 if(SiS_Pr->SiS_VBType & (VB_SIS30xCLV | VB_SIS302LV)) { in SiS_SetGroup4()
7746 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7747 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f); in SiS_SetGroup4()
7751 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup4()
7752 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup4()
7753 SiS_SetDualLinkEtc(SiS_Pr); in SiS_SetGroup4()
7758 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT); in SiS_SetGroup4()
7760 tempbx = SiS_Pr->SiS_RVBHCMAX; in SiS_SetGroup4()
7761 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx); in SiS_SetGroup4()
7765 tempcx = SiS_Pr->SiS_VGAHT - 1; in SiS_SetGroup4()
7766 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx); in SiS_SetGroup4()
7770 tempcx = SiS_Pr->SiS_VGAVT - 1; in SiS_SetGroup4()
7771 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempcx -= 5; in SiS_SetGroup4()
7772 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx); in SiS_SetGroup4()
7775 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp); in SiS_SetGroup4()
7777 tempbx = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup4()
7779 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; in SiS_SetGroup4()
7781 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7784 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup4()
7788 } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetGroup4()
7797 temp |= SiS_Pr->Init_P4_0E; in SiS_SetGroup4()
7799 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetGroup4()
7800 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { in SiS_SetGroup4()
7806 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp); in SiS_SetGroup4()
7808 tempeax = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup4()
7809 tempebx = SiS_Pr->SiS_VDE; in SiS_SetGroup4()
7810 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup4()
7814 tempcx = SiS_Pr->SiS_RVBHRS; in SiS_SetGroup4()
7815 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx); in SiS_SetGroup4()
7831 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp); in SiS_SetGroup4()
7833 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp); in SiS_SetGroup4()
7836 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp); in SiS_SetGroup4()
7838 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetGroup4()
7840 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28); in SiS_SetGroup4()
7844 if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08; in SiS_SetGroup4()
7845 tempax = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup4()
7847 if(SiS_IsDualLink(SiS_Pr)) tempax >>= 1; in SiS_SetGroup4()
7849 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7860 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7873 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax); in SiS_SetGroup4()
7874 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp); in SiS_SetGroup4()
7877 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SiS_SetGroup4()
7880 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7881 … if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr525p))) { in SiS_SetGroup4()
7883 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup4()
7884 if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in SiS_SetGroup4()
7890 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp); in SiS_SetGroup4()
7892 tempbx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup4()
7893 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; in SiS_SetGroup4()
7895 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx); in SiS_SetGroup4()
7897 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp); in SiS_SetGroup4()
7899 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_SetGroup4()
7900 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7901 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7906 SiS_SetDualLinkEtc(SiS_Pr); in SiS_SetGroup4()
7910 SiS_SetCRT2VCLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetGroup4()
7918 SiS_SetGroup5(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetGroup5() argument
7921 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup5()
7923 if(SiS_Pr->SiS_ModeType == ModeVGA) { in SiS_SetGroup5()
7924 if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))) { in SiS_SetGroup5()
7925 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_SetGroup5()
7926 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetGroup5()
7936 SiS_GetLVDSCRT1Ptr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_GetLVDSCRT1Ptr() argument
7946 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSCRT1Ptr()
7947 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSCRT1Ptr()
7949 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetLVDSCRT1Ptr()
7950 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetLVDSCRT1Ptr()
7955 if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSCRT1Ptr()
7958 if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) { in SiS_GetLVDSCRT1Ptr()
7960 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetLVDSCRT1Ptr()
7961 if(SiS_Pr->SiS_CHSOverScan) (*DisplayType) = 84; in SiS_GetLVDSCRT1Ptr()
7965 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++; in SiS_GetLVDSCRT1Ptr()
7971 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSCRT1Ptr()
7990 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { in SiS_GetLVDSCRT1Ptr()
7991 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) (*DisplayType) += 2; in SiS_GetLVDSCRT1Ptr()
8000 SiS_ModCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_ModCRT1CRTC() argument
8010 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_ModCRT1CRTC()
8011 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_ModCRT1CRTC()
8012 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_ModCRT1CRTC()
8013 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) in SiS_ModCRT1CRTC()
8016 if(SiS_Pr->SiS_IF_DEF_LVDS) { in SiS_ModCRT1CRTC()
8017 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_ModCRT1CRTC()
8018 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return; in SiS_ModCRT1CRTC()
8020 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_ModCRT1CRTC()
8021 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return; in SiS_ModCRT1CRTC()
8024 if(SiS_Pr->SiS_LCDInfo & LCDPass11) return; in SiS_ModCRT1CRTC()
8026 if(SiS_Pr->ChipType < SIS_315H) { in SiS_ModCRT1CRTC()
8027 if(SiS_Pr->SiS_SetFlag & SetDOSMode) return; in SiS_ModCRT1CRTC()
8030 if(!(SiS_GetLVDSCRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, in SiS_ModCRT1CRTC()
8036 case 50: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_1; break; /* xSTN */ in SiS_ModCRT1CRTC()
8037 case 14: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_2; break; /* xSTN */ in SiS_ModCRT1CRTC()
8038 case 15: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_2_H; break; /* xSTN */ in SiS_ModCRT1CRTC()
8039 case 18: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_3; break; /* xSTN */ in SiS_ModCRT1CRTC()
8040 case 19: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_3_H; break; /* xSTN */ in SiS_ModCRT1CRTC()
8041 case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1; break; in SiS_ModCRT1CRTC()
8042 case 11: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1_H; break; in SiS_ModCRT1CRTC()
8044 case 26: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1; break; in SiS_ModCRT1CRTC()
8045 case 27: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1_H; break; in SiS_ModCRT1CRTC()
8046 case 28: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2; break; in SiS_ModCRT1CRTC()
8047 case 29: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2_H; break; in SiS_ModCRT1CRTC()
8049 case 80: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UNTSC; break; in SiS_ModCRT1CRTC()
8050 case 81: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1ONTSC; break; in SiS_ModCRT1CRTC()
8051 case 82: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UPAL; break; in SiS_ModCRT1CRTC()
8052 case 83: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1OPAL; break; in SiS_ModCRT1CRTC()
8053 case 84: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1SOPAL; break; in SiS_ModCRT1CRTC()
8058 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_ModCRT1CRTC()
8062 SiS_SetReg(SiS_Pr->SiS_P3d4,CRIdx[i],tempah); in SiS_ModCRT1CRTC()
8067 SiS_SetReg(SiS_Pr->SiS_P3c4,i,tempah); in SiS_ModCRT1CRTC()
8071 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah); in SiS_ModCRT1CRTC()
8073 if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_ModCRT1CRTC()
8074 else modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_ModCRT1CRTC()
8078 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah); in SiS_ModCRT1CRTC()
8082 SiS_CalcLCDACRT1Timing(SiS_Pr, ModeNo, ModeIdIndex); in SiS_ModCRT1CRTC()
8092 SiS_SetCRT2ECLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetCRT2ECLK() argument
8095 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2ECLK()
8099 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetCRT2ECLK()
8100 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT2ECLK()
8101 if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK == 2) { in SiS_SetCRT2ECLK()
8104 vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, in SiS_SetCRT2ECLK()
8106 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2ECLK()
8108 vclkindex = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, in SiS_SetCRT2ECLK()
8112 sr2b = SiS_Pr->SiS_VCLKData[vclkindex].SR2B; in SiS_SetCRT2ECLK()
8113 sr2c = SiS_Pr->SiS_VCLKData[vclkindex].SR2C; in SiS_SetCRT2ECLK()
8115 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2ECLK()
8116 if(SiS_Pr->SiS_UseROM) { in SiS_SetCRT2ECLK()
8125 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ECLK()
8126 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ECLK()
8131 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20); in SiS_SetCRT2ECLK()
8132 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
8133 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
8134 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10); in SiS_SetCRT2ECLK()
8135 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
8136 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
8137 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00); in SiS_SetCRT2ECLK()
8138 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
8139 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
8147 SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_SetCHTVReg() argument
8154 resindex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetCHTVReg()
8156 resindex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetCHTVReg()
8161 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
8162 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetCHTVReg()
8164 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetCHTVReg()
8165 if(SiS_Pr->SiS_CHSOverScan) TVType = 8; in SiS_SetCHTVReg()
8167 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetCHTVReg()
8169 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
8170 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_SetCHTVReg()
8172 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
8177 case 0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break; in SiS_SetCHTVReg()
8178 case 1: CHTVRegData = SiS_Pr->SiS_CHTVReg_ONTSC; break; in SiS_SetCHTVReg()
8179 case 2: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPAL; break; in SiS_SetCHTVReg()
8180 case 3: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; in SiS_SetCHTVReg()
8181 case 4: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALM; break; in SiS_SetCHTVReg()
8182 case 5: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALM; break; in SiS_SetCHTVReg()
8183 case 6: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALN; break; in SiS_SetCHTVReg()
8184 case 7: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALN; break; in SiS_SetCHTVReg()
8185 case 8: CHTVRegData = SiS_Pr->SiS_CHTVReg_SOPAL; break; in SiS_SetCHTVReg()
8186 default: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; in SiS_SetCHTVReg()
8190 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetCHTVReg()
8199 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetCHTVReg()
8200 SiS_SetCH700x(SiS_Pr,0x04,0x43); /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8201 SiS_SetCH700x(SiS_Pr,0x09,0x69); /* Black level for PAL (105)*/ in SiS_SetCHTVReg()
8203 SiS_SetCH700x(SiS_Pr,0x04,0x03); /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8204 SiS_SetCH700x(SiS_Pr,0x09,0x71); /* Black level for NTSC (113)*/ in SiS_SetCHTVReg()
8207 SiS_SetCH700x(SiS_Pr,0x00,CHTVRegData[resindex].Reg[0]); /* Mode register */ in SiS_SetCHTVReg()
8208 SiS_SetCH700x(SiS_Pr,0x07,CHTVRegData[resindex].Reg[1]); /* Start active video register */ in SiS_SetCHTVReg()
8209 SiS_SetCH700x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[2]); /* Position overflow register */ in SiS_SetCHTVReg()
8210 SiS_SetCH700x(SiS_Pr,0x0a,CHTVRegData[resindex].Reg[3]); /* Horiz Position register */ in SiS_SetCHTVReg()
8211 SiS_SetCH700x(SiS_Pr,0x0b,CHTVRegData[resindex].Reg[4]); /* Vertical Position register */ in SiS_SetCHTVReg()
8218 SiS_SetCH700x(SiS_Pr,0x01,0x28); in SiS_SetCHTVReg()
8227 SiS_SetCH700x(SiS_Pr,0x03,0xb1); /* old: 3103 */ in SiS_SetCHTVReg()
8233 SiS_SetCH70xx(SiS_Pr,0x3d,0x00); in SiS_SetCHTVReg()
8239 SiS_SetCH70xxANDOR(SiS_Pr,0x10,0x00,0x1F); in SiS_SetCHTVReg()
8244 SiS_SetCH70xxANDOR(SiS_Pr,0x11,0x02,0xF8); in SiS_SetCHTVReg()
8248 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xEF); in SiS_SetCHTVReg()
8250 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { /* ---- NTSC ---- */ in SiS_SetCHTVReg()
8251 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) { in SiS_SetCHTVReg()
8253 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8254 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on, no need to set FSCI */ in SiS_SetCHTVReg()
8256 SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* 0x18-0x1f: FSCI 469,762,048 */ in SiS_SetCHTVReg()
8257 SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x0C,0xF0); in SiS_SetCHTVReg()
8258 SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x00,0xF0); in SiS_SetCHTVReg()
8259 SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x00,0xF0); in SiS_SetCHTVReg()
8260 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xF0); in SiS_SetCHTVReg()
8261 SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x00,0xF0); in SiS_SetCHTVReg()
8262 SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x00,0xF0); in SiS_SetCHTVReg()
8263 SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x00,0xF0); in SiS_SetCHTVReg()
8264 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x01,0xEF); /* Loop filter on for mode 23 */ in SiS_SetCHTVReg()
8265 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); /* ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8269 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8270 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); in SiS_SetCHTVReg()
8273 … SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* (FSCI was 0x1f1c71c7 - this is for mode 22) */ in SiS_SetCHTVReg()
8274 SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x09,0xF0); /* FSCI for mode 24 is 428,554,851 */ in SiS_SetCHTVReg()
8275 SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x08,0xF0); /* 198b3a63 */ in SiS_SetCHTVReg()
8276 SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x0b,0xF0); in SiS_SetCHTVReg()
8277 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x04,0xF0); in SiS_SetCHTVReg()
8278 SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x01,0xF0); in SiS_SetCHTVReg()
8279 SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x06,0xF0); in SiS_SetCHTVReg()
8280 SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x05,0xF0); in SiS_SetCHTVReg()
8281 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off for mode 24 */ in SiS_SetCHTVReg()
8282 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); * ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8284 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8285 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); in SiS_SetCHTVReg()
8290 SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8291 SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE); /* ACIV on */ in SiS_SetCHTVReg()
8308 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp |= 0x10; in SiS_SetCHTVReg()
8309 SiS_SetCH701x(SiS_Pr,0x00,temp); in SiS_SetCHTVReg()
8311 SiS_SetCH701x(SiS_Pr,0x01,CHTVRegData[resindex].Reg[1]); in SiS_SetCHTVReg()
8312 SiS_SetCH701x(SiS_Pr,0x02,CHTVRegData[resindex].Reg[2]); in SiS_SetCHTVReg()
8313 SiS_SetCH701x(SiS_Pr,0x04,CHTVRegData[resindex].Reg[3]); in SiS_SetCHTVReg()
8314 SiS_SetCH701x(SiS_Pr,0x03,CHTVRegData[resindex].Reg[4]); in SiS_SetCHTVReg()
8315 SiS_SetCH701x(SiS_Pr,0x05,CHTVRegData[resindex].Reg[5]); in SiS_SetCHTVReg()
8316 SiS_SetCH701x(SiS_Pr,0x06,CHTVRegData[resindex].Reg[6]); in SiS_SetCHTVReg()
8319 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 0x66; in SiS_SetCHTVReg()
8320 SiS_SetCH701x(SiS_Pr,0x07,temp); in SiS_SetCHTVReg()
8322 SiS_SetCH701x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[8]); in SiS_SetCHTVReg()
8323 SiS_SetCH701x(SiS_Pr,0x15,CHTVRegData[resindex].Reg[9]); in SiS_SetCHTVReg()
8324 SiS_SetCH701x(SiS_Pr,0x1f,CHTVRegData[resindex].Reg[10]); in SiS_SetCHTVReg()
8325 SiS_SetCH701x(SiS_Pr,0x0c,CHTVRegData[resindex].Reg[11]); in SiS_SetCHTVReg()
8326 SiS_SetCH701x(SiS_Pr,0x0d,CHTVRegData[resindex].Reg[12]); in SiS_SetCHTVReg()
8327 SiS_SetCH701x(SiS_Pr,0x0e,CHTVRegData[resindex].Reg[13]); in SiS_SetCHTVReg()
8328 SiS_SetCH701x(SiS_Pr,0x0f,CHTVRegData[resindex].Reg[14]); in SiS_SetCHTVReg()
8329 SiS_SetCH701x(SiS_Pr,0x10,CHTVRegData[resindex].Reg[15]); in SiS_SetCHTVReg()
8331 temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02; in SiS_SetCHTVReg()
8338 if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02; in SiS_SetCHTVReg()
8339 SiS_SetCH701x(SiS_Pr,0x21,temp); in SiS_SetCHTVReg()
8354 SiS_Chrontel701xBLOn(struct SiS_Private *SiS_Pr) in SiS_Chrontel701xBLOn() argument
8359 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xBLOn()
8360 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xBLOn()
8361 SiS_SetCH701x(SiS_Pr,0x66,0x65); in SiS_Chrontel701xBLOn()
8363 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOn()
8365 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOn()
8371 SiS_Chrontel701xBLOff(struct SiS_Private *SiS_Pr) in SiS_Chrontel701xBLOff() argument
8376 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xBLOff()
8377 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOff()
8379 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOff()
8384 SiS_ChrontelPowerSequencing(struct SiS_Private *SiS_Pr) in SiS_ChrontelPowerSequencing() argument
8398 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelPowerSequencing()
8399 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_ChrontelPowerSequencing()
8400 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1024_740; in SiS_ChrontelPowerSequencing()
8402 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_ChrontelPowerSequencing()
8403 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_ChrontelPowerSequencing()
8404 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { in SiS_ChrontelPowerSequencing()
8405 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1400_740; in SiS_ChrontelPowerSequencing()
8409 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_ChrontelPowerSequencing()
8411 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_ChrontelPowerSequencing()
8412 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_ChrontelPowerSequencing()
8413 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { in SiS_ChrontelPowerSequencing()
8419 SiS_SetCH701x(SiS_Pr, regtable[i], tableptr[i]); in SiS_ChrontelPowerSequencing()
8424 SiS_SetCH701xForLCD(struct SiS_Private *SiS_Pr) in SiS_SetCH701xForLCD() argument
8466 if(SiS_Pr->ChipType == SIS_740) { in SiS_SetCH701xForLCD()
8467 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_740; in SiS_SetCH701xForLCD()
8468 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_740; in SiS_SetCH701xForLCD()
8469 else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_740; in SiS_SetCH701xForLCD()
8470 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_740; in SiS_SetCH701xForLCD()
8473 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_650; in SiS_SetCH701xForLCD()
8474 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_650; in SiS_SetCH701xForLCD()
8475 else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_650; in SiS_SetCH701xForLCD()
8476 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_650; in SiS_SetCH701xForLCD()
8480 tempbh = SiS_GetCH701x(SiS_Pr,0x74); in SiS_SetCH701xForLCD()
8482 tempbh = SiS_GetCH701x(SiS_Pr,0x73); in SiS_SetCH701xForLCD()
8484 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) return; in SiS_SetCH701xForLCD()
8486 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) return; in SiS_SetCH701xForLCD()
8487 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) return; in SiS_SetCH701xForLCD()
8489 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) return; in SiS_SetCH701xForLCD()
8493 if(SiS_Pr->ChipType == SIS_740) tempbh = 0x0d; in SiS_SetCH701xForLCD()
8497 SiS_SetCH701x(SiS_Pr, regtable[i], tableptr[i]); in SiS_SetCH701xForLCD()
8499 SiS_ChrontelPowerSequencing(SiS_Pr); in SiS_SetCH701xForLCD()
8500 tempbh = SiS_GetCH701x(SiS_Pr,0x1e); in SiS_SetCH701xForLCD()
8502 SiS_SetCH701x(SiS_Pr,0x1e,tempbh); in SiS_SetCH701xForLCD()
8504 if(SiS_Pr->ChipType == SIS_740) { in SiS_SetCH701xForLCD()
8505 tempbh = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_SetCH701xForLCD()
8507 SiS_SetCH701x(SiS_Pr,0x1c,tempbh); in SiS_SetCH701xForLCD()
8508 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_SetCH701xForLCD()
8509 tempbh = SiS_GetCH701x(SiS_Pr,0x64); in SiS_SetCH701xForLCD()
8511 SiS_SetCH701x(SiS_Pr,0x64,tempbh); in SiS_SetCH701xForLCD()
8512 tempbh = SiS_GetCH701x(SiS_Pr,0x03); in SiS_SetCH701xForLCD()
8514 SiS_SetCH701x(SiS_Pr,0x03,tempbh); in SiS_SetCH701xForLCD()
8519 SiS_ChrontelResetVSync(struct SiS_Private *SiS_Pr) in SiS_ChrontelResetVSync() argument
8523 temp1 = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetVSync()
8524 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_ChrontelResetVSync()
8525 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8527 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8528 SiS_LongDelay(SiS_Pr, 3); in SiS_ChrontelResetVSync()
8529 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8531 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8532 SiS_SetCH701x(SiS_Pr,0x49,temp1); in SiS_ChrontelResetVSync()
8536 SiS_Chrontel701xOn(struct SiS_Private *SiS_Pr) in SiS_Chrontel701xOn() argument
8540 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xOn()
8541 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xOn()
8542 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_Chrontel701xOn()
8544 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_Chrontel701xOn()
8546 if(SiS_IsYPbPr(SiS_Pr)) { in SiS_Chrontel701xOn()
8547 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8550 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8552 if(SiS_IsChScart(SiS_Pr)) { in SiS_Chrontel701xOn()
8553 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8556 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8558 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xOn()
8559 SiS_ChrontelResetVSync(SiS_Pr); in SiS_Chrontel701xOn()
8560 SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ in SiS_Chrontel701xOn()
8562 SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ in SiS_Chrontel701xOn()
8563 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_Chrontel701xOn()
8564 if(SiS_IsYPbPr(SiS_Pr)) { in SiS_Chrontel701xOn()
8565 temp = SiS_GetCH701x(SiS_Pr,0x73); in SiS_Chrontel701xOn()
8567 SiS_SetCH701x(SiS_Pr,0x73,temp); in SiS_Chrontel701xOn()
8569 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8571 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8572 SiS_LongDelay(SiS_Pr, 2); in SiS_Chrontel701xOn()
8573 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8575 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8581 SiS_Chrontel701xOff(struct SiS_Private *SiS_Pr) in SiS_Chrontel701xOff() argument
8586 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xOff()
8587 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xOff()
8588 SiS_LongDelay(SiS_Pr, 1); in SiS_Chrontel701xOff()
8589 SiS_GenericDelay(SiS_Pr, 5887); in SiS_Chrontel701xOff()
8590 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_Chrontel701xOff()
8591 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_Chrontel701xOff()
8593 SiS_LongDelay(SiS_Pr, 2); in SiS_Chrontel701xOff()
8594 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_Chrontel701xOff()
8596 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_Chrontel701xOff()
8597 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_Chrontel701xOff()
8603 SiS_ChrontelResetDB(struct SiS_Private *SiS_Pr) in SiS_ChrontelResetDB() argument
8607 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelResetDB()
8609 temp = SiS_GetCH701x(SiS_Pr,0x4a); /* Version ID */ in SiS_ChrontelResetDB()
8613 if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { in SiS_ChrontelResetDB()
8614 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetDB()
8615 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_ChrontelResetDB()
8619 SiS_SetCH701x(SiS_Pr,0x48,0x10); in SiS_ChrontelResetDB()
8620 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelResetDB()
8621 SiS_SetCH701x(SiS_Pr,0x48,0x18); in SiS_ChrontelResetDB()
8623 if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { in SiS_ChrontelResetDB()
8624 SiS_ChrontelResetVSync(SiS_Pr); in SiS_ChrontelResetDB()
8625 SiS_SetCH701x(SiS_Pr,0x49,temp); in SiS_ChrontelResetDB()
8631 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8633 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8634 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8636 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8637 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8639 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8640 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelResetDB()
8642 SiS_SetCH701xForLCD(SiS_Pr); in SiS_ChrontelResetDB()
8648 SiS_SetCH701x(SiS_Pr,0x48,0x10); in SiS_ChrontelResetDB()
8649 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelResetDB()
8650 SiS_SetCH701x(SiS_Pr,0x48,0x18); in SiS_ChrontelResetDB()
8655 SiS_ChrontelInitTVVSync(struct SiS_Private *SiS_Pr) in SiS_ChrontelInitTVVSync() argument
8659 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelInitTVVSync()
8661 if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { in SiS_ChrontelInitTVVSync()
8662 SiS_ChrontelResetVSync(SiS_Pr); in SiS_ChrontelInitTVVSync()
8667 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* Power up LVDS block */ in SiS_ChrontelInitTVVSync()
8668 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelInitTVVSync()
8671 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8673 SiS_SetCH701x(SiS_Pr,0x47,temp); /* enable VSYNC */ in SiS_ChrontelInitTVVSync()
8674 SiS_LongDelay(SiS_Pr, 3); in SiS_ChrontelInitTVVSync()
8675 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8677 SiS_SetCH701x(SiS_Pr,0x47,temp); /* disable VSYNC */ in SiS_ChrontelInitTVVSync()
8684 SiS_ChrontelDoSomething3(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_ChrontelDoSomething3() argument
8688 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething3()
8690 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8693 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8695 SiS_SetCH701x(SiS_Pr,0x66,0x45); /* Panel power on */ in SiS_ChrontelDoSomething3()
8696 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on */ in SiS_ChrontelDoSomething3()
8697 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelDoSomething3()
8698 SiS_GenericDelay(SiS_Pr, 5887); in SiS_ChrontelDoSomething3()
8703 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8706 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8709 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_ChrontelDoSomething3()
8710 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8712 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8714 if(SiS_WeHaveBacklightCtrl(SiS_Pr)) { in SiS_ChrontelDoSomething3()
8715 SiS_GenericDelay(SiS_Pr, 1023); in SiS_ChrontelDoSomething3()
8717 SiS_GenericDelay(SiS_Pr, 767); in SiS_ChrontelDoSomething3()
8721 SiS_GenericDelay(SiS_Pr, 767); in SiS_ChrontelDoSomething3()
8723 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething3()
8725 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething3()
8726 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8728 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8729 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelDoSomething3()
8735 SiS_ChrontelDoSomething2(struct SiS_Private *SiS_Pr) in SiS_ChrontelDoSomething2() argument
8739 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelDoSomething2()
8742 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething2()
8746 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething2()
8748 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_ChrontelDoSomething2()
8751 SiS_SetCH701xForLCD(SiS_Pr); in SiS_ChrontelDoSomething2()
8753 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8755 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8756 SiS_LongDelay(SiS_Pr, 2); in SiS_ChrontelDoSomething2()
8757 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8759 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8760 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething2()
8761 SiS_SetCH701x(SiS_Pr,0x78,0xe0); /* PLL loop filter */ in SiS_ChrontelDoSomething2()
8763 SiS_SetCH701x(SiS_Pr,0x78,0x60); in SiS_ChrontelDoSomething2()
8765 SiS_LongDelay(SiS_Pr, 2); in SiS_ChrontelDoSomething2()
8768 SiS_SetCH701x(SiS_Pr,0x77,0x00); /* MV? */ in SiS_ChrontelDoSomething2()
8772 SiS_ChrontelDoSomething1(struct SiS_Private *SiS_Pr) in SiS_ChrontelDoSomething1() argument
8776 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8779 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8781 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething1()
8783 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_ChrontelDoSomething1()
8785 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_ChrontelDoSomething1()
8787 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_ChrontelDoSomething1()
8789 temp = SiS_GetCH701x(SiS_Pr,0x64); in SiS_ChrontelDoSomething1()
8791 SiS_SetCH701x(SiS_Pr,0x64,temp); in SiS_ChrontelDoSomething1()
8793 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8795 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8797 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) { in SiS_ChrontelDoSomething1()
8798 SiS_SetCH701x(SiS_Pr,0x63,0x40); /* LVDS off */ in SiS_ChrontelDoSomething1()
8799 SiS_LongDelay(SiS_Pr, 1); in SiS_ChrontelDoSomething1()
8800 SiS_SetCH701x(SiS_Pr,0x63,0x00); /* LVDS on */ in SiS_ChrontelDoSomething1()
8801 SiS_ChrontelResetDB(SiS_Pr); in SiS_ChrontelDoSomething1()
8802 SiS_ChrontelDoSomething2(SiS_Pr); in SiS_ChrontelDoSomething1()
8803 SiS_ChrontelDoSomething3(SiS_Pr, 0); in SiS_ChrontelDoSomething1()
8805 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething1()
8807 SiS_ChrontelResetDB(SiS_Pr); in SiS_ChrontelDoSomething1()
8808 SiS_ChrontelDoSomething2(SiS_Pr); in SiS_ChrontelDoSomething1()
8809 SiS_ChrontelDoSomething3(SiS_Pr, 0); in SiS_ChrontelDoSomething1()
8815 SiS_ChrontelResetDB(SiS_Pr); in SiS_ChrontelDoSomething1()
8816 SiS_ChrontelDoSomething2(SiS_Pr); in SiS_ChrontelDoSomething1()
8817 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34); in SiS_ChrontelDoSomething1()
8818 SiS_ChrontelDoSomething3(SiS_Pr,temp); in SiS_ChrontelDoSomething1()
8819 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on, LVDS normal operation */ in SiS_ChrontelDoSomething1()
8831 SiS_SetCRT2Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_SetCRT2Group() argument
8834 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2Group()
8838 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2Group()
8840 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2Group()
8841 SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex); in SiS_SetCRT2Group()
8847 SiS_Pr->SiS_SelectCRT2Rate = 4; in SiS_SetCRT2Group()
8849 SiS_UnLockCRT2(SiS_Pr); in SiS_SetCRT2Group()
8851 RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8853 SiS_SaveCRT2Info(SiS_Pr,ModeNo); in SiS_SetCRT2Group()
8855 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8856 SiS_DisableBridge(SiS_Pr); in SiS_SetCRT2Group()
8857 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->ChipType == SIS_730)) { in SiS_SetCRT2Group()
8858 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_SetCRT2Group()
8860 SiS_SetCRT2ModeRegs(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8863 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2Group()
8864 SiS_LockCRT2(SiS_Pr); in SiS_SetCRT2Group()
8865 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8869 SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8872 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_SetCRT2Group()
8873 if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_SetCRT2Group()
8874 ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) || in SiS_SetCRT2Group()
8875 ((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS30xBLV)) ) { in SiS_SetCRT2Group()
8876 SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8879 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8880 SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8883 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2Group()
8885 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8887 SiS_SetGroup2(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8889 SiS_SetGroup2_C_ELV(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8891 SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8892 SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8894 SiS_SetGroup4_C_ELV(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8896 SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8898 SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex); in SiS_SetCRT2Group()
8901 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetCRT2Group()
8903 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) { in SiS_SetCRT2Group()
8904 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT2Group()
8905 SiS_ModCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8908 SiS_SetCRT2ECLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8914 SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex); in SiS_SetCRT2Group()
8916 SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); in SiS_SetCRT2Group()
8918 SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); in SiS_SetCRT2Group()
8920 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8921 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2Group()
8922 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetCRT2Group()
8923 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetCRT2Group()
8925 SiS_SetCH701xForLCD(SiS_Pr); in SiS_SetCRT2Group()
8929 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Group()
8930 SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex); in SiS_SetCRT2Group()
8938 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2Group()
8939 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8940 if(SiS_Pr->SiS_UseOEM) { in SiS_SetCRT2Group()
8941 if((SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_UseOEM == -1)) { in SiS_SetCRT2Group()
8943 SiS_OEM300Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8946 SiS_OEM300Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8949 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2Group()
8950 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_SetCRT2Group()
8951 (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2Group()
8952 SetOEMLCDData2(SiS_Pr, ModeNo, ModeIdIndex,RefreshRateTableIndex); in SiS_SetCRT2Group()
8954 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8961 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2Group()
8962 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8963 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetCRT2Group()
8964 SiS_FinalizeLCD(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT2Group()
8965 SiS_OEM310Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8967 SiS_OEM661Setting(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT2Group()
8969 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); in SiS_SetCRT2Group()
8974 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8975 SiS_EnableBridge(SiS_Pr); in SiS_SetCRT2Group()
8978 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT2Group()
8980 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetCRT2Group()
8981 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Group()
8983 SiS_SetRegSR11ANDOR(SiS_Pr,0xFF,0x0C); in SiS_SetCRT2Group()
8986 SiS_SetCH70xxANDOR(SiS_Pr,0x0e,0x01,0xf8); in SiS_SetCRT2Group()
8990 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8991 SiS_LockCRT2(SiS_Pr); in SiS_SetCRT2Group()
9003 SiS_SiS30xBLOn(struct SiS_Private *SiS_Pr) in SiS_SiS30xBLOn() argument
9006 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOn()
9007 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_SiS30xBLOn()
9008 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_SiS30xBLOn()
9009 SiS_WaitVBRetrace(SiS_Pr); in SiS_SiS30xBLOn()
9011 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) { in SiS_SiS30xBLOn()
9012 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_SiS30xBLOn()
9017 SiS_SiS30xBLOff(struct SiS_Private *SiS_Pr) in SiS_SiS30xBLOff() argument
9020 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_SiS30xBLOff()
9021 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOff()
9029 SiS_SetupDDCN(struct SiS_Private *SiS_Pr) in SiS_SetupDDCN() argument
9031 SiS_Pr->SiS_DDC_NData = ~SiS_Pr->SiS_DDC_Data; in SiS_SetupDDCN()
9032 SiS_Pr->SiS_DDC_NClk = ~SiS_Pr->SiS_DDC_Clk; in SiS_SetupDDCN()
9033 if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) { in SiS_SetupDDCN()
9034 SiS_Pr->SiS_DDC_NData &= 0x0f; in SiS_SetupDDCN()
9035 SiS_Pr->SiS_DDC_NClk &= 0x0f; in SiS_SetupDDCN()
9041 SiS_SetTrumpBlockLoop(struct SiS_Private *SiS_Pr, unsigned char *dataptr) in SiS_SetTrumpBlockLoop() argument
9052 SiS_SetStop(SiS_Pr); in SiS_SetTrumpBlockLoop()
9053 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT * 2); in SiS_SetTrumpBlockLoop()
9055 if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ in SiS_SetTrumpBlockLoop()
9056 tempah = SiS_Pr->SiS_DDC_DeviceAddr; in SiS_SetTrumpBlockLoop()
9057 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9060 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write register number */ in SiS_SetTrumpBlockLoop()
9064 temp = SiS_WriteDDC2Data(SiS_Pr,tempah);/* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9068 if(SiS_SetStop(SiS_Pr)) continue; in SiS_SetTrumpBlockLoop()
9075 SiS_SetTrumpionBlock(struct SiS_Private *SiS_Pr, unsigned char *dataptr) in SiS_SetTrumpionBlock() argument
9077 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ in SiS_SetTrumpionBlock()
9078 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetTrumpionBlock()
9079 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetTrumpionBlock()
9080 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetTrumpionBlock()
9081 SiS_SetupDDCN(SiS_Pr); in SiS_SetTrumpionBlock()
9083 SiS_SetSwitchDDC2(SiS_Pr); in SiS_SetTrumpionBlock()
9086 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); in SiS_SetTrumpionBlock()
9101 SiS_SetChReg(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val, unsigned short myor) in SiS_SetChReg() argument
9107 SiS_SetStop(SiS_Pr); in SiS_SetChReg()
9108 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT * 4); in SiS_SetChReg()
9110 if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ in SiS_SetChReg()
9111 temp = SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_SetChReg()
9113 … temp = SiS_WriteDDC2Data(SiS_Pr, (reg | myor)); /* Write RAB (700x: set bit 7, see datasheet) */ in SiS_SetChReg()
9115 temp = SiS_WriteDDC2Data(SiS_Pr, val); /* Write data */ in SiS_SetChReg()
9117 if(SiS_SetStop(SiS_Pr)) continue; /* Set stop condition */ in SiS_SetChReg()
9118 SiS_Pr->SiS_ChrontelInit = 1; in SiS_SetChReg()
9126 SiS_SetCH700x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) in SiS_SetCH700x() argument
9128 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH700x()
9130 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_SetCH700x()
9132 if(!(SiS_Pr->SiS_ChrontelInit)) { in SiS_SetCH700x()
9133 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH700x()
9134 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetCH700x()
9135 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetCH700x()
9136 SiS_SetupDDCN(SiS_Pr); in SiS_SetCH700x()
9139 if( (!(SiS_SetChReg(SiS_Pr, reg, val, 0x80))) && in SiS_SetCH700x()
9140 (!(SiS_Pr->SiS_ChrontelInit)) ) { in SiS_SetCH700x()
9141 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_SetCH700x()
9142 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_SetCH700x()
9143 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_SetCH700x()
9144 SiS_SetupDDCN(SiS_Pr); in SiS_SetCH700x()
9146 SiS_SetChReg(SiS_Pr, reg, val, 0x80); in SiS_SetCH700x()
9153 SiS_SetCH701x(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) in SiS_SetCH701x() argument
9155 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH701x()
9156 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_SetCH701x()
9157 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_SetCH701x()
9158 SiS_SetupDDCN(SiS_Pr); in SiS_SetCH701x()
9159 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH701x()
9160 SiS_SetChReg(SiS_Pr, reg, val, 0); in SiS_SetCH701x()
9165 SiS_SetCH70xx(struct SiS_Private *SiS_Pr, unsigned short reg, unsigned char val) in SiS_SetCH70xx() argument
9167 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) in SiS_SetCH70xx()
9168 SiS_SetCH700x(SiS_Pr, reg, val); in SiS_SetCH70xx()
9170 SiS_SetCH701x(SiS_Pr, reg, val); in SiS_SetCH70xx()
9174 SiS_GetChReg(struct SiS_Private *SiS_Pr, unsigned short myor) in SiS_GetChReg() argument
9180 SiS_SetStop(SiS_Pr); in SiS_GetChReg()
9181 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT * 4); in SiS_GetChReg()
9183 if(SiS_SetStart(SiS_Pr)) continue; /* Set start condition */ in SiS_GetChReg()
9184 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_GetChReg()
9186 … temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_ReadAddr | myor); /* Write RAB (700x: | 0x80) */ in SiS_GetChReg()
9188 if (SiS_SetStart(SiS_Pr)) continue; /* Re-start */ in SiS_GetChReg()
9189 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr | 0x01);/* DAB (S0=1=read) */ in SiS_GetChReg()
9191 tempah = SiS_ReadDDC2Data(SiS_Pr); /* Read byte */ in SiS_GetChReg()
9192 if(SiS_SetStop(SiS_Pr)) continue; /* Stop condition */ in SiS_GetChReg()
9193 SiS_Pr->SiS_ChrontelInit = 1; in SiS_GetChReg()
9202 SiS_GetCH700x(struct SiS_Private *SiS_Pr, unsigned short tempbx) in SiS_GetCH700x() argument
9206 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH700x()
9208 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_GetCH700x()
9210 if(!(SiS_Pr->SiS_ChrontelInit)) { in SiS_GetCH700x()
9211 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH700x()
9212 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_GetCH700x()
9213 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_GetCH700x()
9214 SiS_SetupDDCN(SiS_Pr); in SiS_GetCH700x()
9217 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetCH700x()
9219 if( ((result = SiS_GetChReg(SiS_Pr,0x80)) == 0xFFFF) && in SiS_GetCH700x()
9220 (!SiS_Pr->SiS_ChrontelInit) ) { in SiS_GetCH700x()
9222 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_GetCH700x()
9223 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_GetCH700x()
9224 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_GetCH700x()
9225 SiS_SetupDDCN(SiS_Pr); in SiS_GetCH700x()
9227 result = SiS_GetChReg(SiS_Pr,0x80); in SiS_GetCH700x()
9235 SiS_GetCH701x(struct SiS_Private *SiS_Pr, unsigned short tempbx) in SiS_GetCH701x() argument
9237 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH701x()
9238 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_GetCH701x()
9239 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_GetCH701x()
9240 SiS_SetupDDCN(SiS_Pr); in SiS_GetCH701x()
9241 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH701x()
9243 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetCH701x()
9245 return SiS_GetChReg(SiS_Pr,0); in SiS_GetCH701x()
9252 SiS_GetCH70xx(struct SiS_Private *SiS_Pr, unsigned short tempbx) in SiS_GetCH70xx() argument
9254 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) in SiS_GetCH70xx()
9255 return SiS_GetCH700x(SiS_Pr, tempbx); in SiS_GetCH70xx()
9257 return SiS_GetCH701x(SiS_Pr, tempbx); in SiS_GetCH70xx()
9261 SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, in SiS_SetCH70xxANDOR() argument
9266 tempbl = (SiS_GetCH70xx(SiS_Pr, (reg & 0xFF)) & myand) | myor; in SiS_SetCH70xxANDOR()
9267 SiS_SetCH70xx(SiS_Pr, reg, tempbl); in SiS_SetCH70xxANDOR()
9273 SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, in SiS_InitDDCRegs() argument
9288 SiS_Pr->SiS_ChrontelInit = 0; /* force re-detection! */ in SiS_InitDDCRegs()
9290 SiS_Pr->SiS_DDC_SecAddr = 0; in SiS_InitDDCRegs()
9291 SiS_Pr->SiS_DDC_DeviceAddr = ddcdtype[DDCdatatype]; in SiS_InitDDCRegs()
9292 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_P3c4; in SiS_InitDDCRegs()
9293 SiS_Pr->SiS_DDC_Index = 0x11; in SiS_InitDDCRegs()
9296 cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32); in SiS_InitDDCRegs()
9319 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; in SiS_InitDDCRegs()
9320 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9351 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; in SiS_InitDDCRegs()
9352 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9374 SiS_Pr->SiS_DDC_Data = 0x02 << temp; in SiS_InitDDCRegs()
9375 SiS_Pr->SiS_DDC_Clk = 0x01 << temp; in SiS_InitDDCRegs()
9377 SiS_SetupDDCN(SiS_Pr); in SiS_InitDDCRegs()
9383 SiS_WriteDABDDC(struct SiS_Private *SiS_Pr) in SiS_WriteDABDDC() argument
9385 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_WriteDABDDC()
9386 if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr)) { in SiS_WriteDABDDC()
9389 if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_SecAddr)) { in SiS_WriteDABDDC()
9396 SiS_PrepareReadDDC(struct SiS_Private *SiS_Pr) in SiS_PrepareReadDDC() argument
9398 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_PrepareReadDDC()
9399 if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) { in SiS_PrepareReadDDC()
9406 SiS_PrepareDDC(struct SiS_Private *SiS_Pr) in SiS_PrepareDDC() argument
9408 if(SiS_WriteDABDDC(SiS_Pr)) SiS_WriteDABDDC(SiS_Pr); in SiS_PrepareDDC()
9409 if(SiS_PrepareReadDDC(SiS_Pr)) return (SiS_PrepareReadDDC(SiS_Pr)); in SiS_PrepareDDC()
9414 SiS_SendACK(struct SiS_Private *SiS_Pr, unsigned short yesno) in SiS_SendACK() argument
9416 SiS_SetSCLKLow(SiS_Pr); in SiS_SendACK()
9418 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SendACK()
9419 SiS_Pr->SiS_DDC_Index, in SiS_SendACK()
9420 SiS_Pr->SiS_DDC_NData, in SiS_SendACK()
9421 SiS_Pr->SiS_DDC_Data); in SiS_SendACK()
9423 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SendACK()
9424 SiS_Pr->SiS_DDC_Index, in SiS_SendACK()
9425 SiS_Pr->SiS_DDC_NData, in SiS_SendACK()
9428 SiS_SetSCLKHigh(SiS_Pr); in SiS_SendACK()
9432 SiS_DoProbeDDC(struct SiS_Private *SiS_Pr) in SiS_DoProbeDDC() argument
9438 SiS_SetSwitchDDC2(SiS_Pr); in SiS_DoProbeDDC()
9439 if(SiS_PrepareDDC(SiS_Pr)) { in SiS_DoProbeDDC()
9440 SiS_SetStop(SiS_Pr); in SiS_DoProbeDDC()
9445 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9446 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); in SiS_DoProbeDDC()
9447 SiS_SendACK(SiS_Pr, 0); in SiS_DoProbeDDC()
9457 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); in SiS_DoProbeDDC()
9458 SiS_SendACK(SiS_Pr, 1); in SiS_DoProbeDDC()
9463 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9468 SiS_SetStop(SiS_Pr); in SiS_DoProbeDDC()
9474 SiS_ProbeDDC(struct SiS_Private *SiS_Pr) in SiS_ProbeDDC() argument
9479 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; in SiS_ProbeDDC()
9480 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x02; in SiS_ProbeDDC()
9481 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; in SiS_ProbeDDC()
9482 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x08; in SiS_ProbeDDC()
9483 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; in SiS_ProbeDDC()
9484 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x10; in SiS_ProbeDDC()
9491 SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, unsigned char *buffer) in SiS_ReadDDC() argument
9499 SiS_SetSwitchDDC2(SiS_Pr); in SiS_ReadDDC()
9500 if(!(SiS_PrepareDDC(SiS_Pr))) { in SiS_ReadDDC()
9506 buffer[i] = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); in SiS_ReadDDC()
9509 SiS_SendACK(SiS_Pr, 0); in SiS_ReadDDC()
9511 buffer[i] = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); in SiS_ReadDDC()
9513 SiS_SendACK(SiS_Pr, 1); in SiS_ReadDDC()
9519 SiS_SetStop(SiS_Pr); in SiS_ReadDDC()
9545 SiS_HandleDDC(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, in SiS_HandleDDC() argument
9561 if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, false, VBFlags2) == 0xFFFF) in SiS_HandleDDC()
9564 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); in SiS_HandleDDC()
9565 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04); in SiS_HandleDDC()
9567 cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80; in SiS_HandleDDC()
9569 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80); in SiS_HandleDDC()
9570 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01); in SiS_HandleDDC()
9571 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); in SiS_HandleDDC()
9575 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9576 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9577 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9578 SiS_WaitRetrace1(SiS_Pr); in SiS_HandleDDC()
9582 result = SiS_ProbeDDC(SiS_Pr); in SiS_HandleDDC()
9584 result = SiS_ReadDDC(SiS_Pr, DDCdatatype, buffer); in SiS_HandleDDC()
9591 if(!SiS_Pr->DDCPortMixup) { in SiS_HandleDDC()
9601 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f); in SiS_HandleDDC()
9603 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17); in SiS_HandleDDC()
9611 SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr) in SiS_SetSwitchDDC2() argument
9613 SiS_SetSCLKHigh(SiS_Pr); in SiS_SetSwitchDDC2()
9614 SiS_WaitRetrace1(SiS_Pr); in SiS_SetSwitchDDC2()
9616 SiS_SetSCLKLow(SiS_Pr); in SiS_SetSwitchDDC2()
9617 SiS_WaitRetrace1(SiS_Pr); in SiS_SetSwitchDDC2()
9621 SiS_ReadDDC1Bit(struct SiS_Private *SiS_Pr) in SiS_ReadDDC1Bit() argument
9623 SiS_WaitRetrace1(SiS_Pr); in SiS_ReadDDC1Bit()
9624 return ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1); in SiS_ReadDDC1Bit()
9630 SiS_SetStart(struct SiS_Private *SiS_Pr) in SiS_SetStart() argument
9632 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9633 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStart()
9634 SiS_Pr->SiS_DDC_Index, in SiS_SetStart()
9635 SiS_Pr->SiS_DDC_NData, in SiS_SetStart()
9636 SiS_Pr->SiS_DDC_Data); /* SD->high */ in SiS_SetStart()
9637 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStart()
9638 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStart()
9639 SiS_Pr->SiS_DDC_Index, in SiS_SetStart()
9640 SiS_Pr->SiS_DDC_NData, in SiS_SetStart()
9642 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9649 SiS_SetStop(struct SiS_Private *SiS_Pr) in SiS_SetStop() argument
9651 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStop()
9652 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStop()
9653 SiS_Pr->SiS_DDC_Index, in SiS_SetStop()
9654 SiS_Pr->SiS_DDC_NData, in SiS_SetStop()
9656 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStop()
9657 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStop()
9658 SiS_Pr->SiS_DDC_Index, in SiS_SetStop()
9659 SiS_Pr->SiS_DDC_NData, in SiS_SetStop()
9660 SiS_Pr->SiS_DDC_Data); /* SD->high = stop condition */ in SiS_SetStop()
9661 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->high) */ in SiS_SetStop()
9667 SiS_WriteDDC2Data(struct SiS_Private *SiS_Pr, unsigned short tempax) in SiS_WriteDDC2Data() argument
9673 SiS_SetSCLKLow(SiS_Pr); /* SC->low */ in SiS_WriteDDC2Data()
9675 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_WriteDDC2Data()
9676 SiS_Pr->SiS_DDC_Index, in SiS_WriteDDC2Data()
9677 SiS_Pr->SiS_DDC_NData, in SiS_WriteDDC2Data()
9678 SiS_Pr->SiS_DDC_Data); /* Write bit (1) to SD */ in SiS_WriteDDC2Data()
9680 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_WriteDDC2Data()
9681 SiS_Pr->SiS_DDC_Index, in SiS_WriteDDC2Data()
9682 SiS_Pr->SiS_DDC_NData, in SiS_WriteDDC2Data()
9685 SiS_SetSCLKHigh(SiS_Pr); /* SC->high */ in SiS_WriteDDC2Data()
9688 temp = SiS_CheckACK(SiS_Pr); /* Check acknowledge */ in SiS_WriteDDC2Data()
9693 SiS_ReadDDC2Data(struct SiS_Private *SiS_Pr) in SiS_ReadDDC2Data() argument
9700 SiS_SetSCLKLow(SiS_Pr); in SiS_ReadDDC2Data()
9701 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_ReadDDC2Data()
9702 SiS_Pr->SiS_DDC_Index, in SiS_ReadDDC2Data()
9703 SiS_Pr->SiS_DDC_NData, in SiS_ReadDDC2Data()
9704 SiS_Pr->SiS_DDC_Data); in SiS_ReadDDC2Data()
9705 SiS_SetSCLKHigh(SiS_Pr); in SiS_ReadDDC2Data()
9706 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); in SiS_ReadDDC2Data()
9707 if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01; in SiS_ReadDDC2Data()
9713 SiS_SetSCLKLow(struct SiS_Private *SiS_Pr) in SiS_SetSCLKLow() argument
9715 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetSCLKLow()
9716 SiS_Pr->SiS_DDC_Index, in SiS_SetSCLKLow()
9717 SiS_Pr->SiS_DDC_NClk, in SiS_SetSCLKLow()
9719 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_SetSCLKLow()
9724 SiS_SetSCLKHigh(struct SiS_Private *SiS_Pr) in SiS_SetSCLKHigh() argument
9728 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetSCLKHigh()
9729 SiS_Pr->SiS_DDC_Index, in SiS_SetSCLKHigh()
9730 SiS_Pr->SiS_DDC_NClk, in SiS_SetSCLKHigh()
9731 SiS_Pr->SiS_DDC_Clk); /* SetSCLKHigh() */ in SiS_SetSCLKHigh()
9733 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); in SiS_SetSCLKHigh()
9734 } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); in SiS_SetSCLKHigh()
9738 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT); in SiS_SetSCLKHigh()
9745 SiS_CheckACK(struct SiS_Private *SiS_Pr) in SiS_CheckACK() argument
9749 SiS_SetSCLKLow(SiS_Pr); /* (SC->low) */ in SiS_CheckACK()
9750 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_CheckACK()
9751 SiS_Pr->SiS_DDC_Index, in SiS_CheckACK()
9752 SiS_Pr->SiS_DDC_NData, in SiS_CheckACK()
9753 SiS_Pr->SiS_DDC_Data); /* (SD->high) */ in SiS_CheckACK()
9754 SiS_SetSCLKHigh(SiS_Pr); /* SC->high = clock impulse for ack */ in SiS_CheckACK()
9755 tempah = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); /* Read SD */ in SiS_CheckACK()
9756 SiS_SetSCLKLow(SiS_Pr); /* SC->low = end of clock impulse */ in SiS_CheckACK()
9757 if(tempah & SiS_Pr->SiS_DDC_Data) return 1; /* Ack OK if bit = 0 */ in SiS_CheckACK()
9769 GetRAMDACromptr(struct SiS_Private *SiS_Pr) in GetRAMDACromptr() argument
9771 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetRAMDACromptr()
9774 if(SiS_Pr->ChipType < SIS_330) { in GetRAMDACromptr()
9776 if(SiS_Pr->SiS_VBType & VB_SIS30xB) in GetRAMDACromptr()
9780 if(SiS_Pr->SiS_VBType & VB_SIS30xB) in GetRAMDACromptr()
9787 GetLCDromptr(struct SiS_Private *SiS_Pr) in GetLCDromptr() argument
9789 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetLCDromptr()
9792 if(SiS_Pr->ChipType < SIS_330) { in GetLCDromptr()
9794 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetLCDromptr()
9798 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetLCDromptr()
9805 GetTVromptr(struct SiS_Private *SiS_Pr) in GetTVromptr() argument
9807 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetTVromptr()
9810 if(SiS_Pr->ChipType < SIS_330) { in GetTVromptr()
9812 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetTVromptr()
9816 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetTVromptr()
9823 GetLCDPtrIndexBIOS(struct SiS_Private *SiS_Pr) in GetLCDPtrIndexBIOS() argument
9827 if((IS_SIS650) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in GetLCDPtrIndexBIOS()
9828 if(!(SiS_IsNotM650orLater(SiS_Pr))) { in GetLCDPtrIndexBIOS()
9829 if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) { in GetLCDPtrIndexBIOS()
9832 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndexBIOS()
9833 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndexBIOS()
9839 index = SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F; in GetLCDPtrIndexBIOS()
9840 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) index -= 5; in GetLCDPtrIndexBIOS()
9841 if(SiS_Pr->SiS_VBType & VB_SIS301C) { /* 1.15.20 and later (not VB specific) */ in GetLCDPtrIndexBIOS()
9842 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 5; in GetLCDPtrIndexBIOS()
9843 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768) index -= 5; in GetLCDPtrIndexBIOS()
9845 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 6; in GetLCDPtrIndexBIOS()
9849 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndexBIOS()
9850 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndexBIOS()
9855 GetLCDPtrIndex(struct SiS_Private *SiS_Pr) in GetLCDPtrIndex() argument
9859 index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3; in GetLCDPtrIndex()
9860 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndex()
9861 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndex()
9866 GetTVPtrIndex(struct SiS_Private *SiS_Pr) in GetTVPtrIndex() argument
9871 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; in GetTVPtrIndex()
9872 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index = 2; in GetTVPtrIndex()
9874 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) index = 0; in GetTVPtrIndex()
9878 if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && in GetTVPtrIndex()
9879 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in GetTVPtrIndex()
9887 GetOEMTVPtr661_2_GEN(struct SiS_Private *SiS_Pr, int addme) in GetOEMTVPtr661_2_GEN() argument
9891 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; in GetOEMTVPtr661_2_GEN()
9892 if(SiS_Pr->SiS_TVMode & TVSetPALM) index = 2; in GetOEMTVPtr661_2_GEN()
9893 if(SiS_Pr->SiS_TVMode & TVSetPALN) index = 3; in GetOEMTVPtr661_2_GEN()
9894 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 6; in GetOEMTVPtr661_2_GEN()
9895 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in GetOEMTVPtr661_2_GEN()
9897 if(SiS_Pr->SiS_TVMode & TVSetPALM) index++; in GetOEMTVPtr661_2_GEN()
9898 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 7; in GetOEMTVPtr661_2_GEN()
9901 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in GetOEMTVPtr661_2_GEN()
9902 if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in GetOEMTVPtr661_2_GEN()
9903 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in GetOEMTVPtr661_2_GEN()
9913 GetOEMTVPtr661_2_OLD(struct SiS_Private *SiS_Pr) in GetOEMTVPtr661_2_OLD() argument
9915 return (GetOEMTVPtr661_2_GEN(SiS_Pr, 8)); in GetOEMTVPtr661_2_OLD()
9920 GetOEMTVPtr661_2_NEW(struct SiS_Private *SiS_Pr)
9922 return (GetOEMTVPtr661_2_GEN(SiS_Pr, 6));
9927 GetOEMTVPtr661(struct SiS_Private *SiS_Pr) in GetOEMTVPtr661() argument
9931 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 2; in GetOEMTVPtr661()
9932 if(SiS_Pr->SiS_ROMNew) { in GetOEMTVPtr661()
9933 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 4; in GetOEMTVPtr661()
9934 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 6; in GetOEMTVPtr661()
9935 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 8; in GetOEMTVPtr661()
9936 if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 10; in GetOEMTVPtr661()
9938 if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 4; in GetOEMTVPtr661()
9939 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6; in GetOEMTVPtr661()
9940 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8; in GetOEMTVPtr661()
9941 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10; in GetOEMTVPtr661()
9944 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) index++; in GetOEMTVPtr661()
9950 SetDelayComp(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SetDelayComp() argument
9952 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetDelayComp()
9956 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
9957 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); in SetDelayComp()
9959 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f); in SetDelayComp()
9964 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { /* ------------ VGA */ in SetDelayComp()
9966 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
9967 romptr = GetRAMDACromptr(SiS_Pr); in SetDelayComp()
9972 if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SetDelayComp()
9980 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
9985 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) { /* ---------- LCD/LCDA */ in SetDelayComp()
9991 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetDelayComp()
9992 if(SiS_Pr->PDC != -1) { in SetDelayComp()
9993 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f)); in SetDelayComp()
9994 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7)); in SetDelayComp()
9998 if(SiS_Pr->PDCA != -1) { in SetDelayComp()
9999 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0)); in SetDelayComp()
10000 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6)); in SetDelayComp()
10007 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) { in SetDelayComp()
10008 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10010 if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) { in SetDelayComp()
10013 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay); in SetDelayComp()
10016 if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SetDelayComp()
10018 if((SiS_Pr->PanelXRes > 1280) && (SiS_Pr->PanelYRes > 1024)) { in SetDelayComp()
10021 } else if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetDelayComp()
10025 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay); in SetDelayComp()
10035 switch(SiS_Pr->SiS_CustomT) { in SetDelayComp()
10038 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SetDelayComp()
10052 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SetDelayComp()
10056 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10066 index = GetLCDPtrIndexBIOS(SiS_Pr); in SetDelayComp()
10067 myindex = GetLCDPtrIndex(SiS_Pr); in SetDelayComp()
10069 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SetDelayComp()
10071 if(SiS_IsNotM650orLater(SiS_Pr)) { in SetDelayComp()
10073 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10088 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) in SetDelayComp()
10093 } else if(SiS_Pr->SiS_UseROM && in SetDelayComp()
10094 (!(SiS_Pr->SiS_ROMNew)) && in SetDelayComp()
10095 (SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) && in SetDelayComp()
10096 (SiS_Pr->SiS_LCDResInfo != Panel_1280x768) && in SetDelayComp()
10097 (SiS_Pr->SiS_LCDResInfo != Panel_1280x960) && in SetDelayComp()
10098 (SiS_Pr->SiS_LCDResInfo != Panel_1600x1200) && in SetDelayComp()
10099 ((romptr = GetLCDromptr(SiS_Pr)))) { in SetDelayComp()
10105 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10113 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetDelayComp()
10115 … else if(SiS_Pr->ChipType <= SIS_315PRO) delay = SiS310_LCDDelayCompensation_3xx301LV[myindex]; in SetDelayComp()
10117 } else if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SetDelayComp()
10120 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) delay = 0x00; /* experience */ in SetDelayComp()
10121 } else if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SetDelayComp()
10130 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10131 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); in SetDelayComp()
10135 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* ------------ TV */ in SetDelayComp()
10137 index = GetTVPtrIndex(SiS_Pr); in SetDelayComp()
10139 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SetDelayComp()
10141 if(SiS_IsNotM650orLater(SiS_Pr)) { in SetDelayComp()
10143 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10160 switch(SiS_Pr->SiS_CustomT) { in SetDelayComp()
10175 if(SiS_Pr->SiS_VBType & VB_SIS302LV) { in SetDelayComp()
10181 } else if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10183 romptr = GetTVromptr(SiS_Pr); in SetDelayComp()
10187 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10194 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetDelayComp()
10200 if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02; in SetDelayComp()
10206 if(SiS_LCDAEnabled(SiS_Pr)) { in SetDelayComp()
10215 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetDelayComp()
10217 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS) && dochiptest) { in SetDelayComp()
10219 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4; in SetDelayComp()
10229 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10233 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10239 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp()
10240 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10242 if(IS_SIS650 && (SiS_Pr->SiS_IF_DEF_CH70xx != 0)) { in SetDelayComp()
10244 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,delay); in SetDelayComp()
10246 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10255 SetAntiFlicker(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SetAntiFlicker() argument
10257 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetAntiFlicker()
10260 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p|TVSetYPbPr525p)) return; in SetAntiFlicker()
10263 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVFlickerIndex; in SetAntiFlicker()
10265 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVFlickerIndex; in SetAntiFlicker()
10267 temp = GetTVPtrIndex(SiS_Pr); in SetAntiFlicker()
10271 if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SetAntiFlicker()
10272 if(SiS_Pr->ChipType >= SIS_661) { in SetAntiFlicker()
10273 temp1 = GetOEMTVPtr661(SiS_Pr); in SetAntiFlicker()
10276 if(SiS_Pr->ChipType >= SIS_760) { in SetAntiFlicker()
10279 } else if(SiS_Pr->ChipType >= SIS_330) { in SetAntiFlicker()
10294 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8f,temp); /* index 0A D[6:4] */ in SetAntiFlicker()
10298 SetEdgeEnhance(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) in SetEdgeEnhance() argument
10300 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetEdgeEnhance()
10303 temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetEdgeEnhance()
10306 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex; in SetEdgeEnhance()
10308 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex; in SetEdgeEnhance()
10310 if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SetEdgeEnhance()
10311 if(SiS_Pr->ChipType >= SIS_661) { in SetEdgeEnhance()
10313 if(SiS_Pr->ChipType >= SIS_760) { in SetEdgeEnhance()
10316 temp1 = GetOEMTVPtr661(SiS_Pr); in SetEdgeEnhance()
10318 } else if(SiS_Pr->ChipType >= SIS_330) { in SetEdgeEnhance()
10332 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x3A,0x1F,temp); /* index 0A D[7:5] */ in SetEdgeEnhance()
10336 SetYFilter(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) in SetYFilter() argument
10341 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex; in SetYFilter()
10343 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex; in SetYFilter()
10346 temp = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetYFilter()
10348 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 1; /* NTSC-J uses PAL */ in SetYFilter()
10349 else if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 3; /* PAL-M */ in SetYFilter()
10350 else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 4; /* PAL-N */ in SetYFilter()
10351 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp = 1; /* HiVision uses PAL */ in SetYFilter()
10353 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetYFilter()
10355 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); in SetYFilter()
10358 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); in SetYFilter()
10362 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter1[temp][index][j]); in SetYFilter()
10368 SetPhaseIncr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SetPhaseIncr() argument
10370 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetPhaseIncr()
10374 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; in SetPhaseIncr()
10377 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) return; in SetPhaseIncr()
10379 if((SiS_Pr->ChipType >= SIS_661) || SiS_Pr->SiS_ROMNew) { in SetPhaseIncr()
10380 lindex = GetOEMTVPtr661_2_OLD(SiS_Pr) & 0xffff; in SetPhaseIncr()
10383 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS_TVPhase[lindex + j]); in SetPhaseIncr()
10389 if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) return; in SetPhaseIncr()
10392 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SetPhaseIncr()
10394 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SetPhaseIncr()
10397 temp = GetTVPtrIndex(SiS_Pr); in SetPhaseIncr()
10401 if(SiS_Pr->SiS_UseROM) { in SetPhaseIncr()
10403 if(SiS_Pr->ChipType >= SIS_330) { in SetPhaseIncr()
10406 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetPhaseIncr()
10408 if(SiS_Pr->ChipType >= SIS_330) { in SetPhaseIncr()
10411 if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode))) { in SetPhaseIncr()
10413 if(SiS_Pr->ChipType >= SIS_330) { in SetPhaseIncr()
10422 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetPhaseIncr()
10428 if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) in SetPhaseIncr()
10429 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); in SetPhaseIncr()
10430 else if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) in SetPhaseIncr()
10431 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr2[temp][index][j]); in SetPhaseIncr()
10433 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); in SetPhaseIncr()
10437 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision))) { in SetPhaseIncr()
10438 if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPr525p | TVSetYPbPr750p))) && (ModeNo > 0x13)) { in SetPhaseIncr()
10441 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21); in SetPhaseIncr()
10442 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0); in SetPhaseIncr()
10443 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5); in SetPhaseIncr()
10444 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f); in SetPhaseIncr()
10446 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e); in SetPhaseIncr()
10447 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b); in SetPhaseIncr()
10448 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb); in SetPhaseIncr()
10449 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b); in SetPhaseIncr()
10456 SetDelayComp661(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SetDelayComp661() argument
10460 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetDelayComp661()
10462 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToRAMDAC))) in SetDelayComp661()
10468 if(SiS_Pr->SiS_ROMNew) { in SetDelayComp661()
10469 if((SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) || in SetDelayComp661()
10470 ((SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && in SetDelayComp661()
10471 (SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SetDelayComp661()
10473 if(SiS_Pr->UseCustomMode) { in SetDelayComp661()
10474 index = SiS_Pr->CSRClock; in SetDelayComp661()
10476 index = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RTI); in SetDelayComp661()
10477 index = SiS_Pr->SiS_VCLKData[index].CLOCK; in SetDelayComp661()
10481 if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) { in SetDelayComp661()
10486 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD)) { in SetDelayComp661()
10487 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10488 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10490 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10491 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10499 if(SiS_Pr->UseCustomMode) delay = 0x04; in SetDelayComp661()
10501 else delay = (SiS_Pr->SiS_RefIndex[RTI].Ext_PDC >> 4); in SetDelayComp661()
10504 if(SiS_Pr->ChipType >= XGI_20) { in SetDelayComp661()
10507 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
10510 if(SiS_Pr->SiS_XGIROM) { in SetDelayComp661()
10511 index = GetTVPtrIndex(SiS_Pr); in SetDelayComp661()
10518 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SetDelayComp661()
10519 if(SiS_Pr->ChipType == XGI_40 && SiS_Pr->ChipRevision == 0x02) { in SetDelayComp661()
10525 } else if(SiS_Pr->ChipType >= SIS_340) { in SetDelayComp661()
10528 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
10533 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
10537 index = GetOEMTVPtr661(SiS_Pr); in SetDelayComp661()
10538 if(SiS_Pr->SiS_ROMNew) { in SetDelayComp661()
10540 if(SiS_Pr->SiS_VBType & VB_UMC) romptr += 12; in SetDelayComp661()
10547 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SetDelayComp661()
10551 if( (SiS_Pr->SiS_LCDResInfo != Panel_Custom) && in SetDelayComp661()
10552 ((romptr = GetLCDStructPtr661_2(SiS_Pr))) ) { in SetDelayComp661()
10554 lcdpdcindex = (SiS_Pr->SiS_VBType & VB_UMC) ? 14 : 12; in SetDelayComp661()
10564 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SetDelayComp661()
10565 switch(SiS_Pr->SiS_LCDResInfo) { in SetDelayComp661()
10578 if((SiS_Pr->PanelXRes <= 1024) && (SiS_Pr->PanelYRes <= 768)) { in SetDelayComp661()
10580 } else if((SiS_Pr->PanelXRes == 1280) && (SiS_Pr->PanelYRes == 1024)) { in SetDelayComp661()
10582 } else if((SiS_Pr->PanelXRes <= 1400) && (SiS_Pr->PanelYRes <= 1050)) { in SetDelayComp661()
10584 } else if((SiS_Pr->PanelXRes <= 1600) && (SiS_Pr->PanelYRes <= 1200)) { in SetDelayComp661()
10594 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->PDC != -1)) { in SetDelayComp661()
10595 delay = SiS_Pr->PDC & 0x1f; in SetDelayComp661()
10597 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) && (SiS_Pr->PDCA != -1)) { in SetDelayComp661()
10598 delay = (SiS_Pr->PDCA & 0x1f) << 8; in SetDelayComp661()
10605 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp661()
10607 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10608 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10610 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10611 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10616 SetCRT2SyncDither661(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short RTI) in SetCRT2SyncDither661() argument
10621 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SetCRT2SyncDither661()
10624 infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2); in SetCRT2SyncDither661()
10625 } else if(SiS_Pr->UseCustomMode) { in SetCRT2SyncDither661()
10626 infoflag = SiS_Pr->CInfoFlag; in SetCRT2SyncDither661()
10628 infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag; in SetCRT2SyncDither661()
10631 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SetCRT2SyncDither661()
10632 infoflag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); /* No longer check D5 */ in SetCRT2SyncDither661()
10637 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetCRT2SyncDither661()
10639 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SetCRT2SyncDither661()
10641 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x10; in SetCRT2SyncDither661()
10643 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp); in SetCRT2SyncDither661()
10646 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) temp = 0x20; in SetCRT2SyncDither661()
10648 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp); in SetCRT2SyncDither661()
10650 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SetCRT2SyncDither661()
10651 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x80; in SetCRT2SyncDither661()
10653 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp); in SetCRT2SyncDither661()
10660 SetPanelParms661(struct SiS_Private *SiS_Pr) in SetPanelParms661() argument
10662 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetPanelParms661()
10665 if(SiS_Pr->SiS_VBType & (VB_SISLVDS | VB_SIS30xC)) { in SetPanelParms661()
10666 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x24,0x0f); in SetPanelParms661()
10669 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetPanelParms661()
10670 if(SiS_Pr->LVDSHL != -1) { in SetPanelParms661()
10671 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SetPanelParms661()
10675 if(SiS_Pr->SiS_ROMNew) { in SetPanelParms661()
10677 if((romptr = GetLCDStructPtr661_2(SiS_Pr))) { in SetPanelParms661()
10678 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetPanelParms661()
10681 if(SiS_Pr->LVDSHL != -1) { in SetPanelParms661()
10685 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1); in SetPanelParms661()
10687 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetPanelParms661()
10689 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1); in SetPanelParms661()
10697 SiS_OEM310Setting(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, un… in SiS_OEM310Setting() argument
10699 if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SiS_OEM310Setting()
10700 SetDelayComp661(SiS_Pr, ModeNo, ModeIdIndex, RRTI); in SiS_OEM310Setting()
10701 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_OEM310Setting()
10702 SetCRT2SyncDither661(SiS_Pr, ModeNo, RRTI); in SiS_OEM310Setting()
10703 SetPanelParms661(SiS_Pr); in SiS_OEM310Setting()
10706 SetDelayComp(SiS_Pr,ModeNo); in SiS_OEM310Setting()
10709 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_OEM310Setting()
10710 SetAntiFlicker(SiS_Pr,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
10711 SetPhaseIncr(SiS_Pr,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
10712 SetYFilter(SiS_Pr,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
10713 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_OEM310Setting()
10714 SetEdgeEnhance(SiS_Pr,ModeNo,ModeIdIndex); in SiS_OEM310Setting()
10720 SiS_OEM661Setting(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_OEM661Setting() argument
10723 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_OEM661Setting()
10725 SetDelayComp661(SiS_Pr, ModeNo, ModeIdIndex, RRTI); in SiS_OEM661Setting()
10727 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_OEM661Setting()
10728 SetCRT2SyncDither661(SiS_Pr, ModeNo, RRTI); in SiS_OEM661Setting()
10729 SetPanelParms661(SiS_Pr); in SiS_OEM661Setting()
10732 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_OEM661Setting()
10733 SetPhaseIncr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_OEM661Setting()
10734 SetYFilter(SiS_Pr, ModeNo, ModeIdIndex); in SiS_OEM661Setting()
10735 SetAntiFlicker(SiS_Pr, ModeNo, ModeIdIndex); in SiS_OEM661Setting()
10736 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_OEM661Setting()
10737 SetEdgeEnhance(SiS_Pr, ModeNo, ModeIdIndex); in SiS_OEM661Setting()
10751 SiS_FinalizeLCD(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_FinalizeLCD() argument
10756 if(!(SiS_Pr->SiS_VBType & VB_SISLVDS)) return; in SiS_FinalizeLCD()
10757 if(SiS_Pr->SiS_ROMNew) return; in SiS_FinalizeLCD()
10759 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
10760 if(SiS_Pr->LVDSHL != -1) { in SiS_FinalizeLCD()
10761 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SiS_FinalizeLCD()
10765 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; in SiS_FinalizeLCD()
10766 if(SiS_Pr->UseCustomMode) return; in SiS_FinalizeLCD()
10768 switch(SiS_Pr->SiS_CustomT) { in SiS_FinalizeLCD()
10777 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_FinalizeLCD()
10778 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_FinalizeLCD()
10780 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_FinalizeLCD()
10781 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_FinalizeLCD()
10785 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) { in SiS_FinalizeLCD()
10786 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { in SiS_FinalizeLCD()
10787 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02); in SiS_FinalizeLCD()
10789 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_FinalizeLCD()
10794 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { in SiS_FinalizeLCD()
10795 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10797 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
10798 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10804 if(SiS_Pr->SiS_CustomT == CUT_CLEVO10242) { in SiS_FinalizeLCD()
10805 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
10806 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10807 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
10809 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10811 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_FinalizeLCD()
10812 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10814 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10815 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10816 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10817 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10825 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
10826 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10827 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_FinalizeLCD()
10828 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_FinalizeLCD()
10830 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_FinalizeLCD()
10832 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_FinalizeLCD()
10834 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_FinalizeLCD()
10835 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
10837 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10840 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10841 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_FinalizeLCD()
10842 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { in SiS_FinalizeLCD()
10843 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76); in SiS_FinalizeLCD()
10844 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10846 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10847 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10848 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10849 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10851 if(SiS_Pr->Backup && (SiS_Pr->Backup_Mode == ModeNo)) { in SiS_FinalizeLCD()
10852 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); in SiS_FinalizeLCD()
10853 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); in SiS_FinalizeLCD()
10854 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); in SiS_FinalizeLCD()
10855 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17); in SiS_FinalizeLCD()
10856 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18); in SiS_FinalizeLCD()
10857 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19); in SiS_FinalizeLCD()
10858 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a); in SiS_FinalizeLCD()
10859 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b); in SiS_FinalizeLCD()
10860 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c); in SiS_FinalizeLCD()
10861 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d); in SiS_FinalizeLCD()
10862 } else if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { /* 1.10.8w */ in SiS_FinalizeLCD()
10863 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90); in SiS_FinalizeLCD()
10865 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11); in SiS_FinalizeLCD()
10867 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18); in SiS_FinalizeLCD()
10870 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10872 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); /* 1.10.7u */ in SiS_FinalizeLCD()
10877 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); in SiS_FinalizeLCD()
10879 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp); in SiS_FinalizeLCD()
10884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70); in SiS_FinalizeLCD()
10885 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff); in SiS_FinalizeLCD()
10886 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10887 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10890 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20); in SiS_FinalizeLCD()
10891 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a); in SiS_FinalizeLCD()
10892 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28); in SiS_FinalizeLCD()
10893 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00); in SiS_FinalizeLCD()
10894 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c); in SiS_FinalizeLCD()
10895 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10899 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10900 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10901 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10); in SiS_FinalizeLCD()
10902 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10903 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48); in SiS_FinalizeLCD()
10904 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10907 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10908 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10911 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10919 tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_FinalizeLCD()
10923 tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04); in SiS_FinalizeLCD()
10925 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10926 if((resinfo == SIS_RI_1024x768) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) { in SiS_FinalizeLCD()
10927 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_FinalizeLCD()
10931 if(SiS_Pr->SiS_VGAVDE < 600) { in SiS_FinalizeLCD()
10932 tempax = 768 - SiS_Pr->SiS_VGAVDE; in SiS_FinalizeLCD()
10934 if(SiS_Pr->SiS_VGAVDE <= 480) tempax >>= 4; /* 1.10.7w; 1.10.6s: < 480; >>=1; */ in SiS_FinalizeLCD()
10941 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp); in SiS_FinalizeLCD()
10943 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp); in SiS_FinalizeLCD()
10955 SetOEMLCDData2(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex, in SetOEMLCDData2() argument
10963 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SetOEMLCDData2()
10964 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SetOEMLCDData2()
10966 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SetOEMLCDData2()
10967 crt2crtc = SiS_Pr->SiS_RefIndex[RefTabIndex].Ext_CRT2CRTC; in SetOEMLCDData2()
10972 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SetOEMLCDData2()
10973 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf); in SetOEMLCDData2()
10976 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SetOEMLCDData2()
10979 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SetOEMLCDData2()
10982 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, in SetOEMLCDData2()
10989 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SetOEMLCDData2()
10991 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18); in SetOEMLCDData2()
10993 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); in SetOEMLCDData2()
10999 GetOEMLCDPtr(struct SiS_Private *SiS_Pr, int Flag) in GetOEMLCDPtr() argument
11001 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetOEMLCDPtr()
11012 if(SiS_Pr->ChipType == SIS_300) { in GetOEMLCDPtr()
11014 tempbx = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f; in GetOEMLCDPtr()
11015 if(SiS_Pr->SiS_VBType & VB_SIS301) tempbx &= 0x07; in GetOEMLCDPtr()
11017 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 4; in GetOEMLCDPtr()
11018 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in GetOEMLCDPtr()
11019 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 3; in GetOEMLCDPtr()
11021 if(SiS_Pr->SiS_UseROM) { in GetOEMLCDPtr()
11023 tempbx = SiS_Pr->SiS_LCDTypeInfo; in GetOEMLCDPtr()
11026 if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11027 else tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11031 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; in GetOEMLCDPtr()
11038 if(SiS_Pr->SiS_UseROM) { in GetOEMLCDPtr()
11040 if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11043 tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11047 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; in GetOEMLCDPtr()
11048 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in GetOEMLCDPtr()
11051 tempbx = SiS_Pr->SiS_LCDTypeInfo << 2; in GetOEMLCDPtr()
11052 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; in GetOEMLCDPtr()
11053 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in GetOEMLCDPtr()
11061 SetOEMLCDDelay(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) in SetOEMLCDDelay() argument
11063 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMLCDDelay()
11066 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; in SetOEMLCDDelay()
11068 if(SiS_Pr->SiS_UseROM) { in SetOEMLCDDelay()
11081 if(SiS_Pr->PDC != -1) return; in SetOEMLCDDelay()
11083 temp = GetOEMLCDPtr(SiS_Pr, 0); in SetOEMLCDDelay()
11085 if(SiS_Pr->UseCustomMode) in SetOEMLCDDelay()
11088 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_LCDDelayIndex; in SetOEMLCDDelay()
11090 if(SiS_Pr->ChipType != SIS_300) { in SetOEMLCDDelay()
11097 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetOEMLCDDelay()
11104 if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) { in SetOEMLCDDelay()
11114 if(SiS_Pr->SiS_UseROM) { in SetOEMLCDDelay()
11130 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* index 0A D[6:4] */ in SetOEMLCDDelay()
11134 SetOEMLCDData(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SetOEMLCDData() argument
11137 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMLCDData()
11140 if((SiS_Pr->SiS_UseROM) { in SetOEMLCDData()
11146 temp = GetOEMLCDPtr(SiS_Pr, 1); in SetOEMLCDData()
11149 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDHIndex; in SetOEMLCDData()
11151 SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDHData[temp][index][j]); in SetOEMLCDData()
11155 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDVIndex; in SetOEMLCDData()
11160 SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDVData[temp][index][j]); in SetOEMLCDData()
11166 GetOEMTVPtr(struct SiS_Private *SiS_Pr) in GetOEMTVPtr() argument
11171 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) index += 4; in GetOEMTVPtr()
11172 if(SiS_Pr->SiS_VBType & VB_SISVB) { in GetOEMTVPtr()
11173 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) index += 2; in GetOEMTVPtr()
11174 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index += 3; in GetOEMTVPtr()
11175 else if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; in GetOEMTVPtr()
11177 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) index += 2; in GetOEMTVPtr()
11178 if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; in GetOEMTVPtr()
11184 SetOEMTVDelay(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SetOEMTVDelay() argument
11186 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMTVDelay()
11189 if(SiS_Pr->SiS_UseROM) { in SetOEMTVDelay()
11195 temp = GetOEMTVPtr(SiS_Pr); in SetOEMTVDelay()
11197 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVDelayIndex; in SetOEMTVDelay()
11205 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetOEMTVDelay()
11212 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); in SetOEMTVDelay()
11216 SetOEMAntiFlicker(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SetOEMAntiFlicker() argument
11218 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMAntiFlicker()
11221 if(SiS_Pr->SiS_UseROM) { in SetOEMAntiFlicker()
11227 temp = GetOEMTVPtr(SiS_Pr); in SetOEMAntiFlicker()
11229 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVFlickerIndex; in SetOEMAntiFlicker()
11240 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp); in SetOEMAntiFlicker()
11244 SetOEMPhaseIncr(struct SiS_Private *SiS_Pr, unsigned short ModeNo,unsigned short ModeIdIndex) in SetOEMPhaseIncr() argument
11246 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMPhaseIncr()
11249 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) return; in SetOEMPhaseIncr()
11251 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPALN)) return; in SetOEMPhaseIncr()
11253 if(SiS_Pr->SiS_UseROM) { in SetOEMPhaseIncr()
11259 temp = GetOEMTVPtr(SiS_Pr); in SetOEMPhaseIncr()
11261 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVPhaseIndex; in SetOEMPhaseIncr()
11263 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetOEMPhaseIncr()
11265 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase2[temp][index][j]); in SetOEMPhaseIncr()
11273 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetOEMPhaseIncr()
11277 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase1[temp][index][j]); in SetOEMPhaseIncr()
11284 SetOEMYFilter(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SetOEMYFilter() argument
11286 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMYFilter()
11289 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVision | SetCRT2ToYPbPr525750)) return; in SetOEMYFilter()
11291 if(SiS_Pr->SiS_UseROM) { in SetOEMYFilter()
11297 temp = GetOEMTVPtr(SiS_Pr); in SetOEMYFilter()
11299 if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; in SetOEMYFilter()
11300 else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 9; in SetOEMYFilter()
11303 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVYFilterIndex; in SetOEMYFilter()
11305 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetOEMYFilter()
11307 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); in SetOEMYFilter()
11310 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); in SetOEMYFilter()
11313 if((romptr) && (!(SiS_Pr->SiS_TVMode & (TVSetPALM|TVSetPALN)))) { in SetOEMYFilter()
11318 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetOEMYFilter()
11322 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter1[temp][index][j]); in SetOEMYFilter()
11329 SiS_SearchVBModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo) in SiS_SearchVBModeID() argument
11332 unsigned char VGAINFO = SiS_Pr->SiS_VGAINFO; in SiS_SearchVBModeID()
11337 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == *ModeNo) break; in SiS_SearchVBModeID()
11338 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF) return 0; in SiS_SearchVBModeID()
11353 SiS_OEM300Setting(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex, in SiS_OEM300Setting() argument
11358 if(!SiS_Pr->UseCustomMode) { in SiS_OEM300Setting()
11359 OEMModeIdIndex = SiS_SearchVBModeID(SiS_Pr,&ModeNo); in SiS_OEM300Setting()
11363 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_OEM300Setting()
11364 SetOEMLCDDelay(SiS_Pr, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11365 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_OEM300Setting()
11366 SetOEMLCDData(SiS_Pr, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11369 if(SiS_Pr->UseCustomMode) return; in SiS_OEM300Setting()
11370 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_OEM300Setting()
11371 SetOEMTVDelay(SiS_Pr, ModeNo,OEMModeIdIndex); in SiS_OEM300Setting()
11372 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_OEM300Setting()
11373 SetOEMAntiFlicker(SiS_Pr, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11374 SetOEMPhaseIncr(SiS_Pr, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()
11375 SetOEMYFilter(SiS_Pr, ModeNo, OEMModeIdIndex); in SiS_OEM300Setting()