Lines Matching refs:SiS_Pr

54 static void SiSUSB_InitPtr(struct SiS_Private *SiS_Pr)  in SiSUSB_InitPtr()  argument
56 SiS_Pr->SiS_ModeResInfo = SiSUSB_ModeResInfo; in SiSUSB_InitPtr()
57 SiS_Pr->SiS_StandTable = SiSUSB_StandTable; in SiSUSB_InitPtr()
59 SiS_Pr->SiS_SModeIDTable = SiSUSB_SModeIDTable; in SiSUSB_InitPtr()
60 SiS_Pr->SiS_EModeIDTable = SiSUSB_EModeIDTable; in SiSUSB_InitPtr()
61 SiS_Pr->SiS_RefIndex = SiSUSB_RefIndex; in SiSUSB_InitPtr()
62 SiS_Pr->SiS_CRT1Table = SiSUSB_CRT1Table; in SiSUSB_InitPtr()
64 SiS_Pr->SiS_VCLKData = SiSUSB_VCLKData; in SiSUSB_InitPtr()
72 SiS_SetReg(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetReg() argument
75 sisusb_setidxreg(SiS_Pr->sisusb, port, index, data); in SiS_SetReg()
79 SiS_SetRegByte(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegByte() argument
82 sisusb_setreg(SiS_Pr->sisusb, port, data); in SiS_SetRegByte()
86 SiS_GetReg(struct SiS_Private *SiS_Pr, unsigned long port, unsigned short index) in SiS_GetReg() argument
90 sisusb_getidxreg(SiS_Pr->sisusb, port, index, &data); in SiS_GetReg()
96 SiS_GetRegByte(struct SiS_Private *SiS_Pr, unsigned long port) in SiS_GetRegByte() argument
100 sisusb_getreg(SiS_Pr->sisusb, port, &data); in SiS_GetRegByte()
106 SiS_SetRegANDOR(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegANDOR() argument
110 sisusb_setidxregandor(SiS_Pr->sisusb, port, index, DataAND, DataOR); in SiS_SetRegANDOR()
114 SiS_SetRegAND(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegAND() argument
117 sisusb_setidxregand(SiS_Pr->sisusb, port, index, DataAND); in SiS_SetRegAND()
121 SiS_SetRegOR(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegOR() argument
124 sisusb_setidxregor(SiS_Pr->sisusb, port, index, DataOR); in SiS_SetRegOR()
131 static void SiS_DisplayOn(struct SiS_Private *SiS_Pr) in SiS_DisplayOn() argument
133 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, 0xDF); in SiS_DisplayOn()
140 static void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) in SiSUSBRegInit() argument
142 SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; in SiSUSBRegInit()
143 SiS_Pr->SiS_P3d4 = BaseAddr + 0x24; in SiSUSBRegInit()
144 SiS_Pr->SiS_P3c0 = BaseAddr + 0x10; in SiSUSBRegInit()
145 SiS_Pr->SiS_P3ce = BaseAddr + 0x1e; in SiSUSBRegInit()
146 SiS_Pr->SiS_P3c2 = BaseAddr + 0x12; in SiSUSBRegInit()
147 SiS_Pr->SiS_P3ca = BaseAddr + 0x1a; in SiSUSBRegInit()
148 SiS_Pr->SiS_P3c6 = BaseAddr + 0x16; in SiSUSBRegInit()
149 SiS_Pr->SiS_P3c7 = BaseAddr + 0x17; in SiSUSBRegInit()
150 SiS_Pr->SiS_P3c8 = BaseAddr + 0x18; in SiSUSBRegInit()
151 SiS_Pr->SiS_P3c9 = BaseAddr + 0x19; in SiSUSBRegInit()
152 SiS_Pr->SiS_P3cb = BaseAddr + 0x1b; in SiSUSBRegInit()
153 SiS_Pr->SiS_P3cc = BaseAddr + 0x1c; in SiSUSBRegInit()
154 SiS_Pr->SiS_P3cd = BaseAddr + 0x1d; in SiSUSBRegInit()
155 SiS_Pr->SiS_P3da = BaseAddr + 0x2a; in SiSUSBRegInit()
156 SiS_Pr->SiS_Part1Port = BaseAddr + SIS_CRT2_PORT_04; in SiSUSBRegInit()
163 static void SiS_GetSysFlags(struct SiS_Private *SiS_Pr) in SiS_GetSysFlags() argument
165 SiS_Pr->SiS_MyCR63 = 0x63; in SiS_GetSysFlags()
172 static void SiSInitPCIetc(struct SiS_Private *SiS_Pr) in SiSInitPCIetc() argument
174 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x20, 0xa1); in SiSInitPCIetc()
181 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1E, 0xDA); in SiSInitPCIetc()
188 static void SiS_SetSegRegLower(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegLower() argument
193 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb) & 0xf0; in SiS_SetSegRegLower()
195 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegLower()
196 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd) & 0xf0; in SiS_SetSegRegLower()
198 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegLower()
201 static void SiS_SetSegRegUpper(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegUpper() argument
206 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb) & 0x0f; in SiS_SetSegRegUpper()
208 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegUpper()
209 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd) & 0x0f; in SiS_SetSegRegUpper()
211 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegUpper()
214 static void SiS_SetSegmentReg(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentReg() argument
216 SiS_SetSegRegLower(SiS_Pr, value); in SiS_SetSegmentReg()
217 SiS_SetSegRegUpper(SiS_Pr, value); in SiS_SetSegmentReg()
220 static void SiS_ResetSegmentReg(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentReg() argument
222 SiS_SetSegmentReg(SiS_Pr, 0); in SiS_ResetSegmentReg()
226 SiS_SetSegmentRegOver(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentRegOver() argument
232 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1d, temp); in SiS_SetSegmentRegOver()
233 SiS_SetSegmentReg(SiS_Pr, value); in SiS_SetSegmentRegOver()
236 static void SiS_ResetSegmentRegOver(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegOver() argument
238 SiS_SetSegmentRegOver(SiS_Pr, 0); in SiS_ResetSegmentRegOver()
241 static void SiS_ResetSegmentRegisters(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegisters() argument
243 SiS_ResetSegmentReg(SiS_Pr); in SiS_ResetSegmentRegisters()
244 SiS_ResetSegmentRegOver(SiS_Pr); in SiS_ResetSegmentRegisters()
252 SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, in SiS_SearchModeID() argument
266 if (SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == in SiS_SearchModeID()
270 if (SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == in SiS_SearchModeID()
284 static void SiS_HandleCRT1(struct SiS_Private *SiS_Pr) in SiS_HandleCRT1() argument
287 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, SiS_Pr->SiS_MyCR63, 0xbf); in SiS_HandleCRT1()
295 SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetColorDepth() argument
303 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetColorDepth()
305 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetColorDepth()
319 SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetOffset() argument
324 infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_GetOffset()
325 xres = SiS_Pr->SiS_RefIndex[rrti].XRes; in SiS_GetOffset()
327 colordepth = SiS_GetColorDepth(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetOffset()
347 SiS_SetSeqRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetSeqRegs() argument
352 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x00, 0x03); in SiS_SetSeqRegs()
354 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[0] | 0x20; in SiS_SetSeqRegs()
355 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, SRdata); in SiS_SetSeqRegs()
358 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[i - 1]; in SiS_SetSeqRegs()
359 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, i, SRdata); in SiS_SetSeqRegs()
368 SiS_SetMiscRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetMiscRegs() argument
370 unsigned char Miscdata = SiS_Pr->SiS_StandTable[StandTableIndex].MISC; in SiS_SetMiscRegs()
372 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c2, Miscdata); in SiS_SetMiscRegs()
380 SiS_SetCRTCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetCRTCRegs() argument
385 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, 0x11, 0x7f); in SiS_SetCRTCRegs()
388 CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i]; in SiS_SetCRTCRegs()
389 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, i, CRTCdata); in SiS_SetCRTCRegs()
398 SiS_SetATTRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetATTRegs() argument
404 ARdata = SiS_Pr->SiS_StandTable[StandTableIndex].ATTR[i]; in SiS_SetATTRegs()
405 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
406 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, i); in SiS_SetATTRegs()
407 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, ARdata); in SiS_SetATTRegs()
409 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
410 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x14); in SiS_SetATTRegs()
411 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x00); in SiS_SetATTRegs()
413 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
414 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x20); in SiS_SetATTRegs()
415 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
423 SiS_SetGRCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetGRCRegs() argument
429 GRdata = SiS_Pr->SiS_StandTable[StandTableIndex].GRC[i]; in SiS_SetGRCRegs()
430 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3ce, i, GRdata); in SiS_SetGRCRegs()
433 if (SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetGRCRegs()
435 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3ce, 0x05, 0xBF); in SiS_SetGRCRegs()
443 static void SiS_ClearExt1Regs(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_ClearExt1Regs() argument
448 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, i, 0x00); in SiS_ClearExt1Regs()
451 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x37, 0xFE); in SiS_ClearExt1Regs()
459 SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetRatePtr() argument
467 index = SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x33) & 0x0F; in SiS_GetRatePtr()
471 rrti = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; in SiS_GetRatePtr()
472 ModeNo = SiS_Pr->SiS_RefIndex[rrti].ModeID; in SiS_GetRatePtr()
476 if (SiS_Pr->SiS_RefIndex[rrti + i].ModeID != ModeNo) in SiS_GetRatePtr()
480 SiS_Pr->SiS_RefIndex[rrti + i].Ext_InfoFlag & ModeTypeMask; in SiS_GetRatePtr()
481 if (temp < SiS_Pr->SiS_ModeType) in SiS_GetRatePtr()
497 static void SiS_SetCRT1Sync(struct SiS_Private *SiS_Pr, unsigned short rrti) in SiS_SetCRT1Sync() argument
499 unsigned short sync = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag >> 8; in SiS_SetCRT1Sync()
502 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c2, sync); in SiS_SetCRT1Sync()
510 SiS_SetCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1CRTC() argument
516 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, 0x11, 0x7f); in SiS_SetCRT1CRTC()
518 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT1CRTC()
520 index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRT1CRTC; in SiS_SetCRT1CRTC()
523 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
524 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
527 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
528 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
531 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
532 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
535 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, j, in SiS_SetCRT1CRTC()
536 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
539 temp = SiS_Pr->SiS_CRT1Table[index].CR[16] & 0xE0; in SiS_SetCRT1CRTC()
540 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0E, temp); in SiS_SetCRT1CRTC()
542 temp = ((SiS_Pr->SiS_CRT1Table[index].CR[16]) & 0x01) << 5; in SiS_SetCRT1CRTC()
545 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3d4, 0x09, 0x5F, temp); in SiS_SetCRT1CRTC()
547 if (SiS_Pr->SiS_ModeType > ModeVGA) in SiS_SetCRT1CRTC()
548 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x14, 0x4F); in SiS_SetCRT1CRTC()
558 SiS_SetCRT1Offset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Offset() argument
561 unsigned short du = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Offset()
562 unsigned short infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_SetCRT1Offset()
566 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0E, 0xF0, temp); in SiS_SetCRT1Offset()
568 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x13, (du & 0xFF)); in SiS_SetCRT1Offset()
578 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x10, temp); in SiS_SetCRT1Offset()
586 SiS_SetCRT1VCLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1VCLK() argument
589 unsigned short index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRTVCLK; in SiS_SetCRT1VCLK()
590 unsigned short clka = SiS_Pr->SiS_VCLKData[index].SR2B; in SiS_SetCRT1VCLK()
591 unsigned short clkb = SiS_Pr->SiS_VCLKData[index].SR2C; in SiS_SetCRT1VCLK()
593 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x31, 0xCF); in SiS_SetCRT1VCLK()
595 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2B, clka); in SiS_SetCRT1VCLK()
596 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2C, clkb); in SiS_SetCRT1VCLK()
597 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2D, 0x01); in SiS_SetCRT1VCLK()
605 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1FIFO_310() argument
608 unsigned short modeflag = SiS_Pr->SiS_EModeIDTable[mi].Ext_ModeFlag; in SiS_SetCRT1FIFO_310()
611 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x3D, 0xFE); in SiS_SetCRT1FIFO_310()
613 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x08, 0xAE); in SiS_SetCRT1FIFO_310()
614 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x09, 0xF0); in SiS_SetCRT1FIFO_310()
620 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x08, 0x34); in SiS_SetCRT1FIFO_310()
621 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x3D, 0x01); in SiS_SetCRT1FIFO_310()
630 SiS_SetVCLKState(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetVCLKState() argument
636 index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRTVCLK; in SiS_SetVCLKState()
637 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetVCLKState()
642 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x32, 0xf3, data); in SiS_SetVCLKState()
645 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1f, 0xe7); in SiS_SetVCLKState()
656 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x07, 0xF8, data); in SiS_SetVCLKState()
660 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1ModeRegs() argument
666 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetCRT1ModeRegs()
668 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT1ModeRegs()
669 infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_SetCRT1ModeRegs()
673 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1F, 0x3F); in SiS_SetCRT1ModeRegs()
677 if (SiS_Pr->SiS_ModeType > ModeEGA) { in SiS_SetCRT1ModeRegs()
679 data |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2); in SiS_SetCRT1ModeRegs()
684 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x06, 0xC0, data); in SiS_SetCRT1ModeRegs()
690 (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x04) | in SiS_SetCRT1ModeRegs()
691 ((SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0b) & 0xc0) << 2)) in SiS_SetCRT1ModeRegs()
694 (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x00) | in SiS_SetCRT1ModeRegs()
695 ((SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0b) & 0x03) << 8)) in SiS_SetCRT1ModeRegs()
699 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x19, (data & 0xFF)); in SiS_SetCRT1ModeRegs()
700 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3d4, 0x1a, 0xFC, (data >> 8)); in SiS_SetCRT1ModeRegs()
703 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, 0x08); in SiS_SetCRT1ModeRegs()
708 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0F, 0xB7, data); in SiS_SetCRT1ModeRegs()
710 if ((SiS_Pr->SiS_ModeType == ModeEGA) && (ModeNo > 0x13)) in SiS_SetCRT1ModeRegs()
711 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0F, 0x40); in SiS_SetCRT1ModeRegs()
713 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x31, 0xfb); in SiS_SetCRT1ModeRegs()
716 if (SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetCRT1ModeRegs()
718 if (SiS_Pr->SiS_ModeType != ModeEGA) in SiS_SetCRT1ModeRegs()
721 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x21, 0x1F, data); in SiS_SetCRT1ModeRegs()
723 SiS_SetVCLKState(SiS_Pr, ModeNo, rrti); in SiS_SetCRT1ModeRegs()
725 if (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x31) & 0x40) in SiS_SetCRT1ModeRegs()
726 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x52, 0x2c); in SiS_SetCRT1ModeRegs()
728 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x52, 0x6c); in SiS_SetCRT1ModeRegs()
736 SiS_WriteDAC(struct SiS_Private *SiS_Pr, unsigned long DACData, in SiS_WriteDAC() argument
758 SiS_SetRegByte(SiS_Pr, DACData, (d1 << shiftflag)); in SiS_WriteDAC()
759 SiS_SetRegByte(SiS_Pr, DACData, (d2 << shiftflag)); in SiS_WriteDAC()
760 SiS_SetRegByte(SiS_Pr, DACData, (d3 << shiftflag)); in SiS_WriteDAC()
764 SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_LoadDAC() argument
773 data = SiS_Pr->SiS_SModeIDTable[mi].St_ModeFlag; in SiS_LoadDAC()
775 data = SiS_Pr->SiS_EModeIDTable[mi].Ext_ModeFlag; in SiS_LoadDAC()
792 DACAddr = SiS_Pr->SiS_P3c8; in SiS_LoadDAC()
793 DACData = SiS_Pr->SiS_P3c9; in SiS_LoadDAC()
795 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c6, 0xFF); in SiS_LoadDAC()
797 SiS_SetRegByte(SiS_Pr, DACAddr, 0x00); in SiS_LoadDAC()
807 SiS_SetRegByte(SiS_Pr, DACData, (data2 << sf)); in SiS_LoadDAC()
816 SiS_SetRegByte(SiS_Pr, DACData, data); in SiS_LoadDAC()
824 SiS_WriteDAC(SiS_Pr, DACData, sf, n, in SiS_LoadDAC()
831 SiS_WriteDAC(SiS_Pr, DACData, sf, n, in SiS_LoadDAC()
847 SiS_SetCRT1Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Group() argument
852 SiS_Pr->SiS_CRT1Mode = ModeNo; in SiS_SetCRT1Group()
859 SiS_ResetSegmentRegisters(SiS_Pr); in SiS_SetCRT1Group()
860 SiS_SetSeqRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
861 SiS_SetMiscRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
862 SiS_SetCRTCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
863 SiS_SetATTRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
864 SiS_SetGRCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
865 SiS_ClearExt1Regs(SiS_Pr, ModeNo); in SiS_SetCRT1Group()
867 rrti = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
870 SiS_SetCRT1Sync(SiS_Pr, rrti); in SiS_SetCRT1Group()
871 SiS_SetCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
872 SiS_SetCRT1Offset(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
873 SiS_SetCRT1VCLK(SiS_Pr, ModeNo, rrti); in SiS_SetCRT1Group()
876 SiS_SetCRT1FIFO_310(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
878 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
880 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
882 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT1Group()
889 int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiSUSBSetMode() argument
892 unsigned long BaseAddr = SiS_Pr->IOAddress; in SiSUSBSetMode()
894 SiSUSB_InitPtr(SiS_Pr); in SiSUSBSetMode()
895 SiSUSBRegInit(SiS_Pr, BaseAddr); in SiSUSBSetMode()
896 SiS_GetSysFlags(SiS_Pr); in SiSUSBSetMode()
898 if (!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) in SiSUSBSetMode()
901 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x05, 0x86); in SiSUSBSetMode()
903 SiSInitPCIetc(SiS_Pr); in SiSUSBSetMode()
907 SiS_Pr->SiS_ModeType = in SiSUSBSetMode()
908 SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask; in SiSUSBSetMode()
910 SiS_Pr->SiS_SetFlag = LowModeTests; in SiSUSBSetMode()
913 SiS_SetCRT1Group(SiS_Pr, ModeNo, ModeIdIndex); in SiSUSBSetMode()
915 SiS_HandleCRT1(SiS_Pr); in SiSUSBSetMode()
917 SiS_DisplayOn(SiS_Pr); in SiSUSBSetMode()
918 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c6, 0xFF); in SiSUSBSetMode()
921 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x34, ModeNo); in SiSUSBSetMode()
926 int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo) in SiSUSBSetVESAMode() argument
931 SiSUSB_InitPtr(SiS_Pr); in SiSUSBSetVESAMode()
942 if (SiS_Pr->SiS_EModeIDTable[i].Ext_VESAID == VModeNo) { in SiSUSBSetVESAMode()
943 ModeNo = SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID; in SiSUSBSetVESAMode()
947 } while (SiS_Pr->SiS_EModeIDTable[i++].Ext_ModeID != 0xff); in SiSUSBSetVESAMode()
954 return SiSUSBSetMode(SiS_Pr, ModeNo); in SiSUSBSetVESAMode()