Lines Matching refs:SiS_Pr
55 static void SiSUSB_InitPtr(struct SiS_Private *SiS_Pr) in SiSUSB_InitPtr() argument
57 SiS_Pr->SiS_ModeResInfo = SiSUSB_ModeResInfo; in SiSUSB_InitPtr()
58 SiS_Pr->SiS_StandTable = SiSUSB_StandTable; in SiSUSB_InitPtr()
60 SiS_Pr->SiS_SModeIDTable = SiSUSB_SModeIDTable; in SiSUSB_InitPtr()
61 SiS_Pr->SiS_EModeIDTable = SiSUSB_EModeIDTable; in SiSUSB_InitPtr()
62 SiS_Pr->SiS_RefIndex = SiSUSB_RefIndex; in SiSUSB_InitPtr()
63 SiS_Pr->SiS_CRT1Table = SiSUSB_CRT1Table; in SiSUSB_InitPtr()
65 SiS_Pr->SiS_VCLKData = SiSUSB_VCLKData; in SiSUSB_InitPtr()
73 SiS_SetReg(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetReg() argument
76 sisusb_setidxreg(SiS_Pr->sisusb, port, index, data); in SiS_SetReg()
80 SiS_SetRegByte(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegByte() argument
83 sisusb_setreg(SiS_Pr->sisusb, port, data); in SiS_SetRegByte()
87 SiS_GetReg(struct SiS_Private *SiS_Pr, unsigned long port, unsigned short index) in SiS_GetReg() argument
91 sisusb_getidxreg(SiS_Pr->sisusb, port, index, &data); in SiS_GetReg()
97 SiS_GetRegByte(struct SiS_Private *SiS_Pr, unsigned long port) in SiS_GetRegByte() argument
101 sisusb_getreg(SiS_Pr->sisusb, port, &data); in SiS_GetRegByte()
107 SiS_SetRegANDOR(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegANDOR() argument
111 sisusb_setidxregandor(SiS_Pr->sisusb, port, index, DataAND, DataOR); in SiS_SetRegANDOR()
115 SiS_SetRegAND(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegAND() argument
118 sisusb_setidxregand(SiS_Pr->sisusb, port, index, DataAND); in SiS_SetRegAND()
122 SiS_SetRegOR(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegOR() argument
125 sisusb_setidxregor(SiS_Pr->sisusb, port, index, DataOR); in SiS_SetRegOR()
132 static void SiS_DisplayOn(struct SiS_Private *SiS_Pr) in SiS_DisplayOn() argument
134 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, 0xDF); in SiS_DisplayOn()
141 static void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) in SiSUSBRegInit() argument
143 SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; in SiSUSBRegInit()
144 SiS_Pr->SiS_P3d4 = BaseAddr + 0x24; in SiSUSBRegInit()
145 SiS_Pr->SiS_P3c0 = BaseAddr + 0x10; in SiSUSBRegInit()
146 SiS_Pr->SiS_P3ce = BaseAddr + 0x1e; in SiSUSBRegInit()
147 SiS_Pr->SiS_P3c2 = BaseAddr + 0x12; in SiSUSBRegInit()
148 SiS_Pr->SiS_P3ca = BaseAddr + 0x1a; in SiSUSBRegInit()
149 SiS_Pr->SiS_P3c6 = BaseAddr + 0x16; in SiSUSBRegInit()
150 SiS_Pr->SiS_P3c7 = BaseAddr + 0x17; in SiSUSBRegInit()
151 SiS_Pr->SiS_P3c8 = BaseAddr + 0x18; in SiSUSBRegInit()
152 SiS_Pr->SiS_P3c9 = BaseAddr + 0x19; in SiSUSBRegInit()
153 SiS_Pr->SiS_P3cb = BaseAddr + 0x1b; in SiSUSBRegInit()
154 SiS_Pr->SiS_P3cc = BaseAddr + 0x1c; in SiSUSBRegInit()
155 SiS_Pr->SiS_P3cd = BaseAddr + 0x1d; in SiSUSBRegInit()
156 SiS_Pr->SiS_P3da = BaseAddr + 0x2a; in SiSUSBRegInit()
157 SiS_Pr->SiS_Part1Port = BaseAddr + SIS_CRT2_PORT_04; in SiSUSBRegInit()
164 static void SiS_GetSysFlags(struct SiS_Private *SiS_Pr) in SiS_GetSysFlags() argument
166 SiS_Pr->SiS_MyCR63 = 0x63; in SiS_GetSysFlags()
173 static void SiSInitPCIetc(struct SiS_Private *SiS_Pr) in SiSInitPCIetc() argument
175 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x20, 0xa1); in SiSInitPCIetc()
182 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1E, 0xDA); in SiSInitPCIetc()
189 static void SiS_SetSegRegLower(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegLower() argument
194 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb) & 0xf0; in SiS_SetSegRegLower()
196 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegLower()
197 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd) & 0xf0; in SiS_SetSegRegLower()
199 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegLower()
202 static void SiS_SetSegRegUpper(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegUpper() argument
207 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb) & 0x0f; in SiS_SetSegRegUpper()
209 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegUpper()
210 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd) & 0x0f; in SiS_SetSegRegUpper()
212 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegUpper()
215 static void SiS_SetSegmentReg(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentReg() argument
217 SiS_SetSegRegLower(SiS_Pr, value); in SiS_SetSegmentReg()
218 SiS_SetSegRegUpper(SiS_Pr, value); in SiS_SetSegmentReg()
221 static void SiS_ResetSegmentReg(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentReg() argument
223 SiS_SetSegmentReg(SiS_Pr, 0); in SiS_ResetSegmentReg()
227 SiS_SetSegmentRegOver(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentRegOver() argument
233 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1d, temp); in SiS_SetSegmentRegOver()
234 SiS_SetSegmentReg(SiS_Pr, value); in SiS_SetSegmentRegOver()
237 static void SiS_ResetSegmentRegOver(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegOver() argument
239 SiS_SetSegmentRegOver(SiS_Pr, 0); in SiS_ResetSegmentRegOver()
242 static void SiS_ResetSegmentRegisters(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegisters() argument
244 SiS_ResetSegmentReg(SiS_Pr); in SiS_ResetSegmentRegisters()
245 SiS_ResetSegmentRegOver(SiS_Pr); in SiS_ResetSegmentRegisters()
253 SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, in SiS_SearchModeID() argument
267 if (SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == in SiS_SearchModeID()
271 if (SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == in SiS_SearchModeID()
285 static void SiS_HandleCRT1(struct SiS_Private *SiS_Pr) in SiS_HandleCRT1() argument
288 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, SiS_Pr->SiS_MyCR63, 0xbf); in SiS_HandleCRT1()
296 SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetColorDepth() argument
304 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetColorDepth()
306 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetColorDepth()
320 SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetOffset() argument
325 infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_GetOffset()
326 xres = SiS_Pr->SiS_RefIndex[rrti].XRes; in SiS_GetOffset()
328 colordepth = SiS_GetColorDepth(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetOffset()
348 SiS_SetSeqRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetSeqRegs() argument
353 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x00, 0x03); in SiS_SetSeqRegs()
355 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[0] | 0x20; in SiS_SetSeqRegs()
356 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, SRdata); in SiS_SetSeqRegs()
359 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[i - 1]; in SiS_SetSeqRegs()
360 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, i, SRdata); in SiS_SetSeqRegs()
369 SiS_SetMiscRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetMiscRegs() argument
371 unsigned char Miscdata = SiS_Pr->SiS_StandTable[StandTableIndex].MISC; in SiS_SetMiscRegs()
373 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c2, Miscdata); in SiS_SetMiscRegs()
381 SiS_SetCRTCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetCRTCRegs() argument
386 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, 0x11, 0x7f); in SiS_SetCRTCRegs()
389 CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i]; in SiS_SetCRTCRegs()
390 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, i, CRTCdata); in SiS_SetCRTCRegs()
399 SiS_SetATTRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetATTRegs() argument
405 ARdata = SiS_Pr->SiS_StandTable[StandTableIndex].ATTR[i]; in SiS_SetATTRegs()
406 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
407 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, i); in SiS_SetATTRegs()
408 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, ARdata); in SiS_SetATTRegs()
410 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
411 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x14); in SiS_SetATTRegs()
412 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x00); in SiS_SetATTRegs()
414 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
415 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x20); in SiS_SetATTRegs()
416 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
424 SiS_SetGRCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetGRCRegs() argument
430 GRdata = SiS_Pr->SiS_StandTable[StandTableIndex].GRC[i]; in SiS_SetGRCRegs()
431 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3ce, i, GRdata); in SiS_SetGRCRegs()
434 if (SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetGRCRegs()
436 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3ce, 0x05, 0xBF); in SiS_SetGRCRegs()
444 static void SiS_ClearExt1Regs(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_ClearExt1Regs() argument
449 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, i, 0x00); in SiS_ClearExt1Regs()
452 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x37, 0xFE); in SiS_ClearExt1Regs()
460 SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetRatePtr() argument
468 index = SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x33) & 0x0F; in SiS_GetRatePtr()
472 rrti = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; in SiS_GetRatePtr()
473 ModeNo = SiS_Pr->SiS_RefIndex[rrti].ModeID; in SiS_GetRatePtr()
477 if (SiS_Pr->SiS_RefIndex[rrti + i].ModeID != ModeNo) in SiS_GetRatePtr()
481 SiS_Pr->SiS_RefIndex[rrti + i].Ext_InfoFlag & ModeTypeMask; in SiS_GetRatePtr()
482 if (temp < SiS_Pr->SiS_ModeType) in SiS_GetRatePtr()
498 static void SiS_SetCRT1Sync(struct SiS_Private *SiS_Pr, unsigned short rrti) in SiS_SetCRT1Sync() argument
500 unsigned short sync = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag >> 8; in SiS_SetCRT1Sync()
503 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c2, sync); in SiS_SetCRT1Sync()
511 SiS_SetCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1CRTC() argument
517 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, 0x11, 0x7f); in SiS_SetCRT1CRTC()
519 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT1CRTC()
521 index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRT1CRTC; in SiS_SetCRT1CRTC()
524 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
525 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
528 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
529 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
532 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
533 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
536 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, j, in SiS_SetCRT1CRTC()
537 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
540 temp = SiS_Pr->SiS_CRT1Table[index].CR[16] & 0xE0; in SiS_SetCRT1CRTC()
541 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0E, temp); in SiS_SetCRT1CRTC()
543 temp = ((SiS_Pr->SiS_CRT1Table[index].CR[16]) & 0x01) << 5; in SiS_SetCRT1CRTC()
546 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3d4, 0x09, 0x5F, temp); in SiS_SetCRT1CRTC()
548 if (SiS_Pr->SiS_ModeType > ModeVGA) in SiS_SetCRT1CRTC()
549 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x14, 0x4F); in SiS_SetCRT1CRTC()
559 SiS_SetCRT1Offset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Offset() argument
562 unsigned short du = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Offset()
563 unsigned short infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_SetCRT1Offset()
567 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0E, 0xF0, temp); in SiS_SetCRT1Offset()
569 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x13, (du & 0xFF)); in SiS_SetCRT1Offset()
579 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x10, temp); in SiS_SetCRT1Offset()
587 SiS_SetCRT1VCLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1VCLK() argument
590 unsigned short index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRTVCLK; in SiS_SetCRT1VCLK()
591 unsigned short clka = SiS_Pr->SiS_VCLKData[index].SR2B; in SiS_SetCRT1VCLK()
592 unsigned short clkb = SiS_Pr->SiS_VCLKData[index].SR2C; in SiS_SetCRT1VCLK()
594 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x31, 0xCF); in SiS_SetCRT1VCLK()
596 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2B, clka); in SiS_SetCRT1VCLK()
597 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2C, clkb); in SiS_SetCRT1VCLK()
598 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2D, 0x01); in SiS_SetCRT1VCLK()
606 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1FIFO_310() argument
609 unsigned short modeflag = SiS_Pr->SiS_EModeIDTable[mi].Ext_ModeFlag; in SiS_SetCRT1FIFO_310()
612 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x3D, 0xFE); in SiS_SetCRT1FIFO_310()
614 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x08, 0xAE); in SiS_SetCRT1FIFO_310()
615 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x09, 0xF0); in SiS_SetCRT1FIFO_310()
621 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x08, 0x34); in SiS_SetCRT1FIFO_310()
622 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x3D, 0x01); in SiS_SetCRT1FIFO_310()
631 SiS_SetVCLKState(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetVCLKState() argument
637 index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRTVCLK; in SiS_SetVCLKState()
638 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetVCLKState()
643 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x32, 0xf3, data); in SiS_SetVCLKState()
646 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1f, 0xe7); in SiS_SetVCLKState()
657 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x07, 0xF8, data); in SiS_SetVCLKState()
661 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1ModeRegs() argument
667 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetCRT1ModeRegs()
669 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT1ModeRegs()
670 infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_SetCRT1ModeRegs()
674 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1F, 0x3F); in SiS_SetCRT1ModeRegs()
678 if (SiS_Pr->SiS_ModeType > ModeEGA) { in SiS_SetCRT1ModeRegs()
680 data |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2); in SiS_SetCRT1ModeRegs()
685 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x06, 0xC0, data); in SiS_SetCRT1ModeRegs()
691 (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x04) | in SiS_SetCRT1ModeRegs()
692 ((SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0b) & 0xc0) << 2)) in SiS_SetCRT1ModeRegs()
695 (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x00) | in SiS_SetCRT1ModeRegs()
696 ((SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0b) & 0x03) << 8)) in SiS_SetCRT1ModeRegs()
700 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x19, (data & 0xFF)); in SiS_SetCRT1ModeRegs()
701 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3d4, 0x1a, 0xFC, (data >> 8)); in SiS_SetCRT1ModeRegs()
704 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, 0x08); in SiS_SetCRT1ModeRegs()
709 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0F, 0xB7, data); in SiS_SetCRT1ModeRegs()
711 if ((SiS_Pr->SiS_ModeType == ModeEGA) && (ModeNo > 0x13)) in SiS_SetCRT1ModeRegs()
712 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0F, 0x40); in SiS_SetCRT1ModeRegs()
714 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x31, 0xfb); in SiS_SetCRT1ModeRegs()
717 if (SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetCRT1ModeRegs()
719 if (SiS_Pr->SiS_ModeType != ModeEGA) in SiS_SetCRT1ModeRegs()
722 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x21, 0x1F, data); in SiS_SetCRT1ModeRegs()
724 SiS_SetVCLKState(SiS_Pr, ModeNo, rrti); in SiS_SetCRT1ModeRegs()
726 if (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x31) & 0x40) in SiS_SetCRT1ModeRegs()
727 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x52, 0x2c); in SiS_SetCRT1ModeRegs()
729 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x52, 0x6c); in SiS_SetCRT1ModeRegs()
737 SiS_WriteDAC(struct SiS_Private *SiS_Pr, unsigned long DACData, in SiS_WriteDAC() argument
759 SiS_SetRegByte(SiS_Pr, DACData, (d1 << shiftflag)); in SiS_WriteDAC()
760 SiS_SetRegByte(SiS_Pr, DACData, (d2 << shiftflag)); in SiS_WriteDAC()
761 SiS_SetRegByte(SiS_Pr, DACData, (d3 << shiftflag)); in SiS_WriteDAC()
765 SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_LoadDAC() argument
774 data = SiS_Pr->SiS_SModeIDTable[mi].St_ModeFlag; in SiS_LoadDAC()
776 data = SiS_Pr->SiS_EModeIDTable[mi].Ext_ModeFlag; in SiS_LoadDAC()
793 DACAddr = SiS_Pr->SiS_P3c8; in SiS_LoadDAC()
794 DACData = SiS_Pr->SiS_P3c9; in SiS_LoadDAC()
796 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c6, 0xFF); in SiS_LoadDAC()
798 SiS_SetRegByte(SiS_Pr, DACAddr, 0x00); in SiS_LoadDAC()
808 SiS_SetRegByte(SiS_Pr, DACData, (data2 << sf)); in SiS_LoadDAC()
817 SiS_SetRegByte(SiS_Pr, DACData, data); in SiS_LoadDAC()
825 SiS_WriteDAC(SiS_Pr, DACData, sf, n, in SiS_LoadDAC()
832 SiS_WriteDAC(SiS_Pr, DACData, sf, n, in SiS_LoadDAC()
848 SiS_SetCRT1Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Group() argument
853 SiS_Pr->SiS_CRT1Mode = ModeNo; in SiS_SetCRT1Group()
860 SiS_ResetSegmentRegisters(SiS_Pr); in SiS_SetCRT1Group()
861 SiS_SetSeqRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
862 SiS_SetMiscRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
863 SiS_SetCRTCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
864 SiS_SetATTRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
865 SiS_SetGRCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
866 SiS_ClearExt1Regs(SiS_Pr, ModeNo); in SiS_SetCRT1Group()
868 rrti = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
871 SiS_SetCRT1Sync(SiS_Pr, rrti); in SiS_SetCRT1Group()
872 SiS_SetCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
873 SiS_SetCRT1Offset(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
874 SiS_SetCRT1VCLK(SiS_Pr, ModeNo, rrti); in SiS_SetCRT1Group()
877 SiS_SetCRT1FIFO_310(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
879 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
881 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
883 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT1Group()
890 int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiSUSBSetMode() argument
893 unsigned long BaseAddr = SiS_Pr->IOAddress; in SiSUSBSetMode()
895 SiSUSB_InitPtr(SiS_Pr); in SiSUSBSetMode()
896 SiSUSBRegInit(SiS_Pr, BaseAddr); in SiSUSBSetMode()
897 SiS_GetSysFlags(SiS_Pr); in SiSUSBSetMode()
899 if (!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) in SiSUSBSetMode()
902 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x05, 0x86); in SiSUSBSetMode()
904 SiSInitPCIetc(SiS_Pr); in SiSUSBSetMode()
908 SiS_Pr->SiS_ModeType = in SiSUSBSetMode()
909 SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask; in SiSUSBSetMode()
911 SiS_Pr->SiS_SetFlag = LowModeTests; in SiSUSBSetMode()
914 SiS_SetCRT1Group(SiS_Pr, ModeNo, ModeIdIndex); in SiSUSBSetMode()
916 SiS_HandleCRT1(SiS_Pr); in SiSUSBSetMode()
918 SiS_DisplayOn(SiS_Pr); in SiSUSBSetMode()
919 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c6, 0xFF); in SiSUSBSetMode()
922 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x34, ModeNo); in SiSUSBSetMode()
927 int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo) in SiSUSBSetVESAMode() argument
932 SiSUSB_InitPtr(SiS_Pr); in SiSUSBSetVESAMode()
943 if (SiS_Pr->SiS_EModeIDTable[i].Ext_VESAID == VModeNo) { in SiSUSBSetVESAMode()
944 ModeNo = SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID; in SiSUSBSetVESAMode()
948 } while (SiS_Pr->SiS_EModeIDTable[i++].Ext_ModeID != 0xff); in SiSUSBSetVESAMode()
955 return SiSUSBSetMode(SiS_Pr, ModeNo); in SiSUSBSetVESAMode()