Lines Matching +full:custom +full:- +full:temp
10 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
27 * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
55 * Formerly based on non-functional code-fragements for 300 series by SiS, Inc.
255 /* VESA non-VESA noscale */
420 if(SiS_Pr->ChipType == XGI_20) in SiS_UnLockCRT2()
422 else if(SiS_Pr->ChipType >= SIS_315H) in SiS_UnLockCRT2()
423 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_UnLockCRT2()
425 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); in SiS_UnLockCRT2()
432 if(SiS_Pr->ChipType == XGI_20) in SiS_LockCRT2()
434 else if(SiS_Pr->ChipType >= SIS_315H) in SiS_LockCRT2()
435 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE); in SiS_LockCRT2()
437 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE); in SiS_LockCRT2()
447 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetRegSR11ANDOR()
451 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR); in SiS_SetRegSR11ANDOR()
462 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetLCDStructPtr661()
473 if((SiS_Pr->SiS_ROMNew) && in GetLCDStructPtr661()
474 ((SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected))) { in GetLCDStructPtr661()
476 if(SiS_Pr->ChipType < SIS_661) reg = 0x3c; in GetLCDStructPtr661()
479 idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26; in GetLCDStructPtr661()
496 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetLCDStructPtr661_2()
506 if((SiS_Pr->SiS_ROMNew) && in GetLCDStructPtr661_2()
507 ((SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected))) { in GetLCDStructPtr661_2()
509 romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize); in GetLCDStructPtr661_2()
526 modeid = SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID; in SiS_AdjustCRT2Rate()
528 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_AdjustCRT2Rate()
530 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_AdjustCRT2Rate()
533 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_AdjustCRT2Rate()
535 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_AdjustCRT2Rate()
537 if(SiS_Pr->SiS_VBType & VB_SISRAMDAC202) { in SiS_AdjustCRT2Rate()
543 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_AdjustCRT2Rate()
546 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_AdjustCRT2Rate()
547 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_AdjustCRT2Rate()
548 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_AdjustCRT2Rate()
554 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_AdjustCRT2Rate()
558 …} else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750|SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCAR… in SiS_AdjustCRT2Rate()
561 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_AdjustCRT2Rate()
563 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_AdjustCRT2Rate()
564 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_AdjustCRT2Rate()
574 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_AdjustCRT2Rate()
575 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_AdjustCRT2Rate()
580 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_AdjustCRT2Rate()
587 for(; SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID == modeid; (*i)--) { in SiS_AdjustCRT2Rate()
588 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; in SiS_AdjustCRT2Rate()
593 /* Look through the whole mode-section of the table from the beginning in SiS_AdjustCRT2Rate()
597 if(SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID != modeid) break; in SiS_AdjustCRT2Rate()
598 infoflag = SiS_Pr->SiS_RefIndex[RRTI + (*i)].Ext_InfoFlag; in SiS_AdjustCRT2Rate()
612 unsigned short modeflag,index,temp,backupindex; in SiS_GetRatePtr() local
625 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetRatePtr()
627 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetRatePtr()
630 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
631 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetRatePtr()
638 index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; in SiS_GetRatePtr()
641 if(index > 0) index--; in SiS_GetRatePtr()
643 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetRatePtr()
644 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetRatePtr()
645 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetRatePtr()
646 if(SiS_Pr->SiS_VBType & VB_NoLCD) index = 0; in SiS_GetRatePtr()
647 else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0; in SiS_GetRatePtr()
649 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_GetRatePtr()
650 if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetRatePtr()
651 temp = LCDRefreshIndex[SiS_GetBIOSLCDResInfo(SiS_Pr)]; in SiS_GetRatePtr()
652 if(index > temp) index = temp; in SiS_GetRatePtr()
656 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0; in SiS_GetRatePtr()
657 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
658 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0; in SiS_GetRatePtr()
663 RRTI = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; in SiS_GetRatePtr()
664 ModeNo = SiS_Pr->SiS_RefIndex[RRTI].ModeID; in SiS_GetRatePtr()
666 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetRatePtr()
667 if(!(SiS_Pr->SiS_VBInfo & DriverMode)) { in SiS_GetRatePtr()
668 if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) || in SiS_GetRatePtr()
669 (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) { in SiS_GetRatePtr()
677 if(SiS_Pr->SiS_RefIndex[RRTI + i].ModeID != ModeNo) break; in SiS_GetRatePtr()
678 temp = SiS_Pr->SiS_RefIndex[RRTI + i].Ext_InfoFlag; in SiS_GetRatePtr()
679 temp &= ModeTypeMask; in SiS_GetRatePtr()
680 if(temp < SiS_Pr->SiS_ModeType) break; in SiS_GetRatePtr()
682 index--; in SiS_GetRatePtr()
685 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_GetRatePtr()
686 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetRatePtr()
687 temp = SiS_Pr->SiS_RefIndex[RRTI + i - 1].Ext_InfoFlag; in SiS_GetRatePtr()
688 if(temp & InterlaceMode) i++; in SiS_GetRatePtr()
692 i--; in SiS_GetRatePtr()
694 if((SiS_Pr->SiS_SetFlag & ProgrammingCRT2) && (!(SiS_Pr->SiS_VBInfo & DisableCRT2Display))) { in SiS_GetRatePtr()
714 SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo); in SiS_SaveCRT2Info()
715 temp1 = (SiS_Pr->SiS_VBInfo & SetInSlaveMode) >> 8; in SiS_SaveCRT2Info()
717 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1); in SiS_SaveCRT2Info()
728 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_CR36BIOSWord23b()
729 unsigned short temp,temp1; in SiS_CR36BIOSWord23b() local
731 if(SiS_Pr->SiS_UseROM) { in SiS_CR36BIOSWord23b()
733 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23b()
735 if(temp1 & temp) return true; in SiS_CR36BIOSWord23b()
744 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_CR36BIOSWord23d()
745 unsigned short temp,temp1; in SiS_CR36BIOSWord23d() local
747 if(SiS_Pr->SiS_UseROM) { in SiS_CR36BIOSWord23d()
749 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23d()
751 if(temp1 & temp) return true; in SiS_CR36BIOSWord23d()
765 while (delaytime-- > 0) in SiS_DDC2Delay()
766 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); in SiS_DDC2Delay()
781 while(delay--) { in SiS_LongDelay()
791 while(delay--) { in SiS_ShortDelay()
801 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_PanelDelay()
805 if(SiS_Pr->ChipType < SIS_315H) { in SiS_PanelDelay()
809 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
810 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_PanelDelay()
811 if(SiS_Pr->SiS_VBType & VB_SIS301) PanelID &= 0xf7; in SiS_PanelDelay()
812 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
818 if(DelayTime >= 2) DelayTime -= 2; in SiS_PanelDelay()
820 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
822 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; in SiS_PanelDelay()
824 if(SiS_Pr->SiS_UseROM) { in SiS_PanelDelay()
839 if((SiS_Pr->ChipType >= SIS_661) || in SiS_PanelDelay()
840 (SiS_Pr->ChipType <= SIS_315PRO) || in SiS_PanelDelay()
841 (SiS_Pr->ChipType == SIS_330) || in SiS_PanelDelay()
842 (SiS_Pr->SiS_ROMNew)) { in SiS_PanelDelay()
850 } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* 315 series, LVDS; Special */ in SiS_PanelDelay()
852 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_PanelDelay()
853 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
854 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) { in SiS_PanelDelay()
855 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
857 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_PanelDelay()
865 if(DelayTime >= 2) DelayTime -= 2; in SiS_PanelDelay()
867 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0]; in SiS_PanelDelay()
869 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1]; in SiS_PanelDelay()
871 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_PanelDelay()
884 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 315 series, all bridges */ in SiS_PanelDelay()
886 DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_PanelDelay()
888 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
890 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1]; in SiS_PanelDelay()
914 /* HELPER: WAIT-FOR-RETRACE FUNCTIONS */
922 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return; in SiS_WaitRetrace1()
923 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return; in SiS_WaitRetrace1()
926 while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog); in SiS_WaitRetrace1()
928 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); in SiS_WaitRetrace1()
938 while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog); in SiS_WaitRetrace2()
940 while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog); in SiS_WaitRetrace2()
947 if(SiS_Pr->ChipType < SIS_315H) { in SiS_WaitVBRetrace()
949 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_WaitVBRetrace()
950 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; in SiS_WaitVBRetrace()
952 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) { in SiS_WaitVBRetrace()
960 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { in SiS_WaitVBRetrace()
972 unsigned short tempal,temp,i,j; in SiS_VBWait() local
974 temp = 0; in SiS_VBWait()
977 tempal = SiS_GetRegByte(SiS_Pr->SiS_P3da); in SiS_VBWait()
978 if(temp & 0x01) { in SiS_VBWait()
986 temp ^= 0x01; in SiS_VBWait()
993 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_VBLongWait()
1008 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return true; in SiS_Is301B()
1016 if(SiS_Pr->ChipType == SIS_730) { in SiS_CRT2IsLCD()
1017 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return true; in SiS_CRT2IsLCD()
1019 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return true; in SiS_CRT2IsLCD()
1027 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsDualEdge()
1028 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { in SiS_IsDualEdge()
1029 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; in SiS_IsDualEdge()
1042 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsVAMode()
1043 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsVAMode()
1064 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsDualLink()
1067 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) return true; in SiS_IsDualLink()
1078 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return true; in SiS_TVEnabled()
1079 if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { in SiS_TVEnabled()
1080 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return true; in SiS_TVEnabled()
1090 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return true; in SiS_LCDAEnabled()
1099 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { in SiS_WeHaveBacklightCtrl()
1100 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return true; in SiS_WeHaveBacklightCtrl()
1112 if(SiS_Pr->ChipType == SIS_650) { in SiS_IsNotM650orLater()
1113 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; in SiS_IsNotM650orLater()
1117 } else if(SiS_Pr->ChipType >= SIS_661) return false; in SiS_IsNotM650orLater()
1126 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsYPbPr()
1128 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return true; in SiS_IsYPbPr()
1138 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsChScart()
1140 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return true; in SiS_IsChScart()
1152 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsTVOrYPbPrOrScart()
1153 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1155 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsTVOrYPbPrOrScart()
1157 if(flag & EnableCHScart) return true; /* = Scart = 0x04 - TW */ in SiS_IsTVOrYPbPrOrScart()
1159 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1172 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_IsLCDOrLCDA()
1173 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1175 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsLCDOrLCDA()
1178 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1190 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_HaveBridge()
1192 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_HaveBridge()
1193 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiS_HaveBridge()
1205 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_BridgeIsEnabled()
1206 if(SiS_Pr->ChipType < SIS_315H) { in SiS_BridgeIsEnabled()
1222 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); in SiS_BridgeInSlavemode()
1237 unsigned short temp; in SiS_SetChrontelGPIO() local
1239 if(!(SiS_Pr->SiS_ChSW)) return; in SiS_SetChrontelGPIO()
1244 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ in SiS_SetChrontelGPIO()
1245 temp &= 0xFEFF; in SiS_SetChrontelGPIO()
1246 SiS_SetRegShort((acpibase + 0x3c), temp); in SiS_SetChrontelGPIO()
1247 temp = SiS_GetRegShort((acpibase + 0x3c)); in SiS_SetChrontelGPIO()
1248 temp = SiS_GetRegShort((acpibase + 0x3a)); /* ACPI register 0x3a: GP Pin Level (low/high) */ in SiS_SetChrontelGPIO()
1249 temp &= 0xFEFF; in SiS_SetChrontelGPIO()
1250 if(!(myvbinfo & SetCRT2ToTV)) temp |= 0x0100; in SiS_SetChrontelGPIO()
1251 SiS_SetRegShort((acpibase + 0x3a), temp); in SiS_SetChrontelGPIO()
1252 temp = SiS_GetRegShort((acpibase + 0x3a)); in SiS_SetChrontelGPIO()
1260 unsigned short tempax, tempbx, temp; in SiS_GetVBInfo() local
1263 SiS_Pr->SiS_SetFlag = 0; in SiS_GetVBInfo()
1267 SiS_Pr->SiS_ModeType = modeflag & ModeTypeMask; in SiS_GetVBInfo()
1269 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetVBInfo()
1270 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetVBInfo()
1277 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_GetVBInfo()
1278 tempbx |= temp; in SiS_GetVBInfo()
1279 tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8; in SiS_GetVBInfo()
1284 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1285 if(SiS_Pr->SiS_VBType & VB_SISLCDA) { in SiS_GetVBInfo()
1288 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf); in SiS_GetVBInfo()
1290 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) { in SiS_GetVBInfo()
1292 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); in SiS_GetVBInfo()
1295 if(SiS_Pr->SiS_UseLCDA) { in SiS_GetVBInfo()
1296 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) { in SiS_GetVBInfo()
1297 if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) { in SiS_GetVBInfo()
1298 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA)); in SiS_GetVBInfo()
1303 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1304 if((temp & (EnableDualEdge | SetToLCDA)) == (EnableDualEdge | SetToLCDA)) { in SiS_GetVBInfo()
1309 if(SiS_Pr->ChipType >= SIS_661) { /* New CR layout */ in SiS_GetVBInfo()
1311 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & 0x04) { in SiS_GetVBInfo()
1312 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; in SiS_GetVBInfo()
1313 if(temp == 0x60) tempbx |= SetCRT2ToHiVision; in SiS_GetVBInfo()
1314 else if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { in SiS_GetVBInfo()
1320 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetVBInfo()
1321 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1322 if(temp & SetToLCDA) { in SiS_GetVBInfo()
1325 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1326 if(temp & EnableCHYPbPr) { in SiS_GetVBInfo()
1335 if(!(SiS_Pr->SiS_VBType & VB_SISVGA2)) { in SiS_GetVBInfo()
1339 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetVBInfo()
1340 temp = SetCRT2ToSVIDEO | in SiS_GetVBInfo()
1349 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1350 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1351 temp = SetCRT2ToAVIDEO | in SiS_GetVBInfo()
1358 temp = SetCRT2ToLCDA | in SiS_GetVBInfo()
1362 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1363 temp = SetCRT2ToTV | SetCRT2ToLCD; in SiS_GetVBInfo()
1365 temp = SetCRT2ToLCD; in SiS_GetVBInfo()
1370 if(!(tempbx & temp)) { in SiS_GetVBInfo()
1375 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetVBInfo()
1395 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1400 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1408 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetVBInfo()
1425 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_GetVBInfo()
1426 if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_GetVBInfo()
1427 ((SiS_Pr->SiS_VBType & VB_NoLCD) && (tempbx & SetCRT2ToLCD)) ) { in SiS_GetVBInfo()
1466 SiS_Pr->SiS_VBInfo = tempbx; in SiS_GetVBInfo()
1469 if(SiS_Pr->ChipType == SIS_630) { in SiS_GetVBInfo()
1470 SiS_SetChrontelGPIO(SiS_Pr, SiS_Pr->SiS_VBInfo); in SiS_GetVBInfo()
1476 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); in SiS_GetVBInfo()
1488 unsigned char temp; in SiS_SetYPbPr() local
1498 SiS_Pr->SiS_YPbPr = 0; in SiS_SetYPbPr()
1499 if(SiS_Pr->ChipType >= SIS_661) return; in SiS_SetYPbPr()
1501 if(SiS_Pr->SiS_VBType) { in SiS_SetYPbPr()
1502 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetYPbPr()
1503 SiS_Pr->SiS_YPbPr = YPbPrHiVision; in SiS_SetYPbPr()
1507 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetYPbPr()
1508 if(SiS_Pr->SiS_VBType & VB_SISYPBPR) { in SiS_SetYPbPr()
1509 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetYPbPr()
1510 if(temp & 0x08) { in SiS_SetYPbPr()
1511 switch((temp >> 4)) { in SiS_SetYPbPr()
1512 case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i; break; in SiS_SetYPbPr()
1513 case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p; break; in SiS_SetYPbPr()
1514 case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p; break; in SiS_SetYPbPr()
1515 case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break; in SiS_SetYPbPr()
1530 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetTVMode()
1531 unsigned short temp, temp1, resinfo = 0, romindex = 0; in SiS_SetTVMode() local
1532 unsigned char OutputSelect = *SiS_Pr->pSiS_OutputSelect; in SiS_SetTVMode()
1534 SiS_Pr->SiS_TVMode = 0; in SiS_SetTVMode()
1536 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; in SiS_SetTVMode()
1537 if(SiS_Pr->UseCustomMode) return; in SiS_SetTVMode()
1540 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetTVMode()
1543 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetTVMode()
1545 if(SiS_Pr->SiS_VBInfo & SetPALTV) SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1547 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1548 temp = 0; in SiS_SetTVMode()
1549 if((SiS_Pr->ChipType == SIS_630) || in SiS_SetTVMode()
1550 (SiS_Pr->ChipType == SIS_730)) { in SiS_SetTVMode()
1551 temp = 0x35; in SiS_SetTVMode()
1553 } else if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetTVMode()
1554 temp = 0x38; in SiS_SetTVMode()
1555 if(SiS_Pr->ChipType < XGI_20) { in SiS_SetTVMode()
1557 if(SiS_Pr->ChipType >= SIS_330) romindex = 0x11b; in SiS_SetTVMode()
1560 if(temp) { in SiS_SetTVMode()
1561 if(romindex && SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetTVMode()
1564 SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F); in SiS_SetTVMode()
1567 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,temp); in SiS_SetTVMode()
1568 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetTVMode()
1570 SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1571 SiS_Pr->SiS_TVMode &= ~TVSetPAL; in SiS_SetTVMode()
1573 SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1577 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1582 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1583 if(SiS_Pr->SiS_YPbPr == YPbPr750p) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1584 else if(SiS_Pr->SiS_YPbPr == YPbPr525p) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1585 else if(SiS_Pr->SiS_YPbPr == YPbPrHiVision) SiS_Pr->SiS_TVMode |= TVSetHiVision; in SiS_SetTVMode()
1586 else SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1587 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p | TVSetYPbPr525i)) { in SiS_SetTVMode()
1588 SiS_Pr->SiS_VBInfo &= ~SetCRT2ToHiVision; in SiS_SetTVMode()
1589 SiS_Pr->SiS_VBInfo |= SetCRT2ToYPbPr525750; in SiS_SetTVMode()
1590 } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { in SiS_SetTVMode()
1591 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1594 } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetTVMode()
1595 if(SiS_Pr->SiS_CHOverScan) { in SiS_SetTVMode()
1596 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetTVMode()
1597 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1598 if((temp & TVOverScan) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1599 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1601 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1602 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79); in SiS_SetTVMode()
1603 if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1604 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1607 if(SiS_Pr->SiS_CHSOverScan) { in SiS_SetTVMode()
1608 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1611 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1612 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetTVMode()
1613 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetTVMode()
1614 if(temp & EnablePALM) SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1615 else if(temp & EnablePALN) SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1617 if(temp & EnableNTSCJ) { in SiS_SetTVMode()
1618 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1626 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1628 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1630 SiS_Pr->SiS_TVMode |= TVSetPALN; in SiS_SetTVMode()
1632 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1633 SiS_Pr->SiS_TVMode &= ~TVSetPAL; in SiS_SetTVMode()
1635 SiS_Pr->SiS_TVMode |= TVSetPALM; in SiS_SetTVMode()
1639 SiS_Pr->SiS_TVMode |= TVSetNTSCJ; in SiS_SetTVMode()
1642 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetTVMode()
1643 if(SiS_Pr->SiS_CHOverScan) { in SiS_SetTVMode()
1644 if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1645 SiS_Pr->SiS_TVMode |= TVSetCHOverScan; in SiS_SetTVMode()
1649 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1650 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetTVMode()
1652 if(temp1 == 0x00) SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1653 else if(temp1 == 0x20) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1654 else if(temp1 == 0x40) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1655 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1656 SiS_Pr->SiS_TVMode |= (TVSetHiVision | TVSetPAL); in SiS_SetTVMode()
1658 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750 | SetCRT2ToHiVision)) { in SiS_SetTVMode()
1660 SiS_Pr->SiS_TVMode |= TVAspect169; in SiS_SetTVMode()
1662 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39); in SiS_SetTVMode()
1664 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetHiVision)) { in SiS_SetTVMode()
1665 SiS_Pr->SiS_TVMode |= TVAspect169; in SiS_SetTVMode()
1667 SiS_Pr->SiS_TVMode |= TVAspect43LB; in SiS_SetTVMode()
1670 SiS_Pr->SiS_TVMode |= TVAspect43; in SiS_SetTVMode()
1677 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1679 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetTVMode()
1681 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetTVMode()
1682 SiS_Pr->SiS_TVMode |= TVSetPAL; in SiS_SetTVMode()
1683 SiS_Pr->SiS_TVMode &= ~(TVSetPALM | TVSetPALN | TVSetNTSCJ); in SiS_SetTVMode()
1684 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetTVMode()
1685 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525i | TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetTVMode()
1686 SiS_Pr->SiS_TVMode &= ~(TVSetPAL | TVSetNTSCJ | TVSetPALM | TVSetPALN); in SiS_SetTVMode()
1690 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetTVMode()
1691 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_SetTVMode()
1692 SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; in SiS_SetTVMode()
1696 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetTVMode()
1698 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_SetTVMode()
1699 SiS_Pr->SiS_TVMode |= TVSet525p1024; in SiS_SetTVMode()
1700 } else if(!(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p))) { in SiS_SetTVMode()
1701 SiS_Pr->SiS_TVMode |= TVSetNTSC1024; in SiS_SetTVMode()
1706 SiS_Pr->SiS_TVMode |= TVRPLLDIV2XO; in SiS_SetTVMode()
1707 if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) && in SiS_SetTVMode()
1708 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetTVMode()
1709 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1710 } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetTVMode()
1711 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1712 } else if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) { in SiS_SetTVMode()
1713 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetTVMode()
1714 SiS_Pr->SiS_TVMode &= ~TVRPLLDIV2XO; in SiS_SetTVMode()
1720 SiS_Pr->SiS_VBInfo &= ~SetPALTV; in SiS_SetTVMode()
1730 unsigned short temp = SiS_Pr->SiS_LCDResInfo; in SiS_GetBIOSLCDResInfo() local
1732 switch(temp) { in SiS_GetBIOSLCDResInfo()
1733 case Panel_1280x768_2: temp = Panel_1280x768; break; in SiS_GetBIOSLCDResInfo()
1734 case Panel_1280x800_2: temp = Panel_1280x800; break; in SiS_GetBIOSLCDResInfo()
1735 case Panel_1280x854: temp = Panel661_1280x854; break; in SiS_GetBIOSLCDResInfo()
1737 return temp; in SiS_GetBIOSLCDResInfo()
1745 unsigned short temp; in SiS_GetLCDInfoBIOS() local
1748 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { in SiS_GetLCDInfoBIOS()
1749 SiS_Pr->SiS_NeedRomModeData = true; in SiS_GetLCDInfoBIOS()
1750 SiS_Pr->PanelHT = temp; in SiS_GetLCDInfoBIOS()
1752 if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) { in SiS_GetLCDInfoBIOS()
1753 SiS_Pr->SiS_NeedRomModeData = true; in SiS_GetLCDInfoBIOS()
1754 SiS_Pr->PanelVT = temp; in SiS_GetLCDInfoBIOS()
1756 SiS_Pr->PanelHRS = SISGETROMW(10); in SiS_GetLCDInfoBIOS()
1757 SiS_Pr->PanelHRE = SISGETROMW(12); in SiS_GetLCDInfoBIOS()
1758 SiS_Pr->PanelVRS = SISGETROMW(14); in SiS_GetLCDInfoBIOS()
1759 SiS_Pr->PanelVRE = SISGETROMW(16); in SiS_GetLCDInfoBIOS()
1760 SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; in SiS_GetLCDInfoBIOS()
1761 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].CLOCK = in SiS_GetLCDInfoBIOS()
1762 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].CLOCK = (unsigned short)((unsigned char)ROMAddr[18]); in SiS_GetLCDInfoBIOS()
1763 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2B = in SiS_GetLCDInfoBIOS()
1764 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; in SiS_GetLCDInfoBIOS()
1765 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = in SiS_GetLCDInfoBIOS()
1766 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; in SiS_GetLCDInfoBIOS()
1779 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) || in SiS_CheckScaling()
1780 (SiS_Pr->UsePanelScaler == -1)) { in SiS_CheckScaling()
1781 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_CheckScaling()
1791 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; in SiS_GetLCDResInfo() local
1794 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_GetLCDResInfo()
1803 SiS_Pr->SiS_LCDResInfo = 0; in SiS_GetLCDResInfo()
1804 SiS_Pr->SiS_LCDTypeInfo = 0; in SiS_GetLCDResInfo()
1805 SiS_Pr->SiS_LCDInfo = 0; in SiS_GetLCDResInfo()
1806 SiS_Pr->PanelHRS = 999; /* HSync start */ in SiS_GetLCDResInfo()
1807 SiS_Pr->PanelHRE = 999; /* HSync end */ in SiS_GetLCDResInfo()
1808 SiS_Pr->PanelVRS = 999; /* VSync start */ in SiS_GetLCDResInfo()
1809 SiS_Pr->PanelVRE = 999; /* VSync end */ in SiS_GetLCDResInfo()
1810 SiS_Pr->SiS_NeedRomModeData = false; in SiS_GetLCDResInfo()
1813 SiS_Pr->Alternate1600x1200 = false; in SiS_GetLCDResInfo()
1815 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return; in SiS_GetLCDResInfo()
1819 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetLCDResInfo()
1820 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetLCDResInfo()
1821 modexres = SiS_Pr->SiS_ModeResInfo[resinfo].HTotal; in SiS_GetLCDResInfo()
1822 modeyres = SiS_Pr->SiS_ModeResInfo[resinfo].VTotal; in SiS_GetLCDResInfo()
1825 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_GetLCDResInfo()
1828 if(temp == 0) temp = 0x02; in SiS_GetLCDResInfo()
1830 if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_GetLCDResInfo()
1831 SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; in SiS_GetLCDResInfo()
1832 } else if((SiS_Pr->ChipType < SIS_315H) || (SiS_Pr->ChipType >= SIS_661)) { in SiS_GetLCDResInfo()
1833 SiS_Pr->SiS_LCDTypeInfo = temp >> 4; in SiS_GetLCDResInfo()
1835 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; in SiS_GetLCDResInfo()
1837 temp &= 0x0f; in SiS_GetLCDResInfo()
1839 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
1841 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_GetLCDResInfo()
1842 if(temp < 0x0f) temp &= 0x07; in SiS_GetLCDResInfo()
1845 temp = SiS300SeriesLCDRes[temp]; in SiS_GetLCDResInfo()
1851 if(SiS_Pr->ChipType == SIS_550) { in SiS_GetLCDResInfo()
1852 if (temp == Panel310_1152x768) temp = Panel_320x240_2; /* Verified working */ in SiS_GetLCDResInfo()
1853 else if(temp == Panel310_320x240_2) temp = Panel_320x240_2; in SiS_GetLCDResInfo()
1854 else if(temp == Panel310_320x240_3) temp = Panel_320x240_3; in SiS_GetLCDResInfo()
1855 } else if(SiS_Pr->ChipType >= SIS_661) { in SiS_GetLCDResInfo()
1856 if(temp == Panel661_1280x854) temp = Panel_1280x854; in SiS_GetLCDResInfo()
1860 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* SiS LVDS */ in SiS_GetLCDResInfo()
1861 if(temp == Panel310_1280x768) { in SiS_GetLCDResInfo()
1862 temp = Panel_1280x768_2; in SiS_GetLCDResInfo()
1864 if(SiS_Pr->SiS_ROMNew) { in SiS_GetLCDResInfo()
1865 if(temp == Panel661_1280x800) { in SiS_GetLCDResInfo()
1866 temp = Panel_1280x800_2; in SiS_GetLCDResInfo()
1871 SiS_Pr->SiS_LCDResInfo = temp; in SiS_GetLCDResInfo()
1874 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
1875 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetLCDResInfo()
1876 SiS_Pr->SiS_LCDResInfo = Panel_Barco1366; in SiS_GetLCDResInfo()
1877 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { in SiS_GetLCDResInfo()
1878 SiS_Pr->SiS_LCDResInfo = Panel_848x480; in SiS_GetLCDResInfo()
1879 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetLCDResInfo()
1880 SiS_Pr->SiS_LCDResInfo = Panel_856x480; in SiS_GetLCDResInfo()
1885 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1886 if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301) in SiS_GetLCDResInfo()
1887 SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301; in SiS_GetLCDResInfo()
1889 if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS) in SiS_GetLCDResInfo()
1890 SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS; in SiS_GetLCDResInfo()
1893 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_GetLCDResInfo()
1894 SiS_Pr->SiS_LCDInfo = temp & ~0x000e; in SiS_GetLCDResInfo()
1895 /* Need temp below! */ in SiS_GetLCDResInfo()
1898 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
1903 SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; in SiS_GetLCDResInfo()
1906 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1909 panelcanscale = (bool)(SiS_Pr->SiS_LCDInfo & DontExpandLCD); in SiS_GetLCDResInfo()
1911 if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; in SiS_GetLCDResInfo()
1912 else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
1916 if(SiS_Pr->ChipType >= SIS_661) { in SiS_GetLCDResInfo()
1917 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1918 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1920 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_GetLCDResInfo()
1921 if(SiS_Pr->SiS_ROMNew) { in SiS_GetLCDResInfo()
1922 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1924 if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1927 } else if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetLCDResInfo()
1928 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
1929 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1931 if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) { in SiS_GetLCDResInfo()
1932 SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit); in SiS_GetLCDResInfo()
1933 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_GetLCDResInfo()
1934 if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; in SiS_GetLCDResInfo()
1935 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_GetLCDResInfo()
1936 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1938 } else if(!(SiS_Pr->SiS_ROMNew)) { in SiS_GetLCDResInfo()
1939 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_GetLCDResInfo()
1940 if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) && in SiS_GetLCDResInfo()
1941 (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) { in SiS_GetLCDResInfo()
1942 SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1944 if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_GetLCDResInfo()
1945 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_GetLCDResInfo()
1946 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || in SiS_GetLCDResInfo()
1947 (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) { in SiS_GetLCDResInfo()
1948 SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1956 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetLCDResInfo()
1958 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1959 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetLCDResInfo()
1960 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_GetLCDResInfo()
1962 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1965 if(panelcanscale) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1966 if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
1970 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1971 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
1973 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
1976 case Panel_320x240_3: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1977 SiS_Pr->PanelVRS = 24; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1978 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1979 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1981 case Panel_640x480: SiS_Pr->PanelXRes = 640; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
1982 SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
1983 SiS_Pr->PanelVCLKIdx300 = VCLK28; in SiS_GetLCDResInfo()
1984 SiS_Pr->PanelVCLKIdx315 = VCLK28; in SiS_GetLCDResInfo()
1986 case Panel_800x600: SiS_Pr->PanelXRes = 800; SiS_Pr->PanelYRes = 600; in SiS_GetLCDResInfo()
1987 SiS_Pr->PanelHT = 1056; SiS_Pr->PanelVT = 628; in SiS_GetLCDResInfo()
1988 SiS_Pr->PanelHRS = 40; SiS_Pr->PanelHRE = 128; in SiS_GetLCDResInfo()
1989 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 4; in SiS_GetLCDResInfo()
1990 SiS_Pr->PanelVCLKIdx300 = VCLK40; in SiS_GetLCDResInfo()
1991 SiS_Pr->PanelVCLKIdx315 = VCLK40; in SiS_GetLCDResInfo()
1993 case Panel_1024x600: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 600; in SiS_GetLCDResInfo()
1994 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 800; in SiS_GetLCDResInfo()
1995 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
1996 SiS_Pr->PanelVRS = 2 /* 88 */ ; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
1997 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
1998 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
2000 case Panel_1024x768: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2001 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2002 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
2003 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2004 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
2005 SiS_Pr->PanelHRS = 23; in SiS_GetLCDResInfo()
2006 SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
2008 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
2009 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
2012 case Panel_1152x768: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2013 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2014 SiS_Pr->PanelHRS = 24; SiS_Pr->PanelHRE = 136; in SiS_GetLCDResInfo()
2015 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2016 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
2017 SiS_Pr->PanelHRS = 23; in SiS_GetLCDResInfo()
2018 SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
2020 SiS_Pr->PanelVCLKIdx300 = VCLK65_300; in SiS_GetLCDResInfo()
2021 SiS_Pr->PanelVCLKIdx315 = VCLK65_315; in SiS_GetLCDResInfo()
2023 case Panel_1152x864: SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes = 864; in SiS_GetLCDResInfo()
2025 case Panel_1280x720: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 720; in SiS_GetLCDResInfo()
2026 SiS_Pr->PanelHT = 1650; SiS_Pr->PanelVT = 750; in SiS_GetLCDResInfo()
2027 SiS_Pr->PanelHRS = 110; SiS_Pr->PanelHRE = 40; in SiS_GetLCDResInfo()
2028 SiS_Pr->PanelVRS = 5; SiS_Pr->PanelVRE = 5; in SiS_GetLCDResInfo()
2029 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x720; in SiS_GetLCDResInfo()
2033 case Panel_1280x768: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2034 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
2035 SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2036 SiS_Pr->PanelVCLKIdx300 = VCLK81_300; /* ? */ in SiS_GetLCDResInfo()
2037 SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */ in SiS_GetLCDResInfo()
2039 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; in SiS_GetLCDResInfo()
2040 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2041 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2042 SiS_Pr->PanelVCLKIdx300 = VCLK81_300; in SiS_GetLCDResInfo()
2043 SiS_Pr->PanelVCLKIdx315 = VCLK81_315; in SiS_GetLCDResInfo()
2046 case Panel_1280x768_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2047 SiS_Pr->PanelHT = 1660; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2048 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2049 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2050 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2; in SiS_GetLCDResInfo()
2053 case Panel_1280x800: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; in SiS_GetLCDResInfo()
2054 SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 816; in SiS_GetLCDResInfo()
2055 SiS_Pr->PanelHRS = 21; SiS_Pr->PanelHRE = 24; in SiS_GetLCDResInfo()
2056 SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2057 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315; in SiS_GetLCDResInfo()
2060 case Panel_1280x800_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; in SiS_GetLCDResInfo()
2061 SiS_Pr->PanelHT = 1552; SiS_Pr->PanelVT = 812; in SiS_GetLCDResInfo()
2062 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2063 SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2064 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315_2; in SiS_GetLCDResInfo()
2067 case Panel_1280x854: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 854; in SiS_GetLCDResInfo()
2068 SiS_Pr->PanelHT = 1664; SiS_Pr->PanelVT = 861; in SiS_GetLCDResInfo()
2069 SiS_Pr->PanelHRS = 16; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2070 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2071 SiS_Pr->PanelVCLKIdx315 = VCLK_1280x854; in SiS_GetLCDResInfo()
2074 case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960; in SiS_GetLCDResInfo()
2075 SiS_Pr->PanelHT = 1800; SiS_Pr->PanelVT = 1000; in SiS_GetLCDResInfo()
2076 SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; in SiS_GetLCDResInfo()
2077 SiS_Pr->PanelVCLKIdx315 = VCLK108_3_315; in SiS_GetLCDResInfo()
2079 SiS_Pr->PanelVCLKIdx300 = VCLK100_300; in SiS_GetLCDResInfo()
2080 SiS_Pr->PanelVCLKIdx315 = VCLK100_315; in SiS_GetLCDResInfo()
2083 case Panel_1280x1024: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024; in SiS_GetLCDResInfo()
2084 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2085 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2086 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2087 SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300; in SiS_GetLCDResInfo()
2088 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
2091 case Panel_1400x1050: SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050; in SiS_GetLCDResInfo()
2092 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2093 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; in SiS_GetLCDResInfo()
2094 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2095 SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; in SiS_GetLCDResInfo()
2098 case Panel_1600x1200: SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200; in SiS_GetLCDResInfo()
2099 SiS_Pr->PanelHT = 2160; SiS_Pr->PanelVT = 1250; in SiS_GetLCDResInfo()
2100 SiS_Pr->PanelHRS = 64; SiS_Pr->PanelHRE = 192; in SiS_GetLCDResInfo()
2101 SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3; in SiS_GetLCDResInfo()
2102 SiS_Pr->PanelVCLKIdx315 = VCLK162_315; in SiS_GetLCDResInfo()
2103 if(SiS_Pr->SiS_VBType & VB_SISTMDSLCDA) { in SiS_GetLCDResInfo()
2104 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_GetLCDResInfo()
2105 SiS_Pr->PanelHT = 1760; SiS_Pr->PanelVT = 1235; in SiS_GetLCDResInfo()
2106 SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 32; in SiS_GetLCDResInfo()
2107 SiS_Pr->PanelVRS = 2; SiS_Pr->PanelVRE = 4; in SiS_GetLCDResInfo()
2108 SiS_Pr->PanelVCLKIdx315 = VCLK130_315; in SiS_GetLCDResInfo()
2109 SiS_Pr->Alternate1600x1200 = true; in SiS_GetLCDResInfo()
2111 } else if(SiS_Pr->SiS_IF_DEF_LVDS) { in SiS_GetLCDResInfo()
2112 SiS_Pr->PanelHT = 2048; SiS_Pr->PanelVT = 1320; in SiS_GetLCDResInfo()
2113 SiS_Pr->PanelHRS = SiS_Pr->PanelHRE = 999; in SiS_GetLCDResInfo()
2114 SiS_Pr->PanelVRS = SiS_Pr->PanelVRE = 999; in SiS_GetLCDResInfo()
2118 case Panel_1680x1050: SiS_Pr->PanelXRes = 1680; SiS_Pr->PanelYRes = 1050; in SiS_GetLCDResInfo()
2119 SiS_Pr->PanelHT = 1900; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2120 SiS_Pr->PanelHRS = 26; SiS_Pr->PanelHRE = 76; in SiS_GetLCDResInfo()
2121 SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; in SiS_GetLCDResInfo()
2122 SiS_Pr->PanelVCLKIdx315 = VCLK121_315; in SiS_GetLCDResInfo()
2125 case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; in SiS_GetLCDResInfo()
2126 SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; in SiS_GetLCDResInfo()
2128 case Panel_848x480: SiS_Pr->PanelXRes = 848; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
2129 SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; in SiS_GetLCDResInfo()
2131 case Panel_856x480: SiS_Pr->PanelXRes = 856; SiS_Pr->PanelYRes = 480; in SiS_GetLCDResInfo()
2132 SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; in SiS_GetLCDResInfo()
2134 case Panel_Custom: SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX; in SiS_GetLCDResInfo()
2135 SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY; in SiS_GetLCDResInfo()
2136 SiS_Pr->PanelHT = SiS_Pr->CHTotal; in SiS_GetLCDResInfo()
2137 SiS_Pr->PanelVT = SiS_Pr->CVTotal; in SiS_GetLCDResInfo()
2138 if(SiS_Pr->CP_PreferredIndex != -1) { in SiS_GetLCDResInfo()
2139 SiS_Pr->PanelXRes = SiS_Pr->CP_HDisplay[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2140 SiS_Pr->PanelYRes = SiS_Pr->CP_VDisplay[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2141 SiS_Pr->PanelHT = SiS_Pr->CP_HTotal[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2142 SiS_Pr->PanelVT = SiS_Pr->CP_VTotal[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2143 SiS_Pr->PanelHRS = SiS_Pr->CP_HSyncStart[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2144 SiS_Pr->PanelHRE = SiS_Pr->CP_HSyncEnd[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2145 SiS_Pr->PanelVRS = SiS_Pr->CP_VSyncStart[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2146 SiS_Pr->PanelVRE = SiS_Pr->CP_VSyncEnd[SiS_Pr->CP_PreferredIndex]; in SiS_GetLCDResInfo()
2147 SiS_Pr->PanelHRS -= SiS_Pr->PanelXRes; in SiS_GetLCDResInfo()
2148 SiS_Pr->PanelHRE -= SiS_Pr->PanelHRS; in SiS_GetLCDResInfo()
2149 SiS_Pr->PanelVRS -= SiS_Pr->PanelYRes; in SiS_GetLCDResInfo()
2150 SiS_Pr->PanelVRE -= SiS_Pr->PanelVRS; in SiS_GetLCDResInfo()
2151 if(SiS_Pr->CP_PrefClock) { in SiS_GetLCDResInfo()
2153 SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315; in SiS_GetLCDResInfo()
2154 SiS_Pr->PanelVCLKIdx300 = VCLK_CUSTOM_300; in SiS_GetLCDResInfo()
2155 if(SiS_Pr->ChipType < SIS_315H) idx = VCLK_CUSTOM_300; in SiS_GetLCDResInfo()
2157 SiS_Pr->SiS_VCLKData[idx].CLOCK = in SiS_GetLCDResInfo()
2158 SiS_Pr->SiS_VBVCLKData[idx].CLOCK = SiS_Pr->CP_PrefClock; in SiS_GetLCDResInfo()
2159 SiS_Pr->SiS_VCLKData[idx].SR2B = in SiS_GetLCDResInfo()
2160 SiS_Pr->SiS_VBVCLKData[idx].Part4_A = SiS_Pr->CP_PrefSR2B; in SiS_GetLCDResInfo()
2161 SiS_Pr->SiS_VCLKData[idx].SR2C = in SiS_GetLCDResInfo()
2162 SiS_Pr->SiS_VBVCLKData[idx].Part4_B = SiS_Pr->CP_PrefSR2C; in SiS_GetLCDResInfo()
2166 default: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; in SiS_GetLCDResInfo()
2167 SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; in SiS_GetLCDResInfo()
2172 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_GetLCDResInfo()
2173 (SiS_Pr->SiS_IF_DEF_DSTN) || in SiS_GetLCDResInfo()
2174 (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_GetLCDResInfo()
2175 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_GetLCDResInfo()
2176 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLCDResInfo()
2177 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { in SiS_GetLCDResInfo()
2178 SiS_Pr->PanelHRS = 999; in SiS_GetLCDResInfo()
2179 SiS_Pr->PanelHRE = 999; in SiS_GetLCDResInfo()
2182 if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_GetLCDResInfo()
2183 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_GetLCDResInfo()
2184 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLCDResInfo()
2185 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { in SiS_GetLCDResInfo()
2186 SiS_Pr->PanelVRS = 999; in SiS_GetLCDResInfo()
2187 SiS_Pr->PanelVRE = 999; in SiS_GetLCDResInfo()
2191 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_GetLCDResInfo()
2193 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (modeflag & NoSupportLCDScale)) { in SiS_GetLCDResInfo()
2195 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2198 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
2203 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2229 if(SiS_Pr->PanelHT == 1650) { in SiS_GetLCDResInfo()
2230 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2242 case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2243 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2267 case SIS_RI_1280x768: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2268 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2284 case SIS_RI_1280x800: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2285 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2320 case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { in SiS_GetLCDResInfo()
2321 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2324 case SIS_RI_1280x1024: SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetLCDResInfo()
2353 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
2354 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetLCDResInfo()
2355 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ in SiS_GetLCDResInfo()
2359 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLCDResInfo()
2360 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_GetLCDResInfo()
2361 if(SiS_Pr->SiS_UseROM) { in SiS_GetLCDResInfo()
2364 SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); in SiS_GetLCDResInfo()
2368 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_GetLCDResInfo()
2369 if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) { in SiS_GetLCDResInfo()
2370 SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD); in SiS_GetLCDResInfo()
2378 if(modexres == SiS_Pr->PanelXRes && modeyres == SiS_Pr->PanelYRes) { in SiS_GetLCDResInfo()
2379 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2382 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_GetLCDResInfo()
2383 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
2386 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLCDResInfo()
2388 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
2392 if(SiS_Pr->CenterScreen == -1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2395 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2398 if((!SiS_Pr->CP_PrefClock) || in SiS_GetLCDResInfo()
2399 (modexres > SiS_Pr->PanelXRes) || (modeyres > SiS_Pr->PanelYRes)) { in SiS_GetLCDResInfo()
2400 SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
2405 if((SiS_Pr->UseCustomMode) || (SiS_Pr->SiS_CustomT == CUT_UNKNOWNLCD)) { in SiS_GetLCDResInfo()
2406 SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); in SiS_GetLCDResInfo()
2410 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLCDResInfo()
2411 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetLCDResInfo()
2415 if(!((SiS_Pr->ChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) { in SiS_GetLCDResInfo()
2417 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_GetLCDResInfo()
2418 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { in SiS_GetLCDResInfo()
2420 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_GetLCDResInfo()
2421 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2424 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { in SiS_GetLCDResInfo()
2425 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLCDResInfo()
2427 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2436 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 1) { in SiS_GetLCDResInfo()
2437 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2438 } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLCDResInfo()
2439 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2440 } else if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) { in SiS_GetLCDResInfo()
2441 SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2443 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLCDResInfo()
2444 if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2445 } else if(SiS_Pr->SiS_LCDResInfo == Panel_800x600) { in SiS_GetLCDResInfo()
2446 if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA; in SiS_GetLCDResInfo()
2454 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetLCDResInfo()
2455 if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) { in SiS_GetLCDResInfo()
2456 SiS_Pr->SiS_SetFlag |= LCDVESATiming; in SiS_GetLCDResInfo()
2459 SiS_Pr->SiS_SetFlag |= LCDVESATiming; in SiS_GetLCDResInfo()
2464 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); in SiS_GetLCDResInfo()
2481 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_GetVCLK2Ptr()
2482 CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetVCLK2Ptr()
2483 VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03; in SiS_GetVCLK2Ptr()
2486 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetVCLK2Ptr()
2487 CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetVCLK2Ptr()
2488 VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK; in SiS_GetVCLK2Ptr()
2490 (SiS_Pr->SiS_SetFlag & ProgrammingCRT2) ? SiS_Pr->SiS_UseWideCRT2 : SiS_Pr->SiS_UseWide); in SiS_GetVCLK2Ptr()
2493 if(SiS_Pr->SiS_VBType & VB_SISVB) { /* 30x/B/LV */ in SiS_GetVCLK2Ptr()
2495 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetVCLK2Ptr()
2498 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /* LCD */ in SiS_GetVCLK2Ptr()
2500 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2501 VCLKIndex = SiS_Pr->PanelVCLKIdx300; in SiS_GetVCLK2Ptr()
2502 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_GetVCLK2Ptr()
2506 VCLKIndex = SiS_Pr->PanelVCLKIdx315; in SiS_GetVCLK2Ptr()
2507 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_GetVCLK2Ptr()
2524 if(SiS_Pr->ChipType <= SIS_315PRO) { in SiS_GetVCLK2Ptr()
2525 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42; in SiS_GetVCLK2Ptr()
2527 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00; in SiS_GetVCLK2Ptr()
2530 if(SiS_Pr->ChipType <= SIS_315PRO) { in SiS_GetVCLK2Ptr()
2538 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* TV */ in SiS_GetVCLK2Ptr()
2540 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetVCLK2Ptr()
2541 if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = HiTVVCLKDIV2; in SiS_GetVCLK2Ptr()
2543 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) VCLKIndex = HiTVSimuVCLK; in SiS_GetVCLK2Ptr()
2544 } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) VCLKIndex = YPbPr750pVCLK; in SiS_GetVCLK2Ptr()
2545 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) VCLKIndex = TVVCLKDIV2; in SiS_GetVCLK2Ptr()
2546 else if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = TVVCLKDIV2; in SiS_GetVCLK2Ptr()
2549 if(SiS_Pr->ChipType < SIS_315H) VCLKIndex += TVCLKBASE_300; in SiS_GetVCLK2Ptr()
2555 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2557 if( (SiS_Pr->ChipType == SIS_630) && in SiS_GetVCLK2Ptr()
2558 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_GetVCLK2Ptr()
2570 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2572 if( (SiS_Pr->ChipType != SIS_630) && in SiS_GetVCLK2Ptr()
2573 (SiS_Pr->ChipType != SIS_300) ) { in SiS_GetVCLK2Ptr()
2584 if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) { in SiS_GetVCLK2Ptr()
2586 if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) { in SiS_GetVCLK2Ptr()
2590 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2591 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetVCLK2Ptr()
2593 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetVCLK2Ptr()
2594 if(SiS_Pr->SiS_CHSOverScan) tempbx = 8; in SiS_GetVCLK2Ptr()
2596 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_GetVCLK2Ptr()
2598 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2599 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_GetVCLK2Ptr()
2601 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; in SiS_GetVCLK2Ptr()
2605 case 0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC; break; in SiS_GetVCLK2Ptr()
2606 case 1: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKONTSC; break; in SiS_GetVCLK2Ptr()
2607 case 2: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPAL; break; in SiS_GetVCLK2Ptr()
2608 case 3: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; in SiS_GetVCLK2Ptr()
2609 case 4: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALM; break; in SiS_GetVCLK2Ptr()
2610 case 5: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALM; break; in SiS_GetVCLK2Ptr()
2611 case 6: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUPALN; break; in SiS_GetVCLK2Ptr()
2612 case 7: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPALN; break; in SiS_GetVCLK2Ptr()
2613 case 8: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKSOPAL; break; in SiS_GetVCLK2Ptr()
2614 default: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKOPAL; break; in SiS_GetVCLK2Ptr()
2618 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetVCLK2Ptr()
2620 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2621 VCLKIndex = SiS_Pr->PanelVCLKIdx300; in SiS_GetVCLK2Ptr()
2623 VCLKIndex = SiS_Pr->PanelVCLKIdx315; in SiS_GetVCLK2Ptr()
2628 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2631 if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetVCLK2Ptr()
2632 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2645 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2647 if( (SiS_Pr->ChipType == SIS_630) && in SiS_GetVCLK2Ptr()
2648 (SiS_Pr->ChipRevision >= 0x30) ) { in SiS_GetVCLK2Ptr()
2658 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetVCLK2Ptr()
2660 if( (SiS_Pr->ChipType != SIS_630) && in SiS_GetVCLK2Ptr()
2661 (SiS_Pr->ChipType != SIS_300) ) { in SiS_GetVCLK2Ptr()
2665 if(SiS_Pr->ChipType == SIS_730) { in SiS_GetVCLK2Ptr()
2666 if(VCLKIndex == 0x0b) VCLKIndex = 0x40; /* 1024x768-70 */ in SiS_GetVCLK2Ptr()
2667 if(VCLKIndex == 0x0d) VCLKIndex = 0x41; /* 1024x768-75 */ in SiS_GetVCLK2Ptr()
2693 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2ModeRegs()
2699 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetCRT2ModeRegs()
2701 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); in SiS_SetCRT2ModeRegs()
2702 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7); in SiS_SetCRT2ModeRegs()
2706 for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0); in SiS_SetCRT2ModeRegs()
2707 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
2708 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F); in SiS_SetCRT2ModeRegs()
2711 tempcl = SiS_Pr->SiS_ModeType; in SiS_SetCRT2ModeRegs()
2713 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2ModeRegs()
2715 #ifdef CONFIG_FB_SIS_300 /* ---- 300 series ---- */ in SiS_SetCRT2ModeRegs()
2718 if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_SetCRT2ModeRegs()
2719 tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32); in SiS_SetCRT2ModeRegs()
2722 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2ModeRegs()
2726 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl); in SiS_SetCRT2ModeRegs()
2730 tempcl -= ModeVGA; in SiS_SetCRT2ModeRegs()
2736 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; in SiS_SetCRT2ModeRegs()
2742 #ifdef CONFIG_FB_SIS_315 /* ------- 315/330 series ------ */ in SiS_SetCRT2ModeRegs()
2745 tempcl -= ModeVGA; in SiS_SetCRT2ModeRegs()
2753 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; in SiS_SetCRT2ModeRegs()
2759 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2761 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2ModeRegs()
2762 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2765 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2ModeRegs()
2766 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2767 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2769 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2771 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2777 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2780 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ModeRegs()
2783 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2ModeRegs()
2785 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetCRT2ModeRegs()
2790 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2ModeRegs()
2792 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2795 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2800 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x08; in SiS_SetCRT2ModeRegs()
2802 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2807 if((SiS_Pr->SiS_ModeType == ModeVGA) && (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { in SiS_SetCRT2ModeRegs()
2812 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2813 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah &= ~0x80; in SiS_SetCRT2ModeRegs()
2816 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2817 if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetYPbPr525p))) { in SiS_SetCRT2ModeRegs()
2818 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT2ModeRegs()
2824 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah); in SiS_SetCRT2ModeRegs()
2827 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2828 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah = 0; in SiS_SetCRT2ModeRegs()
2833 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2ModeRegs()
2834 if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) { in SiS_SetCRT2ModeRegs()
2839 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah); in SiS_SetCRT2ModeRegs()
2843 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
2848 if((modeflag & CRT2Mode) && (SiS_Pr->SiS_ModeType > ModeVGA)) { in SiS_SetCRT2ModeRegs()
2849 if(SiS_Pr->SiS_VBInfo & DriverMode) { in SiS_SetCRT2ModeRegs()
2854 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2856 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah ^= 0x01; in SiS_SetCRT2ModeRegs()
2858 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 1; in SiS_SetCRT2ModeRegs()
2860 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2867 if( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) && (SiS_Pr->SiS_ModeType > ModeVGA) ) { in SiS_SetCRT2ModeRegs()
2872 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2874 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2883 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2ModeRegs()
2885 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
2888 /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ in SiS_SetCRT2ModeRegs()
2893 * NoLCD-if-statements here), some set them according to the in SiS_SetCRT2ModeRegs()
2895 * treated correctly in the following, very case-orientated in SiS_SetCRT2ModeRegs()
2899 /* 740 variants match for 30xB, 301B-DH, 30xLV */ in SiS_SetCRT2ModeRegs()
2904 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2910 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2917 * Addendum: Another combination 651+301B-DH(b1) (Rapo) needs same in SiS_SetCRT2ModeRegs()
2918 * treatment like the 651+301B-DH(b0) case. Seems more to be the in SiS_SetCRT2ModeRegs()
2922 if((IS_SIS740) || (SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_SetCRT2ModeRegs()
2925 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || in SiS_SetCRT2ModeRegs()
2926 ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) { in SiS_SetCRT2ModeRegs()
2930 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah); in SiS_SetCRT2ModeRegs()
2931 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl); in SiS_SetCRT2ModeRegs()
2932 } else if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetCRT2ModeRegs()
2933 /* Fixes "TV-blue-bug" on 315+301 */ in SiS_SetCRT2ModeRegs()
2934 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf); /* For 301 */ in SiS_SetCRT2ModeRegs()
2935 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2936 } else if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_SetCRT2ModeRegs()
2937 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xLV */ in SiS_SetCRT2ModeRegs()
2938 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); in SiS_SetCRT2ModeRegs()
2939 } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { /* For 301B-DH */ in SiS_SetCRT2ModeRegs()
2942 if(SiS_Pr->SiS_TVBlue == 0) { in SiS_SetCRT2ModeRegs()
2944 } else if(SiS_Pr->SiS_TVBlue == -1) { in SiS_SetCRT2ModeRegs()
2950 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2951 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2955 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2961 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2962 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2967 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00; in SiS_SetCRT2ModeRegs()
2968 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah); in SiS_SetCRT2ModeRegs()
2972 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
2976 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2981 } else if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2ModeRegs()
2984 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2986 if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) || in SiS_SetCRT2ModeRegs()
2987 ((SiS_Pr->SiS_VBType & VB_NoLCD) && in SiS_SetCRT2ModeRegs()
2988 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD))) { in SiS_SetCRT2ModeRegs()
2989 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F); in SiS_SetCRT2ModeRegs()
2991 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80); in SiS_SetCRT2ModeRegs()
2997 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2ModeRegs()
2998 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x0D,0x80); in SiS_SetCRT2ModeRegs()
2999 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { in SiS_SetCRT2ModeRegs()
3000 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3A,0xC0); in SiS_SetCRT2ModeRegs()
3007 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2ModeRegs()
3009 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2ModeRegs()
3013 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ModeRegs()
3017 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
3019 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2ModeRegs()
3020 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3023 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3025 } else if(SiS_Pr->ChipType == SIS_550) { in SiS_SetCRT2ModeRegs()
3027 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3028 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3047 return ((unsigned short)SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo); in SiS_GetResInfo()
3049 return ((unsigned short)SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO); in SiS_GetResInfo()
3057 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2ResInfo()
3058 xres = SiS_Pr->CHDisplay; in SiS_GetCRT2ResInfo()
3059 if(SiS_Pr->CModeFlag & HalfDCLK) xres <<= 1; in SiS_GetCRT2ResInfo()
3060 SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; in SiS_GetCRT2ResInfo()
3061 /* DoubleScanMode-check done in CheckCalcCustomMode()! */ in SiS_GetCRT2ResInfo()
3062 SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = SiS_Pr->CVDisplay; in SiS_GetCRT2ResInfo()
3069 xres = SiS_Pr->SiS_StResInfo[resindex].HTotal; in SiS_GetCRT2ResInfo()
3070 yres = SiS_Pr->SiS_StResInfo[resindex].VTotal; in SiS_GetCRT2ResInfo()
3072 xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal; in SiS_GetCRT2ResInfo()
3073 yres = SiS_Pr->SiS_ModeResInfo[resindex].VTotal; in SiS_GetCRT2ResInfo()
3074 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetCRT2ResInfo()
3077 if(!SiS_Pr->SiS_IF_DEF_DSTN && !SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_GetCRT2ResInfo()
3079 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) { in SiS_GetCRT2ResInfo()
3080 if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetCRT2ResInfo()
3083 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) { in SiS_GetCRT2ResInfo()
3093 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_GetCRT2ResInfo()
3095 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetCRT2ResInfo()
3096 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2ResInfo()
3098 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2ResInfo()
3099 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2ResInfo()
3107 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2ResInfo()
3108 /* BIOS bug - does this regardless of scaling */ in SiS_GetCRT2ResInfo()
3112 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_GetCRT2ResInfo()
3117 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2ResInfo()
3126 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2ResInfo()
3127 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) { in SiS_GetCRT2ResInfo()
3132 if(SiS_Pr->SiS_SetFlag & SetDOSMode) { in SiS_GetCRT2ResInfo()
3134 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_GetCRT2ResInfo()
3135 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3137 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3139 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) yres = 480; in SiS_GetCRT2ResInfo()
3143 SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres; in SiS_GetCRT2ResInfo()
3144 SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres; in SiS_GetCRT2ResInfo()
3159 tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2Ptr()
3161 tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetCRT2Ptr()
3162 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetCRT2Ptr()
3165 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) { in SiS_GetCRT2Ptr()
3167 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { /* LCD */ in SiS_GetCRT2Ptr()
3169 tempbx = SiS_Pr->SiS_LCDResInfo; in SiS_GetCRT2Ptr()
3170 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 32; in SiS_GetCRT2Ptr()
3173 if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) { in SiS_GetCRT2Ptr()
3176 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x800) || in SiS_GetCRT2Ptr()
3177 (SiS_Pr->SiS_LCDResInfo == Panel_1280x800_2) || in SiS_GetCRT2Ptr()
3178 (SiS_Pr->SiS_LCDResInfo == Panel_1280x854)) { in SiS_GetCRT2Ptr()
3182 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetCRT2Ptr()
3183 /* Pass 1:1 only (center-screen handled outside) */ in SiS_GetCRT2Ptr()
3188 tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; in SiS_GetCRT2Ptr()
3193 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_GetCRT2Ptr()
3194 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_GetCRT2Ptr()
3195 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetCRT2Ptr()
3197 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; in SiS_GetCRT2Ptr()
3205 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetCRT2Ptr()
3206 /* if(SiS_Pr->SiS_VGAVDE > 480) SiS_Pr->SiS_TVMode &= (~TVSetTVSimuMode); */ in SiS_GetCRT2Ptr()
3208 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetCRT2Ptr()
3210 if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) tempbx = 14; in SiS_GetCRT2Ptr()
3212 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3213 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempbx = 7; in SiS_GetCRT2Ptr()
3214 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempbx = 6; in SiS_GetCRT2Ptr()
3216 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; in SiS_GetCRT2Ptr()
3218 if(SiS_Pr->SiS_TVMode & TVSetPAL) tempbx = 3; in SiS_GetCRT2Ptr()
3220 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) tempbx += 5; in SiS_GetCRT2Ptr()
3228 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) { in SiS_GetCRT2Ptr()
3232 if(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetPALN)) tempal = 9; in SiS_GetCRT2Ptr()
3238 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3239 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 8; in SiS_GetCRT2Ptr()
3248 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3249 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tempal = 8; in SiS_GetCRT2Ptr()
3253 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Ptr()
3254 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempal = 9; in SiS_GetCRT2Ptr()
3264 } else { /* LVDS, 301B-DH (if running on LCD) */ in SiS_GetCRT2Ptr()
3267 if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetCRT2Ptr()
3270 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetCRT2Ptr()
3272 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetCRT2Ptr()
3273 if(SiS_Pr->SiS_CHSOverScan) tempbx = 99; in SiS_GetCRT2Ptr()
3275 if(SiS_Pr->SiS_TVMode & TVSetPALM) tempbx = 94; in SiS_GetCRT2Ptr()
3276 else if(SiS_Pr->SiS_TVMode & TVSetPALN) tempbx = 96; in SiS_GetCRT2Ptr()
3279 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++; in SiS_GetCRT2Ptr()
3284 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Ptr()
3302 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Ptr()
3309 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
3312 if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 30; in SiS_GetCRT2Ptr()
3315 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SiS_GetCRT2Ptr()
3317 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
3318 } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848 || SiS_Pr->SiS_CustomT == CUT_PANEL856) { in SiS_GetCRT2Ptr()
3320 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in SiS_GetCRT2Ptr()
3338 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetRAMDAC2DATA()
3339 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetRAMDAC2DATA()
3343 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetRAMDAC2DATA()
3346 tempax = SiS_Pr->SiS_StandTable[index].CRTC[0]; in SiS_GetRAMDAC2DATA()
3347 tempbx = SiS_Pr->SiS_StandTable[index].CRTC[6]; in SiS_GetRAMDAC2DATA()
3348 temp1 = SiS_Pr->SiS_StandTable[index].CRTC[7]; in SiS_GetRAMDAC2DATA()
3354 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetRAMDAC2DATA()
3355 index = SiS_GetRefCRT1CRTC(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWideCRT2); in SiS_GetRAMDAC2DATA()
3357 tempax = SiS_Pr->SiS_CRT1Table[index].CR[0]; in SiS_GetRAMDAC2DATA()
3358 tempax |= (SiS_Pr->SiS_CRT1Table[index].CR[14] << 8); in SiS_GetRAMDAC2DATA()
3360 tempbx = SiS_Pr->SiS_CRT1Table[index].CR[6]; in SiS_GetRAMDAC2DATA()
3361 tempcx = SiS_Pr->SiS_CRT1Table[index].CR[13] << 8; in SiS_GetRAMDAC2DATA()
3365 temp1 = SiS_Pr->SiS_CRT1Table[index].CR[7]; in SiS_GetRAMDAC2DATA()
3380 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetRAMDAC2DATA()
3381 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = tempbx; in SiS_GetRAMDAC2DATA()
3390 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcPanelLinkTiming()
3391 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_CalcPanelLinkTiming()
3392 if(SiS_Pr->UseCustomMode) { in SiS_CalcPanelLinkTiming()
3393 ResIndex = SiS_Pr->CHTotal; in SiS_CalcPanelLinkTiming()
3394 if(SiS_Pr->CModeFlag & HalfDCLK) ResIndex <<= 1; in SiS_CalcPanelLinkTiming()
3395 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = ResIndex; in SiS_CalcPanelLinkTiming()
3396 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_CalcPanelLinkTiming()
3399 ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_CalcPanelLinkTiming()
3401 ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS; in SiS_CalcPanelLinkTiming()
3404 if(SiS_Pr->Alternate1600x1200) ResIndex = 0x20; /* 1600x1200 LCDA */ in SiS_CalcPanelLinkTiming()
3405 else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) ResIndex = 0x21; /* 1600x1200 LVDS */ in SiS_CalcPanelLinkTiming()
3407 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAHT; in SiS_CalcPanelLinkTiming()
3408 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAVT; in SiS_CalcPanelLinkTiming()
3409 SiS_Pr->SiS_HT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDHT; in SiS_CalcPanelLinkTiming()
3410 SiS_Pr->SiS_VT = SiS_Pr->SiS_NoScaleData[ResIndex].LCDVT; in SiS_CalcPanelLinkTiming()
3413 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_CalcPanelLinkTiming()
3414 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_CalcPanelLinkTiming()
3417 /* This handles custom modes and custom panels */ in SiS_CalcPanelLinkTiming()
3418 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; in SiS_CalcPanelLinkTiming()
3419 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; in SiS_CalcPanelLinkTiming()
3420 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_CalcPanelLinkTiming()
3421 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_CalcPanelLinkTiming()
3422 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT - (SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE); in SiS_CalcPanelLinkTiming()
3423 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT - (SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE); in SiS_CalcPanelLinkTiming()
3436 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2DataLVDS()
3437 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2DataLVDS()
3438 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2DataLVDS()
3439 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2DataLVDS()
3440 SiS_Pr->SiS_RVBHRS = 50; in SiS_GetCRT2DataLVDS()
3441 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2DataLVDS()
3442 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2DataLVDS()
3443 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2DataLVDS()
3444 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2DataLVDS()
3445 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2DataLVDS()
3448 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetCRT2DataLVDS()
3458 backup = SiS_Pr->SiS_IF_DEF_LVDS; in SiS_GetCRT2DataLVDS()
3459 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2DataLVDS()
3460 SiS_Pr->SiS_IF_DEF_LVDS = 1; in SiS_GetCRT2DataLVDS()
3466 SiS_Pr->SiS_IF_DEF_LVDS = backup; in SiS_GetCRT2DataLVDS()
3469 case 10: LVDSData = SiS_Pr->SiS_LVDS320x240Data_1; break; in SiS_GetCRT2DataLVDS()
3470 case 14: LVDSData = SiS_Pr->SiS_LVDS320x240Data_2; break; in SiS_GetCRT2DataLVDS()
3471 case 12: LVDSData = SiS_Pr->SiS_LVDS640x480Data_1; break; in SiS_GetCRT2DataLVDS()
3472 case 16: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1; break; in SiS_GetCRT2DataLVDS()
3473 case 18: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1; break; in SiS_GetCRT2DataLVDS()
3474 case 20: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1; break; in SiS_GetCRT2DataLVDS()
3476 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1; break; in SiS_GetCRT2DataLVDS()
3477 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2; break; in SiS_GetCRT2DataLVDS()
3478 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1; break; in SiS_GetCRT2DataLVDS()
3479 case 84: LVDSData = SiS_Pr->SiS_LVDS848x480Data_1; break; in SiS_GetCRT2DataLVDS()
3480 case 85: LVDSData = SiS_Pr->SiS_LVDS848x480Data_2; break; in SiS_GetCRT2DataLVDS()
3482 case 90: LVDSData = SiS_Pr->SiS_CHTVUNTSCData; break; in SiS_GetCRT2DataLVDS()
3483 case 91: LVDSData = SiS_Pr->SiS_CHTVONTSCData; break; in SiS_GetCRT2DataLVDS()
3484 case 92: LVDSData = SiS_Pr->SiS_CHTVUPALData; break; in SiS_GetCRT2DataLVDS()
3485 case 93: LVDSData = SiS_Pr->SiS_CHTVOPALData; break; in SiS_GetCRT2DataLVDS()
3486 case 94: LVDSData = SiS_Pr->SiS_CHTVUPALMData; break; in SiS_GetCRT2DataLVDS()
3487 case 95: LVDSData = SiS_Pr->SiS_CHTVOPALMData; break; in SiS_GetCRT2DataLVDS()
3488 case 96: LVDSData = SiS_Pr->SiS_CHTVUPALNData; break; in SiS_GetCRT2DataLVDS()
3489 case 97: LVDSData = SiS_Pr->SiS_CHTVOPALNData; break; in SiS_GetCRT2DataLVDS()
3490 case 99: LVDSData = SiS_Pr->SiS_CHTVSOPALData; break; in SiS_GetCRT2DataLVDS()
3494 SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT; in SiS_GetCRT2DataLVDS()
3495 SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT; in SiS_GetCRT2DataLVDS()
3496 SiS_Pr->SiS_HT = (LVDSData+ResIndex)->LCDHT; in SiS_GetCRT2DataLVDS()
3497 SiS_Pr->SiS_VT = (LVDSData+ResIndex)->LCDVT; in SiS_GetCRT2DataLVDS()
3502 if( (!(SiS_Pr->SiS_VBType & VB_SISVB)) && in SiS_GetCRT2DataLVDS()
3503 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && in SiS_GetCRT2DataLVDS()
3504 (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) ) { in SiS_GetCRT2DataLVDS()
3505 if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || in SiS_GetCRT2DataLVDS()
3506 (SiS_Pr->SiS_SetFlag & SetDOSMode) ) { in SiS_GetCRT2DataLVDS()
3507 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes; in SiS_GetCRT2DataLVDS()
3508 SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes; in SiS_GetCRT2DataLVDS()
3510 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetCRT2DataLVDS()
3512 SiS_Pr->SiS_HDE = 1280; in SiS_GetCRT2DataLVDS()
3513 SiS_Pr->SiS_VDE = 1024; in SiS_GetCRT2DataLVDS()
3536 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetCRT2Data301()
3537 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_GetCRT2Data301()
3538 } else if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3539 modeflag = SiS_Pr->CModeFlag; in SiS_GetCRT2Data301()
3542 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetCRT2Data301()
3543 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_GetCRT2Data301()
3545 resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661; in SiS_GetCRT2Data301()
3546 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && in SiS_GetCRT2Data301()
3547 (SiS_Pr->SiS_SetFlag & LCDVESATiming) && in SiS_GetCRT2Data301()
3549 (SiS_Pr->SiS_NeedRomModeData) ) { in SiS_GetCRT2Data301()
3553 ROMAddr = SiS_Pr->VirtualRomBase; in SiS_GetCRT2Data301()
3560 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2Data301()
3561 SiS_Pr->SiS_RVBHRS = 50; in SiS_GetCRT2Data301()
3562 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2Data301()
3563 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2Data301()
3564 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2Data301()
3565 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2Data301()
3566 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3570 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_GetCRT2Data301()
3572 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3574 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3575 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3576 SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3577 SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3579 tempax = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3581 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetCRT2Data301()
3582 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3590 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_GetCRT2Data301()
3596 case 2: TVPtr = SiS_Pr->SiS_ExtHiTVData; break; in SiS_GetCRT2Data301()
3597 case 3: TVPtr = SiS_Pr->SiS_ExtPALData; break; in SiS_GetCRT2Data301()
3598 case 4: TVPtr = SiS_Pr->SiS_ExtNTSCData; break; in SiS_GetCRT2Data301()
3599 case 5: TVPtr = SiS_Pr->SiS_Ext525iData; break; in SiS_GetCRT2Data301()
3600 case 6: TVPtr = SiS_Pr->SiS_Ext525pData; break; in SiS_GetCRT2Data301()
3601 case 7: TVPtr = SiS_Pr->SiS_Ext750pData; break; in SiS_GetCRT2Data301()
3602 case 8: TVPtr = SiS_Pr->SiS_StPALData; break; in SiS_GetCRT2Data301()
3603 case 9: TVPtr = SiS_Pr->SiS_StNTSCData; break; in SiS_GetCRT2Data301()
3604 case 10: TVPtr = SiS_Pr->SiS_St525iData; break; in SiS_GetCRT2Data301()
3605 case 11: TVPtr = SiS_Pr->SiS_St525pData; break; in SiS_GetCRT2Data301()
3606 case 12: TVPtr = SiS_Pr->SiS_St750pData; break; in SiS_GetCRT2Data301()
3607 case 13: TVPtr = SiS_Pr->SiS_St1HiTVData; break; in SiS_GetCRT2Data301()
3608 case 14: TVPtr = SiS_Pr->SiS_St2HiTVData; break; in SiS_GetCRT2Data301()
3609 default: TVPtr = SiS_Pr->SiS_StPALData; break; in SiS_GetCRT2Data301()
3612 SiS_Pr->SiS_RVBHCMAX = (TVPtr+ResIndex)->RVBHCMAX; in SiS_GetCRT2Data301()
3613 SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT; in SiS_GetCRT2Data301()
3614 SiS_Pr->SiS_VGAHT = (TVPtr+ResIndex)->VGAHT; in SiS_GetCRT2Data301()
3615 SiS_Pr->SiS_VGAVT = (TVPtr+ResIndex)->VGAVT; in SiS_GetCRT2Data301()
3616 SiS_Pr->SiS_HDE = (TVPtr+ResIndex)->TVHDE; in SiS_GetCRT2Data301()
3617 SiS_Pr->SiS_VDE = (TVPtr+ResIndex)->TVVDE; in SiS_GetCRT2Data301()
3618 SiS_Pr->SiS_RVBHRS2 = (TVPtr+ResIndex)->RVBHRS2 & 0x0fff; in SiS_GetCRT2Data301()
3620 SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->HALFRVBHRS; in SiS_GetCRT2Data301()
3621 if(SiS_Pr->SiS_RVBHRS2) { in SiS_GetCRT2Data301()
3622 SiS_Pr->SiS_RVBHRS2 = ((SiS_Pr->SiS_RVBHRS2 + 3) >> 1) - 3; in SiS_GetCRT2Data301()
3623 tempax = ((TVPtr+ResIndex)->RVBHRS2 >> 12) & 0x07; in SiS_GetCRT2Data301()
3624 if((TVPtr+ResIndex)->RVBHRS2 & 0x8000) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3625 else SiS_Pr->SiS_RVBHRS2 += tempax; in SiS_GetCRT2Data301()
3628 SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->RVBHRS; in SiS_GetCRT2Data301()
3630 SiS_Pr->SiS_NewFlickerMode = ((TVPtr+ResIndex)->FlickerMode) << 7; in SiS_GetCRT2Data301()
3632 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetCRT2Data301()
3638 SiS_Pr->SiS_NewFlickerMode = 0x40; in SiS_GetCRT2Data301()
3641 if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_TVMode |= TVSetTVSimuMode; in SiS_GetCRT2Data301()
3643 SiS_Pr->SiS_HT = ExtHiTVHT; in SiS_GetCRT2Data301()
3644 SiS_Pr->SiS_VT = ExtHiTVVT; in SiS_GetCRT2Data301()
3645 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_GetCRT2Data301()
3646 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_GetCRT2Data301()
3647 SiS_Pr->SiS_HT = StHiTVHT; in SiS_GetCRT2Data301()
3648 SiS_Pr->SiS_VT = StHiTVVT; in SiS_GetCRT2Data301()
3652 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetCRT2Data301()
3654 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_GetCRT2Data301()
3655 SiS_Pr->SiS_HT = 1650; in SiS_GetCRT2Data301()
3656 SiS_Pr->SiS_VT = 750; in SiS_GetCRT2Data301()
3657 } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_GetCRT2Data301()
3658 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3659 if(SiS_Pr->SiS_TVMode & TVSet525p1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3660 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3662 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3663 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3664 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3669 SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE; in SiS_GetCRT2Data301()
3670 SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE; in SiS_GetCRT2Data301()
3671 SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE; in SiS_GetCRT2Data301()
3672 SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE; in SiS_GetCRT2Data301()
3675 SiS_Pr->SiS_RY1COE = 0x00; in SiS_GetCRT2Data301()
3676 SiS_Pr->SiS_RY2COE = 0xf4; in SiS_GetCRT2Data301()
3677 SiS_Pr->SiS_RY3COE = 0x10; in SiS_GetCRT2Data301()
3678 SiS_Pr->SiS_RY4COE = 0x38; in SiS_GetCRT2Data301()
3681 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_GetCRT2Data301()
3682 SiS_Pr->SiS_HT = NTSCHT; in SiS_GetCRT2Data301()
3683 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT; in SiS_GetCRT2Data301()
3684 SiS_Pr->SiS_VT = NTSCVT; in SiS_GetCRT2Data301()
3686 SiS_Pr->SiS_HT = PALHT; in SiS_GetCRT2Data301()
3687 SiS_Pr->SiS_VT = PALVT; in SiS_GetCRT2Data301()
3692 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetCRT2Data301()
3694 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3695 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3697 if(SiS_Pr->UseCustomMode) { in SiS_GetCRT2Data301()
3699 SiS_Pr->SiS_HDE = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3700 SiS_Pr->SiS_VDE = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3702 tempax = SiS_Pr->CHTotal; in SiS_GetCRT2Data301()
3704 SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; in SiS_GetCRT2Data301()
3705 SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; in SiS_GetCRT2Data301()
3711 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_GetCRT2Data301()
3713 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3714 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3715 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3716 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3719 } else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) { in SiS_GetCRT2Data301()
3722 SiS_Pr->SiS_RVBHCMAX = ROMAddr[romptr]; in SiS_GetCRT2Data301()
3723 SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1]; in SiS_GetCRT2Data301()
3724 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); in SiS_GetCRT2Data301()
3725 SiS_Pr->SiS_VGAVT = (ROMAddr[romptr+4] << 4) | ((ROMAddr[romptr+3] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3726 SiS_Pr->SiS_HT = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8); in SiS_GetCRT2Data301()
3727 SiS_Pr->SiS_VT = (ROMAddr[romptr+7] << 4) | ((ROMAddr[romptr+6] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3728 SiS_Pr->SiS_RVBHRS2 = ROMAddr[romptr+8] | ((ROMAddr[romptr+9] & 0x0f) << 8); in SiS_GetCRT2Data301()
3729 if((SiS_Pr->SiS_RVBHRS2) && (modeflag & HalfDCLK)) { in SiS_GetCRT2Data301()
3730 SiS_Pr->SiS_RVBHRS2 = ((SiS_Pr->SiS_RVBHRS2 + 3) >> 1) - 3; in SiS_GetCRT2Data301()
3732 if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3733 else SiS_Pr->SiS_RVBHRS2 += tempax; in SiS_GetCRT2Data301()
3735 if(SiS_Pr->SiS_VGAHT) gotit = true; in SiS_GetCRT2Data301()
3737 SiS_Pr->SiS_LCDInfo |= DontExpandLCD; in SiS_GetCRT2Data301()
3738 SiS_Pr->SiS_LCDInfo &= ~LCDPass11; in SiS_GetCRT2Data301()
3739 SiS_Pr->SiS_RVBHCMAX = 1; in SiS_GetCRT2Data301()
3740 SiS_Pr->SiS_RVBHCFACT = 1; in SiS_GetCRT2Data301()
3741 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3742 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3743 SiS_Pr->SiS_HT = SiS_Pr->PanelHT; in SiS_GetCRT2Data301()
3744 SiS_Pr->SiS_VT = SiS_Pr->PanelVT; in SiS_GetCRT2Data301()
3745 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3758 case Panel_1024x768 : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; in SiS_GetCRT2Data301()
3759 case Panel_1024x768 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data; break; in SiS_GetCRT2Data301()
3761 case Panel_1280x720 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x720Data; break; in SiS_GetCRT2Data301()
3762 case Panel_1280x768_2 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x768_2Data; break; in SiS_GetCRT2Data301()
3763 case Panel_1280x768_2+ 32: LCDPtr = SiS_Pr->SiS_StLCD1280x768_2Data; break; in SiS_GetCRT2Data301()
3765 case Panel_1280x800 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x800Data; break; in SiS_GetCRT2Data301()
3767 case Panel_1280x800_2+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x800_2Data; break; in SiS_GetCRT2Data301()
3769 case Panel_1280x854 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x854Data; break; in SiS_GetCRT2Data301()
3771 case Panel_1280x960 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data; break; in SiS_GetCRT2Data301()
3772 case Panel_1280x1024 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data; break; in SiS_GetCRT2Data301()
3773 case Panel_1280x1024 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; in SiS_GetCRT2Data301()
3774 case Panel_1400x1050 : LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data; break; in SiS_GetCRT2Data301()
3775 case Panel_1400x1050 + 32: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data; break; in SiS_GetCRT2Data301()
3776 case Panel_1600x1200 : LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data; break; in SiS_GetCRT2Data301()
3777 case Panel_1600x1200 + 32: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data; break; in SiS_GetCRT2Data301()
3779 case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data; break; in SiS_GetCRT2Data301()
3780 case 100 : LCDPtr = SiS_Pr->SiS_NoScaleData; break; in SiS_GetCRT2Data301()
3783 case 201 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data; break; in SiS_GetCRT2Data301()
3785 default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; in SiS_GetCRT2Data301()
3788 SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; in SiS_GetCRT2Data301()
3789 SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; in SiS_GetCRT2Data301()
3790 SiS_Pr->SiS_VGAHT = (LCDPtr+ResIndex)->VGAHT; in SiS_GetCRT2Data301()
3791 SiS_Pr->SiS_VGAVT = (LCDPtr+ResIndex)->VGAVT; in SiS_GetCRT2Data301()
3792 SiS_Pr->SiS_HT = (LCDPtr+ResIndex)->LCDHT; in SiS_GetCRT2Data301()
3793 SiS_Pr->SiS_VT = (LCDPtr+ResIndex)->LCDVT; in SiS_GetCRT2Data301()
3797 tempax = SiS_Pr->PanelXRes; in SiS_GetCRT2Data301()
3798 tempbx = SiS_Pr->PanelYRes; in SiS_GetCRT2Data301()
3800 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetCRT2Data301()
3802 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_GetCRT2Data301()
3803 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetCRT2Data301()
3804 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; in SiS_GetCRT2Data301()
3805 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; in SiS_GetCRT2Data301()
3808 if (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527; in SiS_GetCRT2Data301()
3809 else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620; in SiS_GetCRT2Data301()
3810 else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775; in SiS_GetCRT2Data301()
3811 else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775; in SiS_GetCRT2Data301()
3812 else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560; in SiS_GetCRT2Data301()
3813 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640; in SiS_GetCRT2Data301()
3817 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 700; in SiS_GetCRT2Data301()
3818 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 800; in SiS_GetCRT2Data301()
3819 else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960; in SiS_GetCRT2Data301()
3822 if (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768; in SiS_GetCRT2Data301()
3823 else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800; in SiS_GetCRT2Data301()
3824 else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864; in SiS_GetCRT2Data301()
3827 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2Data301()
3828 if (SiS_Pr->SiS_VGAVDE == 350) tempbx = 875; in SiS_GetCRT2Data301()
3829 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 1000; in SiS_GetCRT2Data301()
3834 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetCRT2Data301()
3835 tempax = SiS_Pr->SiS_VGAHDE; in SiS_GetCRT2Data301()
3836 tempbx = SiS_Pr->SiS_VGAVDE; in SiS_GetCRT2Data301()
3839 SiS_Pr->SiS_HDE = tempax; in SiS_GetCRT2Data301()
3840 SiS_Pr->SiS_VDE = tempbx; in SiS_GetCRT2Data301()
3850 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_GetCRT2Data()
3852 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_GetCRT2Data()
3855 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_GetCRT2Data()
3856 /* Need LVDS Data for LCD on 301B-DH */ in SiS_GetCRT2Data()
3880 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetLVDSDesPtr()
3882 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesPtr()
3883 if(SiS_Pr->SiS_LCDTypeInfo == 4) { in SiS_GetLVDSDesPtr()
3884 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SiS_GetLVDSDesPtr()
3885 PanelDesPtr = SiS_Pr->SiS_PanelType04_1a; in SiS_GetLVDSDesPtr()
3886 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesPtr()
3887 PanelDesPtr = SiS_Pr->SiS_PanelType04_2a; in SiS_GetLVDSDesPtr()
3889 } else if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SiS_GetLVDSDesPtr()
3890 PanelDesPtr = SiS_Pr->SiS_PanelType04_1b; in SiS_GetLVDSDesPtr()
3891 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesPtr()
3892 PanelDesPtr = SiS_Pr->SiS_PanelType04_2b; in SiS_GetLVDSDesPtr()
3909 SiS_Pr->SiS_LCDHDES = 0; in SiS_GetLVDSDesData()
3910 SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
3913 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_GetLVDSDesData()
3916 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_GetLVDSDesData()
3917 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLVDSDesData()
3918 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3919 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3926 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
3927 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480 && SiS_Pr->SiS_LCDTypeInfo == 3) { in SiS_GetLVDSDesData()
3928 SiS_Pr->SiS_LCDHDES = 8; in SiS_GetLVDSDesData()
3929 if (SiS_Pr->SiS_VGAVDE >= 480) SiS_Pr->SiS_LCDVDES = 512; in SiS_GetLVDSDesData()
3930 else if(SiS_Pr->SiS_VGAVDE >= 400) SiS_Pr->SiS_LCDVDES = 436; in SiS_GetLVDSDesData()
3931 else if(SiS_Pr->SiS_VGAVDE >= 350) SiS_Pr->SiS_LCDVDES = 440; in SiS_GetLVDSDesData()
3938 if( (SiS_Pr->UseCustomMode) || in SiS_GetLVDSDesData()
3939 (SiS_Pr->SiS_LCDResInfo == Panel_Custom) || in SiS_GetLVDSDesData()
3940 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_GetLVDSDesData()
3941 (SiS_Pr->SiS_CustomT == CUT_PANEL856) || in SiS_GetLVDSDesData()
3942 (SiS_Pr->SiS_LCDInfo & LCDPass11) ) { in SiS_GetLVDSDesData()
3946 if(ModeNo <= 0x13) ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSDesData()
3947 else ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetLVDSDesData()
3949 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSDesData()
3952 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesData()
3953 /* non-pass 1:1 only, see above */ in SiS_GetLVDSDesData()
3954 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { in SiS_GetLVDSDesData()
3955 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); in SiS_GetLVDSDesData()
3957 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3958 SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); in SiS_GetLVDSDesData()
3961 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
3962 switch(SiS_Pr->SiS_CustomT) { in SiS_GetLVDSDesData()
3966 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetLVDSDesData()
3967 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3971 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
3973 if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) { in SiS_GetLVDSDesData()
3974 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3980 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
3988 if((SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSDesData()
3990 if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) { in SiS_GetLVDSDesData()
3991 if(ResIndex <= 3) SiS_Pr->SiS_LCDHDES = 256; in SiS_GetLVDSDesData()
3996 SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES; in SiS_GetLVDSDesData()
3997 SiS_Pr->SiS_LCDVDES = (PanelDesPtr+ResIndex)->LCDVDES; in SiS_GetLVDSDesData()
3999 } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_GetLVDSDesData()
4001 if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) { in SiS_GetLVDSDesData()
4002 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2); in SiS_GetLVDSDesData()
4004 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4005 SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2); in SiS_GetLVDSDesData()
4007 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
4008 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4010 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
4014 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT; in SiS_GetLVDSDesData()
4017 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4025 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
4027 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
4029 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4030 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4032 SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT + 3; in SiS_GetLVDSDesData()
4033 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT; in SiS_GetLVDSDesData()
4034 if(SiS_Pr->SiS_VGAVDE == 400) SiS_Pr->SiS_LCDVDES -= 2; in SiS_GetLVDSDesData()
4035 else SiS_Pr->SiS_LCDVDES -= 4; in SiS_GetLVDSDesData()
4039 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4040 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4042 SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT - 1; in SiS_GetLVDSDesData()
4043 if(SiS_Pr->SiS_VGAVDE <= 400) SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 8; in SiS_GetLVDSDesData()
4044 if(SiS_Pr->SiS_VGAVDE <= 350) SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 12; in SiS_GetLVDSDesData()
4049 if( (SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) && in SiS_GetLVDSDesData()
4050 (SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) ) { in SiS_GetLVDSDesData()
4051 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4053 SiS_Pr->SiS_LCDHDES = SiS_Pr->PanelHT - 1; in SiS_GetLVDSDesData()
4058 switch(SiS_Pr->SiS_LCDTypeInfo) { in SiS_GetLVDSDesData()
4060 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
4063 SiS_Pr->SiS_LCDHDES = 8; in SiS_GetLVDSDesData()
4064 if (SiS_Pr->SiS_VGAVDE >= 480) SiS_Pr->SiS_LCDVDES = 512; in SiS_GetLVDSDesData()
4065 else if(SiS_Pr->SiS_VGAVDE >= 400) SiS_Pr->SiS_LCDVDES = 436; in SiS_GetLVDSDesData()
4066 else if(SiS_Pr->SiS_VGAVDE >= 350) SiS_Pr->SiS_LCDVDES = 440; in SiS_GetLVDSDesData()
4072 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSDesData()
4075 if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) { in SiS_GetLVDSDesData()
4076 SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1; in SiS_GetLVDSDesData()
4082 SiS_Pr->SiS_LCDVDES = 524; in SiS_GetLVDSDesData()
4089 if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLVDSDesData()
4090 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSDesData()
4091 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_GetLVDSDesData()
4092 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 632; in SiS_GetLVDSDesData()
4093 } else if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetLVDSDesData()
4094 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { in SiS_GetLVDSDesData()
4095 if(SiS_Pr->SiS_LCDResInfo >= Panel_1024x768) { in SiS_GetLVDSDesData()
4096 if(SiS_Pr->ChipType < SIS_315H) { in SiS_GetLVDSDesData()
4097 if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320; in SiS_GetLVDSDesData()
4100 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) SiS_Pr->SiS_LCDHDES = 480; in SiS_GetLVDSDesData()
4101 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804; in SiS_GetLVDSDesData()
4102 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704; in SiS_GetLVDSDesData()
4104 SiS_Pr->SiS_LCDHDES = 320; in SiS_GetLVDSDesData()
4105 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 632; in SiS_GetLVDSDesData()
4106 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 542; in SiS_GetLVDSDesData()
4127 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_HandlePWD()
4129 unsigned char drivermode = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40; in SiS_HandlePWD()
4130 unsigned short temp; in SiS_HandlePWD() local
4132 if( (SiS_Pr->SiS_VBType & VB_SISPWD) && in SiS_HandlePWD()
4134 (SiS_Pr->SiS_PWDOffset) ) { in SiS_HandlePWD()
4135 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2b,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 0]); in SiS_HandlePWD()
4136 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2c,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 1]); in SiS_HandlePWD()
4137 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2d,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 2]); in SiS_HandlePWD()
4138 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2e,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 3]); in SiS_HandlePWD()
4139 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2f,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 4]); in SiS_HandlePWD()
4140 temp = 0x00; in SiS_HandlePWD()
4142 temp = 0x80; in SiS_HandlePWD()
4145 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); in SiS_HandlePWD()
4162 unsigned short temp=0; in SiS_DisableBridge() local
4164 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_DisableBridge()
4166 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* ===== For 30xB/C/LV ===== */ in SiS_DisableBridge()
4168 if(SiS_Pr->ChipType < SIS_315H) { in SiS_DisableBridge()
4173 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4174 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_DisableBridge()
4181 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f); in SiS_DisableBridge()
4184 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); in SiS_DisableBridge()
4186 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4187 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4189 if(!(SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SiS_DisableBridge()
4190 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4191 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4196 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4197 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4210 bool custom1 = (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || in SiS_DisableBridge()
4211 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400); in SiS_DisableBridge()
4213 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; in SiS_DisableBridge()
4215 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4218 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_DisableBridge()
4219 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { in SiS_DisableBridge()
4220 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_DisableBridge()
4231 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfe); in SiS_DisableBridge()
4234 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfc); in SiS_DisableBridge()
4241 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_DisableBridge()
4242 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_DisableBridge()
4244 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_DisableBridge()
4252 /* if(SiS_Pr->ChipType < SIS_340) {*/ in SiS_DisableBridge()
4255 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_DisableBridge()
4259 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4260 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10); in SiS_DisableBridge()
4268 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_DisableBridge()
4271 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4274 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4277 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4278 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF); in SiS_DisableBridge()
4283 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4286 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf); in SiS_DisableBridge()
4289 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4291 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4295 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4296 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4297 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4298 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4299 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4304 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4307 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_DisableBridge()
4315 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4321 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_DisableBridge()
4322 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_DisableBridge()
4337 if(SiS_Pr->ChipType < SIS_315H) { in SiS_DisableBridge()
4346 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); /* disable VB */ in SiS_DisableBridge()
4349 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_DisableBridge()
4350 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4353 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); /* disable lock mode */ in SiS_DisableBridge()
4355 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_DisableBridge()
4356 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4357 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4358 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_DisableBridge()
4359 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4362 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ in SiS_DisableBridge()
4375 if(SiS_Pr->ChipType < SIS_315H) { in SiS_DisableBridge()
4379 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_DisableBridge()
4383 if(SiS_Pr->ChipType == SIS_730) { in SiS_DisableBridge()
4384 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4392 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4393 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_DisableBridge()
4396 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) { in SiS_DisableBridge()
4408 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4410 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4412 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4413 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4428 /*if(SiS_Pr->ChipType < SIS_340) { */ /* XGI needs this */ in SiS_DisableBridge()
4429 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18); in SiS_DisableBridge()
4433 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4435 if(SiS_Pr->ChipType == SIS_740) { in SiS_DisableBridge()
4436 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_DisableBridge()
4437 if(temp < 1) { in SiS_DisableBridge()
4454 if(SiS_Pr->ChipType != SIS_740) { in SiS_DisableBridge()
4463 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4468 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4474 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4477 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4480 if(SiS_Pr->ChipType == SIS_740) { in SiS_DisableBridge()
4481 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4484 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4486 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4489 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4492 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4494 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4495 if(SiS_Pr->ChipType == SIS_550) { in SiS_DisableBridge()
4496 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf); in SiS_DisableBridge()
4497 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef); in SiS_DisableBridge()
4501 if(SiS_Pr->ChipType == SIS_740) { in SiS_DisableBridge()
4503 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4506 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4510 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4512 /* SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff); */ in SiS_DisableBridge()
4514 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_DisableBridge()
4520 if(SiS_Pr->ChipType == SIS_550) { in SiS_DisableBridge()
4521 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/ in SiS_DisableBridge()
4522 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */ in SiS_DisableBridge()
4523 } else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4526 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_DisableBridge()
4529 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4558 unsigned short temp=0, tempah; in SiS_EnableBridge() local
4564 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_EnableBridge()
4566 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* ====== For 301B et al ====== */ in SiS_EnableBridge()
4568 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4573 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4574 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4575 } else if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_EnableBridge()
4578 if(SiS_Pr->SiS_VBType & (VB_SISLVDS | VB_NoLCD)) { in SiS_EnableBridge()
4585 if((SiS_Pr->SiS_VBType & VB_NoLCD) && in SiS_EnableBridge()
4588 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* Enable CRT2 */ in SiS_EnableBridge()
4591 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
4593 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
4595 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
4597 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
4598 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4609 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4611 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4612 if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; in SiS_EnableBridge()
4614 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4615 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4616 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4617 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0); in SiS_EnableBridge()
4619 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4621 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4625 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4645 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4646 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef); in SiS_EnableBridge()
4648 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4649 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4655 /*if(SiS_Pr->ChipType < SIS_340) { */ in SiS_EnableBridge()
4661 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_EnableBridge()
4665 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4667 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_EnableBridge()
4669 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_EnableBridge()
4671 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_EnableBridge()
4678 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_EnableBridge()
4680 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4682 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4688 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4694 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { in SiS_EnableBridge()
4703 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; in SiS_EnableBridge()
4705 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4707 if(!(SiS_LCDAEnabled(SiS_Pr))) temp |= 0x20; in SiS_EnableBridge()
4710 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4712 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4714 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
4715 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4717 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4723 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_EnableBridge()
4727 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20); in SiS_EnableBridge()
4728 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4730 if(SiS_Pr->SiS_VBType & VB_SISPOWER) { in SiS_EnableBridge()
4734 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f); in SiS_EnableBridge()
4736 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x7f); in SiS_EnableBridge()
4745 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_EnableBridge()
4747 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_EnableBridge()
4751 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10); in SiS_EnableBridge()
4752 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4754 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) { in SiS_EnableBridge()
4756 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4757 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4761 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c); in SiS_EnableBridge()
4763 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4765 cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_EnableBridge()
4767 if(SiS_Pr->SiS_ROMNew) { in SiS_EnableBridge()
4768 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_EnableBridge()
4771 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4772 SiS_Pr->EMI_30 = 0; in SiS_EnableBridge()
4773 SiS_Pr->EMI_31 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 0]; in SiS_EnableBridge()
4774 SiS_Pr->EMI_32 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 1]; in SiS_EnableBridge()
4775 SiS_Pr->EMI_33 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 2]; in SiS_EnableBridge()
4776 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; in SiS_EnableBridge()
4778 SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = true; in SiS_EnableBridge()
4793 if(SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4794 r30 = SiS_Pr->EMI_30; r31 = SiS_Pr->EMI_31; in SiS_EnableBridge()
4795 r32 = SiS_Pr->EMI_32; r33 = SiS_Pr->EMI_33; in SiS_EnableBridge()
4803 * don't know if it should be set - hence our detection is wrong. in SiS_EnableBridge()
4804 * Work-around this here: in SiS_EnableBridge()
4807 if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) { in SiS_EnableBridge()
4811 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40; in SiS_EnableBridge()
4812 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4820 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40; in SiS_EnableBridge()
4821 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4823 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_EnableBridge()
4830 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4832 if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { in SiS_EnableBridge()
4837 case 11: /* 1600x1200 - unknown */ in SiS_EnableBridge()
4839 if(!SiS_Pr->HaveEMI) { in SiS_EnableBridge()
4846 if(!SiS_Pr->OverruleEMI) { in SiS_EnableBridge()
4848 if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) { in SiS_EnableBridge()
4855 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) { in SiS_EnableBridge()
4862 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_EnableBridge()
4873 if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) { in SiS_EnableBridge()
4874 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4877 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31); in SiS_EnableBridge()
4878 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32); in SiS_EnableBridge()
4879 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33); in SiS_EnableBridge()
4882 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_EnableBridge()
4888 /*SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x2a,0x80);*/ in SiS_EnableBridge()
4896 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_EnableBridge()
4899 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); /* Enable */ in SiS_EnableBridge()
4900 /*SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f);*/ in SiS_EnableBridge()
4914 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_EnableBridge()
4919 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4921 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x03); in SiS_EnableBridge()
4926 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_EnableBridge()
4928 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff); in SiS_EnableBridge()
4933 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4942 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4949 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4951 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4952 if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; in SiS_EnableBridge()
4954 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4956 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4958 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_EnableBridge()
4959 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
4960 if(!(temp & 0x80)) { in SiS_EnableBridge()
4961 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); /* BVBDOENABLE=1 */ in SiS_EnableBridge()
4965 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4969 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_EnableBridge()
4970 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4974 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4985 if(SiS_Pr->ChipType < SIS_315H) { in SiS_EnableBridge()
4990 if(SiS_Pr->ChipType == SIS_730) { in SiS_EnableBridge()
5001 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5004 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
5006 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
5008 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
5011 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_EnableBridge()
5019 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
5020 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
5038 /*if(SiS_Pr->ChipType < SIS_340) {*/ /* XGI needs this */ in SiS_EnableBridge()
5039 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18); in SiS_EnableBridge()
5043 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5050 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5053 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_EnableBridge()
5055 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5056 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_EnableBridge()
5057 temp &= 0x20; in SiS_EnableBridge()
5061 if(SiS_Pr->ChipType != SIS_550) { in SiS_EnableBridge()
5062 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
5065 if(SiS_Pr->ChipType == SIS_740) { in SiS_EnableBridge()
5066 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5068 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5073 temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
5075 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); in SiS_EnableBridge()
5078 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5079 if(temp) { in SiS_EnableBridge()
5084 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5086 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5087 if(SiS_Pr->ChipType == SIS_550) { in SiS_EnableBridge()
5088 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40); in SiS_EnableBridge()
5089 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10); in SiS_EnableBridge()
5093 if(SiS_Pr->ChipType != SIS_740) { in SiS_EnableBridge()
5094 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5099 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
5102 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5112 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_EnableBridge()
5120 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5147 unsigned char temp; in SiS_SetCRT2Offset() local
5149 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return; in SiS_SetCRT2Offset()
5153 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF)); in SiS_SetCRT2Offset()
5154 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8)); in SiS_SetCRT2Offset()
5156 temp = (unsigned char)(((offset >> 3) & 0xFF) + 1); in SiS_SetCRT2Offset()
5157 if(offset & 0x07) temp++; in SiS_SetCRT2Offset()
5158 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp); in SiS_SetCRT2Offset()
5169 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2Sync()
5170 infoflag = SiS_Pr->CInfoFlag; in SiS_SetCRT2Sync()
5172 infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; in SiS_SetCRT2Sync()
5175 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* LVDS */ in SiS_SetCRT2Sync()
5177 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Sync()
5179 } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) { in SiS_SetCRT2Sync()
5180 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
5184 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5185 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5186 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_SetCRT2Sync()
5187 (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2Sync()
5190 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_SetCRT2Sync()
5191 (SiS_Pr->SiS_IF_DEF_DSTN) || in SiS_SetCRT2Sync()
5192 (SiS_Pr->SiS_IF_DEF_TRUMPION) || in SiS_SetCRT2Sync()
5193 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_SetCRT2Sync()
5194 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) { in SiS_SetCRT2Sync()
5197 if( (SiS_Pr->SiS_IF_DEF_FSTN) || in SiS_SetCRT2Sync()
5198 (SiS_Pr->SiS_IF_DEF_DSTN) ) { in SiS_SetCRT2Sync()
5202 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Sync()
5203 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2Sync()
5206 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah); in SiS_SetCRT2Sync()
5207 /* Don't care about 12/18/24 bit mode - TV is via VGA, not PL */ in SiS_SetCRT2Sync()
5209 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0); in SiS_SetCRT2Sync()
5212 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5215 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2Sync()
5217 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2Sync()
5219 #ifdef CONFIG_FB_SIS_300 /* ---- 300 series --- */ in SiS_SetCRT2Sync()
5221 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { /* 630 - 301B(-DH) */ in SiS_SetCRT2Sync()
5225 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5226 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
5227 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
5233 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5235 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5236 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetCRT2Sync()
5237 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5240 } else { /* 630 - 301 */ in SiS_SetCRT2Sync()
5243 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5244 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5252 #ifdef CONFIG_FB_SIS_315 /* ------- 315 series ------ */ in SiS_SetCRT2Sync()
5254 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* 315 - LVDS */ in SiS_SetCRT2Sync()
5257 if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) && in SiS_SetCRT2Sync()
5258 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetCRT2Sync()
5260 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
5261 tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6); in SiS_SetCRT2Sync()
5263 } else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400) && in SiS_SetCRT2Sync()
5264 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050)) { in SiS_SetCRT2Sync()
5268 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_SetCRT2Sync()
5271 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04; in SiS_SetCRT2Sync()
5275 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5276 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) tempah |= 0xc0; in SiS_SetCRT2Sync()
5277 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5278 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2Sync()
5279 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5280 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5284 } else { /* 315 - TMDS */ in SiS_SetCRT2Sync()
5287 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2Sync()
5289 if((SiS_Pr->SiS_VBType & VB_SIS30xC) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2Sync()
5291 tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetCRT2Sync()
5294 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetCRT2Sync()
5295 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetCRT2Sync()
5296 if(SiS_Pr->SiS_LCDInfo & LCDSync) { in SiS_SetCRT2Sync()
5297 tempah = SiS_Pr->SiS_LCDInfo; in SiS_SetCRT2Sync()
5305 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5306 if(SiS_Pr->SiS_VBType & VB_NoLCD) { in SiS_SetCRT2Sync()
5308 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah |= 0xc0; in SiS_SetCRT2Sync()
5310 if((SiS_Pr->SiS_VBType & VB_SIS30xC) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) { in SiS_SetCRT2Sync()
5313 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah); in SiS_SetCRT2Sync()
5315 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5316 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2Sync()
5317 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetCRT2Sync()
5318 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5334 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2FIFO_300()
5335 unsigned short temp, index, modeidindex, refreshratetableindex; in SiS_SetCRT2FIFO_300() local
5343 SelectRate_backup = SiS_Pr->SiS_SelectCRT2Rate; in SiS_SetCRT2FIFO_300()
5345 if(!SiS_Pr->CRT1UsesCustomMode) { in SiS_SetCRT2FIFO_300()
5347 CRT1ModeNo = SiS_Pr->SiS_CRT1Mode; /* get CRT1 ModeNo */ in SiS_SetCRT2FIFO_300()
5349 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT2FIFO_300()
5350 SiS_Pr->SiS_SelectCRT2Rate = 0; in SiS_SetCRT2FIFO_300()
5355 index = SiS_GetRefCRTVCLK(SiS_Pr, refreshratetableindex, SiS_Pr->SiS_UseWide); in SiS_SetCRT2FIFO_300()
5356 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetCRT2FIFO_300()
5368 VCLK = SiS_Pr->CSRClock_CRT1; in SiS_SetCRT2FIFO_300()
5371 colorth = colortharray[((SiS_Pr->CModeFlag_CRT1 & ModeTypeMask) - 2)]; in SiS_SetCRT2FIFO_300()
5377 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT2FIFO_300()
5378 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A); in SiS_SetCRT2FIFO_300()
5380 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A); in SiS_SetCRT2FIFO_300()
5383 MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK; in SiS_SetCRT2FIFO_300()
5385 temp = ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) >> 6) & 0x03) << 1; in SiS_SetCRT2FIFO_300()
5386 if(!temp) temp++; in SiS_SetCRT2FIFO_300()
5387 temp <<= 2; in SiS_SetCRT2FIFO_300()
5389 data2 = temp - ((colorth * VCLK) / MCLK); in SiS_SetCRT2FIFO_300()
5391 temp = (28 * 16) % data2; in SiS_SetCRT2FIFO_300()
5393 if(temp) data2++; in SiS_SetCRT2FIFO_300()
5395 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT2FIFO_300()
5405 if(SiS_Pr->ChipType == SIS_730) { in SiS_SetCRT2FIFO_300()
5411 index = 0; /* -- do it like the BIOS anyway... */ in SiS_SetCRT2FIFO_300()
5423 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80) index += 12; in SiS_SetCRT2FIFO_300()
5428 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80)) data += 5; in SiS_SetCRT2FIFO_300()
5434 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2FIFO_300()
5435 SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; in SiS_SetCRT2FIFO_300()
5437 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2FIFO_300()
5446 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetCRT2FIFO_300()
5448 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2FIFO_300()
5449 if(SiS_Pr->SiS_UseROM) { in SiS_SetCRT2FIFO_300()
5460 VCLK = SiS_Pr->CSRClock; in SiS_SetCRT2FIFO_300()
5469 temp = data % (MCLK << 4); in SiS_SetCRT2FIFO_300()
5471 if(temp) data++; in SiS_SetCRT2FIFO_300()
5476 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT2FIFO_300()
5477 temp = 0x16; in SiS_SetCRT2FIFO_300()
5478 if((data <= 0x0f) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) in SiS_SetCRT2FIFO_300()
5479 temp = 0x13; in SiS_SetCRT2FIFO_300()
5481 temp = 0x16; in SiS_SetCRT2FIFO_300()
5482 if(( (SiS_Pr->ChipType == SIS_630) || in SiS_SetCRT2FIFO_300()
5483 (SiS_Pr->ChipType == SIS_730) ) && in SiS_SetCRT2FIFO_300()
5484 (SiS_Pr->ChipRevision >= 0x30)) in SiS_SetCRT2FIFO_300()
5485 temp = 0x1b; in SiS_SetCRT2FIFO_300()
5487 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp); in SiS_SetCRT2FIFO_300()
5489 if((SiS_Pr->ChipType == SIS_630) && in SiS_SetCRT2FIFO_300()
5490 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetCRT2FIFO_300()
5493 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data); in SiS_SetCRT2FIFO_300()
5497 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2FIFO_300()
5498 SiS_Pr->SiS_SelectCRT2Rate = SelectRate_backup; in SiS_SetCRT2FIFO_300()
5509 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B); in SiS_SetCRT2FIFO_310()
5510 if( (SiS_Pr->ChipType == SIS_760) && in SiS_SetCRT2FIFO_310()
5511 (SiS_Pr->SiS_SysFlags & SF_760LFB) && in SiS_SetCRT2FIFO_310()
5512 (SiS_Pr->SiS_ModeType == Mode32Bpp) && in SiS_SetCRT2FIFO_310()
5513 (SiS_Pr->SiS_VGAHDE >= 1280) && in SiS_SetCRT2FIFO_310()
5514 (SiS_Pr->SiS_VGAVDE >= 1024) ) { in SiS_SetCRT2FIFO_310()
5515 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03); in SiS_SetCRT2FIFO_310()
5516 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b); in SiS_SetCRT2FIFO_310()
5517 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5518 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_SetCRT2FIFO_310()
5519 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5520 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e); in SiS_SetCRT2FIFO_310()
5522 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04); in SiS_SetCRT2FIFO_310()
5533 tempbx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX; in SiS_GetVGAHT2()
5534 tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT; in SiS_GetVGAHT2()
5535 tempax = (tempax * SiS_Pr->SiS_HT) / tempbx; in SiS_GetVGAHT2()
5544 unsigned short temp, modeflag, i, j, xres=0, VGAVDE; in SiS_SetGroup1_301() local
5555 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1_301()
5556 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1_301()
5557 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1_301()
5558 xres = SiS_Pr->CHDisplay; in SiS_SetGroup1_301()
5560 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1_301()
5561 xres = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes; in SiS_SetGroup1_301()
5566 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_301()
5568 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04); in SiS_SetGroup1_301()
5572 SiS_Pr->CHTotal = 8224; /* Max HT, 0x2020, results in 0x3ff in registers */ in SiS_SetGroup1_301()
5574 SiS_Pr->CHDisplay = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup1_301()
5575 if(modeflag & HalfDCLK) SiS_Pr->CHDisplay >>= 1; in SiS_SetGroup1_301()
5577 SiS_Pr->CHBlankStart = SiS_Pr->CHDisplay; in SiS_SetGroup1_301()
5578 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup1_301()
5579 SiS_Pr->CHBlankStart += 16; in SiS_SetGroup1_301()
5582 SiS_Pr->CHBlankEnd = 32; in SiS_SetGroup1_301()
5583 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1_301()
5584 if(xres == 1600) SiS_Pr->CHBlankEnd += 80; in SiS_SetGroup1_301()
5587 temp = SiS_Pr->SiS_VGAHT - 96; in SiS_SetGroup1_301()
5588 if(!(modeflag & HalfDCLK)) temp -= 32; in SiS_SetGroup1_301()
5589 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetGroup1_301()
5590 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x04); in SiS_SetGroup1_301()
5591 temp |= ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0xc0) << 2); in SiS_SetGroup1_301()
5592 temp -= 3; in SiS_SetGroup1_301()
5593 temp <<= 3; in SiS_SetGroup1_301()
5595 if(SiS_Pr->SiS_RVBHRS2) temp = SiS_Pr->SiS_RVBHRS2; in SiS_SetGroup1_301()
5597 SiS_Pr->CHSyncStart = temp; in SiS_SetGroup1_301()
5599 SiS_Pr->CHSyncEnd = 0xffe8; /* results in 0x2000 in registers */ in SiS_SetGroup1_301()
5601 SiS_Pr->CVTotal = 2049; /* Max VT, 0x0801, results in 0x7ff in registers */ in SiS_SetGroup1_301()
5603 VGAVDE = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_301()
5611 SiS_Pr->CVDisplay = VGAVDE; in SiS_SetGroup1_301()
5613 SiS_Pr->CVBlankStart = SiS_Pr->CVDisplay; in SiS_SetGroup1_301()
5615 SiS_Pr->CVBlankEnd = 1; in SiS_SetGroup1_301()
5616 if(ModeNo == 0x3c) SiS_Pr->CVBlankEnd = 226; in SiS_SetGroup1_301()
5618 temp = (SiS_Pr->SiS_VGAVT - VGAVDE) >> 1; in SiS_SetGroup1_301()
5619 SiS_Pr->CVSyncStart = VGAVDE + temp; in SiS_SetGroup1_301()
5621 temp >>= 3; in SiS_SetGroup1_301()
5622 SiS_Pr->CVSyncEnd = SiS_Pr->CVSyncStart + temp; in SiS_SetGroup1_301()
5625 SiS_Pr->CCRT1CRTC[16] &= ~0xE0; in SiS_SetGroup1_301()
5628 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[i]); in SiS_SetGroup1_301()
5631 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); in SiS_SetGroup1_301()
5634 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); in SiS_SetGroup1_301()
5637 SiS_SetReg(SiS_Pr->SiS_Part1Port,CRTranslation[i],SiS_Pr->CCRT1CRTC[j]); in SiS_SetGroup1_301()
5640 temp = SiS_Pr->CCRT1CRTC[16] & 0xE0; in SiS_SetGroup1_301()
5641 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x0E],0x1F,temp); in SiS_SetGroup1_301()
5643 temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5; in SiS_SetGroup1_301()
5644 if(modeflag & DoubleScanMode) temp |= 0x80; in SiS_SetGroup1_301()
5645 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x09],0x5F,temp); in SiS_SetGroup1_301()
5647 temp = 0; in SiS_SetGroup1_301()
5648 temp |= (SiS_GetReg(SiS_Pr->SiS_P3c4,0x01) & 0x01); in SiS_SetGroup1_301()
5649 if(modeflag & HalfDCLK) temp |= 0x08; in SiS_SetGroup1_301()
5650 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* SR01: HalfDCLK[3], 8/9 div dotclock[… in SiS_SetGroup1_301()
5652 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00); /* CR14: (text mode: underline location… in SiS_SetGroup1_301()
5653 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00); /* CR17: n/a */ in SiS_SetGroup1_301()
5655 temp = 0; in SiS_SetGroup1_301()
5656 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup1_301()
5657 temp = (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) << 7; in SiS_SetGroup1_301()
5659 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* SR0E, dither[7] */ in SiS_SetGroup1_301()
5661 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetGroup1_301()
5662 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ in SiS_SetGroup1_301()
5667 * 300/LVDS+TV, 300/301B-DH, 315/LVDS+TV, 315/LCDA
5674 unsigned short push2, tempax, tempbx, tempcx, temp; in SiS_SetGroup1_LVDS() local
5685 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1_LVDS()
5686 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup1_LVDS()
5688 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup1_LVDS()
5690 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1_LVDS()
5691 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1_LVDS()
5693 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1_LVDS()
5694 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1_LVDS()
5696 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetGroup1_LVDS()
5700 /* is lvds if really LVDS, or 301B-DH with external LVDS transmitter */ in SiS_SetGroup1_LVDS()
5701 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { in SiS_SetGroup1_LVDS()
5705 /* is really sis if sis bridge, but not 301B-DH */ in SiS_SetGroup1_LVDS()
5706 if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { in SiS_SetGroup1_LVDS()
5710 if((SiS_Pr->ChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) { in SiS_SetGroup1_LVDS()
5711 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) { in SiS_SetGroup1_LVDS()
5717 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5719 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5722 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5723 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03); in SiS_SetGroup1_LVDS()
5724 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1_LVDS()
5725 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5729 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5730 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00); in SiS_SetGroup1_LVDS()
5731 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1_LVDS()
5732 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f); in SiS_SetGroup1_LVDS()
5733 if(SiS_Pr->SiS_VBType & VB_SIS30xC) { in SiS_SetGroup1_LVDS()
5734 if((SiS_Pr->SiS_LCDResInfo == Panel_1024x768) || in SiS_SetGroup1_LVDS()
5735 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetGroup1_LVDS()
5736 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20); in SiS_SetGroup1_LVDS()
5746 tempax = SiS_Pr->SiS_LCDHDES; in SiS_SetGroup1_LVDS()
5748 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5749 if(!SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
5750 if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) && in SiS_SetGroup1_LVDS()
5751 (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) { in SiS_SetGroup1_LVDS()
5752 tempax -= 8; in SiS_SetGroup1_LVDS()
5758 temp = (tempax & 0x0007); in SiS_SetGroup1_LVDS()
5759 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* BPLHDESKEW[2:0] */ in SiS_SetGroup1_LVDS()
5760 temp = (tempax >> 3) & 0x00FF; in SiS_SetGroup1_LVDS()
5761 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* BPLHDESKEW[10:3] */ in SiS_SetGroup1_LVDS()
5763 tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
5764 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5765 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5766 tempbx = SiS_Pr->PanelXRes; in SiS_SetGroup1_LVDS()
5768 if((SiS_Pr->SiS_LCDResInfo == Panel_320x240_1) || in SiS_SetGroup1_LVDS()
5769 (SiS_Pr->SiS_LCDResInfo == Panel_320x240_2) || in SiS_SetGroup1_LVDS()
5770 (SiS_Pr->SiS_LCDResInfo == Panel_320x240_3)) { in SiS_SetGroup1_LVDS()
5776 if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5778 temp = tempax; in SiS_SetGroup1_LVDS()
5779 if(temp & 0x07) temp += 8; in SiS_SetGroup1_LVDS()
5780 temp >>= 3; in SiS_SetGroup1_LVDS()
5781 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* BPLHDEE */ in SiS_SetGroup1_LVDS()
5783 tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2; in SiS_SetGroup1_LVDS()
5785 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5786 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5787 if(SiS_Pr->PanelHRS != 999) tempcx = SiS_Pr->PanelHRS; in SiS_SetGroup1_LVDS()
5792 if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5794 temp = (tempcx >> 3) & 0x00FF; in SiS_SetGroup1_LVDS()
5795 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5796 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5797 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5801 case 0x0d: temp = 0x56; break; in SiS_SetGroup1_LVDS()
5802 case 0x10: temp = 0x60; break; in SiS_SetGroup1_LVDS()
5803 case 0x13: temp = 0x5f; break; in SiS_SetGroup1_LVDS()
5813 case 0x5e: temp = 0x54; break; in SiS_SetGroup1_LVDS()
5818 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp); /* BPLHRS */ in SiS_SetGroup1_LVDS()
5820 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5821 temp += 2; in SiS_SetGroup1_LVDS()
5822 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5823 temp += 8; in SiS_SetGroup1_LVDS()
5824 if(SiS_Pr->PanelHRE != 999) { in SiS_SetGroup1_LVDS()
5825 temp = tempcx + SiS_Pr->PanelHRE; in SiS_SetGroup1_LVDS()
5826 if(temp >= SiS_Pr->SiS_HT) temp -= SiS_Pr->SiS_HT; in SiS_SetGroup1_LVDS()
5827 temp >>= 3; in SiS_SetGroup1_LVDS()
5831 temp += 10; in SiS_SetGroup1_LVDS()
5834 temp &= 0x1F; in SiS_SetGroup1_LVDS()
5835 temp |= ((tempcx & 0x07) << 5); in SiS_SetGroup1_LVDS()
5836 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp); /* BPLHRE */ in SiS_SetGroup1_LVDS()
5840 tempax = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5841 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5842 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5843 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup1_LVDS()
5847 tempbx = SiS_Pr->SiS_LCDVDES + tempax; in SiS_SetGroup1_LVDS()
5848 if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; in SiS_SetGroup1_LVDS()
5852 tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5853 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1_LVDS()
5854 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5855 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5856 tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->PanelYRes; in SiS_SetGroup1_LVDS()
5863 if( (SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && in SiS_SetGroup1_LVDS()
5864 (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) && in SiS_SetGroup1_LVDS()
5865 (SiS_Pr->PanelVRS != 999) ) { in SiS_SetGroup1_LVDS()
5866 tempcx = SiS_Pr->PanelVRS; in SiS_SetGroup1_LVDS()
5871 if(SiS_Pr->ChipType < SIS_315H) tempbx++; in SiS_SetGroup1_LVDS()
5875 if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT; in SiS_SetGroup1_LVDS()
5877 temp = tempbx & 0x00FF; in SiS_SetGroup1_LVDS()
5878 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
5879 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
5880 if(ModeNo == 0x10) temp = 0xa9; in SiS_SetGroup1_LVDS()
5883 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); /* BPLVRS */ in SiS_SetGroup1_LVDS()
5888 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5889 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SiS_SetGroup1_LVDS()
5890 if(SiS_Pr->PanelVRE != 999) tempcx = SiS_Pr->PanelVRE; in SiS_SetGroup1_LVDS()
5895 temp = tempcx & 0x000F; in SiS_SetGroup1_LVDS()
5896 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); /* BPLVRE */ in SiS_SetGroup1_LVDS()
5898 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
5899 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
5900 if(SiS_Pr->SiS_HDE != 640) { in SiS_SetGroup1_LVDS()
5901 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5903 } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5904 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) temp |= 0x40; in SiS_SetGroup1_LVDS()
5906 if((SiS_Pr->ChipType >= SIS_315H) || in SiS_SetGroup1_LVDS()
5907 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetGroup1_LVDS()
5909 if((SiS_Pr->SiS_IF_DEF_CH70xx == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup1_LVDS()
5910 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03) temp |= 0x80; in SiS_SetGroup1_LVDS()
5912 /* Chrontel 701x operates in 24bit mode (8-8-8, 2x12bit multiplexed) via VGA2 */ in SiS_SetGroup1_LVDS()
5913 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup1_LVDS()
5914 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1_LVDS()
5915 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80; in SiS_SetGroup1_LVDS()
5917 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80; in SiS_SetGroup1_LVDS()
5921 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp); in SiS_SetGroup1_LVDS()
5925 tempcx = SiS_Pr->SiS_LCDVDES; /* BPLVDES */ in SiS_SetGroup1_LVDS()
5927 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetGroup1_LVDS()
5928 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_SetGroup1_LVDS()
5930 tempbx = SiS_Pr->SiS_VGAVDE - 1; in SiS_SetGroup1_LVDS()
5931 tempcx = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup1_LVDS()
5934 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5939 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5941 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup1_LVDS()
5947 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1_LVDS()
5948 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1_LVDS()
5956 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
5957 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup1_LVDS()
5958 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp); in SiS_SetGroup1_LVDS()
5959 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx); in SiS_SetGroup1_LVDS()
5960 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx); in SiS_SetGroup1_LVDS()
5964 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1_LVDS()
5967 tempeax = SiS_Pr->SiS_VGAVDE << 6; in SiS_SetGroup1_LVDS()
5968 temp = (tempeax % (unsigned int)SiS_Pr->SiS_VDE); in SiS_SetGroup1_LVDS()
5969 tempeax = tempeax / (unsigned int)SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5970 if(temp) tempeax++; in SiS_SetGroup1_LVDS()
5972 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F; in SiS_SetGroup1_LVDS()
5974 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5975 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ in SiS_SetGroup1_LVDS()
5976 tempvcfact = temp; in SiS_SetGroup1_LVDS()
5982 tempeax = SiS_Pr->SiS_VGAVDE << 18; in SiS_SetGroup1_LVDS()
5983 tempebx = SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
5984 temp = (tempeax % tempebx); in SiS_SetGroup1_LVDS()
5986 if(temp) tempeax++; in SiS_SetGroup1_LVDS()
5989 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5990 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp); in SiS_SetGroup1_LVDS()
5991 temp = (unsigned short)((tempeax & 0x00FF00) >> 8); in SiS_SetGroup1_LVDS()
5992 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp); in SiS_SetGroup1_LVDS()
5993 temp = (unsigned short)((tempeax & 0x00030000) >> 16); in SiS_SetGroup1_LVDS()
5994 if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04; in SiS_SetGroup1_LVDS()
5995 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp); in SiS_SetGroup1_LVDS()
5997 if(SiS_Pr->SiS_VBType & VB_SISPART4SCALER) { in SiS_SetGroup1_LVDS()
5998 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5999 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp); in SiS_SetGroup1_LVDS()
6000 temp = (unsigned short)((tempeax & 0x00FF00) >> 8); in SiS_SetGroup1_LVDS()
6001 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp); in SiS_SetGroup1_LVDS()
6002 temp = (unsigned short)(((tempeax & 0x00030000) >> 16) << 6); in SiS_SetGroup1_LVDS()
6003 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp); in SiS_SetGroup1_LVDS()
6004 temp = 0; in SiS_SetGroup1_LVDS()
6005 if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08; in SiS_SetGroup1_LVDS()
6006 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp); in SiS_SetGroup1_LVDS()
6014 tempeax = SiS_Pr->SiS_VGAHDE; /* 1f = ( (VGAHDE * 65536) / ( (VGAHDE * 65536) / HDE ) ) - 1*/ in SiS_SetGroup1_LVDS()
6019 if(SiS_Pr->SiS_HDE == tempeax) { in SiS_SetGroup1_LVDS()
6022 tempecx = tempebx / SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
6023 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6024 if(tempebx % SiS_Pr->SiS_HDE) tempecx++; in SiS_SetGroup1_LVDS()
6028 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6029 tempeax = (tempebx / tempecx) - 1; in SiS_SetGroup1_LVDS()
6031 tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1; in SiS_SetGroup1_LVDS()
6034 temp = (unsigned short)(tempecx & 0x00FF); in SiS_SetGroup1_LVDS()
6035 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp); in SiS_SetGroup1_LVDS()
6037 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6038 tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact; in SiS_SetGroup1_LVDS()
6041 tempeax = SiS_Pr->SiS_VGAVDE << 6; in SiS_SetGroup1_LVDS()
6047 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tempbx--; in SiS_SetGroup1_LVDS()
6048 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) { in SiS_SetGroup1_LVDS()
6049 if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) tempbx = 1; in SiS_SetGroup1_LVDS()
6050 else if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempbx = 1; in SiS_SetGroup1_LVDS()
6053 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
6054 temp = temp | ((tempecx >> 8) & 0x07); in SiS_SetGroup1_LVDS()
6055 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp); in SiS_SetGroup1_LVDS()
6056 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx); in SiS_SetGroup1_LVDS()
6062 temp = (unsigned short)((tempecx & 0xFF00) >> 8); in SiS_SetGroup1_LVDS()
6063 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp); in SiS_SetGroup1_LVDS()
6064 temp = (unsigned short)(tempecx & 0x00FF); in SiS_SetGroup1_LVDS()
6065 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); in SiS_SetGroup1_LVDS()
6068 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1_LVDS()
6069 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1_LVDS()
6070 if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SISLVDS)) { in SiS_SetGroup1_LVDS()
6071 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_SetGroup1_LVDS()
6075 if(SiS_Pr->ChipType == SIS_740) { in SiS_SetGroup1_LVDS()
6076 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_SetGroup1_LVDS()
6078 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23); in SiS_SetGroup1_LVDS()
6086 if(SiS_Pr->SiS_IF_DEF_TRUMPION) { in SiS_SetGroup1_LVDS()
6087 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetGroup1_LVDS()
6094 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1_LVDS()
6097 if(SiS_Pr->SiS_LCDTypeInfo == 0x0e) j += 7; in SiS_SetGroup1_LVDS()
6101 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf); in SiS_SetGroup1_LVDS()
6105 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup1_LVDS()
6117 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_SetGroup1_LVDS()
6122 if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) { in SiS_SetGroup1_LVDS()
6123 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); in SiS_SetGroup1_LVDS()
6124 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); in SiS_SetGroup1_LVDS()
6125 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00); in SiS_SetGroup1_LVDS()
6126 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87); in SiS_SetGroup1_LVDS()
6127 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A); in SiS_SetGroup1_LVDS()
6128 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B); in SiS_SetGroup1_LVDS()
6129 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03); in SiS_SetGroup1_LVDS()
6130 tempax = SiS_Pr->SiS_HDE; /* Blps = lcdhdee(lcdhdes+HDE) + 64 */ in SiS_SetGroup1_LVDS()
6131 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6132 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6133 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6135 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,tempax & 0xff); in SiS_SetGroup1_LVDS()
6136 temp = (tempax >> 8) << 3; in SiS_SetGroup1_LVDS()
6137 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp); in SiS_SetGroup1_LVDS()
6139 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,tempax & 0xff); in SiS_SetGroup1_LVDS()
6140 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00); /* Bflml = 0 */ in SiS_SetGroup1_LVDS()
6141 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x007); in SiS_SetGroup1_LVDS()
6143 tempax = SiS_Pr->SiS_VDE; in SiS_SetGroup1_LVDS()
6144 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6145 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6146 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6148 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,tempax & 0xff); in SiS_SetGroup1_LVDS()
6149 temp = (tempax >> 8) << 3; in SiS_SetGroup1_LVDS()
6150 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp); in SiS_SetGroup1_LVDS()
6152 tempeax = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
6153 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6154 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6155 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempeax >>= 1; in SiS_SetGroup1_LVDS()
6157 temp = tempeax & 0x7f; in SiS_SetGroup1_LVDS()
6159 if(temp) tempeax++; in SiS_SetGroup1_LVDS()
6160 temp = tempeax & 0x3f; in SiS_SetGroup1_LVDS()
6161 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,temp); in SiS_SetGroup1_LVDS()
6162 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00); /* BDxWadrst0 */ in SiS_SetGroup1_LVDS()
6163 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00); in SiS_SetGroup1_LVDS()
6164 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10); in SiS_SetGroup1_LVDS()
6165 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x040); in SiS_SetGroup1_LVDS()
6167 tempax = SiS_Pr->SiS_HDE; in SiS_SetGroup1_LVDS()
6168 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6169 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6170 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6173 temp = tempax & 0x00FF; in SiS_SetGroup1_LVDS()
6174 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp); in SiS_SetGroup1_LVDS()
6175 temp = ((tempax & 0xFF00) >> 8) << 3; in SiS_SetGroup1_LVDS()
6176 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x44, 0x07, temp); in SiS_SetGroup1_LVDS()
6178 tempax = SiS_Pr->SiS_VDE; /* BDxWadrst1 = BDxWadrst0 + BDxWadroff * VDE */ in SiS_SetGroup1_LVDS()
6179 if(SiS_Pr->SiS_LCDResInfo == Panel_320x240_1 || in SiS_SetGroup1_LVDS()
6180 SiS_Pr->SiS_LCDResInfo == Panel_320x240_2 || in SiS_SetGroup1_LVDS()
6181 SiS_Pr->SiS_LCDResInfo == Panel_320x240_3) tempax >>= 1; in SiS_SetGroup1_LVDS()
6183 temp = tempeax & 0xFF; in SiS_SetGroup1_LVDS()
6184 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp); in SiS_SetGroup1_LVDS()
6185 temp = (tempeax & 0xFF00) >> 8; in SiS_SetGroup1_LVDS()
6186 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp); in SiS_SetGroup1_LVDS()
6187 temp = ((tempeax & 0xFF0000) >> 16) | 0x10; in SiS_SetGroup1_LVDS()
6188 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp); in SiS_SetGroup1_LVDS()
6189 temp = ((tempeax & 0x01000000) >> 24) << 7; in SiS_SetGroup1_LVDS()
6190 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x3C, 0x7F, temp); in SiS_SetGroup1_LVDS()
6192 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03); in SiS_SetGroup1_LVDS()
6193 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50); in SiS_SetGroup1_LVDS()
6194 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00); in SiS_SetGroup1_LVDS()
6195 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01); in SiS_SetGroup1_LVDS()
6196 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38); in SiS_SetGroup1_LVDS()
6198 if(SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_SetGroup1_LVDS()
6199 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02); in SiS_SetGroup1_LVDS()
6200 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00); in SiS_SetGroup1_LVDS()
6201 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00); in SiS_SetGroup1_LVDS()
6202 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c); in SiS_SetGroup1_LVDS()
6203 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00); in SiS_SetGroup1_LVDS()
6204 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00); in SiS_SetGroup1_LVDS()
6205 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80); in SiS_SetGroup1_LVDS()
6206 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0); in SiS_SetGroup1_LVDS()
6207 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00); in SiS_SetGroup1_LVDS()
6208 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0); in SiS_SetGroup1_LVDS()
6209 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00); in SiS_SetGroup1_LVDS()
6210 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10); in SiS_SetGroup1_LVDS()
6211 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00); in SiS_SetGroup1_LVDS()
6212 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00); in SiS_SetGroup1_LVDS()
6213 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10); in SiS_SetGroup1_LVDS()
6214 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25); in SiS_SetGroup1_LVDS()
6215 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80); in SiS_SetGroup1_LVDS()
6216 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14); in SiS_SetGroup1_LVDS()
6217 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03); in SiS_SetGroup1_LVDS()
6218 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); in SiS_SetGroup1_LVDS()
6230 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetGroup1()
6232 unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; in SiS_SetGroup1() local
6238 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup1()
6244 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup1()
6245 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6246 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup1()
6248 CRT1Index = SiS_GetRefCRT1CRTC(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWideCRT2); in SiS_SetGroup1()
6249 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup1()
6250 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup1()
6255 if( ! ((SiS_Pr->ChipType >= SIS_315H) && in SiS_SetGroup1()
6256 (SiS_Pr->SiS_IF_DEF_LVDS == 1) && in SiS_SetGroup1()
6257 (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) { in SiS_SetGroup1()
6259 if(SiS_Pr->ChipType < SIS_315H ) { in SiS_SetGroup1()
6271 if(SiS_Pr->ChipType < SIS_315H ) { in SiS_SetGroup1()
6273 #ifdef CONFIG_FB_SIS_300 /* ------------- 300 series --------------*/ in SiS_SetGroup1()
6275 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6276 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6278 temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4; in SiS_SetGroup1()
6279 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6281 temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6282 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6284 pushbx = SiS_Pr->SiS_VGAHDE + 12; /* bx BTVGA2HRS 0x0B,0x0C */ in SiS_SetGroup1()
6285 tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2; in SiS_SetGroup1()
6296 #ifdef CONFIG_FB_SIS_315 /* ------------------- 315/330 series --------------- */ in SiS_SetGroup1()
6298 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6300 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6303 tempax = SiS_Pr->SiS_VGAHDE >> 1; in SiS_SetGroup1()
6304 tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax; in SiS_SetGroup1()
6305 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup1()
6306 tempcx = SiS_Pr->SiS_HT - tempax; in SiS_SetGroup1()
6310 tempcx--; in SiS_SetGroup1()
6311 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6312 temp = (tempcx >> 4) & 0xF0; in SiS_SetGroup1()
6313 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6315 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6316 tempbx = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup1()
6317 tempcx -= tempbx; in SiS_SetGroup1()
6325 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6334 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6335 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetGroup1()
6336 if((SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || in SiS_SetGroup1()
6337 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) { in SiS_SetGroup1()
6351 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6353 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6354 tempbx = SiS_Pr->CHSyncStart + bridgeadd; in SiS_SetGroup1()
6355 tempcx = SiS_Pr->CHSyncEnd + bridgeadd; in SiS_SetGroup1()
6356 tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1()
6358 tempax--; in SiS_SetGroup1()
6362 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_SetGroup1()
6364 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6365 cr4 = SiS_Pr->CCRT1CRTC[4]; in SiS_SetGroup1()
6366 cr14 = SiS_Pr->CCRT1CRTC[14]; in SiS_SetGroup1()
6367 cr5 = SiS_Pr->CCRT1CRTC[5]; in SiS_SetGroup1()
6368 cr15 = SiS_Pr->CCRT1CRTC[15]; in SiS_SetGroup1()
6370 cr4 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4]; in SiS_SetGroup1()
6371 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14]; in SiS_SetGroup1()
6372 cr5 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5]; in SiS_SetGroup1()
6373 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15]; in SiS_SetGroup1()
6375 tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; /* (VGAHRS-3)*8 */ in SiS_SetGroup1()
6376 tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3; /* (VGAHRE-3)*8 */ in SiS_SetGroup1()
6381 tempax = SiS_Pr->SiS_VGAHT; in SiS_SetGroup1()
6383 tempax--; in SiS_SetGroup1()
6387 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSet525p1024)) { in SiS_SetGroup1()
6394 … SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx); /* CRT2 Horizontal Retrace Start */ in SiS_SetGroup1()
6396 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx); /* CRT2 Horizontal Retrace End */ in SiS_SetGroup1()
6398 temp = ((tempbx >> 8) & 0x0F) | ((pushbx >> 4) & 0xF0); in SiS_SetGroup1()
6399 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* Overflow */ in SiS_SetGroup1()
6403 tempcx = SiS_Pr->SiS_VGAVT - 1; in SiS_SetGroup1()
6404 temp = tempcx & 0x00FF; in SiS_SetGroup1()
6406 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetGroup1()
6407 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetGroup1()
6408 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1()
6409 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6410 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { in SiS_SetGroup1()
6411 temp--; in SiS_SetGroup1()
6415 temp--; in SiS_SetGroup1()
6417 } else if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup1()
6418 temp--; in SiS_SetGroup1()
6421 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); /* CRT2 Vertical Total */ in SiS_SetGroup1()
6423 tempbx = SiS_Pr->SiS_VGAVDE - 1; in SiS_SetGroup1()
6424 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx); /* CRT2 Vertical Display Enable End */ in SiS_SetGroup1()
6426 temp = ((tempbx >> 5) & 0x38) | ((tempcx >> 8) & 0x07); in SiS_SetGroup1()
6427 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp); /* Overflow */ in SiS_SetGroup1()
6429 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) { in SiS_SetGroup1()
6433 tempcx -= tempax; in SiS_SetGroup1()
6441 …tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x1… in SiS_SetGroup1()
6442 …tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 … in SiS_SetGroup1()
6445 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6446 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6447 tempbx = SiS_Pr->CVSyncStart; in SiS_SetGroup1()
6448 tempcx = SiS_Pr->CVSyncEnd; in SiS_SetGroup1()
6450 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { in SiS_SetGroup1()
6452 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup1()
6453 cr8 = SiS_Pr->CCRT1CRTC[8]; in SiS_SetGroup1()
6454 cr7 = SiS_Pr->CCRT1CRTC[7]; in SiS_SetGroup1()
6455 cr13 = SiS_Pr->CCRT1CRTC[13]; in SiS_SetGroup1()
6456 tempcx = SiS_Pr->CCRT1CRTC[9]; in SiS_SetGroup1()
6458 cr8 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8]; in SiS_SetGroup1()
6459 cr7 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7]; in SiS_SetGroup1()
6460 cr13 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13]; in SiS_SetGroup1()
6461 tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9]; in SiS_SetGroup1()
6469 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx); /* CRT2 Vertical Retrace Start */ in SiS_SetGroup1()
6471 temp = ((tempbx >> 4) & 0x70) | (tempcx & 0x0F); in SiS_SetGroup1()
6472 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp); /* CRT2 Vert. Retrace End; Overflow */ in SiS_SetGroup1()
6476 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1()
6478 #ifdef CONFIG_FB_SIS_300 /* ---------- 300 series -------------- */ in SiS_SetGroup1()
6480 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6481 temp = 0x20; in SiS_SetGroup1()
6482 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetGroup1()
6483 temp = 0x10; in SiS_SetGroup1()
6484 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) temp = 0x2c; in SiS_SetGroup1()
6485 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6487 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetGroup1()
6488 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6490 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) temp = 0x24; in SiS_SetGroup1()
6491 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) temp = 0x2c; in SiS_SetGroup1()
6492 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x08; in SiS_SetGroup1()
6493 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup1()
6494 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) temp = 0x2c; in SiS_SetGroup1()
6495 else temp = 0x20; in SiS_SetGroup1()
6497 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1()
6499 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) in SiS_SetGroup1()
6500 temp = ROMAddr[0x221]; in SiS_SetGroup1()
6501 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) in SiS_SetGroup1()
6502 temp = ROMAddr[0x222]; in SiS_SetGroup1()
6503 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) in SiS_SetGroup1()
6504 temp = ROMAddr[0x223]; in SiS_SetGroup1()
6506 temp = ROMAddr[0x224]; in SiS_SetGroup1()
6509 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1()
6510 if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC; in SiS_SetGroup1()
6514 temp = 0x20; in SiS_SetGroup1()
6515 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup1()
6516 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04; in SiS_SetGroup1()
6518 if(SiS_Pr->SiS_UseROM) { in SiS_SetGroup1()
6520 temp = ROMAddr[0x220]; in SiS_SetGroup1()
6523 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup1()
6524 if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC; in SiS_SetGroup1()
6528 temp &= 0x3c; in SiS_SetGroup1()
6530 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Softw… in SiS_SetGroup1()
6536 #ifdef CONFIG_FB_SIS_315 /* --------------- 315/330 series ---------------*/ in SiS_SetGroup1()
6538 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetGroup1()
6540 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetGroup1()
6542 if(SiS_Pr->ChipType == SIS_740) temp = 0x03; in SiS_SetGroup1()
6543 else temp = 0x00; in SiS_SetGroup1()
6545 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a; in SiS_SetGroup1()
6547 if(SiS_Pr->ChipType == SIS_650) { in SiS_SetGroup1()
6548 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6549 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F; in SiS_SetGroup1()
6553 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) { in SiS_SetGroup1()
6554 temp = 0x08; in SiS_SetGroup1()
6556 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetGroup1()
6561 … SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp); /* Panel Link Delay Compensation */ in SiS_SetGroup1()
6569 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); in SiS_SetGroup1()
6577 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetGroup1()
6578 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetGroup1()
6581 } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup1()
6585 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetGroup1()
6588 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6589 if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup1()
6610 a = SiS_Pr->SiS_VGAHDE; in SiS_GetGroup2CLVXPtr()
6611 b = SiS_Pr->SiS_HDE; in SiS_GetGroup2CLVXPtr()
6613 a = SiS_Pr->SiS_VGAVDE; in SiS_GetGroup2CLVXPtr()
6614 b = SiS_Pr->SiS_VDE; in SiS_GetGroup2CLVXPtr()
6622 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_GetGroup2CLVXPtr()
6627 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_GetGroup2CLVXPtr()
6628 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) tableptr = SiS_Part2CLVX_3; in SiS_GetGroup2CLVXPtr()
6629 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tableptr = SiS_Part2CLVX_3; in SiS_GetGroup2CLVXPtr()
6631 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_GetGroup2CLVXPtr()
6638 if((tableptr[p] | tableptr[p+1] << 8) == 0xffff) p -= 0x42; in SiS_GetGroup2CLVXPtr()
6649 unsigned char temp; in SiS_SetGroup2_C_ELV() local
6652 if(!(SiS_Pr->SiS_VBType & VB_SISTAP4SCALER)) return; in SiS_SetGroup2_C_ELV()
6656 SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]); in SiS_SetGroup2_C_ELV()
6658 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2_C_ELV()
6661 SiS_SetReg(SiS_Pr->SiS_Part2Port, i, tableptr[j]); in SiS_SetGroup2_C_ELV()
6664 temp = 0x10; in SiS_SetGroup2_C_ELV()
6665 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04; in SiS_SetGroup2_C_ELV()
6666 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); in SiS_SetGroup2_C_ELV()
6675 if(SiS_Pr->ChipType < SIS_315H) return false; in SiS_GetCRT2Part2Ptr()
6678 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetCRT2Part2Ptr()
6680 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetCRT2Part2Ptr()
6685 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Part2Ptr()
6686 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_GetCRT2Part2Ptr()
6691 if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) { in SiS_GetCRT2Part2Ptr()
6692 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_GetCRT2Part2Ptr()
6693 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) (*CRT2Index) = 206; in SiS_GetCRT2Part2Ptr()
6710 if(!SiS_Pr->UseCustomMode) { in SiS_Group2LCDSpecial()
6711 if( ( ( (SiS_Pr->ChipType == SIS_630) || in SiS_Group2LCDSpecial()
6712 (SiS_Pr->ChipType == SIS_730) ) && in SiS_Group2LCDSpecial()
6713 (SiS_Pr->ChipRevision > 2) ) && in SiS_Group2LCDSpecial()
6714 (SiS_Pr->SiS_LCDResInfo == Panel_1024x768) && in SiS_Group2LCDSpecial()
6715 (!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) && in SiS_Group2LCDSpecial()
6716 (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) { in SiS_Group2LCDSpecial()
6718 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9); in SiS_Group2LCDSpecial()
6719 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC); in SiS_Group2LCDSpecial()
6720 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6); in SiS_Group2LCDSpecial()
6722 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B); in SiS_Group2LCDSpecial()
6723 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13); in SiS_Group2LCDSpecial()
6724 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5); in SiS_Group2LCDSpecial()
6725 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08); in SiS_Group2LCDSpecial()
6726 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2); in SiS_Group2LCDSpecial()
6730 if(SiS_Pr->ChipType < SIS_315H) { in SiS_Group2LCDSpecial()
6731 if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) { in SiS_Group2LCDSpecial()
6734 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_Group2LCDSpecial()
6735 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_Group2LCDSpecial()
6741 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff); in SiS_Group2LCDSpecial()
6744 if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) { in SiS_Group2LCDSpecial()
6745 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_Group2LCDSpecial()
6747 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28); in SiS_Group2LCDSpecial()
6751 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18); in SiS_Group2LCDSpecial()
6752 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]); in SiS_Group2LCDSpecial()
6767 if(SiS_Pr->ChipType != SIS_300) return; in SiS_Set300Part2Regs()
6768 if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return; in SiS_Set300Part2Regs()
6769 if(SiS_Pr->UseCustomMode) return; in SiS_Set300Part2Regs()
6772 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_Set300Part2Regs()
6774 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_Set300Part2Regs()
6778 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; in SiS_Set300Part2Regs()
6779 else CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2; in SiS_Set300Part2Regs()
6783 CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; in SiS_Set300Part2Regs()
6787 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_Set300Part2Regs()
6788 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_Set300Part2Regs()
6790 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6793 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6796 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_Set300Part2Regs()
6798 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_Set300Part2Regs()
6799 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_Set300Part2Regs()
6806 if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) return; in SiS_SetTVSpecial()
6807 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) return; in SiS_SetTVSpecial()
6808 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) return; in SiS_SetTVSpecial()
6810 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetTVSpecial()
6811 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetTVSpecial()
6819 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,specialtv[j]); in SiS_SetTVSpecial()
6821 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72); in SiS_SetTVSpecial()
6822 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750)) { in SiS_SetTVSpecial()
6823 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetTVSpecial()
6824 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); in SiS_SetTVSpecial()
6825 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b); in SiS_SetTVSpecial()
6827 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); /* 15 */ in SiS_SetTVSpecial()
6828 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a); /* 1b */ in SiS_SetTVSpecial()
6835 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 21 */ in SiS_SetTVSpecial()
6836 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 5a */ in SiS_SetTVSpecial()
6838 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a); /* 21 */ in SiS_SetTVSpecial()
6839 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53); /* 5a */ in SiS_SetTVSpecial()
6847 unsigned short temp; in SiS_SetGroup2_Tail() local
6849 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) { in SiS_SetGroup2_Tail()
6850 if(SiS_Pr->SiS_VGAVDE == 525) { in SiS_SetGroup2_Tail()
6851 temp = 0xc3; in SiS_SetGroup2_Tail()
6852 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2_Tail()
6853 temp++; in SiS_SetGroup2_Tail()
6854 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) temp += 2; in SiS_SetGroup2_Tail()
6856 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6857 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3); in SiS_SetGroup2_Tail()
6858 } else if(SiS_Pr->SiS_VGAVDE == 420) { in SiS_SetGroup2_Tail()
6859 temp = 0x4d; in SiS_SetGroup2_Tail()
6860 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2_Tail()
6861 temp++; in SiS_SetGroup2_Tail()
6862 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) temp++; in SiS_SetGroup2_Tail()
6864 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6868 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup2_Tail()
6869 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { in SiS_SetGroup2_Tail()
6870 if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SiS_SetGroup2_Tail()
6871 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03); in SiS_SetGroup2_Tail()
6874 temp = 1; in SiS_SetGroup2_Tail()
6875 if(ModeNo <= 0x13) temp = 3; in SiS_SetGroup2_Tail()
6876 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp); in SiS_SetGroup2_Tail()
6879 /* 651+301C, for 1280x768 - do I really need that? */ in SiS_SetGroup2_Tail()
6880 if((SiS_Pr->SiS_PanelXRes == 1280) && (SiS_Pr->SiS_PanelYRes == 768)) { in SiS_SetGroup2_Tail()
6881 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { in SiS_SetGroup2_Tail()
6882 if(((SiS_Pr->SiS_HDE == 640) && (SiS_Pr->SiS_VDE == 480)) || in SiS_SetGroup2_Tail()
6883 ((SiS_Pr->SiS_HDE == 320) && (SiS_Pr->SiS_VDE == 240))) { in SiS_SetGroup2_Tail()
6907 unsigned short i, j, tempax, tempbx, tempcx, tempch, tempcl, temp; in SiS_SetGroup2() local
6916 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup2()
6920 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup2()
6921 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetGroup2()
6922 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
6923 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup2()
6926 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup2()
6927 crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetGroup2()
6930 temp = 0; in SiS_SetGroup2()
6931 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08; in SiS_SetGroup2()
6932 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04; in SiS_SetGroup2()
6933 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) temp |= 0x02; in SiS_SetGroup2()
6934 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp |= 0x01; in SiS_SetGroup2()
6936 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) temp |= 0x10; in SiS_SetGroup2()
6938 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp); in SiS_SetGroup2()
6941 TimingPoint = SiS_Pr->SiS_PALTiming; in SiS_SetGroup2()
6944 if( (SiS_Pr->SiS_VBType & VB_SIS30xBLV) && in SiS_SetGroup2()
6945 ( (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in SiS_SetGroup2()
6946 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode) ) ) { in SiS_SetGroup2()
6950 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
6952 TimingPoint = SiS_Pr->SiS_HiTVExtTiming; in SiS_SetGroup2()
6953 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
6954 TimingPoint = SiS_Pr->SiS_HiTVSt2Timing; in SiS_SetGroup2()
6955 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup2()
6956 TimingPoint = SiS_Pr->SiS_HiTVSt1Timing; in SiS_SetGroup2()
6960 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
6963 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) i = 2; in SiS_SetGroup2()
6964 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) i = 1; in SiS_SetGroup2()
6970 } else if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
6976 TimingPoint = SiS_Pr->SiS_NTSCTiming; in SiS_SetGroup2()
6977 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetNTSCJ) ? 0x01 : 0x00; /* SiS_PALPhase : SiS_NTSCPhase */ in SiS_SetGroup2()
6982 if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) { in SiS_SetGroup2()
6983 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetPALM) ? 0x02 : 0x03; /* SiS_PALMPhase : SiS_PALNPhase */ in SiS_SetGroup2()
6987 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in SiS_SetGroup2()
6988 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
6990 } else if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) { in SiS_SetGroup2()
6998 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS_TVPhase[(PhaseIndex * 4) + j]); in SiS_SetGroup2()
7002 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
7005 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]); in SiS_SetGroup2()
7008 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2()
7009 if(SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetGroup2()
7010 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F); in SiS_SetGroup2()
7014 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode); in SiS_SetGroup2()
7016 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE); in SiS_SetGroup2()
7017 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE); in SiS_SetGroup2()
7018 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE); in SiS_SetGroup2()
7019 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE); in SiS_SetGroup2()
7021 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempax = 950; in SiS_SetGroup2()
7022 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempax = 680; in SiS_SetGroup2()
7023 else if(SiS_Pr->SiS_TVMode & TVSetPAL) tempax = 520; in SiS_SetGroup2()
7026 if( ((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) && (SiS_Pr->SiS_VDE <= tempax)) || in SiS_SetGroup2()
7027 ( (SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) && in SiS_SetGroup2()
7028 ((SiS_Pr->SiS_VGAHDE == 1024) || (SiS_Pr->SiS_VDE <= tempax)) ) ) { in SiS_SetGroup2()
7030 tempax -= SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7032 if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) { in SiS_SetGroup2()
7037 temp = tempax + (unsigned short)TimingPoint[0]; in SiS_SetGroup2()
7038 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7040 temp = tempax + (unsigned short)TimingPoint[1]; in SiS_SetGroup2()
7041 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7043 if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) { in SiS_SetGroup2()
7044 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
7045 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); in SiS_SetGroup2()
7046 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); in SiS_SetGroup2()
7048 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17); in SiS_SetGroup2()
7049 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d); in SiS_SetGroup2()
7055 tempcx = SiS_Pr->SiS_HT; in SiS_SetGroup2()
7057 tempcx--; in SiS_SetGroup2()
7058 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) tempcx--; in SiS_SetGroup2()
7059 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx); in SiS_SetGroup2()
7060 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f)); in SiS_SetGroup2()
7062 tempcx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup2()
7065 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; in SiS_SetGroup2()
7066 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7070 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx); in SiS_SetGroup2()
7071 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7074 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7075 tempbx -= 4; in SiS_SetGroup2()
7078 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0)); in SiS_SetGroup2()
7082 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx); in SiS_SetGroup2()
7083 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0)); in SiS_SetGroup2()
7086 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4; in SiS_SetGroup2()
7087 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7089 tempcx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup2()
7092 tempcx -= (TimingPoint[j] | ((TimingPoint[j+1]) << 8)); in SiS_SetGroup2()
7093 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7095 tempcx -= 11; in SiS_SetGroup2()
7096 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_SetGroup2()
7097 tempcx = SiS_GetVGAHT2(SiS_Pr) - 1; in SiS_SetGroup2()
7099 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx); in SiS_SetGroup2()
7101 tempbx = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7102 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup2()
7103 if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746; in SiS_SetGroup2()
7104 if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746; in SiS_SetGroup2()
7105 if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853; in SiS_SetGroup2()
7106 } else if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && in SiS_SetGroup2()
7107 (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p))) ) { in SiS_SetGroup2()
7109 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup2()
7110 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup2()
7112 } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
7113 if(SiS_Pr->SiS_ModeType <= ModeVGA) { in SiS_SetGroup2()
7118 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup2()
7119 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7122 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { in SiS_SetGroup2()
7123 if(ModeNo == 0x03) tempbx++; /* From 1.10.7w - doesn't make sense */ in SiS_SetGroup2()
7127 tempbx -= 2; in SiS_SetGroup2()
7128 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx); in SiS_SetGroup2()
7130 temp = (tempcx >> 8) & 0x0F; in SiS_SetGroup2()
7131 temp |= ((tempbx >> 2) & 0xC0); in SiS_SetGroup2()
7132 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) { in SiS_SetGroup2()
7133 temp |= 0x10; in SiS_SetGroup2()
7134 if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20; in SiS_SetGroup2()
7136 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp); in SiS_SetGroup2()
7138 if(SiS_Pr->SiS_VBType & VB_SISPART4OVERFLOW) { in SiS_SetGroup2()
7139 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5)); in SiS_SetGroup2()
7142 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetGroup2()
7143 tempbx = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7144 if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && in SiS_SetGroup2()
7145 (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) ) { in SiS_SetGroup2()
7148 tempbx -= 3; in SiS_SetGroup2()
7149 temp = ((tempbx >> 3) & 0x60) | 0x18; in SiS_SetGroup2()
7150 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp); in SiS_SetGroup2()
7151 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx); in SiS_SetGroup2()
7153 if(SiS_Pr->SiS_VBType & VB_SISPART4OVERFLOW) { in SiS_SetGroup2()
7154 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4)); in SiS_SetGroup2()
7160 if(SiS_Pr->SiS_VGAHDE >= SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7167 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup2()
7168 if(SiS_Pr->SiS_VGAHDE >= 960) { in SiS_SetGroup2()
7169 if((!(modeflag & HalfDCLK)) || (SiS_Pr->ChipType < SIS_315H)) { in SiS_SetGroup2()
7171 if(SiS_Pr->SiS_VGAHDE >= 1280) { in SiS_SetGroup2()
7183 longtemp = ((SiS_Pr->SiS_VGAHDE * tempch) / tempcl) << 13; in SiS_SetGroup2()
7184 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) longtemp <<= 3; in SiS_SetGroup2()
7185 tempax = longtemp / SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7186 if(longtemp % SiS_Pr->SiS_HDE) tempax++; in SiS_SetGroup2()
7191 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax); in SiS_SetGroup2()
7192 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx); in SiS_SetGroup2()
7194 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetGroup2()
7198 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,tempcx); in SiS_SetGroup2()
7200 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup2()
7207 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx); in SiS_SetGroup2()
7208 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx); in SiS_SetGroup2()
7209 temp = (tempcx & 0x0300) >> 6; in SiS_SetGroup2()
7210 temp |= ((tempbx >> 8) & 0x03); in SiS_SetGroup2()
7211 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup2()
7212 temp |= 0x10; in SiS_SetGroup2()
7213 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp |= 0x20; in SiS_SetGroup2()
7214 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40; in SiS_SetGroup2()
7216 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp); in SiS_SetGroup2()
7218 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); in SiS_SetGroup2()
7219 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3)); in SiS_SetGroup2()
7223 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { in SiS_SetGroup2()
7224 temp = 0; in SiS_SetGroup2()
7225 if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; in SiS_SetGroup2()
7226 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp); in SiS_SetGroup2()
7231 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup2()
7232 if(!(SiS_Pr->SiS_TVMode & TVSetNTSC1024)) { in SiS_SetGroup2()
7233 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_SetGroup2()
7234 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1)); in SiS_SetGroup2()
7236 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF); in SiS_SetGroup2()
7239 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup2()
7240 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetGroup2()
7241 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00); in SiS_SetGroup2()
7245 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) return; in SiS_SetGroup2()
7249 tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7251 tempbx--; /* RHACTE = HDE - 1 */ in SiS_SetGroup2()
7252 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx); in SiS_SetGroup2()
7253 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7255 temp = 0x01; in SiS_SetGroup2()
7256 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetGroup2()
7257 if(SiS_Pr->SiS_ModeType == ModeEGA) { in SiS_SetGroup2()
7258 if(SiS_Pr->SiS_VGAHDE >= 1024) { in SiS_SetGroup2()
7259 temp = 0x02; in SiS_SetGroup2()
7260 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_SetGroup2()
7261 temp = 0x01; in SiS_SetGroup2()
7266 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp); in SiS_SetGroup2()
7268 tempbx = SiS_Pr->SiS_VDE - 1; in SiS_SetGroup2()
7269 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx); in SiS_SetGroup2()
7270 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07)); in SiS_SetGroup2()
7272 tempcx = SiS_Pr->SiS_VT - 1; in SiS_SetGroup2()
7273 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx); in SiS_SetGroup2()
7274 temp = (tempcx >> 3) & 0xE0; in SiS_SetGroup2()
7275 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SiS_SetGroup2()
7277 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { in SiS_SetGroup2()
7278 temp |= 0x10; in SiS_SetGroup2()
7281 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp); in SiS_SetGroup2()
7283 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0); in SiS_SetGroup2()
7284 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0); in SiS_SetGroup2()
7286 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); in SiS_SetGroup2()
7287 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); in SiS_SetGroup2()
7295 case 200: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1; break; in SiS_SetGroup2()
7298 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_SetGroup2()
7299 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_SetGroup2()
7301 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7304 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7307 SiS_SetReg(SiS_Pr->SiS_Part2Port,j,(CRT2Part2Ptr+resindex)->CR[i]); in SiS_SetGroup2()
7309 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_SetGroup2()
7310 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_SetGroup2()
7318 /* Clevo dual-link 1024x768 */ in SiS_SetGroup2()
7322 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7323 if((SiS_Pr->SiS_LCDInfo & LCDPass11) || (SiS_Pr->PanelYRes == SiS_Pr->SiS_VDE)) { in SiS_SetGroup2()
7324 tempbx = SiS_Pr->SiS_VDE - 1; in SiS_SetGroup2()
7325 tempcx = SiS_Pr->SiS_VT - 1; in SiS_SetGroup2()
7327 tempbx = SiS_Pr->SiS_VDE + ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); in SiS_SetGroup2()
7328 tempcx = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2); in SiS_SetGroup2()
7331 tempbx = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7332 tempcx = SiS_Pr->SiS_VT; in SiS_SetGroup2()
7334 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7335 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7336 /* if(SiS_Pr->SiS_VGAVDE == 525) tempax += 0x3c; */ /* 651+301C */ in SiS_SetGroup2()
7337 if(SiS_Pr->PanelYRes < SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7340 tempax -= SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7344 tempcx -= tempax; /* lcdvdes */ in SiS_SetGroup2()
7345 tempbx -= tempax; /* lcdvdee */ in SiS_SetGroup2()
7348 /* Non-expanding: lcdvdes = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */ in SiS_SetGroup2()
7350 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ in SiS_SetGroup2()
7351 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ in SiS_SetGroup2()
7353 temp = (tempbx >> 5) & 0x38; in SiS_SetGroup2()
7354 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup2()
7355 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7357 tempax = SiS_Pr->SiS_VDE; in SiS_SetGroup2()
7358 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7359 tempax = SiS_Pr->PanelYRes; in SiS_SetGroup2()
7361 tempcx = (SiS_Pr->SiS_VT - tempax) >> 4; in SiS_SetGroup2()
7362 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7363 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7364 tempcx = (SiS_Pr->SiS_VT - tempax) / 10; in SiS_SetGroup2()
7368 tempbx = ((SiS_Pr->SiS_VT + SiS_Pr->SiS_VDE) >> 1) - 1; in SiS_SetGroup2()
7369 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7370 if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) { in SiS_SetGroup2()
7371 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { /* ? */ in SiS_SetGroup2()
7372 tempax = SiS_Pr->SiS_VT - SiS_Pr->PanelYRes; in SiS_SetGroup2()
7375 tempbx -= (tempax - 1); in SiS_SetGroup2()
7377 tempbx -= 10; in SiS_SetGroup2()
7378 if(tempbx <= SiS_Pr->SiS_VDE) tempbx = SiS_Pr->SiS_VDE + 1; in SiS_SetGroup2()
7382 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_SetGroup2()
7384 if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (crt2crtc == 6)) { in SiS_SetGroup2()
7385 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_SetGroup2()
7392 /* non-expanding: lcdvrs = ((VT + VDE) / 2) - 10 */ in SiS_SetGroup2()
7394 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7395 tempbx = SiS_Pr->CVSyncStart; in SiS_SetGroup2()
7398 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ in SiS_SetGroup2()
7400 temp = (tempbx >> 4) & 0xF0; in SiS_SetGroup2()
7402 temp |= (tempbx & 0x0F); in SiS_SetGroup2()
7404 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7405 temp &= 0xf0; in SiS_SetGroup2()
7406 temp |= (SiS_Pr->CVSyncEnd & 0x0f); in SiS_SetGroup2()
7409 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7416 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) bridgeoffset += 2; in SiS_SetGroup2()
7417 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) bridgeoffset += 2; /* OK for Averatec 1280x800 (301C) */ in SiS_SetGroup2()
7419 else if(SiS_Pr->SiS_VBType & VB_SIS302LV) bridgeoffset++; /* OK for Asus A4L 1280x800 */ in SiS_SetGroup2()
7422 temp = 0; in SiS_SetGroup2()
7423 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7424 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7425 temp = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); in SiS_SetGroup2()
7426 if(SiS_IsDualLink(SiS_Pr)) temp >>= 1; in SiS_SetGroup2()
7429 temp += bridgeoffset; in SiS_SetGroup2()
7430 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp); /* lcdhdes */ in SiS_SetGroup2()
7431 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0)); in SiS_SetGroup2()
7433 tempcx = SiS_Pr->SiS_HT; in SiS_SetGroup2()
7434 tempax = tempbx = SiS_Pr->SiS_HDE; in SiS_SetGroup2()
7435 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7436 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) { in SiS_SetGroup2()
7437 tempax = SiS_Pr->PanelXRes; in SiS_SetGroup2()
7438 tempbx = SiS_Pr->PanelXRes - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2); in SiS_SetGroup2()
7449 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ in SiS_SetGroup2()
7450 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f)); in SiS_SetGroup2()
7452 tempcx = (tempcx - tempax) >> 2; in SiS_SetGroup2()
7457 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_SetGroup2()
7458 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_SetGroup2()
7459 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetGroup2()
7460 if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47; in SiS_SetGroup2()
7465 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7466 tempbx = SiS_Pr->CHSyncStart; in SiS_SetGroup2()
7472 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ in SiS_SetGroup2()
7473 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7478 if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SiS_SetGroup2()
7479 if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) tempcx >>= 2; in SiS_SetGroup2()
7483 if(SiS_Pr->UseCustomMode) { in SiS_SetGroup2()
7484 tempbx = SiS_Pr->CHSyncEnd; in SiS_SetGroup2()
7490 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ in SiS_SetGroup2()
7498 } /* CRT2-LCD from table */ in SiS_SetGroup2()
7512 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup3()
7515 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00); in SiS_SetGroup3()
7520 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetGroup3()
7521 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7522 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7524 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5); in SiS_SetGroup3()
7525 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7); in SiS_SetGroup3()
7528 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetGroup3()
7529 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7530 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7531 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8); in SiS_SetGroup3()
7535 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup3()
7536 tempdi = SiS_Pr->SiS_HiTVGroup3Data; in SiS_SetGroup3()
7537 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) { in SiS_SetGroup3()
7538 tempdi = SiS_Pr->SiS_HiTVGroup3Simu; in SiS_SetGroup3()
7540 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) { in SiS_SetGroup3()
7541 if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) { in SiS_SetGroup3()
7543 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) tempdi = SiS_HiTVGroup3_2; in SiS_SetGroup3()
7548 SiS_SetReg(SiS_Pr->SiS_Part3Port,i,tempdi[i]); in SiS_SetGroup3()
7550 if(SiS_Pr->SiS_VBType & VB_SIS30xCLV) { in SiS_SetGroup3()
7551 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) { in SiS_SetGroup3()
7552 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f); in SiS_SetGroup3()
7571 unsigned short temp, temp1, temp2;
7573 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f);
7574 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20);
7575 temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
7576 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp);
7577 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0));
7578 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f;
7579 temp = (unsigned short)((int)(temp) + shift);
7580 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f));
7581 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
7582 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42);
7583 temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
7584 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp);
7585 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0));
7592 unsigned short temp, temp1; in SiS_SetGroup4_C_ELV() local
7593 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetGroup4_C_ELV()
7595 if(!(SiS_Pr->SiS_VBType & VB_SIS30xCLV)) return; in SiS_SetGroup4_C_ELV()
7596 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) return; in SiS_SetGroup4_C_ELV()
7598 if(SiS_Pr->ChipType >= XGI_20) return; in SiS_SetGroup4_C_ELV()
7600 if((SiS_Pr->ChipType >= SIS_661) && (SiS_Pr->SiS_ROMNew)) { in SiS_SetGroup4_C_ELV()
7604 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08); in SiS_SetGroup4_C_ELV()
7605 temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a); in SiS_SetGroup4_C_ELV()
7606 if(!(temp & 0x01)) { in SiS_SetGroup4_C_ELV()
7607 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf); in SiS_SetGroup4_C_ELV()
7608 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc); in SiS_SetGroup4_C_ELV()
7609 if((SiS_Pr->ChipType < SIS_661) && (!(SiS_Pr->SiS_ROMNew))) { in SiS_SetGroup4_C_ELV()
7610 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8); in SiS_SetGroup4_C_ELV()
7612 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb); in SiS_SetGroup4_C_ELV()
7613 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp = 0x0000; in SiS_SetGroup4_C_ELV()
7614 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp = 0x0002; in SiS_SetGroup4_C_ELV()
7615 else if(SiS_Pr->SiS_TVMode & TVSetHiVision) temp = 0x0400; in SiS_SetGroup4_C_ELV()
7616 else temp = 0x0402; in SiS_SetGroup4_C_ELV()
7617 if((SiS_Pr->ChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) { in SiS_SetGroup4_C_ELV()
7619 if(SiS_Pr->SiS_TVMode & TVAspect43) temp1 = 4; in SiS_SetGroup4_C_ELV()
7620 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1); in SiS_SetGroup4_C_ELV()
7621 if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7622 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7623 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7625 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x39,0xfd); in SiS_SetGroup4_C_ELV()
7628 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03; in SiS_SetGroup4_C_ELV()
7629 if(temp1 == 0x01) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7630 if(temp1 == 0x03) temp |= 0x04; /* ? why not 0x10? */ in SiS_SetGroup4_C_ELV()
7631 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7632 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7634 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3b,0xfd); in SiS_SetGroup4_C_ELV()
7639 if(SiS_Pr->ChipType >= SIS_661) { /* ? */ in SiS_SetGroup4_C_ELV()
7640 if(SiS_Pr->SiS_TVMode & TVAspect43) { in SiS_SetGroup4_C_ELV()
7641 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) { in SiS_SetGroup4_C_ELV()
7647 } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) { in SiS_SetGroup4_C_ELV()
7663 unsigned short vclkindex, temp, reg1, reg2; in SiS_SetCRT2VCLK() local
7665 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT2VCLK()
7666 reg1 = SiS_Pr->CSR2B; in SiS_SetCRT2VCLK()
7667 reg2 = SiS_Pr->CSR2C; in SiS_SetCRT2VCLK()
7670 reg1 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_A; in SiS_SetCRT2VCLK()
7671 reg2 = SiS_Pr->SiS_VBVCLKData[vclkindex].Part4_B; in SiS_SetCRT2VCLK()
7674 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetCRT2VCLK()
7675 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSet525p1024)) { in SiS_SetCRT2VCLK()
7676 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57); in SiS_SetCRT2VCLK()
7677 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46); in SiS_SetCRT2VCLK()
7678 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6); in SiS_SetCRT2VCLK()
7680 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7681 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7684 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01); in SiS_SetCRT2VCLK()
7685 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7686 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7688 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00); in SiS_SetCRT2VCLK()
7689 temp = 0x08; in SiS_SetCRT2VCLK()
7690 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20; in SiS_SetCRT2VCLK()
7691 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp); in SiS_SetCRT2VCLK()
7697 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetDualLinkEtc()
7698 if(SiS_Pr->SiS_VBType & VB_SISDUALLINK) { in SiS_SetDualLinkEtc()
7701 if(SiS_Pr->SiS_LCDInfo & LCDDualLink) { in SiS_SetDualLinkEtc()
7702 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); in SiS_SetDualLinkEtc()
7704 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20); in SiS_SetDualLinkEtc()
7709 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_SetDualLinkEtc()
7710 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_SetDualLinkEtc()
7712 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_SetDualLinkEtc()
7714 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_SetDualLinkEtc()
7722 unsigned short tempax, tempcx, tempbx, modeflag, temp, resinfo; in SiS_SetGroup4() local
7726 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetGroup4()
7727 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_SetGroup4()
7728 } else if(SiS_Pr->UseCustomMode) { in SiS_SetGroup4()
7729 modeflag = SiS_Pr->CModeFlag; in SiS_SetGroup4()
7732 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetGroup4()
7733 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_SetGroup4()
7736 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup4()
7737 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_SetGroup4()
7738 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup4()
7739 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7744 if(SiS_Pr->SiS_VBType & (VB_SIS30xCLV | VB_SIS302LV)) { in SiS_SetGroup4()
7745 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7746 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f); in SiS_SetGroup4()
7750 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetGroup4()
7751 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetGroup4()
7757 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT); in SiS_SetGroup4()
7759 tempbx = SiS_Pr->SiS_RVBHCMAX; in SiS_SetGroup4()
7760 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx); in SiS_SetGroup4()
7762 temp = (tempbx >> 1) & 0x80; in SiS_SetGroup4()
7764 tempcx = SiS_Pr->SiS_VGAHT - 1; in SiS_SetGroup4()
7765 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx); in SiS_SetGroup4()
7767 temp |= ((tempcx >> 5) & 0x78); in SiS_SetGroup4()
7769 tempcx = SiS_Pr->SiS_VGAVT - 1; in SiS_SetGroup4()
7770 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempcx -= 5; in SiS_SetGroup4()
7771 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx); in SiS_SetGroup4()
7773 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup4()
7774 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp); in SiS_SetGroup4()
7776 tempbx = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup4()
7780 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7781 temp = 0; in SiS_SetGroup4()
7782 if(tempbx > 800) temp = 0x60; in SiS_SetGroup4()
7783 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup4()
7784 temp = 0; in SiS_SetGroup4()
7785 if(tempbx > 1024) temp = 0xC0; in SiS_SetGroup4()
7786 else if(tempbx >= 960) temp = 0xA0; in SiS_SetGroup4()
7787 } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) { in SiS_SetGroup4()
7788 temp = 0; in SiS_SetGroup4()
7789 if(tempbx >= 1280) temp = 0x40; in SiS_SetGroup4()
7790 else if(tempbx >= 1024) temp = 0x20; in SiS_SetGroup4()
7792 temp = 0x80; in SiS_SetGroup4()
7793 if(tempbx >= 1024) temp = 0xA0; in SiS_SetGroup4()
7796 temp |= SiS_Pr->Init_P4_0E; in SiS_SetGroup4()
7798 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_SetGroup4()
7799 if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) { in SiS_SetGroup4()
7800 temp &= 0xf0; in SiS_SetGroup4()
7801 temp |= 0x0A; in SiS_SetGroup4()
7805 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp); in SiS_SetGroup4()
7807 tempeax = SiS_Pr->SiS_VGAVDE; in SiS_SetGroup4()
7808 tempebx = SiS_Pr->SiS_VDE; in SiS_SetGroup4()
7809 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SiS_SetGroup4()
7810 if(!(temp & 0xE0)) tempebx >>=1; in SiS_SetGroup4()
7813 tempcx = SiS_Pr->SiS_RVBHRS; in SiS_SetGroup4()
7814 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx); in SiS_SetGroup4()
7821 tempeax -= tempebx; in SiS_SetGroup4()
7829 temp = (unsigned short)(tempeax & 0x000000FF); in SiS_SetGroup4()
7830 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp); in SiS_SetGroup4()
7831 temp = (unsigned short)((tempeax & 0x0000FF00) >> 8); in SiS_SetGroup4()
7832 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp); in SiS_SetGroup4()
7833 temp = (unsigned short)((tempeax >> 12) & 0x70); /* sic! */ in SiS_SetGroup4()
7834 temp |= (tempcx & 0x4F); in SiS_SetGroup4()
7835 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp); in SiS_SetGroup4()
7837 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetGroup4()
7839 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28); in SiS_SetGroup4()
7843 if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08; in SiS_SetGroup4()
7844 tempax = SiS_Pr->SiS_VGAHDE; in SiS_SetGroup4()
7848 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7849 tempax -= 800; in SiS_SetGroup4()
7855 temp = tempax % 32; in SiS_SetGroup4()
7857 if(temp) tempax++; in SiS_SetGroup4()
7859 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7870 tempax--; in SiS_SetGroup4()
7871 temp = ((tempax >> 4) & 0x30) | tempbx; in SiS_SetGroup4()
7872 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax); in SiS_SetGroup4()
7873 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp); in SiS_SetGroup4()
7875 temp = 0x0036; tempbx = 0xD0; in SiS_SetGroup4()
7876 if((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SiS_SetGroup4()
7877 temp = 0x0026; tempbx = 0xC0; /* See En/DisableBridge() */ in SiS_SetGroup4()
7879 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetGroup4()
7880 … if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr525p))) { in SiS_SetGroup4()
7881 temp |= 0x01; in SiS_SetGroup4()
7882 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetGroup4()
7883 if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in SiS_SetGroup4()
7884 temp &= ~0x01; in SiS_SetGroup4()
7889 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp); in SiS_SetGroup4()
7891 tempbx = SiS_Pr->SiS_HT >> 1; in SiS_SetGroup4()
7893 tempbx -= 2; in SiS_SetGroup4()
7894 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx); in SiS_SetGroup4()
7895 temp = (tempbx >> 5) & 0x38; in SiS_SetGroup4()
7896 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp); in SiS_SetGroup4()
7898 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SiS_SetGroup4()
7899 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetGroup4()
7900 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7901 /* LCD-too-dark-error-source, see FinalizeLCD() */ in SiS_SetGroup4()
7920 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return; in SiS_SetGroup5()
7922 if(SiS_Pr->SiS_ModeType == ModeVGA) { in SiS_SetGroup5()
7923 if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))) { in SiS_SetGroup5()
7924 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_SetGroup5()
7945 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetLVDSCRT1Ptr()
7946 (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSCRT1Ptr()
7948 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetLVDSCRT1Ptr()
7949 (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_GetLVDSCRT1Ptr()
7954 if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSCRT1Ptr()
7957 if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) { in SiS_GetLVDSCRT1Ptr()
7959 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_GetLVDSCRT1Ptr()
7960 if(SiS_Pr->SiS_CHSOverScan) (*DisplayType) = 84; in SiS_GetLVDSCRT1Ptr()
7964 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++; in SiS_GetLVDSCRT1Ptr()
7970 switch(SiS_Pr->SiS_LCDResInfo) { in SiS_GetLVDSCRT1Ptr()
7989 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) { in SiS_GetLVDSCRT1Ptr()
7990 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) (*DisplayType) += 2; in SiS_GetLVDSCRT1Ptr()
8009 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_ModCRT1CRTC()
8010 (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || in SiS_ModCRT1CRTC()
8011 (SiS_Pr->SiS_CustomT == CUT_PANEL848) || in SiS_ModCRT1CRTC()
8012 (SiS_Pr->SiS_CustomT == CUT_PANEL856) ) in SiS_ModCRT1CRTC()
8015 if(SiS_Pr->SiS_IF_DEF_LVDS) { in SiS_ModCRT1CRTC()
8016 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_ModCRT1CRTC()
8017 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return; in SiS_ModCRT1CRTC()
8019 } else if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_ModCRT1CRTC()
8020 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return; in SiS_ModCRT1CRTC()
8023 if(SiS_Pr->SiS_LCDInfo & LCDPass11) return; in SiS_ModCRT1CRTC()
8025 if(SiS_Pr->ChipType < SIS_315H) { in SiS_ModCRT1CRTC()
8026 if(SiS_Pr->SiS_SetFlag & SetDOSMode) return; in SiS_ModCRT1CRTC()
8035 case 50: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_1; break; /* xSTN */ in SiS_ModCRT1CRTC()
8036 case 14: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_2; break; /* xSTN */ in SiS_ModCRT1CRTC()
8037 case 15: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_2_H; break; /* xSTN */ in SiS_ModCRT1CRTC()
8038 case 18: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_3; break; /* xSTN */ in SiS_ModCRT1CRTC()
8039 case 19: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1320x240_3_H; break; /* xSTN */ in SiS_ModCRT1CRTC()
8040 case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1; break; in SiS_ModCRT1CRTC()
8041 case 11: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1640x480_1_H; break; in SiS_ModCRT1CRTC()
8043 case 26: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1; break; in SiS_ModCRT1CRTC()
8044 case 27: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_1_H; break; in SiS_ModCRT1CRTC()
8045 case 28: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2; break; in SiS_ModCRT1CRTC()
8046 case 29: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x600_2_H; break; in SiS_ModCRT1CRTC()
8048 case 80: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UNTSC; break; in SiS_ModCRT1CRTC()
8049 case 81: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1ONTSC; break; in SiS_ModCRT1CRTC()
8050 case 82: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1UPAL; break; in SiS_ModCRT1CRTC()
8051 case 83: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1OPAL; break; in SiS_ModCRT1CRTC()
8052 case 84: LVDSCRT1Ptr = SiS_Pr->SiS_CHTVCRT1SOPAL; break; in SiS_ModCRT1CRTC()
8057 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_ModCRT1CRTC()
8060 tempah = (LVDSCRT1Ptr + ResIndex)->CR[i]; in SiS_ModCRT1CRTC()
8061 SiS_SetReg(SiS_Pr->SiS_P3d4,CRIdx[i],tempah); in SiS_ModCRT1CRTC()
8065 tempah = (LVDSCRT1Ptr + ResIndex)->CR[j]; in SiS_ModCRT1CRTC()
8066 SiS_SetReg(SiS_Pr->SiS_P3c4,i,tempah); in SiS_ModCRT1CRTC()
8069 tempah = (LVDSCRT1Ptr + ResIndex)->CR[14] & 0xE0; in SiS_ModCRT1CRTC()
8070 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah); in SiS_ModCRT1CRTC()
8072 if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_ModCRT1CRTC()
8073 else modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_ModCRT1CRTC()
8075 tempah = ((LVDSCRT1Ptr + ResIndex)->CR[14] & 0x01) << 5; in SiS_ModCRT1CRTC()
8077 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah); in SiS_ModCRT1CRTC()
8094 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2ECLK()
8098 if(SiS_Pr->SiS_LCDInfo & LCDPass11) { in SiS_SetCRT2ECLK()
8099 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT2ECLK()
8100 if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK == 2) { in SiS_SetCRT2ECLK()
8101 RefreshRateTableIndex--; in SiS_SetCRT2ECLK()
8105 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2ECLK()
8111 sr2b = SiS_Pr->SiS_VCLKData[vclkindex].SR2B; in SiS_SetCRT2ECLK()
8112 sr2c = SiS_Pr->SiS_VCLKData[vclkindex].SR2C; in SiS_SetCRT2ECLK()
8114 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2ECLK()
8115 if(SiS_Pr->SiS_UseROM) { in SiS_SetCRT2ECLK()
8124 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT2ECLK()
8125 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) { in SiS_SetCRT2ECLK()
8130 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20); in SiS_SetCRT2ECLK()
8131 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
8132 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
8133 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10); in SiS_SetCRT2ECLK()
8134 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
8135 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
8136 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00); in SiS_SetCRT2ECLK()
8137 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b); in SiS_SetCRT2ECLK()
8138 SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c); in SiS_SetCRT2ECLK()
8153 resindex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_SetCHTVReg()
8155 resindex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; in SiS_SetCHTVReg()
8160 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
8161 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetCHTVReg()
8163 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetCHTVReg()
8164 if(SiS_Pr->SiS_CHSOverScan) TVType = 8; in SiS_SetCHTVReg()
8166 if(SiS_Pr->SiS_TVMode & TVSetPALM) { in SiS_SetCHTVReg()
8168 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
8169 } else if(SiS_Pr->SiS_TVMode & TVSetPALN) { in SiS_SetCHTVReg()
8171 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1; in SiS_SetCHTVReg()
8176 case 0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break; in SiS_SetCHTVReg()
8177 case 1: CHTVRegData = SiS_Pr->SiS_CHTVReg_ONTSC; break; in SiS_SetCHTVReg()
8178 case 2: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPAL; break; in SiS_SetCHTVReg()
8179 case 3: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; in SiS_SetCHTVReg()
8180 case 4: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALM; break; in SiS_SetCHTVReg()
8181 case 5: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALM; break; in SiS_SetCHTVReg()
8182 case 6: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALN; break; in SiS_SetCHTVReg()
8183 case 7: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALN; break; in SiS_SetCHTVReg()
8184 case 8: CHTVRegData = SiS_Pr->SiS_CHTVReg_SOPAL; break; in SiS_SetCHTVReg()
8185 default: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL; break; in SiS_SetCHTVReg()
8189 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetCHTVReg()
8193 /* Chrontel 7005 - I assume that it does not come with a 315 series chip */ in SiS_SetCHTVReg()
8198 if(SiS_Pr->SiS_TVMode & TVSetPAL) { in SiS_SetCHTVReg()
8199 SiS_SetCH700x(SiS_Pr,0x04,0x43); /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8202 SiS_SetCH700x(SiS_Pr,0x04,0x03); /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8212 /* Set minimum flicker filter for Luma channel (SR1-0=00), in SiS_SetCHTVReg()
8213 minimum text enhancement (S3-2=10), in SiS_SetCHTVReg()
8214 maximum flicker filter for Chroma channel (S5-4=10) in SiS_SetCHTVReg()
8215 =00101000=0x28 (When reading, S1-0->S3-2, and S3-2->S1-0!) in SiS_SetCHTVReg()
8221 low bandwidth Luma S-video filter (S2-1=00) in SiS_SetCHTVReg()
8222 disable peak filter in S-video channel (S3=0) in SiS_SetCHTVReg()
8223 high bandwidth Chroma Filter (S5-4=11) in SiS_SetCHTVReg()
8228 /* Register 0x3D does not exist in non-macrovision register map in SiS_SetCHTVReg()
8236 all other bits a read-only. Macrovision? in SiS_SetCHTVReg()
8240 /* Register 0x11 only contains 3 writable bits (S0-S2) for in SiS_SetCHTVReg()
8241 contrast enhancement (set to 010 -> gain 1 Yout = 17/16*(Yin-30) ) in SiS_SetCHTVReg()
8249 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) { /* ---- NTSC ---- */ in SiS_SetCHTVReg()
8250 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) { in SiS_SetCHTVReg()
8255 SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* 0x18-0x1f: FSCI 469,762,048 */ in SiS_SetCHTVReg()
8267 if(resindex == 0x04) { /* ----- 640x480 underscan; Mode 17 */ in SiS_SetCHTVReg()
8270 } else if(resindex == 0x05) { /* ----- 800x600 underscan: Mode 24 */ in SiS_SetCHTVReg()
8272 … SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* (FSCI was 0x1f1c71c7 - this is for mode 22) */ in SiS_SetCHTVReg()
8287 } else { /* ---- PAL ---- */ in SiS_SetCHTVReg()
8297 /* Chrontel 7019 - assumed that it does not come with a 300 series chip */ in SiS_SetCHTVReg()
8301 unsigned short temp; in SiS_SetCHTVReg() local
8306 temp = CHTVRegData[resindex].Reg[0]; in SiS_SetCHTVReg()
8307 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp |= 0x10; in SiS_SetCHTVReg()
8308 SiS_SetCH701x(SiS_Pr,0x00,temp); in SiS_SetCHTVReg()
8317 temp = CHTVRegData[resindex].Reg[7]; in SiS_SetCHTVReg()
8318 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 0x66; in SiS_SetCHTVReg()
8319 SiS_SetCH701x(SiS_Pr,0x07,temp); in SiS_SetCHTVReg()
8330 temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02; in SiS_SetCHTVReg()
8331 /* D1 should be set for PAL, PAL-N and NTSC-J, in SiS_SetCHTVReg()
8334 non-default CIV values and blacklevels, in SiS_SetCHTVReg()
8337 if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02; in SiS_SetCHTVReg()
8338 SiS_SetCH701x(SiS_Pr,0x21,temp); in SiS_SetCHTVReg()
8350 #ifdef CONFIG_FB_SIS_315 /* ----------- 315 series only ---------- */
8355 unsigned short temp; in SiS_Chrontel701xBLOn() local
8358 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xBLOn()
8359 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xBLOn()
8362 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOn()
8363 temp |= 0x20; in SiS_Chrontel701xBLOn()
8364 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOn()
8372 unsigned short temp; in SiS_Chrontel701xBLOff() local
8375 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xBLOff()
8376 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOff()
8377 temp &= 0xDF; in SiS_Chrontel701xBLOff()
8378 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOff()
8397 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelPowerSequencing()
8398 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_ChrontelPowerSequencing()
8399 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1024_740; in SiS_ChrontelPowerSequencing()
8401 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_ChrontelPowerSequencing()
8402 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_ChrontelPowerSequencing()
8403 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { in SiS_ChrontelPowerSequencing()
8404 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1400_740; in SiS_ChrontelPowerSequencing()
8408 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_ChrontelPowerSequencing()
8410 } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || in SiS_ChrontelPowerSequencing()
8411 (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || in SiS_ChrontelPowerSequencing()
8412 (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) { in SiS_ChrontelPowerSequencing()
8465 if(SiS_Pr->ChipType == SIS_740) { in SiS_SetCH701xForLCD()
8466 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_740; in SiS_SetCH701xForLCD()
8467 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_740; in SiS_SetCH701xForLCD()
8468 else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_740; in SiS_SetCH701xForLCD()
8469 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_740; in SiS_SetCH701xForLCD()
8472 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tableptr = table1024_650; in SiS_SetCH701xForLCD()
8473 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_650; in SiS_SetCH701xForLCD()
8474 else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_650; in SiS_SetCH701xForLCD()
8475 else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_650; in SiS_SetCH701xForLCD()
8483 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) return; in SiS_SetCH701xForLCD()
8485 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) return; in SiS_SetCH701xForLCD()
8486 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) return; in SiS_SetCH701xForLCD()
8488 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) return; in SiS_SetCH701xForLCD()
8492 if(SiS_Pr->ChipType == SIS_740) tempbh = 0x0d; in SiS_SetCH701xForLCD()
8503 if(SiS_Pr->ChipType == SIS_740) { in SiS_SetCH701xForLCD()
8507 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_SetCH701xForLCD()
8520 unsigned char temp, temp1; in SiS_ChrontelResetVSync() local
8524 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8525 temp &= 0x7f; /* Use external VSYNC */ in SiS_ChrontelResetVSync()
8526 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8528 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8529 temp |= 0x80; /* Use internal VSYNC */ in SiS_ChrontelResetVSync()
8530 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8537 unsigned short temp; in SiS_Chrontel701xOn() local
8539 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xOn()
8540 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xOn()
8541 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_Chrontel701xOn()
8542 temp |= 0x04; /* Invert XCLK phase */ in SiS_Chrontel701xOn()
8543 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_Chrontel701xOn()
8546 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8547 temp &= 0x3f; in SiS_Chrontel701xOn()
8548 temp |= 0x80; /* Enable YPrPb (HDTV) */ in SiS_Chrontel701xOn()
8549 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8552 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8553 temp &= 0x3f; in SiS_Chrontel701xOn()
8554 temp |= 0xc0; /* Enable SCART + CVBS */ in SiS_Chrontel701xOn()
8555 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8557 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xOn()
8562 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_Chrontel701xOn()
8564 temp = SiS_GetCH701x(SiS_Pr,0x73); in SiS_Chrontel701xOn()
8565 temp |= 0x60; in SiS_Chrontel701xOn()
8566 SiS_SetCH701x(SiS_Pr,0x73,temp); in SiS_Chrontel701xOn()
8568 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8569 temp &= 0x7f; in SiS_Chrontel701xOn()
8570 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8572 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8573 temp |= 0x80; in SiS_Chrontel701xOn()
8574 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8582 unsigned short temp; in SiS_Chrontel701xOff() local
8585 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_Chrontel701xOff()
8586 if(SiS_Pr->ChipType == SIS_740) { in SiS_Chrontel701xOff()
8593 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_Chrontel701xOff()
8594 temp &= 0xfc; in SiS_Chrontel701xOff()
8595 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_Chrontel701xOff()
8604 unsigned short temp; in SiS_ChrontelResetDB() local
8606 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelResetDB()
8608 temp = SiS_GetCH701x(SiS_Pr,0x4a); /* Version ID */ in SiS_ChrontelResetDB()
8609 temp &= 0x01; in SiS_ChrontelResetDB()
8610 if(!temp) { in SiS_ChrontelResetDB()
8613 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetDB()
8624 SiS_SetCH701x(SiS_Pr,0x49,temp); in SiS_ChrontelResetDB()
8630 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8631 temp &= 0xef; in SiS_ChrontelResetDB()
8632 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8633 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8634 temp |= 0x10; in SiS_ChrontelResetDB()
8635 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8636 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8637 temp &= 0xef; in SiS_ChrontelResetDB()
8638 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8639 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelResetDB()
8640 if(!temp) { in SiS_ChrontelResetDB()
8656 unsigned short temp; in SiS_ChrontelInitTVVSync() local
8658 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelInitTVVSync()
8667 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelInitTVVSync()
8668 temp &= 1; in SiS_ChrontelInitTVVSync()
8669 if(temp != 1) { /* TV block powered? (0 = yes, 1 = no) */ in SiS_ChrontelInitTVVSync()
8670 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8671 temp &= 0x70; in SiS_ChrontelInitTVVSync()
8672 SiS_SetCH701x(SiS_Pr,0x47,temp); /* enable VSYNC */ in SiS_ChrontelInitTVVSync()
8674 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8675 temp |= 0x80; in SiS_ChrontelInitTVVSync()
8676 SiS_SetCH701x(SiS_Pr,0x47,temp); /* disable VSYNC */ in SiS_ChrontelInitTVVSync()
8685 unsigned short temp,temp1; in SiS_ChrontelDoSomething3() local
8687 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething3()
8689 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8690 if(temp < 1) { in SiS_ChrontelDoSomething3()
8691 temp++; in SiS_ChrontelDoSomething3()
8692 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8702 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8703 if(temp < 2) { in SiS_ChrontelDoSomething3()
8704 temp++; in SiS_ChrontelDoSomething3()
8705 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8709 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8710 temp |= 0x5f; in SiS_ChrontelDoSomething3()
8711 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8722 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething3()
8723 temp |= 0x03; in SiS_ChrontelDoSomething3()
8724 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething3()
8725 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8726 temp &= 0x7f; in SiS_ChrontelDoSomething3()
8727 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8736 unsigned short temp; in SiS_ChrontelDoSomething2() local
8741 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething2()
8742 temp &= 0x04; /* PLL stable? -> bail out */ in SiS_ChrontelDoSomething2()
8743 if(temp == 0x04) break; in SiS_ChrontelDoSomething2()
8745 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething2()
8752 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8753 temp &= 0xfb; /* Reset PLL */ in SiS_ChrontelDoSomething2()
8754 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8756 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8757 temp |= 0x04; /* PLL normal operation */ in SiS_ChrontelDoSomething2()
8758 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8759 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething2()
8773 unsigned short temp; in SiS_ChrontelDoSomething1() local
8775 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8776 temp |= 0x80; /* Set datapath 1 to TV */ in SiS_ChrontelDoSomething1()
8777 temp &= 0xbf; /* Set datapath 2 to LVDS */ in SiS_ChrontelDoSomething1()
8778 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8780 if(SiS_Pr->ChipType == SIS_740) { in SiS_ChrontelDoSomething1()
8782 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_ChrontelDoSomething1()
8783 temp &= 0xfb; /* Normal XCLK phase */ in SiS_ChrontelDoSomething1()
8784 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_ChrontelDoSomething1()
8786 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_ChrontelDoSomething1()
8788 temp = SiS_GetCH701x(SiS_Pr,0x64); in SiS_ChrontelDoSomething1()
8789 temp |= 0x40; /* ? Bit not defined */ in SiS_ChrontelDoSomething1()
8790 SiS_SetCH701x(SiS_Pr,0x64,temp); in SiS_ChrontelDoSomething1()
8792 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8793 temp &= 0x3f; /* D1 input to both LVDS and TV */ in SiS_ChrontelDoSomething1()
8794 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8796 if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) { in SiS_ChrontelDoSomething1()
8804 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething1()
8805 if(temp != 0x45) { in SiS_ChrontelDoSomething1()
8816 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34); in SiS_ChrontelDoSomething1()
8817 SiS_ChrontelDoSomething3(SiS_Pr,temp); in SiS_ChrontelDoSomething1()
8833 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT2Group()
8837 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT2Group()
8839 if(!SiS_Pr->UseCustomMode) { in SiS_SetCRT2Group()
8846 SiS_Pr->SiS_SelectCRT2Rate = 4; in SiS_SetCRT2Group()
8854 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8856 if((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->ChipType == SIS_730)) { in SiS_SetCRT2Group()
8857 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_SetCRT2Group()
8862 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) { in SiS_SetCRT2Group()
8871 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_SetCRT2Group()
8872 if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiS_SetCRT2Group()
8873 ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) || in SiS_SetCRT2Group()
8874 ((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS30xBLV)) ) { in SiS_SetCRT2Group()
8878 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8882 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_SetCRT2Group()
8884 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8900 if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) { in SiS_SetCRT2Group()
8902 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) { in SiS_SetCRT2Group()
8903 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT2Group()
8919 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8920 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2Group()
8921 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_SetCRT2Group()
8922 if(SiS_Pr->SiS_IF_DEF_CH70xx == 2) { in SiS_SetCRT2Group()
8928 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Group()
8937 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetCRT2Group()
8938 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8939 if(SiS_Pr->SiS_UseOEM) { in SiS_SetCRT2Group()
8940 if((SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_UseOEM == -1)) { in SiS_SetCRT2Group()
8948 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetCRT2Group()
8949 if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || in SiS_SetCRT2Group()
8950 (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) { in SiS_SetCRT2Group()
8960 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT2Group()
8961 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8962 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetCRT2Group()
8968 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); in SiS_SetCRT2Group()
8973 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
8979 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) { in SiS_SetCRT2Group()
8980 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetCRT2Group()
8989 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT2Group()
9006 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_SiS30xBLOn()
9007 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_SiS30xBLOn()
9010 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) { in SiS_SiS30xBLOn()
9011 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_SiS30xBLOn()
9019 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_SiS30xBLOff()
9030 SiS_Pr->SiS_DDC_NData = ~SiS_Pr->SiS_DDC_Data; in SiS_SetupDDCN()
9031 SiS_Pr->SiS_DDC_NClk = ~SiS_Pr->SiS_DDC_Clk; in SiS_SetupDDCN()
9032 if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) { in SiS_SetupDDCN()
9033 SiS_Pr->SiS_DDC_NData &= 0x0f; in SiS_SetupDDCN()
9034 SiS_Pr->SiS_DDC_NClk &= 0x0f; in SiS_SetupDDCN()
9043 unsigned short tempah,temp; in SiS_SetTrumpBlockLoop() local
9055 tempah = SiS_Pr->SiS_DDC_DeviceAddr; in SiS_SetTrumpBlockLoop()
9056 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9057 if(temp) continue; /* (ERROR: no ack) */ in SiS_SetTrumpBlockLoop()
9059 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write register number */ in SiS_SetTrumpBlockLoop()
9060 if(temp) continue; /* (ERROR: no ack) */ in SiS_SetTrumpBlockLoop()
9063 temp = SiS_WriteDDC2Data(SiS_Pr,tempah);/* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9064 if(temp) break; in SiS_SetTrumpBlockLoop()
9066 if(temp) continue; in SiS_SetTrumpBlockLoop()
9076 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ in SiS_SetTrumpionBlock()
9077 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetTrumpionBlock()
9078 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetTrumpionBlock()
9079 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetTrumpionBlock()
9102 unsigned short temp, i; in SiS_SetChReg() local
9110 temp = SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_SetChReg()
9111 if(temp) continue; /* (ERROR: no ack) */ in SiS_SetChReg()
9112 … temp = SiS_WriteDDC2Data(SiS_Pr, (reg | myor)); /* Write RAB (700x: set bit 7, see datasheet) */ in SiS_SetChReg()
9113 if(temp) continue; /* (ERROR: no ack) */ in SiS_SetChReg()
9114 temp = SiS_WriteDDC2Data(SiS_Pr, val); /* Write data */ in SiS_SetChReg()
9115 if(temp) continue; /* (ERROR: no ack) */ in SiS_SetChReg()
9117 SiS_Pr->SiS_ChrontelInit = 1; in SiS_SetChReg()
9127 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH700x()
9131 if(!(SiS_Pr->SiS_ChrontelInit)) { in SiS_SetCH700x()
9132 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH700x()
9133 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetCH700x()
9134 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetCH700x()
9139 (!(SiS_Pr->SiS_ChrontelInit)) ) { in SiS_SetCH700x()
9140 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_SetCH700x()
9141 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_SetCH700x()
9142 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_SetCH700x()
9150 /* Parameter is [Data (S15-S8) | Register no (S7-S0)] */
9154 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH701x()
9155 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_SetCH701x()
9156 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_SetCH701x()
9158 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH701x()
9166 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) in SiS_SetCH70xx()
9175 unsigned short tempah, temp, i; in SiS_GetChReg() local
9183 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_GetChReg()
9184 if(temp) continue; /* (ERROR: no ack) */ in SiS_GetChReg()
9185 … temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_ReadAddr | myor); /* Write RAB (700x: | 0x80) */ in SiS_GetChReg()
9186 if(temp) continue; /* (ERROR: no ack) */ in SiS_GetChReg()
9187 if (SiS_SetStart(SiS_Pr)) continue; /* Re-start */ in SiS_GetChReg()
9188 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr | 0x01);/* DAB (S0=1=read) */ in SiS_GetChReg()
9189 if(temp) continue; /* (ERROR: no ack) */ in SiS_GetChReg()
9192 SiS_Pr->SiS_ChrontelInit = 1; in SiS_GetChReg()
9199 /* Parameter is [Register no (S7-S0)] */
9205 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH700x()
9209 if(!(SiS_Pr->SiS_ChrontelInit)) { in SiS_GetCH700x()
9210 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH700x()
9211 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_GetCH700x()
9212 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_GetCH700x()
9216 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetCH700x()
9219 (!SiS_Pr->SiS_ChrontelInit) ) { in SiS_GetCH700x()
9221 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_GetCH700x()
9222 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_GetCH700x()
9223 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_GetCH700x()
9232 /* Parameter is [Register no (S7-S0)] */
9236 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH701x()
9237 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_GetCH701x()
9238 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_GetCH701x()
9240 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH701x()
9242 SiS_Pr->SiS_DDC_ReadAddr = tempbx; in SiS_GetCH701x()
9248 /* Parameter is [Register no (S7-S0)] */
9253 if(SiS_Pr->SiS_IF_DEF_CH70xx == 1) in SiS_GetCH70xx()
9278 unsigned short temp = 0, myadaptnum = adaptnum; in SiS_InitDDCRegs() local
9287 SiS_Pr->SiS_ChrontelInit = 0; /* force re-detection! */ in SiS_InitDDCRegs()
9289 SiS_Pr->SiS_DDC_SecAddr = 0; in SiS_InitDDCRegs()
9290 SiS_Pr->SiS_DDC_DeviceAddr = ddcdtype[DDCdatatype]; in SiS_InitDDCRegs()
9291 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_P3c4; in SiS_InitDDCRegs()
9292 SiS_Pr->SiS_DDC_Index = 0x11; in SiS_InitDDCRegs()
9295 cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32); in SiS_InitDDCRegs()
9318 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; in SiS_InitDDCRegs()
9319 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9334 temp = 4 - (myadaptnum * 2); in SiS_InitDDCRegs()
9335 if(flag) temp = 0; in SiS_InitDDCRegs()
9350 SiS_Pr->SiS_DDC_Port = SiS_Pr->SiS_Part4Port; in SiS_InitDDCRegs()
9351 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9364 temp = myadaptnum; in SiS_InitDDCRegs()
9366 temp = 0; in SiS_InitDDCRegs()
9370 if(flag) temp = 0; in SiS_InitDDCRegs()
9373 SiS_Pr->SiS_DDC_Data = 0x02 << temp; in SiS_InitDDCRegs()
9374 SiS_Pr->SiS_DDC_Clk = 0x01 << temp; in SiS_InitDDCRegs()
9385 if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr)) { in SiS_WriteDABDDC()
9388 if(SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_SecAddr)) { in SiS_WriteDABDDC()
9398 if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) { in SiS_PrepareReadDDC()
9417 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SendACK()
9418 SiS_Pr->SiS_DDC_Index, in SiS_SendACK()
9419 SiS_Pr->SiS_DDC_NData, in SiS_SendACK()
9420 SiS_Pr->SiS_DDC_Data); in SiS_SendACK()
9422 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SendACK()
9423 SiS_Pr->SiS_DDC_Index, in SiS_SendACK()
9424 SiS_Pr->SiS_DDC_NData, in SiS_SendACK()
9434 unsigned short temp, ret=0; in SiS_DoProbeDDC() local
9444 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9445 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); in SiS_DoProbeDDC()
9447 if(temp == 0) { in SiS_DoProbeDDC()
9456 temp = (unsigned char)SiS_ReadDDC2Data(SiS_Pr); in SiS_DoProbeDDC()
9458 temp &= mask; in SiS_DoProbeDDC()
9459 if(temp == value) ret = 0; in SiS_DoProbeDDC()
9462 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9463 if(temp == 0x30) ret = 0; in SiS_DoProbeDDC()
9478 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; in SiS_ProbeDDC()
9480 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; in SiS_ProbeDDC()
9482 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; in SiS_ProbeDDC()
9528 we use our pre-detected pSiS-values instead of SiS_Pr as
9535 DDCdatatype: 0=Probe, 1=EDID, 2=EDID+VDIF, 3=EDID V2 (P&D), 4=EDID V2 (FPDI-2)
9563 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); in SiS_HandleDDC()
9564 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04); in SiS_HandleDDC()
9566 cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80; in SiS_HandleDDC()
9568 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80); in SiS_HandleDDC()
9569 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01); in SiS_HandleDDC()
9570 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); in SiS_HandleDDC()
9590 if(!SiS_Pr->DDCPortMixup) { in SiS_HandleDDC()
9600 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f); in SiS_HandleDDC()
9602 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17); in SiS_HandleDDC()
9607 /* Generic I2C functions for Chrontel & DDC --------- */
9623 return ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1); in SiS_ReadDDC1Bit()
9627 /* This is done by a SD high-to-low transition while SC is high */
9631 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9632 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStart()
9633 SiS_Pr->SiS_DDC_Index, in SiS_SetStart()
9634 SiS_Pr->SiS_DDC_NData, in SiS_SetStart()
9635 SiS_Pr->SiS_DDC_Data); /* SD->high */ in SiS_SetStart()
9636 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStart()
9637 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStart()
9638 SiS_Pr->SiS_DDC_Index, in SiS_SetStart()
9639 SiS_Pr->SiS_DDC_NData, in SiS_SetStart()
9640 0x00); /* SD->low = start condition */ in SiS_SetStart()
9641 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9646 /* This is done by a SD low-to-high transition while SC is high */
9650 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStop()
9651 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStop()
9652 SiS_Pr->SiS_DDC_Index, in SiS_SetStop()
9653 SiS_Pr->SiS_DDC_NData, in SiS_SetStop()
9654 0x00); /* SD->low */ in SiS_SetStop()
9655 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStop()
9656 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetStop()
9657 SiS_Pr->SiS_DDC_Index, in SiS_SetStop()
9658 SiS_Pr->SiS_DDC_NData, in SiS_SetStop()
9659 SiS_Pr->SiS_DDC_Data); /* SD->high = stop condition */ in SiS_SetStop()
9660 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->high) */ in SiS_SetStop()
9668 unsigned short i,flag,temp; in SiS_WriteDDC2Data() local
9672 SiS_SetSCLKLow(SiS_Pr); /* SC->low */ in SiS_WriteDDC2Data()
9674 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_WriteDDC2Data()
9675 SiS_Pr->SiS_DDC_Index, in SiS_WriteDDC2Data()
9676 SiS_Pr->SiS_DDC_NData, in SiS_WriteDDC2Data()
9677 SiS_Pr->SiS_DDC_Data); /* Write bit (1) to SD */ in SiS_WriteDDC2Data()
9679 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_WriteDDC2Data()
9680 SiS_Pr->SiS_DDC_Index, in SiS_WriteDDC2Data()
9681 SiS_Pr->SiS_DDC_NData, in SiS_WriteDDC2Data()
9684 SiS_SetSCLKHigh(SiS_Pr); /* SC->high */ in SiS_WriteDDC2Data()
9687 temp = SiS_CheckACK(SiS_Pr); /* Check acknowledge */ in SiS_WriteDDC2Data()
9688 return temp; in SiS_WriteDDC2Data()
9694 unsigned short i, temp, getdata; in SiS_ReadDDC2Data() local
9700 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_ReadDDC2Data()
9701 SiS_Pr->SiS_DDC_Index, in SiS_ReadDDC2Data()
9702 SiS_Pr->SiS_DDC_NData, in SiS_ReadDDC2Data()
9703 SiS_Pr->SiS_DDC_Data); in SiS_ReadDDC2Data()
9705 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); in SiS_ReadDDC2Data()
9706 if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01; in SiS_ReadDDC2Data()
9714 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetSCLKLow()
9715 SiS_Pr->SiS_DDC_Index, in SiS_SetSCLKLow()
9716 SiS_Pr->SiS_DDC_NClk, in SiS_SetSCLKLow()
9725 unsigned short temp, watchdog=1000; in SiS_SetSCLKHigh() local
9727 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_SetSCLKHigh()
9728 SiS_Pr->SiS_DDC_Index, in SiS_SetSCLKHigh()
9729 SiS_Pr->SiS_DDC_NClk, in SiS_SetSCLKHigh()
9730 SiS_Pr->SiS_DDC_Clk); /* SetSCLKHigh() */ in SiS_SetSCLKHigh()
9732 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); in SiS_SetSCLKHigh()
9733 } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); in SiS_SetSCLKHigh()
9742 /* Returns 0 if ack ok, non-0 if ack not ok */
9748 SiS_SetSCLKLow(SiS_Pr); /* (SC->low) */ in SiS_CheckACK()
9749 SiS_SetRegANDOR(SiS_Pr->SiS_DDC_Port, in SiS_CheckACK()
9750 SiS_Pr->SiS_DDC_Index, in SiS_CheckACK()
9751 SiS_Pr->SiS_DDC_NData, in SiS_CheckACK()
9752 SiS_Pr->SiS_DDC_Data); /* (SD->high) */ in SiS_CheckACK()
9753 SiS_SetSCLKHigh(SiS_Pr); /* SC->high = clock impulse for ack */ in SiS_CheckACK()
9754 tempah = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); /* Read SD */ in SiS_CheckACK()
9755 SiS_SetSCLKLow(SiS_Pr); /* SC->low = end of clock impulse */ in SiS_CheckACK()
9756 if(tempah & SiS_Pr->SiS_DDC_Data) return 1; /* Ack OK if bit = 0 */ in SiS_CheckACK()
9760 /* End of I2C functions ----------------------- */
9770 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetRAMDACromptr()
9773 if(SiS_Pr->ChipType < SIS_330) { in GetRAMDACromptr()
9775 if(SiS_Pr->SiS_VBType & VB_SIS30xB) in GetRAMDACromptr()
9779 if(SiS_Pr->SiS_VBType & VB_SIS30xB) in GetRAMDACromptr()
9788 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetLCDromptr()
9791 if(SiS_Pr->ChipType < SIS_330) { in GetLCDromptr()
9793 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetLCDromptr()
9797 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetLCDromptr()
9806 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetTVromptr()
9809 if(SiS_Pr->ChipType < SIS_330) { in GetTVromptr()
9811 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetTVromptr()
9815 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) in GetTVromptr()
9826 if((IS_SIS650) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in GetLCDPtrIndexBIOS()
9828 if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) { in GetLCDPtrIndexBIOS()
9831 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndexBIOS()
9832 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndexBIOS()
9839 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) index -= 5; in GetLCDPtrIndexBIOS()
9840 if(SiS_Pr->SiS_VBType & VB_SIS301C) { /* 1.15.20 and later (not VB specific) */ in GetLCDPtrIndexBIOS()
9841 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 5; in GetLCDPtrIndexBIOS()
9842 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768) index -= 5; in GetLCDPtrIndexBIOS()
9844 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 6; in GetLCDPtrIndexBIOS()
9846 index--; in GetLCDPtrIndexBIOS()
9848 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndexBIOS()
9849 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndexBIOS()
9858 index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3; in GetLCDPtrIndex()
9859 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2; in GetLCDPtrIndex()
9860 else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++; in GetLCDPtrIndex()
9870 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; in GetTVPtrIndex()
9871 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index = 2; in GetTVPtrIndex()
9873 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) index = 0; in GetTVPtrIndex()
9877 if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && in GetTVPtrIndex()
9878 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in GetTVPtrIndex()
9888 unsigned short index = 0, temp = 0; in GetOEMTVPtr661_2_GEN() local
9890 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 1; in GetOEMTVPtr661_2_GEN()
9891 if(SiS_Pr->SiS_TVMode & TVSetPALM) index = 2; in GetOEMTVPtr661_2_GEN()
9892 if(SiS_Pr->SiS_TVMode & TVSetPALN) index = 3; in GetOEMTVPtr661_2_GEN()
9893 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 6; in GetOEMTVPtr661_2_GEN()
9894 if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) { in GetOEMTVPtr661_2_GEN()
9896 if(SiS_Pr->SiS_TVMode & TVSetPALM) index++; in GetOEMTVPtr661_2_GEN()
9897 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) index = 7; in GetOEMTVPtr661_2_GEN()
9900 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in GetOEMTVPtr661_2_GEN()
9901 if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || in GetOEMTVPtr661_2_GEN()
9902 (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) { in GetOEMTVPtr661_2_GEN()
9904 temp++; in GetOEMTVPtr661_2_GEN()
9906 temp += 0x0100; in GetOEMTVPtr661_2_GEN()
9908 return (unsigned int)(index | (temp << 16)); in GetOEMTVPtr661_2_GEN()
9930 if(SiS_Pr->SiS_TVMode & TVSetPAL) index = 2; in GetOEMTVPtr661()
9931 if(SiS_Pr->SiS_ROMNew) { in GetOEMTVPtr661()
9932 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 4; in GetOEMTVPtr661()
9933 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 6; in GetOEMTVPtr661()
9934 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 8; in GetOEMTVPtr661()
9935 if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 10; in GetOEMTVPtr661()
9937 if(SiS_Pr->SiS_TVMode & TVSetHiVision) index = 4; in GetOEMTVPtr661()
9938 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6; in GetOEMTVPtr661()
9939 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8; in GetOEMTVPtr661()
9940 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10; in GetOEMTVPtr661()
9943 if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) index++; in GetOEMTVPtr661()
9951 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetDelayComp()
9952 unsigned short delay=0,index,myindex,temp,romptr=0; in SetDelayComp() local
9955 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
9956 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); in SetDelayComp()
9958 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f); in SetDelayComp()
9963 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) { /* ------------ VGA */ in SetDelayComp()
9965 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
9971 if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SetDelayComp()
9979 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
9984 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) { /* ---------- LCD/LCDA */ in SetDelayComp()
9988 /* Could we detect a PDC for LCD or did we get a user-defined? If yes, use it */ in SetDelayComp()
9990 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetDelayComp()
9991 if(SiS_Pr->PDC != -1) { in SetDelayComp()
9992 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f)); in SetDelayComp()
9993 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7)); in SetDelayComp()
9997 if(SiS_Pr->PDCA != -1) { in SetDelayComp()
9998 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0)); in SetDelayComp()
9999 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6)); in SetDelayComp()
10004 /* Custom Panel? */ in SetDelayComp()
10006 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) { in SetDelayComp()
10007 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10009 if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) { in SetDelayComp()
10012 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay); in SetDelayComp()
10015 if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SetDelayComp()
10017 if((SiS_Pr->PanelXRes > 1280) && (SiS_Pr->PanelYRes > 1024)) { in SetDelayComp()
10020 } else if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetDelayComp()
10024 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay); in SetDelayComp()
10034 switch(SiS_Pr->SiS_CustomT) { in SetDelayComp()
10037 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SetDelayComp()
10051 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SetDelayComp()
10055 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10068 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SetDelayComp()
10072 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10076 /* if(SiS_Pr->SiS_VBType & VB_SIS302LV) */ in SetDelayComp()
10087 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) in SetDelayComp()
10092 } else if(SiS_Pr->SiS_UseROM && in SetDelayComp()
10093 (!(SiS_Pr->SiS_ROMNew)) && in SetDelayComp()
10094 (SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) && in SetDelayComp()
10095 (SiS_Pr->SiS_LCDResInfo != Panel_1280x768) && in SetDelayComp()
10096 (SiS_Pr->SiS_LCDResInfo != Panel_1280x960) && in SetDelayComp()
10097 (SiS_Pr->SiS_LCDResInfo != Panel_1600x1200) && in SetDelayComp()
10104 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10112 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetDelayComp()
10114 … else if(SiS_Pr->ChipType <= SIS_315PRO) delay = SiS310_LCDDelayCompensation_3xx301LV[myindex]; in SetDelayComp()
10116 } else if(SiS_Pr->SiS_VBType & VB_SIS301C) { in SetDelayComp()
10119 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) delay = 0x00; /* experience */ in SetDelayComp()
10120 } else if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SetDelayComp()
10129 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp()
10130 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); in SetDelayComp()
10134 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { /* ------------ TV */ in SetDelayComp()
10138 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SetDelayComp()
10142 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10146 /* if(SiS_Pr->SiS_VBType & VB_SIS302LV) */ in SetDelayComp()
10159 switch(SiS_Pr->SiS_CustomT) { in SetDelayComp()
10174 if(SiS_Pr->SiS_VBType & VB_SIS302LV) { in SetDelayComp()
10180 } else if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) { in SetDelayComp()
10186 } else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SetDelayComp()
10193 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetDelayComp()
10199 if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02; in SetDelayComp()
10214 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetDelayComp()
10216 if(IS_SIS650 && (SiS_Pr->SiS_VBType & VB_SISLVDS) && dochiptest) { in SetDelayComp()
10218 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4; in SetDelayComp()
10219 if(temp == 8) { /* 1400x1050 BIOS (COMPAL) */ in SetDelayComp()
10222 } else if(temp == 6) { in SetDelayComp()
10225 } else if(temp > 7) { /* 1280x1024 BIOS (which one?) */ in SetDelayComp()
10228 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10232 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10238 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp()
10239 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10241 if(IS_SIS650 && (SiS_Pr->SiS_IF_DEF_CH70xx != 0)) { in SetDelayComp()
10243 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,delay); in SetDelayComp()
10245 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10256 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetAntiFlicker()
10257 unsigned short index,temp,temp1,romptr=0; in SetAntiFlicker() local
10259 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p|TVSetYPbPr525p)) return; in SetAntiFlicker()
10262 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVFlickerIndex; in SetAntiFlicker()
10264 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVFlickerIndex; in SetAntiFlicker()
10266 temp = GetTVPtrIndex(SiS_Pr); in SetAntiFlicker()
10267 temp >>= 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetAntiFlicker()
10268 temp1 = temp; in SetAntiFlicker()
10270 if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SetAntiFlicker()
10271 if(SiS_Pr->ChipType >= SIS_661) { in SetAntiFlicker()
10275 if(SiS_Pr->ChipType >= SIS_760) { in SetAntiFlicker()
10278 } else if(SiS_Pr->ChipType >= SIS_330) { in SetAntiFlicker()
10287 temp = ROMAddr[romptr + temp1 + index]; in SetAntiFlicker()
10289 temp = SiS310_TVAntiFlick1[temp][index]; in SetAntiFlicker()
10291 temp <<= 4; in SetAntiFlicker()
10293 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8f,temp); /* index 0A D[6:4] */ in SetAntiFlicker()
10299 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetEdgeEnhance()
10300 unsigned short index,temp,temp1,romptr=0; in SetEdgeEnhance() local
10302 temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetEdgeEnhance()
10305 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex; in SetEdgeEnhance()
10307 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex; in SetEdgeEnhance()
10309 if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) { in SetEdgeEnhance()
10310 if(SiS_Pr->ChipType >= SIS_661) { in SetEdgeEnhance()
10312 if(SiS_Pr->ChipType >= SIS_760) { in SetEdgeEnhance()
10317 } else if(SiS_Pr->ChipType >= SIS_330) { in SetEdgeEnhance()
10326 temp = ROMAddr[romptr + temp1 + index]; in SetEdgeEnhance()
10328 temp = SiS310_TVEdge1[temp][index]; in SetEdgeEnhance()
10330 temp <<= 5; in SetEdgeEnhance()
10331 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x3A,0x1F,temp); /* index 0A D[7:5] */ in SetEdgeEnhance()
10337 unsigned short index, temp, i, j; in SetYFilter() local
10340 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex; in SetYFilter()
10342 index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex; in SetYFilter()
10345 temp = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetYFilter()
10347 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 1; /* NTSC-J uses PAL */ in SetYFilter()
10348 else if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 3; /* PAL-M */ in SetYFilter()
10349 else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 4; /* PAL-N */ in SetYFilter()
10350 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp = 1; /* HiVision uses PAL */ in SetYFilter()
10352 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetYFilter()
10354 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); in SetYFilter()
10357 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter2[temp][index][j]); in SetYFilter()
10361 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVYFilter1[temp][index][j]); in SetYFilter()
10369 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetPhaseIncr()
10370 unsigned short index,temp,i,j,resinfo,romptr=0; in SetPhaseIncr() local
10373 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) return; in SetPhaseIncr()
10375 /* NTSC-J data not in BIOS, and already set in SetGroup2 */ in SetPhaseIncr()
10376 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) return; in SetPhaseIncr()
10378 if((SiS_Pr->ChipType >= SIS_661) || SiS_Pr->SiS_ROMNew) { in SetPhaseIncr()
10382 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS_TVPhase[lindex + j]); in SetPhaseIncr()
10387 /* PAL-M, PAL-N not in BIOS, and already set in SetGroup2 */ in SetPhaseIncr()
10388 if(SiS_Pr->SiS_TVMode & (TVSetPALM | TVSetPALN)) return; in SetPhaseIncr()
10391 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SetPhaseIncr()
10393 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SetPhaseIncr()
10396 temp = GetTVPtrIndex(SiS_Pr); in SetPhaseIncr()
10400 if(SiS_Pr->SiS_UseROM) { in SetPhaseIncr()
10402 if(SiS_Pr->ChipType >= SIS_330) { in SetPhaseIncr()
10405 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetPhaseIncr()
10407 if(SiS_Pr->ChipType >= SIS_330) { in SetPhaseIncr()
10410 if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode))) { in SetPhaseIncr()
10412 if(SiS_Pr->ChipType >= SIS_330) { in SetPhaseIncr()
10419 romptr += (temp << 2); in SetPhaseIncr()
10421 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetPhaseIncr()
10424 index = temp % 2; in SetPhaseIncr()
10425 temp >>= 1; /* 0:NTSC, 1:PAL, 2:HiTV */ in SetPhaseIncr()
10427 if(!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) in SetPhaseIncr()
10428 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); in SetPhaseIncr()
10429 else if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) || (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) in SetPhaseIncr()
10430 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr2[temp][index][j]); in SetPhaseIncr()
10432 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS310_TVPhaseIncr1[temp][index][j]); in SetPhaseIncr()
10436 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision))) { in SetPhaseIncr()
10437 if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPr525p | TVSetYPbPr750p))) && (ModeNo > 0x13)) { in SetPhaseIncr()
10440 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21); in SetPhaseIncr()
10441 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0); in SetPhaseIncr()
10442 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5); in SetPhaseIncr()
10443 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f); in SetPhaseIncr()
10445 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e); in SetPhaseIncr()
10446 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b); in SetPhaseIncr()
10447 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb); in SetPhaseIncr()
10448 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b); in SetPhaseIncr()
10459 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetDelayComp661()
10461 if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToRAMDAC))) in SetDelayComp661()
10464 /* 1. New ROM: VGA2 and LCD/LCDA-Pass1:1 */ in SetDelayComp661()
10465 /* (If a custom mode is used, Pass1:1 is always set; hence we do this:) */ in SetDelayComp661()
10467 if(SiS_Pr->SiS_ROMNew) { in SetDelayComp661()
10468 if((SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) || in SetDelayComp661()
10469 ((SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && in SetDelayComp661()
10470 (SiS_Pr->SiS_LCDInfo & LCDPass11))) { in SetDelayComp661()
10472 if(SiS_Pr->UseCustomMode) { in SetDelayComp661()
10473 index = SiS_Pr->CSRClock; in SetDelayComp661()
10476 index = SiS_Pr->SiS_VCLKData[index].CLOCK; in SetDelayComp661()
10479 index = ((index / 25) - 1) << 1; in SetDelayComp661()
10480 if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) { in SetDelayComp661()
10485 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD)) { in SetDelayComp661()
10486 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10487 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10489 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10490 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10496 /* 2. Old ROM: VGA2 and LCD/LCDA-Pass 1:1 */ in SetDelayComp661()
10498 if(SiS_Pr->UseCustomMode) delay = 0x04; in SetDelayComp661()
10500 else delay = (SiS_Pr->SiS_RefIndex[RTI].Ext_PDC >> 4); in SetDelayComp661()
10503 if(SiS_Pr->ChipType >= XGI_20) { in SetDelayComp661()
10506 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
10509 if(SiS_Pr->SiS_XGIROM) { in SetDelayComp661()
10517 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) { in SetDelayComp661()
10518 if(SiS_Pr->ChipType == XGI_40 && SiS_Pr->ChipRevision == 0x02) { in SetDelayComp661()
10519 delay -= 0x0404; in SetDelayComp661()
10524 } else if(SiS_Pr->ChipType >= SIS_340) { in SetDelayComp661()
10527 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
10532 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SetDelayComp661()
10537 if(SiS_Pr->SiS_ROMNew) { in SetDelayComp661()
10539 if(SiS_Pr->SiS_VBType & VB_UMC) romptr += 12; in SetDelayComp661()
10546 } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SetDelayComp661()
10548 /* 4. LCD, LCDA (for new ROM only LV and non-Pass 1:1) */ in SetDelayComp661()
10550 if( (SiS_Pr->SiS_LCDResInfo != Panel_Custom) && in SetDelayComp661()
10553 lcdpdcindex = (SiS_Pr->SiS_VBType & VB_UMC) ? 14 : 12; in SetDelayComp661()
10563 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SetDelayComp661()
10564 switch(SiS_Pr->SiS_LCDResInfo) { in SetDelayComp661()
10577 if((SiS_Pr->PanelXRes <= 1024) && (SiS_Pr->PanelYRes <= 768)) { in SetDelayComp661()
10579 } else if((SiS_Pr->PanelXRes == 1280) && (SiS_Pr->PanelYRes == 1024)) { in SetDelayComp661()
10581 } else if((SiS_Pr->PanelXRes <= 1400) && (SiS_Pr->PanelYRes <= 1050)) { in SetDelayComp661()
10583 } else if((SiS_Pr->PanelXRes <= 1600) && (SiS_Pr->PanelYRes <= 1200)) { in SetDelayComp661()
10591 /* Override by detected or user-set values */ in SetDelayComp661()
10593 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->PDC != -1)) { in SetDelayComp661()
10594 delay = SiS_Pr->PDC & 0x1f; in SetDelayComp661()
10596 if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) && (SiS_Pr->PDCA != -1)) { in SetDelayComp661()
10597 delay = (SiS_Pr->PDCA & 0x1f) << 8; in SetDelayComp661()
10604 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SetDelayComp661()
10606 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10607 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10609 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10610 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10618 unsigned char temp; in SetCRT2SyncDither661() local
10620 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SetCRT2SyncDither661()
10623 infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2); in SetCRT2SyncDither661()
10624 } else if(SiS_Pr->UseCustomMode) { in SetCRT2SyncDither661()
10625 infoflag = SiS_Pr->CInfoFlag; in SetCRT2SyncDither661()
10627 infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag; in SetCRT2SyncDither661()
10630 if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { in SetCRT2SyncDither661()
10631 infoflag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); /* No longer check D5 */ in SetCRT2SyncDither661()
10636 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetCRT2SyncDither661()
10637 temp = (infoflag >> 6) | 0x0c; in SetCRT2SyncDither661()
10638 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SetCRT2SyncDither661()
10639 temp ^= 0x04; in SetCRT2SyncDither661()
10640 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x10; in SetCRT2SyncDither661()
10642 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp); in SetCRT2SyncDither661()
10644 temp = 0x30; in SetCRT2SyncDither661()
10645 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) temp = 0x20; in SetCRT2SyncDither661()
10646 temp |= infoflag; in SetCRT2SyncDither661()
10647 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp); in SetCRT2SyncDither661()
10648 temp = 0; in SetCRT2SyncDither661()
10649 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) { in SetCRT2SyncDither661()
10650 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x80; in SetCRT2SyncDither661()
10652 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp); in SetCRT2SyncDither661()
10661 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetPanelParms661()
10664 if(SiS_Pr->SiS_VBType & (VB_SISLVDS | VB_SIS30xC)) { in SetPanelParms661()
10665 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x24,0x0f); in SetPanelParms661()
10668 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetPanelParms661()
10669 if(SiS_Pr->LVDSHL != -1) { in SetPanelParms661()
10670 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SetPanelParms661()
10674 if(SiS_Pr->SiS_ROMNew) { in SetPanelParms661()
10677 if(SiS_Pr->SiS_VBType & VB_SISLVDS) { in SetPanelParms661()
10680 if(SiS_Pr->LVDSHL != -1) { in SetPanelParms661()
10684 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1); in SetPanelParms661()
10686 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SetPanelParms661()
10688 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1); in SetPanelParms661()
10698 if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SISLVDS)) { in SiS_OEM310Setting()
10700 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_OEM310Setting()
10708 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_OEM310Setting()
10712 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_OEM310Setting()
10722 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_OEM661Setting()
10726 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_OEM661Setting()
10731 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_OEM661Setting()
10735 if(SiS_Pr->SiS_VBType & VB_SIS301) { in SiS_OEM661Setting()
10752 unsigned short tempcl,tempch,tempbl,tempbh,tempbx,tempax,temp; in SiS_FinalizeLCD() local
10755 if(!(SiS_Pr->SiS_VBType & VB_SISLVDS)) return; in SiS_FinalizeLCD()
10756 if(SiS_Pr->SiS_ROMNew) return; in SiS_FinalizeLCD()
10758 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
10759 if(SiS_Pr->LVDSHL != -1) { in SiS_FinalizeLCD()
10760 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SiS_FinalizeLCD()
10764 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; in SiS_FinalizeLCD()
10765 if(SiS_Pr->UseCustomMode) return; in SiS_FinalizeLCD()
10767 switch(SiS_Pr->SiS_CustomT) { in SiS_FinalizeLCD()
10776 resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo; in SiS_FinalizeLCD()
10777 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_FinalizeLCD()
10779 resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO; in SiS_FinalizeLCD()
10780 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_FinalizeLCD()
10784 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) { in SiS_FinalizeLCD()
10785 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { in SiS_FinalizeLCD()
10786 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02); in SiS_FinalizeLCD()
10788 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_FinalizeLCD()
10793 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) { in SiS_FinalizeLCD()
10794 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10796 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
10797 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10803 if(SiS_Pr->SiS_CustomT == CUT_CLEVO10242) { in SiS_FinalizeLCD()
10804 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
10805 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10806 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
10808 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10810 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_FinalizeLCD()
10811 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10813 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10814 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10815 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10816 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10824 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { in SiS_FinalizeLCD()
10825 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10826 if(SiS_Pr->SiS_VBType & VB_SISEMI) { in SiS_FinalizeLCD()
10827 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_FinalizeLCD()
10829 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_FinalizeLCD()
10831 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_FinalizeLCD()
10833 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) { in SiS_FinalizeLCD()
10834 if(SiS_Pr->LVDSHL == -1) { in SiS_FinalizeLCD()
10836 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10839 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10840 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_FinalizeLCD()
10841 if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) { in SiS_FinalizeLCD()
10842 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76); in SiS_FinalizeLCD()
10843 } else if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10845 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10846 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10847 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10848 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10850 if(SiS_Pr->Backup && (SiS_Pr->Backup_Mode == ModeNo)) { in SiS_FinalizeLCD()
10851 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); in SiS_FinalizeLCD()
10852 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); in SiS_FinalizeLCD()
10853 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); in SiS_FinalizeLCD()
10854 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17); in SiS_FinalizeLCD()
10855 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18); in SiS_FinalizeLCD()
10856 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19); in SiS_FinalizeLCD()
10857 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a); in SiS_FinalizeLCD()
10858 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b); in SiS_FinalizeLCD()
10859 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c); in SiS_FinalizeLCD()
10860 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d); in SiS_FinalizeLCD()
10861 } else if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { /* 1.10.8w */ in SiS_FinalizeLCD()
10862 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90); in SiS_FinalizeLCD()
10864 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11); in SiS_FinalizeLCD()
10866 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18); in SiS_FinalizeLCD()
10869 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10871 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); /* 1.10.7u */ in SiS_FinalizeLCD()
10874 tempbx--; in SiS_FinalizeLCD()
10875 temp = tempbx & 0xff; in SiS_FinalizeLCD()
10876 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); in SiS_FinalizeLCD()
10877 temp = (tempbx >> 8) & 0x03; in SiS_FinalizeLCD()
10878 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp); in SiS_FinalizeLCD()
10883 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70); in SiS_FinalizeLCD()
10884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff); in SiS_FinalizeLCD()
10885 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10886 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10889 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20); in SiS_FinalizeLCD()
10890 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a); in SiS_FinalizeLCD()
10891 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28); in SiS_FinalizeLCD()
10892 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00); in SiS_FinalizeLCD()
10893 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c); in SiS_FinalizeLCD()
10894 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10898 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10899 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10900 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10); in SiS_FinalizeLCD()
10901 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10902 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48); in SiS_FinalizeLCD()
10903 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10906 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10907 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10910 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10918 tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_FinalizeLCD()
10922 tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04); in SiS_FinalizeLCD()
10924 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_FinalizeLCD()
10925 if((resinfo == SIS_RI_1024x768) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) { in SiS_FinalizeLCD()
10926 if(SiS_Pr->SiS_SetFlag & LCDVESATiming) { in SiS_FinalizeLCD()
10930 if(SiS_Pr->SiS_VGAVDE < 600) { in SiS_FinalizeLCD()
10931 tempax = 768 - SiS_Pr->SiS_VGAVDE; in SiS_FinalizeLCD()
10933 if(SiS_Pr->SiS_VGAVDE <= 480) tempax >>= 4; /* 1.10.7w; 1.10.6s: < 480; >>=1; */ in SiS_FinalizeLCD()
10934 tempbx -= tempax; in SiS_FinalizeLCD()
10939 temp = tempbx & 0xff; in SiS_FinalizeLCD()
10940 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp); in SiS_FinalizeLCD()
10941 temp = ((tempbx & 0xff00) >> 4) | tempcl; in SiS_FinalizeLCD()
10942 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp); in SiS_FinalizeLCD()
10958 unsigned char temp; in SetOEMLCDData2() local
10962 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SetOEMLCDData2()
10963 crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SetOEMLCDData2()
10965 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SetOEMLCDData2()
10966 crt2crtc = SiS_Pr->SiS_RefIndex[RefTabIndex].Ext_CRT2CRTC; in SetOEMLCDData2()
10971 if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { in SetOEMLCDData2()
10972 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf); in SetOEMLCDData2()
10975 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) { in SetOEMLCDData2()
10978 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SetOEMLCDData2()
10981 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, in SetOEMLCDData2()
10988 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SetOEMLCDData2()
10989 if(temp & 0x80) { in SetOEMLCDData2()
10990 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18); in SetOEMLCDData2()
10991 temp++; in SetOEMLCDData2()
10992 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); in SetOEMLCDData2()
11000 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in GetOEMLCDPtr()
11011 if(SiS_Pr->ChipType == SIS_300) { in GetOEMLCDPtr()
11013 tempbx = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f; in GetOEMLCDPtr()
11014 if(SiS_Pr->SiS_VBType & VB_SIS301) tempbx &= 0x07; in GetOEMLCDPtr()
11015 tempbx -= 2; in GetOEMLCDPtr()
11016 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 4; in GetOEMLCDPtr()
11017 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in GetOEMLCDPtr()
11018 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 3; in GetOEMLCDPtr()
11020 if(SiS_Pr->SiS_UseROM) { in GetOEMLCDPtr()
11022 tempbx = SiS_Pr->SiS_LCDTypeInfo; in GetOEMLCDPtr()
11025 if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11026 else tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11030 if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++; in GetOEMLCDPtr()
11037 if(SiS_Pr->SiS_UseROM) { in GetOEMLCDPtr()
11039 if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11042 tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo]; in GetOEMLCDPtr()
11046 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; in GetOEMLCDPtr()
11047 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in GetOEMLCDPtr()
11050 tempbx = SiS_Pr->SiS_LCDTypeInfo << 2; in GetOEMLCDPtr()
11051 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempbx += 2; in GetOEMLCDPtr()
11052 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; in GetOEMLCDPtr()
11062 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMLCDDelay()
11063 unsigned short index,temp,romptr=0; in SetOEMLCDDelay() local
11065 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return; in SetOEMLCDDelay()
11067 if(SiS_Pr->SiS_UseROM) { in SetOEMLCDDelay()
11077 * Thus we don't set this if the user selected a custom pdc or if in SetOEMLCDDelay()
11080 if(SiS_Pr->PDC != -1) return; in SetOEMLCDDelay()
11082 temp = GetOEMLCDPtr(SiS_Pr, 0); in SetOEMLCDDelay()
11084 if(SiS_Pr->UseCustomMode) in SetOEMLCDDelay()
11087 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_LCDDelayIndex; in SetOEMLCDDelay()
11089 if(SiS_Pr->ChipType != SIS_300) { in SetOEMLCDDelay()
11091 romptr += (temp * 2); in SetOEMLCDDelay()
11094 temp = ROMAddr[romptr]; in SetOEMLCDDelay()
11096 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetOEMLCDDelay()
11097 temp = SiS300_OEMLCDDelay2[temp][index]; in SetOEMLCDDelay()
11099 temp = SiS300_OEMLCDDelay3[temp][index]; in SetOEMLCDDelay()
11103 if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) { in SetOEMLCDDelay()
11105 romptr += (temp * 2); in SetOEMLCDDelay()
11108 temp = ROMAddr[romptr]; in SetOEMLCDDelay()
11110 temp = SiS300_OEMLCDDelay5[temp][index]; in SetOEMLCDDelay()
11113 if(SiS_Pr->SiS_UseROM) { in SetOEMLCDDelay()
11116 romptr += (temp * 2); in SetOEMLCDDelay()
11119 temp = ROMAddr[romptr]; in SetOEMLCDDelay()
11121 temp = SiS300_OEMLCDDelay4[temp][index]; in SetOEMLCDDelay()
11124 temp = SiS300_OEMLCDDelay4[temp][index]; in SetOEMLCDDelay()
11128 temp &= 0x3c; in SetOEMLCDDelay()
11129 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* index 0A D[6:4] */ in SetOEMLCDDelay()
11136 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMLCDData()
11137 unsigned short index,temp; in SetOEMLCDData()
11139 if((SiS_Pr->SiS_UseROM) { in SetOEMLCDData()
11145 temp = GetOEMLCDPtr(SiS_Pr, 1); in SetOEMLCDData()
11146 if(temp == 0xFFFF) return; in SetOEMLCDData()
11148 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDHIndex; in SetOEMLCDData()
11150 SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDHData[temp][index][j]); in SetOEMLCDData()
11152 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1a, 0xf8, (SiS300_LCDHData[temp][index][j] & 0x07)); in SetOEMLCDData()
11154 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDVIndex; in SetOEMLCDData()
11155 SiS_SetReg(SiS_SiS_Part1Port,0x18, SiS300_LCDVData[temp][index][0]); in SetOEMLCDData()
11156 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x19, 0xF0, SiS300_LCDVData[temp][index][1]); in SetOEMLCDData()
11157 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1A, 0xC7, (SiS300_LCDVData[temp][index][2] & 0x38)); in SetOEMLCDData()
11159 SiS_SetReg(SiS_Pr->SiS_Part1Port,i,SiS300_LCDVData[temp][index][j]); in SetOEMLCDData()
11170 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) index += 4; in GetOEMTVPtr()
11171 if(SiS_Pr->SiS_VBType & VB_SISVB) { in GetOEMTVPtr()
11172 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) index += 2; in GetOEMTVPtr()
11173 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) index += 3; in GetOEMTVPtr()
11174 else if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; in GetOEMTVPtr()
11176 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) index += 2; in GetOEMTVPtr()
11177 if(SiS_Pr->SiS_TVMode & TVSetPAL) index += 1; in GetOEMTVPtr()
11185 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMTVDelay()
11186 unsigned short index,temp,romptr=0; in SetOEMTVDelay() local
11188 if(SiS_Pr->SiS_UseROM) { in SetOEMTVDelay()
11194 temp = GetOEMTVPtr(SiS_Pr); in SetOEMTVDelay()
11196 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVDelayIndex; in SetOEMTVDelay()
11199 romptr += (temp * 2); in SetOEMTVDelay()
11202 temp = ROMAddr[romptr]; in SetOEMTVDelay()
11204 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SetOEMTVDelay()
11205 temp = SiS300_OEMTVDelay301[temp][index]; in SetOEMTVDelay()
11207 temp = SiS300_OEMTVDelayLVDS[temp][index]; in SetOEMTVDelay()
11210 temp &= 0x3c; in SetOEMTVDelay()
11211 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); in SetOEMTVDelay()
11217 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMAntiFlicker()
11218 unsigned short index,temp,romptr=0; in SetOEMAntiFlicker() local
11220 if(SiS_Pr->SiS_UseROM) { in SetOEMAntiFlicker()
11226 temp = GetOEMTVPtr(SiS_Pr); in SetOEMAntiFlicker()
11228 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVFlickerIndex; in SetOEMAntiFlicker()
11231 romptr += (temp * 2); in SetOEMAntiFlicker()
11234 temp = ROMAddr[romptr]; in SetOEMAntiFlicker()
11236 temp = SiS300_OEMTVFlicker[temp][index]; in SetOEMAntiFlicker()
11238 temp &= 0x70; in SetOEMAntiFlicker()
11239 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp); in SetOEMAntiFlicker()
11245 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMPhaseIncr()
11246 unsigned short index,i,j,temp,romptr=0; in SetOEMPhaseIncr() local
11248 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) return; in SetOEMPhaseIncr()
11250 if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPALN)) return; in SetOEMPhaseIncr()
11252 if(SiS_Pr->SiS_UseROM) { in SetOEMPhaseIncr()
11258 temp = GetOEMTVPtr(SiS_Pr); in SetOEMPhaseIncr()
11260 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVPhaseIndex; in SetOEMPhaseIncr()
11262 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetOEMPhaseIncr()
11264 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase2[temp][index][j]); in SetOEMPhaseIncr()
11268 romptr += (temp * 2); in SetOEMPhaseIncr()
11272 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetOEMPhaseIncr()
11276 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Phase1[temp][index][j]); in SetOEMPhaseIncr()
11285 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SetOEMYFilter()
11286 unsigned short index,temp,i,j,romptr=0; in SetOEMYFilter() local
11288 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVision | SetCRT2ToYPbPr525750)) return; in SetOEMYFilter()
11290 if(SiS_Pr->SiS_UseROM) { in SetOEMYFilter()
11296 temp = GetOEMTVPtr(SiS_Pr); in SetOEMYFilter()
11298 if(SiS_Pr->SiS_TVMode & TVSetPALM) temp = 8; in SetOEMYFilter()
11299 else if(SiS_Pr->SiS_TVMode & TVSetPALN) temp = 9; in SetOEMYFilter()
11302 index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].VB_TVYFilterIndex; in SetOEMYFilter()
11304 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SetOEMYFilter()
11306 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); in SetOEMYFilter()
11309 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter2[temp][index][j]); in SetOEMYFilter()
11312 if((romptr) && (!(SiS_Pr->SiS_TVMode & (TVSetPALM|TVSetPALN)))) { in SetOEMYFilter()
11313 romptr += (temp * 2); in SetOEMYFilter()
11317 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]); in SetOEMYFilter()
11321 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS300_Filter1[temp][index][j]); in SetOEMYFilter()
11331 unsigned char VGAINFO = SiS_Pr->SiS_VGAINFO; in SiS_SearchVBModeID()
11336 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == *ModeNo) break; in SiS_SearchVBModeID()
11337 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF) return 0; in SiS_SearchVBModeID()
11357 if(!SiS_Pr->UseCustomMode) { in SiS_OEM300Setting()
11362 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_OEM300Setting()
11364 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_OEM300Setting()
11368 if(SiS_Pr->UseCustomMode) return; in SiS_OEM300Setting()
11369 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_OEM300Setting()
11371 if(SiS_Pr->SiS_VBType & VB_SISVB) { in SiS_OEM300Setting()