Lines Matching refs:SiS_Pr
56 static void SiSUSB_InitPtr(struct SiS_Private *SiS_Pr) in SiSUSB_InitPtr() argument
58 SiS_Pr->SiS_ModeResInfo = SiSUSB_ModeResInfo; in SiSUSB_InitPtr()
59 SiS_Pr->SiS_StandTable = SiSUSB_StandTable; in SiSUSB_InitPtr()
61 SiS_Pr->SiS_SModeIDTable = SiSUSB_SModeIDTable; in SiSUSB_InitPtr()
62 SiS_Pr->SiS_EModeIDTable = SiSUSB_EModeIDTable; in SiSUSB_InitPtr()
63 SiS_Pr->SiS_RefIndex = SiSUSB_RefIndex; in SiSUSB_InitPtr()
64 SiS_Pr->SiS_CRT1Table = SiSUSB_CRT1Table; in SiSUSB_InitPtr()
66 SiS_Pr->SiS_VCLKData = SiSUSB_VCLKData; in SiSUSB_InitPtr()
74 SiS_SetReg(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetReg() argument
77 sisusb_setidxreg(SiS_Pr->sisusb, port, index, data); in SiS_SetReg()
81 SiS_SetRegByte(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegByte() argument
84 sisusb_setreg(SiS_Pr->sisusb, port, data); in SiS_SetRegByte()
88 SiS_GetReg(struct SiS_Private *SiS_Pr, unsigned long port, unsigned short index) in SiS_GetReg() argument
92 sisusb_getidxreg(SiS_Pr->sisusb, port, index, &data); in SiS_GetReg()
98 SiS_GetRegByte(struct SiS_Private *SiS_Pr, unsigned long port) in SiS_GetRegByte() argument
102 sisusb_getreg(SiS_Pr->sisusb, port, &data); in SiS_GetRegByte()
108 SiS_SetRegANDOR(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegANDOR() argument
112 sisusb_setidxregandor(SiS_Pr->sisusb, port, index, DataAND, DataOR); in SiS_SetRegANDOR()
116 SiS_SetRegAND(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegAND() argument
119 sisusb_setidxregand(SiS_Pr->sisusb, port, index, DataAND); in SiS_SetRegAND()
123 SiS_SetRegOR(struct SiS_Private *SiS_Pr, unsigned long port, in SiS_SetRegOR() argument
126 sisusb_setidxregor(SiS_Pr->sisusb, port, index, DataOR); in SiS_SetRegOR()
133 static void SiS_DisplayOn(struct SiS_Private *SiS_Pr) in SiS_DisplayOn() argument
135 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, 0xDF); in SiS_DisplayOn()
142 static void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) in SiSUSBRegInit() argument
144 SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; in SiSUSBRegInit()
145 SiS_Pr->SiS_P3d4 = BaseAddr + 0x24; in SiSUSBRegInit()
146 SiS_Pr->SiS_P3c0 = BaseAddr + 0x10; in SiSUSBRegInit()
147 SiS_Pr->SiS_P3ce = BaseAddr + 0x1e; in SiSUSBRegInit()
148 SiS_Pr->SiS_P3c2 = BaseAddr + 0x12; in SiSUSBRegInit()
149 SiS_Pr->SiS_P3ca = BaseAddr + 0x1a; in SiSUSBRegInit()
150 SiS_Pr->SiS_P3c6 = BaseAddr + 0x16; in SiSUSBRegInit()
151 SiS_Pr->SiS_P3c7 = BaseAddr + 0x17; in SiSUSBRegInit()
152 SiS_Pr->SiS_P3c8 = BaseAddr + 0x18; in SiSUSBRegInit()
153 SiS_Pr->SiS_P3c9 = BaseAddr + 0x19; in SiSUSBRegInit()
154 SiS_Pr->SiS_P3cb = BaseAddr + 0x1b; in SiSUSBRegInit()
155 SiS_Pr->SiS_P3cc = BaseAddr + 0x1c; in SiSUSBRegInit()
156 SiS_Pr->SiS_P3cd = BaseAddr + 0x1d; in SiSUSBRegInit()
157 SiS_Pr->SiS_P3da = BaseAddr + 0x2a; in SiSUSBRegInit()
158 SiS_Pr->SiS_Part1Port = BaseAddr + SIS_CRT2_PORT_04; in SiSUSBRegInit()
165 static void SiS_GetSysFlags(struct SiS_Private *SiS_Pr) in SiS_GetSysFlags() argument
167 SiS_Pr->SiS_MyCR63 = 0x63; in SiS_GetSysFlags()
174 static void SiSInitPCIetc(struct SiS_Private *SiS_Pr) in SiSInitPCIetc() argument
176 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x20, 0xa1); in SiSInitPCIetc()
183 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1E, 0xDA); in SiSInitPCIetc()
190 static void SiS_SetSegRegLower(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegLower() argument
195 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb) & 0xf0; in SiS_SetSegRegLower()
197 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegLower()
198 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd) & 0xf0; in SiS_SetSegRegLower()
200 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegLower()
203 static void SiS_SetSegRegUpper(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegUpper() argument
208 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb) & 0x0f; in SiS_SetSegRegUpper()
210 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegUpper()
211 temp = SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd) & 0x0f; in SiS_SetSegRegUpper()
213 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegUpper()
216 static void SiS_SetSegmentReg(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentReg() argument
218 SiS_SetSegRegLower(SiS_Pr, value); in SiS_SetSegmentReg()
219 SiS_SetSegRegUpper(SiS_Pr, value); in SiS_SetSegmentReg()
222 static void SiS_ResetSegmentReg(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentReg() argument
224 SiS_SetSegmentReg(SiS_Pr, 0); in SiS_ResetSegmentReg()
228 SiS_SetSegmentRegOver(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentRegOver() argument
234 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1d, temp); in SiS_SetSegmentRegOver()
235 SiS_SetSegmentReg(SiS_Pr, value); in SiS_SetSegmentRegOver()
238 static void SiS_ResetSegmentRegOver(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegOver() argument
240 SiS_SetSegmentRegOver(SiS_Pr, 0); in SiS_ResetSegmentRegOver()
243 static void SiS_ResetSegmentRegisters(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegisters() argument
245 SiS_ResetSegmentReg(SiS_Pr); in SiS_ResetSegmentRegisters()
246 SiS_ResetSegmentRegOver(SiS_Pr); in SiS_ResetSegmentRegisters()
254 SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, in SiS_SearchModeID() argument
268 if (SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == in SiS_SearchModeID()
272 if (SiS_Pr->SiS_EModeIDTable[*ModeIdIndex].Ext_ModeID == in SiS_SearchModeID()
286 static void SiS_HandleCRT1(struct SiS_Private *SiS_Pr) in SiS_HandleCRT1() argument
289 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, SiS_Pr->SiS_MyCR63, 0xbf); in SiS_HandleCRT1()
297 SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetColorDepth() argument
305 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetColorDepth()
307 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetColorDepth()
321 SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetOffset() argument
326 infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_GetOffset()
327 xres = SiS_Pr->SiS_RefIndex[rrti].XRes; in SiS_GetOffset()
329 colordepth = SiS_GetColorDepth(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetOffset()
349 SiS_SetSeqRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetSeqRegs() argument
354 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x00, 0x03); in SiS_SetSeqRegs()
356 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[0] | 0x20; in SiS_SetSeqRegs()
357 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, SRdata); in SiS_SetSeqRegs()
360 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[i - 1]; in SiS_SetSeqRegs()
361 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, i, SRdata); in SiS_SetSeqRegs()
370 SiS_SetMiscRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetMiscRegs() argument
372 unsigned char Miscdata = SiS_Pr->SiS_StandTable[StandTableIndex].MISC; in SiS_SetMiscRegs()
374 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c2, Miscdata); in SiS_SetMiscRegs()
382 SiS_SetCRTCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetCRTCRegs() argument
387 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, 0x11, 0x7f); in SiS_SetCRTCRegs()
390 CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i]; in SiS_SetCRTCRegs()
391 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, i, CRTCdata); in SiS_SetCRTCRegs()
400 SiS_SetATTRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetATTRegs() argument
406 ARdata = SiS_Pr->SiS_StandTable[StandTableIndex].ATTR[i]; in SiS_SetATTRegs()
407 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
408 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, i); in SiS_SetATTRegs()
409 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, ARdata); in SiS_SetATTRegs()
411 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
412 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x14); in SiS_SetATTRegs()
413 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x00); in SiS_SetATTRegs()
415 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
416 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c0, 0x20); in SiS_SetATTRegs()
417 SiS_GetRegByte(SiS_Pr, SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
425 SiS_SetGRCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetGRCRegs() argument
431 GRdata = SiS_Pr->SiS_StandTable[StandTableIndex].GRC[i]; in SiS_SetGRCRegs()
432 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3ce, i, GRdata); in SiS_SetGRCRegs()
435 if (SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetGRCRegs()
437 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3ce, 0x05, 0xBF); in SiS_SetGRCRegs()
445 static void SiS_ClearExt1Regs(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_ClearExt1Regs() argument
450 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, i, 0x00); in SiS_ClearExt1Regs()
453 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x37, 0xFE); in SiS_ClearExt1Regs()
461 SiS_GetRatePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetRatePtr() argument
469 index = SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x33) & 0x0F; in SiS_GetRatePtr()
473 rrti = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex; in SiS_GetRatePtr()
474 ModeNo = SiS_Pr->SiS_RefIndex[rrti].ModeID; in SiS_GetRatePtr()
478 if (SiS_Pr->SiS_RefIndex[rrti + i].ModeID != ModeNo) in SiS_GetRatePtr()
482 SiS_Pr->SiS_RefIndex[rrti + i].Ext_InfoFlag & ModeTypeMask; in SiS_GetRatePtr()
483 if (temp < SiS_Pr->SiS_ModeType) in SiS_GetRatePtr()
499 static void SiS_SetCRT1Sync(struct SiS_Private *SiS_Pr, unsigned short rrti) in SiS_SetCRT1Sync() argument
501 unsigned short sync = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag >> 8; in SiS_SetCRT1Sync()
504 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c2, sync); in SiS_SetCRT1Sync()
512 SiS_SetCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1CRTC() argument
518 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3d4, 0x11, 0x7f); in SiS_SetCRT1CRTC()
520 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT1CRTC()
522 index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRT1CRTC; in SiS_SetCRT1CRTC()
525 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
526 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
529 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
530 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
533 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, j, in SiS_SetCRT1CRTC()
534 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
537 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, j, in SiS_SetCRT1CRTC()
538 SiS_Pr->SiS_CRT1Table[index].CR[i]); in SiS_SetCRT1CRTC()
541 temp = SiS_Pr->SiS_CRT1Table[index].CR[16] & 0xE0; in SiS_SetCRT1CRTC()
542 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0E, temp); in SiS_SetCRT1CRTC()
544 temp = ((SiS_Pr->SiS_CRT1Table[index].CR[16]) & 0x01) << 5; in SiS_SetCRT1CRTC()
547 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3d4, 0x09, 0x5F, temp); in SiS_SetCRT1CRTC()
549 if (SiS_Pr->SiS_ModeType > ModeVGA) in SiS_SetCRT1CRTC()
550 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x14, 0x4F); in SiS_SetCRT1CRTC()
560 SiS_SetCRT1Offset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Offset() argument
563 unsigned short du = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Offset()
564 unsigned short infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_SetCRT1Offset()
568 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0E, 0xF0, temp); in SiS_SetCRT1Offset()
570 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x13, (du & 0xFF)); in SiS_SetCRT1Offset()
580 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x10, temp); in SiS_SetCRT1Offset()
588 SiS_SetCRT1VCLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1VCLK() argument
591 unsigned short index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRTVCLK; in SiS_SetCRT1VCLK()
592 unsigned short clka = SiS_Pr->SiS_VCLKData[index].SR2B; in SiS_SetCRT1VCLK()
593 unsigned short clkb = SiS_Pr->SiS_VCLKData[index].SR2C; in SiS_SetCRT1VCLK()
595 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x31, 0xCF); in SiS_SetCRT1VCLK()
597 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2B, clka); in SiS_SetCRT1VCLK()
598 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2C, clkb); in SiS_SetCRT1VCLK()
599 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x2D, 0x01); in SiS_SetCRT1VCLK()
607 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1FIFO_310() argument
610 unsigned short modeflag = SiS_Pr->SiS_EModeIDTable[mi].Ext_ModeFlag; in SiS_SetCRT1FIFO_310()
613 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x3D, 0xFE); in SiS_SetCRT1FIFO_310()
615 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x08, 0xAE); in SiS_SetCRT1FIFO_310()
616 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x09, 0xF0); in SiS_SetCRT1FIFO_310()
622 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x08, 0x34); in SiS_SetCRT1FIFO_310()
623 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x3D, 0x01); in SiS_SetCRT1FIFO_310()
632 SiS_SetVCLKState(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetVCLKState() argument
638 index = SiS_Pr->SiS_RefIndex[rrti].Ext_CRTVCLK; in SiS_SetVCLKState()
639 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetVCLKState()
644 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x32, 0xf3, data); in SiS_SetVCLKState()
647 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1f, 0xe7); in SiS_SetVCLKState()
658 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x07, 0xF8, data); in SiS_SetVCLKState()
662 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1ModeRegs() argument
668 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_SetCRT1ModeRegs()
670 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_SetCRT1ModeRegs()
671 infoflag = SiS_Pr->SiS_RefIndex[rrti].Ext_InfoFlag; in SiS_SetCRT1ModeRegs()
675 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x1F, 0x3F); in SiS_SetCRT1ModeRegs()
679 if (SiS_Pr->SiS_ModeType > ModeEGA) { in SiS_SetCRT1ModeRegs()
681 data |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2); in SiS_SetCRT1ModeRegs()
686 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x06, 0xC0, data); in SiS_SetCRT1ModeRegs()
692 (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x04) | in SiS_SetCRT1ModeRegs()
693 ((SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0b) & 0xc0) << 2)) in SiS_SetCRT1ModeRegs()
696 (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x00) | in SiS_SetCRT1ModeRegs()
697 ((SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0b) & 0x03) << 8)) in SiS_SetCRT1ModeRegs()
701 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x19, (data & 0xFF)); in SiS_SetCRT1ModeRegs()
702 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3d4, 0x1a, 0xFC, (data >> 8)); in SiS_SetCRT1ModeRegs()
705 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x01, 0x08); in SiS_SetCRT1ModeRegs()
710 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0F, 0xB7, data); in SiS_SetCRT1ModeRegs()
712 if ((SiS_Pr->SiS_ModeType == ModeEGA) && (ModeNo > 0x13)) in SiS_SetCRT1ModeRegs()
713 SiS_SetRegOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x0F, 0x40); in SiS_SetCRT1ModeRegs()
715 SiS_SetRegAND(SiS_Pr, SiS_Pr->SiS_P3c4, 0x31, 0xfb); in SiS_SetCRT1ModeRegs()
718 if (SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetCRT1ModeRegs()
720 if (SiS_Pr->SiS_ModeType != ModeEGA) in SiS_SetCRT1ModeRegs()
723 SiS_SetRegANDOR(SiS_Pr, SiS_Pr->SiS_P3c4, 0x21, 0x1F, data); in SiS_SetCRT1ModeRegs()
725 SiS_SetVCLKState(SiS_Pr, ModeNo, rrti); in SiS_SetCRT1ModeRegs()
727 if (SiS_GetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x31) & 0x40) in SiS_SetCRT1ModeRegs()
728 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x52, 0x2c); in SiS_SetCRT1ModeRegs()
730 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x52, 0x6c); in SiS_SetCRT1ModeRegs()
738 SiS_WriteDAC(struct SiS_Private *SiS_Pr, unsigned long DACData, in SiS_WriteDAC() argument
760 SiS_SetRegByte(SiS_Pr, DACData, (d1 << shiftflag)); in SiS_WriteDAC()
761 SiS_SetRegByte(SiS_Pr, DACData, (d2 << shiftflag)); in SiS_WriteDAC()
762 SiS_SetRegByte(SiS_Pr, DACData, (d3 << shiftflag)); in SiS_WriteDAC()
766 SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_LoadDAC() argument
775 data = SiS_Pr->SiS_SModeIDTable[mi].St_ModeFlag; in SiS_LoadDAC()
777 data = SiS_Pr->SiS_EModeIDTable[mi].Ext_ModeFlag; in SiS_LoadDAC()
794 DACAddr = SiS_Pr->SiS_P3c8; in SiS_LoadDAC()
795 DACData = SiS_Pr->SiS_P3c9; in SiS_LoadDAC()
797 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c6, 0xFF); in SiS_LoadDAC()
799 SiS_SetRegByte(SiS_Pr, DACAddr, 0x00); in SiS_LoadDAC()
809 SiS_SetRegByte(SiS_Pr, DACData, (data2 << sf)); in SiS_LoadDAC()
818 SiS_SetRegByte(SiS_Pr, DACData, data); in SiS_LoadDAC()
826 SiS_WriteDAC(SiS_Pr, DACData, sf, n, in SiS_LoadDAC()
833 SiS_WriteDAC(SiS_Pr, DACData, sf, n, in SiS_LoadDAC()
849 SiS_SetCRT1Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Group() argument
854 SiS_Pr->SiS_CRT1Mode = ModeNo; in SiS_SetCRT1Group()
861 SiS_ResetSegmentRegisters(SiS_Pr); in SiS_SetCRT1Group()
862 SiS_SetSeqRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
863 SiS_SetMiscRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
864 SiS_SetCRTCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
865 SiS_SetATTRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
866 SiS_SetGRCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
867 SiS_ClearExt1Regs(SiS_Pr, ModeNo); in SiS_SetCRT1Group()
869 rrti = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
872 SiS_SetCRT1Sync(SiS_Pr, rrti); in SiS_SetCRT1Group()
873 SiS_SetCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
874 SiS_SetCRT1Offset(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
875 SiS_SetCRT1VCLK(SiS_Pr, ModeNo, rrti); in SiS_SetCRT1Group()
878 SiS_SetCRT1FIFO_310(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
880 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, rrti); in SiS_SetCRT1Group()
882 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
884 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT1Group()
891 int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiSUSBSetMode() argument
894 unsigned long BaseAddr = SiS_Pr->IOAddress; in SiSUSBSetMode()
896 SiSUSB_InitPtr(SiS_Pr); in SiSUSBSetMode()
897 SiSUSBRegInit(SiS_Pr, BaseAddr); in SiSUSBSetMode()
898 SiS_GetSysFlags(SiS_Pr); in SiSUSBSetMode()
900 if (!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) in SiSUSBSetMode()
903 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3c4, 0x05, 0x86); in SiSUSBSetMode()
905 SiSInitPCIetc(SiS_Pr); in SiSUSBSetMode()
909 SiS_Pr->SiS_ModeType = in SiSUSBSetMode()
910 SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag & ModeTypeMask; in SiSUSBSetMode()
912 SiS_Pr->SiS_SetFlag = LowModeTests; in SiSUSBSetMode()
915 SiS_SetCRT1Group(SiS_Pr, ModeNo, ModeIdIndex); in SiSUSBSetMode()
917 SiS_HandleCRT1(SiS_Pr); in SiSUSBSetMode()
919 SiS_DisplayOn(SiS_Pr); in SiSUSBSetMode()
920 SiS_SetRegByte(SiS_Pr, SiS_Pr->SiS_P3c6, 0xFF); in SiSUSBSetMode()
923 SiS_SetReg(SiS_Pr, SiS_Pr->SiS_P3d4, 0x34, ModeNo); in SiSUSBSetMode()
928 int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo) in SiSUSBSetVESAMode() argument
933 SiSUSB_InitPtr(SiS_Pr); in SiSUSBSetVESAMode()
944 if (SiS_Pr->SiS_EModeIDTable[i].Ext_VESAID == VModeNo) { in SiSUSBSetVESAMode()
945 ModeNo = SiS_Pr->SiS_EModeIDTable[i].Ext_ModeID; in SiSUSBSetVESAMode()
949 } while (SiS_Pr->SiS_EModeIDTable[i++].Ext_ModeID != 0xff); in SiSUSBSetVESAMode()
956 return SiSUSBSetMode(SiS_Pr, ModeNo); in SiSUSBSetVESAMode()