Lines Matching refs:SiS_Pr
79 InitCommonPointer(struct SiS_Private *SiS_Pr) in InitCommonPointer() argument
81 SiS_Pr->SiS_SModeIDTable = SiS_SModeIDTable; in InitCommonPointer()
82 SiS_Pr->SiS_StResInfo = SiS_StResInfo; in InitCommonPointer()
83 SiS_Pr->SiS_ModeResInfo = SiS_ModeResInfo; in InitCommonPointer()
84 SiS_Pr->SiS_StandTable = SiS_StandTable; in InitCommonPointer()
86 SiS_Pr->SiS_NTSCTiming = SiS_NTSCTiming; in InitCommonPointer()
87 SiS_Pr->SiS_PALTiming = SiS_PALTiming; in InitCommonPointer()
88 SiS_Pr->SiS_HiTVSt1Timing = SiS_HiTVSt1Timing; in InitCommonPointer()
89 SiS_Pr->SiS_HiTVSt2Timing = SiS_HiTVSt2Timing; in InitCommonPointer()
91 SiS_Pr->SiS_HiTVExtTiming = SiS_HiTVExtTiming; in InitCommonPointer()
92 SiS_Pr->SiS_HiTVGroup3Data = SiS_HiTVGroup3Data; in InitCommonPointer()
93 SiS_Pr->SiS_HiTVGroup3Simu = SiS_HiTVGroup3Simu; in InitCommonPointer()
95 SiS_Pr->SiS_HiTVTextTiming = SiS_HiTVTextTiming; in InitCommonPointer()
96 SiS_Pr->SiS_HiTVGroup3Text = SiS_HiTVGroup3Text; in InitCommonPointer()
99 SiS_Pr->SiS_StPALData = SiS_StPALData; in InitCommonPointer()
100 SiS_Pr->SiS_ExtPALData = SiS_ExtPALData; in InitCommonPointer()
101 SiS_Pr->SiS_StNTSCData = SiS_StNTSCData; in InitCommonPointer()
102 SiS_Pr->SiS_ExtNTSCData = SiS_ExtNTSCData; in InitCommonPointer()
103 SiS_Pr->SiS_St1HiTVData = SiS_StHiTVData; in InitCommonPointer()
104 SiS_Pr->SiS_St2HiTVData = SiS_St2HiTVData; in InitCommonPointer()
105 SiS_Pr->SiS_ExtHiTVData = SiS_ExtHiTVData; in InitCommonPointer()
106 SiS_Pr->SiS_St525iData = SiS_StNTSCData; in InitCommonPointer()
107 SiS_Pr->SiS_St525pData = SiS_St525pData; in InitCommonPointer()
108 SiS_Pr->SiS_St750pData = SiS_St750pData; in InitCommonPointer()
109 SiS_Pr->SiS_Ext525iData = SiS_ExtNTSCData; in InitCommonPointer()
110 SiS_Pr->SiS_Ext525pData = SiS_ExtNTSCData; in InitCommonPointer()
111 SiS_Pr->SiS_Ext750pData = SiS_Ext750pData; in InitCommonPointer()
113 SiS_Pr->pSiS_OutputSelect = &SiS_OutputSelect; in InitCommonPointer()
114 SiS_Pr->pSiS_SoftSetting = &SiS_SoftSetting; in InitCommonPointer()
116 SiS_Pr->SiS_LCD1280x720Data = SiS_LCD1280x720Data; in InitCommonPointer()
117 SiS_Pr->SiS_StLCD1280x768_2Data = SiS_StLCD1280x768_2Data; in InitCommonPointer()
118 SiS_Pr->SiS_ExtLCD1280x768_2Data = SiS_ExtLCD1280x768_2Data; in InitCommonPointer()
119 SiS_Pr->SiS_LCD1280x800Data = SiS_LCD1280x800Data; in InitCommonPointer()
120 SiS_Pr->SiS_LCD1280x800_2Data = SiS_LCD1280x800_2Data; in InitCommonPointer()
121 SiS_Pr->SiS_LCD1280x854Data = SiS_LCD1280x854Data; in InitCommonPointer()
122 SiS_Pr->SiS_LCD1280x960Data = SiS_LCD1280x960Data; in InitCommonPointer()
123 SiS_Pr->SiS_StLCD1400x1050Data = SiS_StLCD1400x1050Data; in InitCommonPointer()
124 SiS_Pr->SiS_ExtLCD1400x1050Data = SiS_ExtLCD1400x1050Data; in InitCommonPointer()
125 SiS_Pr->SiS_LCD1680x1050Data = SiS_LCD1680x1050Data; in InitCommonPointer()
126 SiS_Pr->SiS_StLCD1600x1200Data = SiS_StLCD1600x1200Data; in InitCommonPointer()
127 SiS_Pr->SiS_ExtLCD1600x1200Data = SiS_ExtLCD1600x1200Data; in InitCommonPointer()
128 SiS_Pr->SiS_NoScaleData = SiS_NoScaleData; in InitCommonPointer()
130 SiS_Pr->SiS_LVDS320x240Data_1 = SiS_LVDS320x240Data_1; in InitCommonPointer()
131 SiS_Pr->SiS_LVDS320x240Data_2 = SiS_LVDS320x240Data_2; in InitCommonPointer()
132 SiS_Pr->SiS_LVDS640x480Data_1 = SiS_LVDS640x480Data_1; in InitCommonPointer()
133 SiS_Pr->SiS_LVDS800x600Data_1 = SiS_LVDS800x600Data_1; in InitCommonPointer()
134 SiS_Pr->SiS_LVDS1024x600Data_1 = SiS_LVDS1024x600Data_1; in InitCommonPointer()
135 SiS_Pr->SiS_LVDS1024x768Data_1 = SiS_LVDS1024x768Data_1; in InitCommonPointer()
137 SiS_Pr->SiS_LVDSCRT1320x240_1 = SiS_LVDSCRT1320x240_1; in InitCommonPointer()
138 SiS_Pr->SiS_LVDSCRT1320x240_2 = SiS_LVDSCRT1320x240_2; in InitCommonPointer()
139 SiS_Pr->SiS_LVDSCRT1320x240_2_H = SiS_LVDSCRT1320x240_2_H; in InitCommonPointer()
140 SiS_Pr->SiS_LVDSCRT1320x240_3 = SiS_LVDSCRT1320x240_3; in InitCommonPointer()
141 SiS_Pr->SiS_LVDSCRT1320x240_3_H = SiS_LVDSCRT1320x240_3_H; in InitCommonPointer()
142 SiS_Pr->SiS_LVDSCRT1640x480_1 = SiS_LVDSCRT1640x480_1; in InitCommonPointer()
143 SiS_Pr->SiS_LVDSCRT1640x480_1_H = SiS_LVDSCRT1640x480_1_H; in InitCommonPointer()
145 SiS_Pr->SiS_LVDSCRT11024x600_1 = SiS_LVDSCRT11024x600_1; in InitCommonPointer()
146 SiS_Pr->SiS_LVDSCRT11024x600_1_H = SiS_LVDSCRT11024x600_1_H; in InitCommonPointer()
147 SiS_Pr->SiS_LVDSCRT11024x600_2 = SiS_LVDSCRT11024x600_2; in InitCommonPointer()
148 SiS_Pr->SiS_LVDSCRT11024x600_2_H = SiS_LVDSCRT11024x600_2_H; in InitCommonPointer()
151 SiS_Pr->SiS_CHTVUNTSCData = SiS_CHTVUNTSCData; in InitCommonPointer()
152 SiS_Pr->SiS_CHTVONTSCData = SiS_CHTVONTSCData; in InitCommonPointer()
154 SiS_Pr->SiS_PanelMinLVDS = Panel_800x600; /* lowest value LVDS/LCDA */ in InitCommonPointer()
155 SiS_Pr->SiS_PanelMin301 = Panel_1024x768; /* lowest value 301 */ in InitCommonPointer()
161 InitTo300Pointer(struct SiS_Private *SiS_Pr) in InitTo300Pointer() argument
163 InitCommonPointer(SiS_Pr); in InitTo300Pointer()
165 SiS_Pr->SiS_VBModeIDTable = SiS300_VBModeIDTable; in InitTo300Pointer()
166 SiS_Pr->SiS_EModeIDTable = SiS300_EModeIDTable; in InitTo300Pointer()
167 SiS_Pr->SiS_RefIndex = SiS300_RefIndex; in InitTo300Pointer()
168 SiS_Pr->SiS_CRT1Table = SiS300_CRT1Table; in InitTo300Pointer()
169 if(SiS_Pr->ChipType == SIS_300) { in InitTo300Pointer()
170 SiS_Pr->SiS_MCLKData_0 = SiS300_MCLKData_300; /* 300 */ in InitTo300Pointer()
172 SiS_Pr->SiS_MCLKData_0 = SiS300_MCLKData_630; /* 630, 730 */ in InitTo300Pointer()
174 SiS_Pr->SiS_VCLKData = SiS300_VCLKData; in InitTo300Pointer()
175 SiS_Pr->SiS_VBVCLKData = (struct SiS_VBVCLKData *)SiS300_VCLKData; in InitTo300Pointer()
177 SiS_Pr->SiS_SR15 = SiS300_SR15; in InitTo300Pointer()
179 SiS_Pr->SiS_PanelDelayTbl = SiS300_PanelDelayTbl; in InitTo300Pointer()
180 SiS_Pr->SiS_PanelDelayTblLVDS = SiS300_PanelDelayTbl; in InitTo300Pointer()
182 SiS_Pr->SiS_ExtLCD1024x768Data = SiS300_ExtLCD1024x768Data; in InitTo300Pointer()
183 SiS_Pr->SiS_St2LCD1024x768Data = SiS300_St2LCD1024x768Data; in InitTo300Pointer()
184 SiS_Pr->SiS_ExtLCD1280x1024Data = SiS300_ExtLCD1280x1024Data; in InitTo300Pointer()
185 SiS_Pr->SiS_St2LCD1280x1024Data = SiS300_St2LCD1280x1024Data; in InitTo300Pointer()
187 SiS_Pr->SiS_CRT2Part2_1024x768_1 = SiS300_CRT2Part2_1024x768_1; in InitTo300Pointer()
188 SiS_Pr->SiS_CRT2Part2_1024x768_2 = SiS300_CRT2Part2_1024x768_2; in InitTo300Pointer()
189 SiS_Pr->SiS_CRT2Part2_1024x768_3 = SiS300_CRT2Part2_1024x768_3; in InitTo300Pointer()
191 SiS_Pr->SiS_CHTVUPALData = SiS300_CHTVUPALData; in InitTo300Pointer()
192 SiS_Pr->SiS_CHTVOPALData = SiS300_CHTVOPALData; in InitTo300Pointer()
193 SiS_Pr->SiS_CHTVUPALMData = SiS_CHTVUNTSCData; /* not supported on 300 series */ in InitTo300Pointer()
194 SiS_Pr->SiS_CHTVOPALMData = SiS_CHTVONTSCData; /* not supported on 300 series */ in InitTo300Pointer()
195 SiS_Pr->SiS_CHTVUPALNData = SiS300_CHTVUPALData; /* not supported on 300 series */ in InitTo300Pointer()
196 SiS_Pr->SiS_CHTVOPALNData = SiS300_CHTVOPALData; /* not supported on 300 series */ in InitTo300Pointer()
197 SiS_Pr->SiS_CHTVSOPALData = SiS300_CHTVSOPALData; in InitTo300Pointer()
199 SiS_Pr->SiS_LVDS848x480Data_1 = SiS300_LVDS848x480Data_1; in InitTo300Pointer()
200 SiS_Pr->SiS_LVDS848x480Data_2 = SiS300_LVDS848x480Data_2; in InitTo300Pointer()
201 SiS_Pr->SiS_LVDSBARCO1024Data_1 = SiS300_LVDSBARCO1024Data_1; in InitTo300Pointer()
202 SiS_Pr->SiS_LVDSBARCO1366Data_1 = SiS300_LVDSBARCO1366Data_1; in InitTo300Pointer()
203 SiS_Pr->SiS_LVDSBARCO1366Data_2 = SiS300_LVDSBARCO1366Data_2; in InitTo300Pointer()
205 SiS_Pr->SiS_PanelType04_1a = SiS300_PanelType04_1a; in InitTo300Pointer()
206 SiS_Pr->SiS_PanelType04_2a = SiS300_PanelType04_2a; in InitTo300Pointer()
207 SiS_Pr->SiS_PanelType04_1b = SiS300_PanelType04_1b; in InitTo300Pointer()
208 SiS_Pr->SiS_PanelType04_2b = SiS300_PanelType04_2b; in InitTo300Pointer()
210 SiS_Pr->SiS_CHTVCRT1UNTSC = SiS300_CHTVCRT1UNTSC; in InitTo300Pointer()
211 SiS_Pr->SiS_CHTVCRT1ONTSC = SiS300_CHTVCRT1ONTSC; in InitTo300Pointer()
212 SiS_Pr->SiS_CHTVCRT1UPAL = SiS300_CHTVCRT1UPAL; in InitTo300Pointer()
213 SiS_Pr->SiS_CHTVCRT1OPAL = SiS300_CHTVCRT1OPAL; in InitTo300Pointer()
214 SiS_Pr->SiS_CHTVCRT1SOPAL = SiS300_CHTVCRT1SOPAL; in InitTo300Pointer()
215 SiS_Pr->SiS_CHTVReg_UNTSC = SiS300_CHTVReg_UNTSC; in InitTo300Pointer()
216 SiS_Pr->SiS_CHTVReg_ONTSC = SiS300_CHTVReg_ONTSC; in InitTo300Pointer()
217 SiS_Pr->SiS_CHTVReg_UPAL = SiS300_CHTVReg_UPAL; in InitTo300Pointer()
218 SiS_Pr->SiS_CHTVReg_OPAL = SiS300_CHTVReg_OPAL; in InitTo300Pointer()
219 SiS_Pr->SiS_CHTVReg_UPALM = SiS300_CHTVReg_UNTSC; /* not supported on 300 series */ in InitTo300Pointer()
220 SiS_Pr->SiS_CHTVReg_OPALM = SiS300_CHTVReg_ONTSC; /* not supported on 300 series */ in InitTo300Pointer()
221 SiS_Pr->SiS_CHTVReg_UPALN = SiS300_CHTVReg_UPAL; /* not supported on 300 series */ in InitTo300Pointer()
222 SiS_Pr->SiS_CHTVReg_OPALN = SiS300_CHTVReg_OPAL; /* not supported on 300 series */ in InitTo300Pointer()
223 SiS_Pr->SiS_CHTVReg_SOPAL = SiS300_CHTVReg_SOPAL; in InitTo300Pointer()
224 SiS_Pr->SiS_CHTVVCLKUNTSC = SiS300_CHTVVCLKUNTSC; in InitTo300Pointer()
225 SiS_Pr->SiS_CHTVVCLKONTSC = SiS300_CHTVVCLKONTSC; in InitTo300Pointer()
226 SiS_Pr->SiS_CHTVVCLKUPAL = SiS300_CHTVVCLKUPAL; in InitTo300Pointer()
227 SiS_Pr->SiS_CHTVVCLKOPAL = SiS300_CHTVVCLKOPAL; in InitTo300Pointer()
228 SiS_Pr->SiS_CHTVVCLKUPALM = SiS300_CHTVVCLKUNTSC; /* not supported on 300 series */ in InitTo300Pointer()
229 SiS_Pr->SiS_CHTVVCLKOPALM = SiS300_CHTVVCLKONTSC; /* not supported on 300 series */ in InitTo300Pointer()
230 SiS_Pr->SiS_CHTVVCLKUPALN = SiS300_CHTVVCLKUPAL; /* not supported on 300 series */ in InitTo300Pointer()
231 SiS_Pr->SiS_CHTVVCLKOPALN = SiS300_CHTVVCLKOPAL; /* not supported on 300 series */ in InitTo300Pointer()
232 SiS_Pr->SiS_CHTVVCLKSOPAL = SiS300_CHTVVCLKSOPAL; in InitTo300Pointer()
238 InitTo310Pointer(struct SiS_Private *SiS_Pr) in InitTo310Pointer() argument
240 InitCommonPointer(SiS_Pr); in InitTo310Pointer()
242 SiS_Pr->SiS_EModeIDTable = SiS310_EModeIDTable; in InitTo310Pointer()
243 SiS_Pr->SiS_RefIndex = SiS310_RefIndex; in InitTo310Pointer()
244 SiS_Pr->SiS_CRT1Table = SiS310_CRT1Table; in InitTo310Pointer()
245 if(SiS_Pr->ChipType >= SIS_340) { in InitTo310Pointer()
246 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_340; /* 340 + XGI */ in InitTo310Pointer()
247 } else if(SiS_Pr->ChipType >= SIS_761) { in InitTo310Pointer()
248 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_761; /* 761 - preliminary */ in InitTo310Pointer()
249 } else if(SiS_Pr->ChipType >= SIS_760) { in InitTo310Pointer()
250 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_760; /* 760 */ in InitTo310Pointer()
251 } else if(SiS_Pr->ChipType >= SIS_661) { in InitTo310Pointer()
252 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_660; /* 661/741 */ in InitTo310Pointer()
253 } else if(SiS_Pr->ChipType == SIS_330) { in InitTo310Pointer()
254 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_330; /* 330 */ in InitTo310Pointer()
255 } else if(SiS_Pr->ChipType > SIS_315PRO) { in InitTo310Pointer()
256 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_650; /* 550, 650, 740 */ in InitTo310Pointer()
258 SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_315; /* 315 */ in InitTo310Pointer()
260 if(SiS_Pr->ChipType >= SIS_340) { in InitTo310Pointer()
261 SiS_Pr->SiS_MCLKData_1 = SiS310_MCLKData_1_340; in InitTo310Pointer()
263 SiS_Pr->SiS_MCLKData_1 = SiS310_MCLKData_1; in InitTo310Pointer()
265 SiS_Pr->SiS_VCLKData = SiS310_VCLKData; in InitTo310Pointer()
266 SiS_Pr->SiS_VBVCLKData = SiS310_VBVCLKData; in InitTo310Pointer()
268 SiS_Pr->SiS_SR15 = SiS310_SR15; in InitTo310Pointer()
270 SiS_Pr->SiS_PanelDelayTbl = SiS310_PanelDelayTbl; in InitTo310Pointer()
271 SiS_Pr->SiS_PanelDelayTblLVDS = SiS310_PanelDelayTblLVDS; in InitTo310Pointer()
273 SiS_Pr->SiS_St2LCD1024x768Data = SiS310_St2LCD1024x768Data; in InitTo310Pointer()
274 SiS_Pr->SiS_ExtLCD1024x768Data = SiS310_ExtLCD1024x768Data; in InitTo310Pointer()
275 SiS_Pr->SiS_St2LCD1280x1024Data = SiS310_St2LCD1280x1024Data; in InitTo310Pointer()
276 SiS_Pr->SiS_ExtLCD1280x1024Data = SiS310_ExtLCD1280x1024Data; in InitTo310Pointer()
278 SiS_Pr->SiS_CRT2Part2_1024x768_1 = SiS310_CRT2Part2_1024x768_1; in InitTo310Pointer()
280 SiS_Pr->SiS_CHTVUPALData = SiS310_CHTVUPALData; in InitTo310Pointer()
281 SiS_Pr->SiS_CHTVOPALData = SiS310_CHTVOPALData; in InitTo310Pointer()
282 SiS_Pr->SiS_CHTVUPALMData = SiS310_CHTVUPALMData; in InitTo310Pointer()
283 SiS_Pr->SiS_CHTVOPALMData = SiS310_CHTVOPALMData; in InitTo310Pointer()
284 SiS_Pr->SiS_CHTVUPALNData = SiS310_CHTVUPALNData; in InitTo310Pointer()
285 SiS_Pr->SiS_CHTVOPALNData = SiS310_CHTVOPALNData; in InitTo310Pointer()
286 SiS_Pr->SiS_CHTVSOPALData = SiS310_CHTVSOPALData; in InitTo310Pointer()
288 SiS_Pr->SiS_CHTVCRT1UNTSC = SiS310_CHTVCRT1UNTSC; in InitTo310Pointer()
289 SiS_Pr->SiS_CHTVCRT1ONTSC = SiS310_CHTVCRT1ONTSC; in InitTo310Pointer()
290 SiS_Pr->SiS_CHTVCRT1UPAL = SiS310_CHTVCRT1UPAL; in InitTo310Pointer()
291 SiS_Pr->SiS_CHTVCRT1OPAL = SiS310_CHTVCRT1OPAL; in InitTo310Pointer()
292 SiS_Pr->SiS_CHTVCRT1SOPAL = SiS310_CHTVCRT1OPAL; in InitTo310Pointer()
294 SiS_Pr->SiS_CHTVReg_UNTSC = SiS310_CHTVReg_UNTSC; in InitTo310Pointer()
295 SiS_Pr->SiS_CHTVReg_ONTSC = SiS310_CHTVReg_ONTSC; in InitTo310Pointer()
296 SiS_Pr->SiS_CHTVReg_UPAL = SiS310_CHTVReg_UPAL; in InitTo310Pointer()
297 SiS_Pr->SiS_CHTVReg_OPAL = SiS310_CHTVReg_OPAL; in InitTo310Pointer()
298 SiS_Pr->SiS_CHTVReg_UPALM = SiS310_CHTVReg_UPALM; in InitTo310Pointer()
299 SiS_Pr->SiS_CHTVReg_OPALM = SiS310_CHTVReg_OPALM; in InitTo310Pointer()
300 SiS_Pr->SiS_CHTVReg_UPALN = SiS310_CHTVReg_UPALN; in InitTo310Pointer()
301 SiS_Pr->SiS_CHTVReg_OPALN = SiS310_CHTVReg_OPALN; in InitTo310Pointer()
302 SiS_Pr->SiS_CHTVReg_SOPAL = SiS310_CHTVReg_OPAL; in InitTo310Pointer()
304 SiS_Pr->SiS_CHTVVCLKUNTSC = SiS310_CHTVVCLKUNTSC; in InitTo310Pointer()
305 SiS_Pr->SiS_CHTVVCLKONTSC = SiS310_CHTVVCLKONTSC; in InitTo310Pointer()
306 SiS_Pr->SiS_CHTVVCLKUPAL = SiS310_CHTVVCLKUPAL; in InitTo310Pointer()
307 SiS_Pr->SiS_CHTVVCLKOPAL = SiS310_CHTVVCLKOPAL; in InitTo310Pointer()
308 SiS_Pr->SiS_CHTVVCLKUPALM = SiS310_CHTVVCLKUPALM; in InitTo310Pointer()
309 SiS_Pr->SiS_CHTVVCLKOPALM = SiS310_CHTVVCLKOPALM; in InitTo310Pointer()
310 SiS_Pr->SiS_CHTVVCLKUPALN = SiS310_CHTVVCLKUPALN; in InitTo310Pointer()
311 SiS_Pr->SiS_CHTVVCLKOPALN = SiS310_CHTVVCLKOPALN; in InitTo310Pointer()
312 SiS_Pr->SiS_CHTVVCLKSOPAL = SiS310_CHTVVCLKOPAL; in InitTo310Pointer()
317 SiSInitPtr(struct SiS_Private *SiS_Pr) in SiSInitPtr() argument
319 if(SiS_Pr->ChipType < SIS_315H) { in SiSInitPtr()
321 InitTo300Pointer(SiS_Pr); in SiSInitPtr()
327 InitTo310Pointer(SiS_Pr); in SiSInitPtr()
964 SiS_DisplayOn(struct SiS_Private *SiS_Pr) in SiS_DisplayOn() argument
966 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x01,0xDF); in SiS_DisplayOn()
970 SiS_DisplayOff(struct SiS_Private *SiS_Pr) in SiS_DisplayOff() argument
972 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x20); in SiS_DisplayOff()
981 SiSRegInit(struct SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr) in SiSRegInit() argument
983 SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; in SiSRegInit()
984 SiS_Pr->SiS_P3d4 = BaseAddr + 0x24; in SiSRegInit()
985 SiS_Pr->SiS_P3c0 = BaseAddr + 0x10; in SiSRegInit()
986 SiS_Pr->SiS_P3ce = BaseAddr + 0x1e; in SiSRegInit()
987 SiS_Pr->SiS_P3c2 = BaseAddr + 0x12; in SiSRegInit()
988 SiS_Pr->SiS_P3ca = BaseAddr + 0x1a; in SiSRegInit()
989 SiS_Pr->SiS_P3c6 = BaseAddr + 0x16; in SiSRegInit()
990 SiS_Pr->SiS_P3c7 = BaseAddr + 0x17; in SiSRegInit()
991 SiS_Pr->SiS_P3c8 = BaseAddr + 0x18; in SiSRegInit()
992 SiS_Pr->SiS_P3c9 = BaseAddr + 0x19; in SiSRegInit()
993 SiS_Pr->SiS_P3cb = BaseAddr + 0x1b; in SiSRegInit()
994 SiS_Pr->SiS_P3cc = BaseAddr + 0x1c; in SiSRegInit()
995 SiS_Pr->SiS_P3cd = BaseAddr + 0x1d; in SiSRegInit()
996 SiS_Pr->SiS_P3da = BaseAddr + 0x2a; in SiSRegInit()
997 SiS_Pr->SiS_Part1Port = BaseAddr + SIS_CRT2_PORT_04; in SiSRegInit()
998 SiS_Pr->SiS_Part2Port = BaseAddr + SIS_CRT2_PORT_10; in SiSRegInit()
999 SiS_Pr->SiS_Part3Port = BaseAddr + SIS_CRT2_PORT_12; in SiSRegInit()
1000 SiS_Pr->SiS_Part4Port = BaseAddr + SIS_CRT2_PORT_14; in SiSRegInit()
1001 SiS_Pr->SiS_Part5Port = BaseAddr + SIS_CRT2_PORT_14 + 2; in SiSRegInit()
1002 SiS_Pr->SiS_DDC_Port = BaseAddr + 0x14; in SiSRegInit()
1003 SiS_Pr->SiS_VidCapt = BaseAddr + SIS_VIDEO_CAPTURE; in SiSRegInit()
1004 SiS_Pr->SiS_VidPlay = BaseAddr + SIS_VIDEO_PLAYBACK; in SiSRegInit()
1012 SiS_GetSysFlags(struct SiS_Private *SiS_Pr) in SiS_GetSysFlags() argument
1018 SiS_Pr->SiS_SensibleSR11 = false; in SiS_GetSysFlags()
1019 SiS_Pr->SiS_MyCR63 = 0x63; in SiS_GetSysFlags()
1020 if(SiS_Pr->ChipType >= SIS_330) { in SiS_GetSysFlags()
1021 SiS_Pr->SiS_MyCR63 = 0x53; in SiS_GetSysFlags()
1022 if(SiS_Pr->ChipType >= SIS_661) { in SiS_GetSysFlags()
1023 SiS_Pr->SiS_SensibleSR11 = true; in SiS_GetSysFlags()
1029 SiS_Pr->SiS_SysFlags = 0; in SiS_GetSysFlags()
1030 if(SiS_Pr->ChipType == SIS_650) { in SiS_GetSysFlags()
1031 cr5f = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; in SiS_GetSysFlags()
1032 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x5c,0x07); in SiS_GetSysFlags()
1033 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5c) & 0xf8; in SiS_GetSysFlags()
1034 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x5c,0xf8); in SiS_GetSysFlags()
1035 temp2 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5c) & 0xf8; in SiS_GetSysFlags()
1041 SiS_Pr->SiS_SysFlags |= SF_IsM650; in SiS_GetSysFlags()
1046 SiS_Pr->SiS_SysFlags |= SF_Is651; in SiS_GetSysFlags()
1052 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5c) & 0xf8; in SiS_GetSysFlags()
1054 case 0x00: SiS_Pr->SiS_SysFlags |= SF_IsM652; break; in SiS_GetSysFlags()
1055 case 0x40: SiS_Pr->SiS_SysFlags |= SF_IsM653; break; in SiS_GetSysFlags()
1056 default: SiS_Pr->SiS_SysFlags |= SF_IsM650; break; in SiS_GetSysFlags()
1060 SiS_Pr->SiS_SysFlags |= SF_Is652; in SiS_GetSysFlags()
1063 SiS_Pr->SiS_SysFlags |= SF_IsM650; in SiS_GetSysFlags()
1069 if(SiS_Pr->ChipType >= SIS_760 && SiS_Pr->ChipType <= SIS_761) { in SiS_GetSysFlags()
1070 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x78) & 0x30) { in SiS_GetSysFlags()
1071 SiS_Pr->SiS_SysFlags |= SF_760LFB; in SiS_GetSysFlags()
1073 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0xf0) { in SiS_GetSysFlags()
1074 SiS_Pr->SiS_SysFlags |= SF_760UMA; in SiS_GetSysFlags()
1084 SiSInitPCIetc(struct SiS_Private *SiS_Pr) in SiSInitPCIetc() argument
1086 switch(SiS_Pr->ChipType) { in SiSInitPCIetc()
1097 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x20,0xa1); in SiSInitPCIetc()
1103 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x5A); in SiSInitPCIetc()
1121 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x20,0xa1); in SiSInitPCIetc()
1128 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0xDA); in SiSInitPCIetc()
1133 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x20,0xa1); in SiSInitPCIetc()
1138 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1E,0x60,0x40); in SiSInitPCIetc()
1152 SiSSetLVDSetc(struct SiS_Private *SiS_Pr) in SiSSetLVDSetc() argument
1156 SiS_Pr->SiS_IF_DEF_LVDS = 0; in SiSSetLVDSetc()
1157 SiS_Pr->SiS_IF_DEF_TRUMPION = 0; in SiSSetLVDSetc()
1158 SiS_Pr->SiS_IF_DEF_CH70xx = 0; in SiSSetLVDSetc()
1159 SiS_Pr->SiS_IF_DEF_CONEX = 0; in SiSSetLVDSetc()
1161 SiS_Pr->SiS_ChrontelInit = 0; in SiSSetLVDSetc()
1163 if(SiS_Pr->ChipType == XGI_20) return; in SiSSetLVDSetc()
1166 temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiSSetLVDSetc()
1169 switch(SiS_Pr->ChipType) { in SiSSetLVDSetc()
1174 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x37) & 0x0e) >> 1; in SiSSetLVDSetc()
1175 if((temp >= 2) && (temp <= 5)) SiS_Pr->SiS_IF_DEF_LVDS = 1; in SiSSetLVDSetc()
1176 if(temp == 3) SiS_Pr->SiS_IF_DEF_TRUMPION = 1; in SiSSetLVDSetc()
1179 SiS_Pr->SiS_Backup70xx = SiS_GetCH700x(SiS_Pr, 0x0e); in SiSSetLVDSetc()
1180 SiS_Pr->SiS_IF_DEF_CH70xx = 1; in SiSSetLVDSetc()
1189 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x37) & 0x0e) >> 1; in SiSSetLVDSetc()
1190 if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1; in SiSSetLVDSetc()
1191 if(temp == 3) SiS_Pr->SiS_IF_DEF_CH70xx = 2; in SiSSetLVDSetc()
1201 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & 0xe0) >> 5; in SiSSetLVDSetc()
1202 if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1; in SiSSetLVDSetc()
1203 if(temp == 3) SiS_Pr->SiS_IF_DEF_CH70xx = 2; in SiSSetLVDSetc()
1204 if(temp == 4) SiS_Pr->SiS_IF_DEF_CONEX = 1; /* Not yet supported */ in SiSSetLVDSetc()
1217 SiS_SetEnableDstn(struct SiS_Private *SiS_Pr, int enable) in SiS_SetEnableDstn() argument
1219 SiS_Pr->SiS_IF_DEF_DSTN = enable ? 1 : 0; in SiS_SetEnableDstn()
1223 SiS_SetEnableFstn(struct SiS_Private *SiS_Pr, int enable) in SiS_SetEnableFstn() argument
1225 SiS_Pr->SiS_IF_DEF_FSTN = enable ? 1 : 0; in SiS_SetEnableFstn()
1233 SiS_GetModeFlag(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetModeFlag() argument
1236 if(SiS_Pr->UseCustomMode) { in SiS_GetModeFlag()
1237 return SiS_Pr->CModeFlag; in SiS_GetModeFlag()
1239 return SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetModeFlag()
1241 return SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetModeFlag()
1250 SiSDetermineROMLayout661(struct SiS_Private *SiS_Pr) in SiSDetermineROMLayout661() argument
1252 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiSDetermineROMLayout661()
1255 if(SiS_Pr->ChipType >= XGI_20) { in SiSDetermineROMLayout661()
1258 } else if(SiS_Pr->ChipType >= SIS_761) { in SiSDetermineROMLayout661()
1261 } else if(SiS_Pr->ChipType >= SIS_661) { in SiSDetermineROMLayout661()
1290 SiSDetermineROMUsage(struct SiS_Private *SiS_Pr) in SiSDetermineROMUsage() argument
1292 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiSDetermineROMUsage()
1295 SiS_Pr->SiS_UseROM = false; in SiSDetermineROMUsage()
1296 SiS_Pr->SiS_ROMNew = false; in SiSDetermineROMUsage()
1297 SiS_Pr->SiS_PWDOffset = 0; in SiSDetermineROMUsage()
1299 if(SiS_Pr->ChipType >= XGI_20) return; in SiSDetermineROMUsage()
1301 if((ROMAddr) && (SiS_Pr->UseROM)) { in SiSDetermineROMUsage()
1302 if(SiS_Pr->ChipType == SIS_300) { in SiSDetermineROMUsage()
1308 SiS_Pr->SiS_UseROM = true; in SiSDetermineROMUsage()
1309 } else if(SiS_Pr->ChipType < SIS_315H) { in SiSDetermineROMUsage()
1313 SiS_Pr->SiS_UseROM = true; in SiSDetermineROMUsage()
1316 SiS_Pr->SiS_UseROM = true; in SiSDetermineROMUsage()
1317 if((SiS_Pr->SiS_ROMNew = SiSDetermineROMLayout661(SiS_Pr))) { in SiSDetermineROMUsage()
1318 SiS_Pr->SiS_EMIOffset = 14; in SiSDetermineROMUsage()
1319 SiS_Pr->SiS_PWDOffset = 17; in SiSDetermineROMUsage()
1320 SiS_Pr->SiS661LCD2TableSize = 36; in SiSDetermineROMUsage()
1324 SiS_Pr->SiS661LCD2TableSize = 32; in SiSDetermineROMUsage()
1326 SiS_Pr->SiS661LCD2TableSize = 34; in SiSDetermineROMUsage()
1328 SiS_Pr->SiS661LCD2TableSize = 36; in SiSDetermineROMUsage()
1331 SiS_Pr->SiS661LCD2TableSize = 38; /* UMC data layout abandoned at 2.05.00 */ in SiSDetermineROMUsage()
1332 SiS_Pr->SiS_EMIOffset = 16; in SiSDetermineROMUsage()
1333 SiS_Pr->SiS_PWDOffset = 19; in SiSDetermineROMUsage()
1346 SiS_SetSegRegLower(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegLower() argument
1351 temp = SiS_GetRegByte(SiS_Pr->SiS_P3cb) & 0xf0; in SiS_SetSegRegLower()
1353 SiS_SetRegByte(SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegLower()
1354 temp = SiS_GetRegByte(SiS_Pr->SiS_P3cd) & 0xf0; in SiS_SetSegRegLower()
1356 SiS_SetRegByte(SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegLower()
1360 SiS_SetSegRegUpper(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegRegUpper() argument
1365 temp = SiS_GetRegByte(SiS_Pr->SiS_P3cb) & 0x0f; in SiS_SetSegRegUpper()
1367 SiS_SetRegByte(SiS_Pr->SiS_P3cb, temp); in SiS_SetSegRegUpper()
1368 temp = SiS_GetRegByte(SiS_Pr->SiS_P3cd) & 0x0f; in SiS_SetSegRegUpper()
1370 SiS_SetRegByte(SiS_Pr->SiS_P3cd, temp); in SiS_SetSegRegUpper()
1374 SiS_SetSegmentReg(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentReg() argument
1376 SiS_SetSegRegLower(SiS_Pr, value); in SiS_SetSegmentReg()
1377 SiS_SetSegRegUpper(SiS_Pr, value); in SiS_SetSegmentReg()
1381 SiS_ResetSegmentReg(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentReg() argument
1383 SiS_SetSegmentReg(SiS_Pr, 0); in SiS_ResetSegmentReg()
1387 SiS_SetSegmentRegOver(struct SiS_Private *SiS_Pr, unsigned short value) in SiS_SetSegmentRegOver() argument
1393 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1d,temp); in SiS_SetSegmentRegOver()
1394 SiS_SetSegmentReg(SiS_Pr, value); in SiS_SetSegmentRegOver()
1398 SiS_ResetSegmentRegOver(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegOver() argument
1400 SiS_SetSegmentRegOver(SiS_Pr, 0); in SiS_ResetSegmentRegOver()
1404 SiS_ResetSegmentRegisters(struct SiS_Private *SiS_Pr) in SiS_ResetSegmentRegisters() argument
1406 if((IS_SIS65x) || (SiS_Pr->ChipType >= SIS_661)) { in SiS_ResetSegmentRegisters()
1407 SiS_ResetSegmentReg(SiS_Pr); in SiS_ResetSegmentRegisters()
1408 SiS_ResetSegmentRegOver(SiS_Pr); in SiS_ResetSegmentRegisters()
1418 SiS_GetVBType(struct SiS_Private *SiS_Pr) in SiS_GetVBType() argument
1423 SiS_Pr->SiS_VBType = 0; in SiS_GetVBType()
1425 if((SiS_Pr->SiS_IF_DEF_LVDS) || (SiS_Pr->SiS_IF_DEF_CONEX)) in SiS_GetVBType()
1428 if(SiS_Pr->ChipType == XGI_20) in SiS_GetVBType()
1431 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiS_GetVBType()
1436 rev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); in SiS_GetVBType()
1439 SiS_Pr->SiS_VBType = VB_SIS302B; in SiS_GetVBType()
1442 SiS_Pr->SiS_VBType = VB_SIS301C; in SiS_GetVBType()
1444 SiS_Pr->SiS_VBType = VB_SIS301B; in SiS_GetVBType()
1446 nolcd = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x23); in SiS_GetVBType()
1447 if(!(nolcd & 0x02)) SiS_Pr->SiS_VBType |= VB_NoLCD; in SiS_GetVBType()
1449 SiS_Pr->SiS_VBType = VB_SIS301; in SiS_GetVBType()
1452 if(SiS_Pr->SiS_VBType & (VB_SIS301B | VB_SIS301C | VB_SIS302B)) { in SiS_GetVBType()
1454 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x39); in SiS_GetVBType()
1455 if(flag == 0xff) SiS_Pr->SiS_VBType = VB_SIS302LV; in SiS_GetVBType()
1456 else SiS_Pr->SiS_VBType = VB_SIS301C; /* VB_SIS302ELV; */ in SiS_GetVBType()
1458 SiS_Pr->SiS_VBType = VB_SIS301LV; in SiS_GetVBType()
1461 if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) { in SiS_GetVBType()
1462 p4_0f = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x0f); in SiS_GetVBType()
1463 p4_25 = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x25); in SiS_GetVBType()
1464 p4_27 = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x27); in SiS_GetVBType()
1465 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0x7f); in SiS_GetVBType()
1466 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x25,0x08); in SiS_GetVBType()
1467 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,0xfd); in SiS_GetVBType()
1468 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x08) { in SiS_GetVBType()
1469 SiS_Pr->SiS_VBType |= VB_UMC; in SiS_GetVBType()
1471 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x27,p4_27); in SiS_GetVBType()
1472 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x25,p4_25); in SiS_GetVBType()
1473 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0f,p4_0f); in SiS_GetVBType()
1482 SiS_CheckMemorySize(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_CheckMemorySize() argument
1485 unsigned short AdapterMemSize = SiS_Pr->VideoMemorySize / (1024*1024); in SiS_CheckMemorySize()
1486 unsigned short modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_CheckMemorySize()
1501 SiS_Get310DRAMType(struct SiS_Private *SiS_Pr) in SiS_Get310DRAMType() argument
1505 if((*SiS_Pr->pSiS_SoftSetting) & SoftDRAMType) { in SiS_Get310DRAMType()
1506 data = (*SiS_Pr->pSiS_SoftSetting) & 0x03; in SiS_Get310DRAMType()
1508 if(SiS_Pr->ChipType >= XGI_20) { in SiS_Get310DRAMType()
1511 } else if(SiS_Pr->ChipType >= SIS_340) { in SiS_Get310DRAMType()
1514 } else if(SiS_Pr->ChipType >= SIS_661) { in SiS_Get310DRAMType()
1515 if(SiS_Pr->SiS_ROMNew) { in SiS_Get310DRAMType()
1516 data = ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x78) & 0xc0) >> 6); in SiS_Get310DRAMType()
1518 data = SiS_GetReg(SiS_Pr->SiS_P3d4,0x78) & 0x07; in SiS_Get310DRAMType()
1521 data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x07; in SiS_Get310DRAMType()
1523 data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3a) & 0x03; in SiS_Get310DRAMType()
1524 if(SiS_Pr->ChipType == SIS_330) { in SiS_Get310DRAMType()
1526 switch(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0x30) { in SiS_Get310DRAMType()
1543 SiS_GetMCLK(struct SiS_Private *SiS_Pr) in SiS_GetMCLK() argument
1545 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_GetMCLK()
1548 index = SiS_Get310DRAMType(SiS_Pr); in SiS_GetMCLK()
1549 if(SiS_Pr->ChipType >= SIS_661) { in SiS_GetMCLK()
1550 if(SiS_Pr->SiS_ROMNew) { in SiS_GetMCLK()
1553 return(SiS_Pr->SiS_MCLKData_0[index].CLOCK); in SiS_GetMCLK()
1555 return(SiS_Pr->SiS_MCLKData_1[index - 4].CLOCK); in SiS_GetMCLK()
1557 return(SiS_Pr->SiS_MCLKData_0[index].CLOCK); in SiS_GetMCLK()
1567 SiS_ClearBuffer(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_ClearBuffer() argument
1569 unsigned char SISIOMEMTYPE *memaddr = SiS_Pr->VideoMemoryAddress; in SiS_ClearBuffer()
1570 unsigned int memsize = SiS_Pr->VideoMemorySize; in SiS_ClearBuffer()
1576 if(SiS_Pr->SiS_ModeType >= ModeEGA) { in SiS_ClearBuffer()
1583 } else if(SiS_Pr->SiS_ModeType < ModeCGA) { in SiS_ClearBuffer()
1596 SiS_SearchModeID(struct SiS_Private *SiS_Pr, unsigned short *ModeNo, in SiS_SearchModeID() argument
1599 unsigned char VGAINFO = SiS_Pr->SiS_VGAINFO; in SiS_SearchModeID()
1606 if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == (*ModeNo)) break; in SiS_SearchModeID()
1607 if(SiS_Pr->SiS_SModeIDTable[(*ModeIdIndex)].St_ModeID == 0xFF) return false; in SiS_SearchModeID()
1624 if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == (*ModeNo)) break; in SiS_SearchModeID()
1625 if(SiS_Pr->SiS_EModeIDTable[(*ModeIdIndex)].Ext_ModeID == 0xFF) return false; in SiS_SearchModeID()
1637 SiS_GetModePtr(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_GetModePtr() argument
1642 index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_StTableIndex; in SiS_GetModePtr()
1644 if(SiS_Pr->SiS_ModeType <= ModeEGA) index = 0x1B; in SiS_GetModePtr()
1655 SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide) in SiS_GetRefCRTVCLK() argument
1657 if(SiS_Pr->SiS_RefIndex[Index].Ext_InfoFlag & HaveWideTiming) { in SiS_GetRefCRTVCLK()
1659 return SiS_Pr->SiS_RefIndex[Index].Ext_CRTVCLK_WIDE; in SiS_GetRefCRTVCLK()
1661 return SiS_Pr->SiS_RefIndex[Index].Ext_CRTVCLK_NORM; in SiS_GetRefCRTVCLK()
1664 return SiS_Pr->SiS_RefIndex[Index].Ext_CRTVCLK; in SiS_GetRefCRTVCLK()
1669 SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide) in SiS_GetRefCRT1CRTC() argument
1671 if(SiS_Pr->SiS_RefIndex[Index].Ext_InfoFlag & HaveWideTiming) { in SiS_GetRefCRT1CRTC()
1673 return SiS_Pr->SiS_RefIndex[Index].Ext_CRT1CRTC_WIDE; in SiS_GetRefCRT1CRTC()
1675 return SiS_Pr->SiS_RefIndex[Index].Ext_CRT1CRTC_NORM; in SiS_GetRefCRT1CRTC()
1678 return SiS_Pr->SiS_RefIndex[Index].Ext_CRT1CRTC; in SiS_GetRefCRT1CRTC()
1687 SiS_DoLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_DoLowModeTest() argument
1693 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x11); in SiS_DoLowModeTest()
1694 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80); in SiS_DoLowModeTest()
1695 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00); in SiS_DoLowModeTest()
1696 SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,0x55); in SiS_DoLowModeTest()
1697 temp2 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00); in SiS_DoLowModeTest()
1698 SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,temp1); in SiS_DoLowModeTest()
1699 SiS_SetReg(SiS_Pr->SiS_P3d4,0x11,temp); in SiS_DoLowModeTest()
1700 if((SiS_Pr->ChipType >= SIS_315H) || in SiS_DoLowModeTest()
1701 (SiS_Pr->ChipType == SIS_300)) { in SiS_DoLowModeTest()
1707 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); in SiS_DoLowModeTest()
1714 SiS_SetLowModeTest(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_SetLowModeTest() argument
1716 if(SiS_DoLowModeTest(SiS_Pr, ModeNo)) { in SiS_SetLowModeTest()
1717 SiS_Pr->SiS_SetFlag |= LowModeTests; in SiS_SetLowModeTest()
1726 SiS_OpenCRTC(struct SiS_Private *SiS_Pr) in SiS_OpenCRTC() argument
1729 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f); in SiS_OpenCRTC()
1730 if(IS_SIS651) SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x20); in SiS_OpenCRTC()
1731 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7); in SiS_OpenCRTC()
1733 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x61,0xf7); in SiS_OpenCRTC()
1734 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f); in SiS_OpenCRTC()
1735 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7); in SiS_OpenCRTC()
1736 if(!SiS_Pr->SiS_ROMNew) { in SiS_OpenCRTC()
1737 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x3a,0xef); in SiS_OpenCRTC()
1743 SiS_CloseCRTC(struct SiS_Private *SiS_Pr) in SiS_CloseCRTC() argument
1749 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_CloseCRTC()
1752 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x51,0x1f,temp1); in SiS_CloseCRTC()
1753 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x56,0xe7,temp2); in SiS_CloseCRTC()
1759 SiS_HandleCRT1(struct SiS_Private *SiS_Pr) in SiS_HandleCRT1() argument
1762 SiS_SetRegAND(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0xbf); in SiS_HandleCRT1()
1764 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x01)) { in SiS_HandleCRT1()
1765 if((SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x0a) || in SiS_HandleCRT1()
1766 (SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x01)) { in SiS_HandleCRT1()
1767 SiS_SetRegOR(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0x40); in SiS_HandleCRT1()
1778 SiS_GetColorDepth(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetColorDepth() argument
1787 modeflag = SiS_Pr->CModeFlag; in SiS_GetColorDepth()
1789 modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_GetColorDepth()
1791 modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag; in SiS_GetColorDepth()
1804 SiS_GetOffset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_GetOffset() argument
1809 if(SiS_Pr->UseCustomMode) { in SiS_GetOffset()
1810 infoflag = SiS_Pr->CInfoFlag; in SiS_GetOffset()
1811 xres = SiS_Pr->CHDisplay; in SiS_GetOffset()
1813 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag; in SiS_GetOffset()
1814 xres = SiS_Pr->SiS_RefIndex[RRTI].XRes; in SiS_GetOffset()
1817 colordepth = SiS_GetColorDepth(SiS_Pr, ModeNo, ModeIdIndex); in SiS_GetOffset()
1832 SiS_SetSeqRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetSeqRegs() argument
1837 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); in SiS_SetSeqRegs()
1840 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[0] | 0x20; in SiS_SetSeqRegs()
1843 if((SiS_Pr->SiS_VBType & VB_SISVB) || (SiS_Pr->SiS_IF_DEF_LVDS)) { in SiS_SetSeqRegs()
1845 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) { in SiS_SetSeqRegs()
1846 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) SRdata |= 0x01; in SiS_SetSeqRegs()
1847 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) SRdata |= 0x01; in SiS_SetSeqRegs()
1851 SiS_SetReg(SiS_Pr->SiS_P3c4,0x01,SRdata); in SiS_SetSeqRegs()
1854 SRdata = SiS_Pr->SiS_StandTable[StandTableIndex].SR[i - 1]; in SiS_SetSeqRegs()
1855 SiS_SetReg(SiS_Pr->SiS_P3c4,i,SRdata); in SiS_SetSeqRegs()
1864 SiS_SetMiscRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetMiscRegs() argument
1868 Miscdata = SiS_Pr->SiS_StandTable[StandTableIndex].MISC; in SiS_SetMiscRegs()
1870 if(SiS_Pr->ChipType < SIS_661) { in SiS_SetMiscRegs()
1871 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetMiscRegs()
1872 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetMiscRegs()
1878 SiS_SetRegByte(SiS_Pr->SiS_P3c2,Miscdata); in SiS_SetMiscRegs()
1886 SiS_SetCRTCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetCRTCRegs() argument
1892 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_SetCRTCRegs()
1895 CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i]; in SiS_SetCRTCRegs()
1896 SiS_SetReg(SiS_Pr->SiS_P3d4,i,CRTCdata); in SiS_SetCRTCRegs()
1899 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetCRTCRegs()
1900 SiS_OpenCRTC(SiS_Pr); in SiS_SetCRTCRegs()
1902 CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i]; in SiS_SetCRTCRegs()
1903 SiS_SetReg(SiS_Pr->SiS_P3d4,i,CRTCdata); in SiS_SetCRTCRegs()
1905 } else if( ( (SiS_Pr->ChipType == SIS_630) || in SiS_SetCRTCRegs()
1906 (SiS_Pr->ChipType == SIS_730) ) && in SiS_SetCRTCRegs()
1907 (SiS_Pr->ChipRevision >= 0x30) ) { in SiS_SetCRTCRegs()
1908 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRTCRegs()
1909 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) { in SiS_SetCRTCRegs()
1910 SiS_SetReg(SiS_Pr->SiS_P3d4,0x18,0xFE); in SiS_SetCRTCRegs()
1921 SiS_SetATTRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetATTRegs() argument
1927 ARdata = SiS_Pr->SiS_StandTable[StandTableIndex].ATTR[i]; in SiS_SetATTRegs()
1933 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiS_SetATTRegs()
1934 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) ARdata = 0; in SiS_SetATTRegs()
1936 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiS_SetATTRegs()
1937 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetATTRegs()
1938 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) { in SiS_SetATTRegs()
1939 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata = 0; in SiS_SetATTRegs()
1943 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetATTRegs()
1944 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) { in SiS_SetATTRegs()
1945 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata = 0; in SiS_SetATTRegs()
1947 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) { in SiS_SetATTRegs()
1948 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetATTRegs()
1951 if(SiS_Pr->SiS_VBType & VB_SIS30xB) { in SiS_SetATTRegs()
1952 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata = 0; in SiS_SetATTRegs()
1958 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) ARdata = 0; in SiS_SetATTRegs()
1962 SiS_GetRegByte(SiS_Pr->SiS_P3da); /* reset 3da */ in SiS_SetATTRegs()
1963 SiS_SetRegByte(SiS_Pr->SiS_P3c0,i); /* set index */ in SiS_SetATTRegs()
1964 SiS_SetRegByte(SiS_Pr->SiS_P3c0,ARdata); /* set data */ in SiS_SetATTRegs()
1967 SiS_GetRegByte(SiS_Pr->SiS_P3da); /* reset 3da */ in SiS_SetATTRegs()
1968 SiS_SetRegByte(SiS_Pr->SiS_P3c0,0x14); /* set index */ in SiS_SetATTRegs()
1969 SiS_SetRegByte(SiS_Pr->SiS_P3c0,0x00); /* set data */ in SiS_SetATTRegs()
1971 SiS_GetRegByte(SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
1972 SiS_SetRegByte(SiS_Pr->SiS_P3c0,0x20); /* Enable Attribute */ in SiS_SetATTRegs()
1973 SiS_GetRegByte(SiS_Pr->SiS_P3da); in SiS_SetATTRegs()
1981 SiS_SetGRCRegs(struct SiS_Private *SiS_Pr, unsigned short StandTableIndex) in SiS_SetGRCRegs() argument
1987 GRdata = SiS_Pr->SiS_StandTable[StandTableIndex].GRC[i]; in SiS_SetGRCRegs()
1988 SiS_SetReg(SiS_Pr->SiS_P3ce,i,GRdata); in SiS_SetGRCRegs()
1991 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetGRCRegs()
1993 SiS_SetRegAND(SiS_Pr->SiS_P3ce,0x05,0xBF); in SiS_SetGRCRegs()
2002 SiS_ClearExt1Regs(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiS_ClearExt1Regs() argument
2007 SiS_SetReg(SiS_Pr->SiS_P3c4,i,0x00); in SiS_ClearExt1Regs()
2010 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_ClearExt1Regs()
2011 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x37,0xFE); in SiS_ClearExt1Regs()
2014 SiS_SetReg(SiS_Pr->SiS_P3c4,0x0e,0x20); in SiS_ClearExt1Regs()
2025 SiS_ResetCRT1VCLK(struct SiS_Private *SiS_Pr) in SiS_ResetCRT1VCLK() argument
2027 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_ResetCRT1VCLK()
2028 if(SiS_Pr->ChipType < SIS_661) { in SiS_ResetCRT1VCLK()
2029 if(SiS_Pr->SiS_IF_DEF_LVDS == 0) return; in SiS_ResetCRT1VCLK()
2032 if((SiS_Pr->SiS_IF_DEF_LVDS == 0) && in SiS_ResetCRT1VCLK()
2033 (!(SiS_Pr->SiS_VBType & VB_SIS30xBLV)) ) { in SiS_ResetCRT1VCLK()
2038 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x31,0xcf,0x20); in SiS_ResetCRT1VCLK()
2039 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[1].SR2B); in SiS_ResetCRT1VCLK()
2040 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[1].SR2C); in SiS_ResetCRT1VCLK()
2041 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x80); in SiS_ResetCRT1VCLK()
2042 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x31,0xcf,0x10); in SiS_ResetCRT1VCLK()
2043 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2B,SiS_Pr->SiS_VCLKData[0].SR2B); in SiS_ResetCRT1VCLK()
2044 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2C,SiS_Pr->SiS_VCLKData[0].SR2C); in SiS_ResetCRT1VCLK()
2045 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x80); in SiS_ResetCRT1VCLK()
2053 SiS_SetCRT1Sync(struct SiS_Private *SiS_Pr, unsigned short RRTI) in SiS_SetCRT1Sync() argument
2057 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1Sync()
2058 sync = SiS_Pr->CInfoFlag >> 8; in SiS_SetCRT1Sync()
2060 sync = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag >> 8; in SiS_SetCRT1Sync()
2065 SiS_SetRegByte(SiS_Pr->SiS_P3c2,sync); in SiS_SetCRT1Sync()
2073 SiS_SetCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1CRTC() argument
2079 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1CRTC()
2081 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1CRTC()
2083 crt1data = &SiS_Pr->CCRT1CRTC[0]; in SiS_SetCRT1CRTC()
2087 temp = SiS_GetRefCRT1CRTC(SiS_Pr, RRTI, SiS_Pr->SiS_UseWide); in SiS_SetCRT1CRTC()
2090 if((temp == 0x20) && (SiS_Pr->Alternate1600x1200)) temp = 0x57; in SiS_SetCRT1CRTC()
2092 crt1data = (unsigned char *)&SiS_Pr->SiS_CRT1Table[temp].CR[0]; in SiS_SetCRT1CRTC()
2097 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_SetCRT1CRTC()
2100 SiS_SetReg(SiS_Pr->SiS_P3d4,j,crt1data[i]); in SiS_SetCRT1CRTC()
2103 SiS_SetReg(SiS_Pr->SiS_P3d4,j,crt1data[i]); in SiS_SetCRT1CRTC()
2106 SiS_SetReg(SiS_Pr->SiS_P3d4,j,crt1data[i]); in SiS_SetCRT1CRTC()
2109 SiS_SetReg(SiS_Pr->SiS_P3c4,j,crt1data[i]); in SiS_SetCRT1CRTC()
2112 SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,crt1data[16] & 0xE0); in SiS_SetCRT1CRTC()
2116 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,temp); in SiS_SetCRT1CRTC()
2118 if(SiS_Pr->SiS_ModeType > ModeVGA) { in SiS_SetCRT1CRTC()
2119 SiS_SetReg(SiS_Pr->SiS_P3d4,0x14,0x4F); in SiS_SetCRT1CRTC()
2123 if(SiS_Pr->ChipType == XGI_20) { in SiS_SetCRT1CRTC()
2124 SiS_SetReg(SiS_Pr->SiS_P3d4,0x04,crt1data[4] - 1); in SiS_SetCRT1CRTC()
2126 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0c,0xfb); in SiS_SetCRT1CRTC()
2128 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x05,0xe0,((temp - 1) & 0x1f)); in SiS_SetCRT1CRTC()
2131 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0e,0x1f,(temp << 5)); in SiS_SetCRT1CRTC()
2143 SiS_SetCRT1Offset(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1Offset() argument
2148 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1Offset()
2149 infoflag = SiS_Pr->CInfoFlag; in SiS_SetCRT1Offset()
2151 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag; in SiS_SetCRT1Offset()
2154 DisplayUnit = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, RRTI); in SiS_SetCRT1Offset()
2157 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0xF0,temp); in SiS_SetCRT1Offset()
2159 SiS_SetReg(SiS_Pr->SiS_P3d4,0x13,DisplayUnit & 0xFF); in SiS_SetCRT1Offset()
2166 if(SiS_Pr->ChipType == XGI_20) { in SiS_SetCRT1Offset()
2169 SiS_SetReg(SiS_Pr->SiS_P3c4,0x10,temp); in SiS_SetCRT1Offset()
2177 SiS_SetCRT1VCLK(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1VCLK() argument
2182 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1VCLK()
2183 clka = SiS_Pr->CSR2B; in SiS_SetCRT1VCLK()
2184 clkb = SiS_Pr->CSR2C; in SiS_SetCRT1VCLK()
2186 index = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RRTI); in SiS_SetCRT1VCLK()
2187 if((SiS_Pr->SiS_VBType & VB_SIS30xBLV) && in SiS_SetCRT1VCLK()
2188 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT1VCLK()
2190 if((index == 0x21) && (SiS_Pr->Alternate1600x1200)) index = 0x72; in SiS_SetCRT1VCLK()
2191 clka = SiS_Pr->SiS_VBVCLKData[index].Part4_A; in SiS_SetCRT1VCLK()
2192 clkb = SiS_Pr->SiS_VBVCLKData[index].Part4_B; in SiS_SetCRT1VCLK()
2194 clka = SiS_Pr->SiS_VCLKData[index].SR2B; in SiS_SetCRT1VCLK()
2195 clkb = SiS_Pr->SiS_VCLKData[index].SR2C; in SiS_SetCRT1VCLK()
2199 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xCF); in SiS_SetCRT1VCLK()
2201 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2b,clka); in SiS_SetCRT1VCLK()
2202 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2c,clkb); in SiS_SetCRT1VCLK()
2204 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT1VCLK()
2206 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x01); in SiS_SetCRT1VCLK()
2207 if(SiS_Pr->ChipType == XGI_20) { in SiS_SetCRT1VCLK()
2208 unsigned short mf = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1VCLK()
2210 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2b,SiS_GetReg(SiS_Pr->SiS_P3c4,0x2b)); in SiS_SetCRT1VCLK()
2211 clkb = SiS_GetReg(SiS_Pr->SiS_P3c4,0x2c); in SiS_SetCRT1VCLK()
2213 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2c,clkb); in SiS_SetCRT1VCLK()
2218 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2D,0x80); in SiS_SetCRT1VCLK()
2228 SiS_GetFIFOThresholdIndex300(struct SiS_Private *SiS_Pr, unsigned short *idx1, in SiS_GetFIFOThresholdIndex300() argument
2236 temp1 = temp2 = (SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x62) >> 1; in SiS_GetFIFOThresholdIndex300()
2238 (*idx1) = (unsigned short)(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) >> 6) & 0x03; in SiS_GetFIFOThresholdIndex300()
2239 (*idx1) |= (unsigned short)(((SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) >> 4) & 0x0c)); in SiS_GetFIFOThresholdIndex300()
2268 SiS_DoCalcDelay(struct SiS_Private *SiS_Pr, unsigned short MCLK, unsigned short VCLK, in SiS_DoCalcDelay() argument
2274 SiS_GetFIFOThresholdIndex300(SiS_Pr, &idx1, &idx2); in SiS_DoCalcDelay()
2288 SiS_CalcDelay(struct SiS_Private *SiS_Pr, unsigned short VCLK, in SiS_CalcDelay() argument
2293 temp2 = SiS_DoCalcDelay(SiS_Pr, MCLK, VCLK, colordepth, 0); in SiS_CalcDelay()
2294 temp1 = SiS_DoCalcDelay(SiS_Pr, MCLK, VCLK, colordepth, 1); in SiS_CalcDelay()
2302 SiS_SetCRT1FIFO_300(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1FIFO_300() argument
2312 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1FIFO_300()
2313 VCLK = SiS_Pr->CSRClock; in SiS_SetCRT1FIFO_300()
2315 index = SiS_GetRefCRTVCLK(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWide); in SiS_SetCRT1FIFO_300()
2316 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetCRT1FIFO_300()
2320 colorth = colortharray[(SiS_Pr->SiS_ModeType - ModeEGA)]; in SiS_SetCRT1FIFO_300()
2323 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A) & 0x07; in SiS_SetCRT1FIFO_300()
2324 MCLK = SiS_Pr->SiS_MCLKData_0[index].CLOCK; in SiS_SetCRT1FIFO_300()
2326 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xc3; in SiS_SetCRT1FIFO_300()
2327 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x16,0x3c,temp); in SiS_SetCRT1FIFO_300()
2330 ThresholdLow = SiS_CalcDelay(SiS_Pr, VCLK, colorth, MCLK) + 1; in SiS_SetCRT1FIFO_300()
2332 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x16,0xfc); in SiS_SetCRT1FIFO_300()
2334 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) >> 6; in SiS_SetCRT1FIFO_300()
2336 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x16,0x3f,((temp - 1) << 6)); in SiS_SetCRT1FIFO_300()
2343 SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,temp); in SiS_SetCRT1FIFO_300()
2347 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0f,0x9f,temp); in SiS_SetCRT1FIFO_300()
2350 SiS_SetReg(SiS_Pr->SiS_P3c4,0x3B,0x09); in SiS_SetCRT1FIFO_300()
2355 SiS_SetReg(SiS_Pr->SiS_P3c4,0x09,temp); in SiS_SetCRT1FIFO_300()
2359 SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index) in SiS_GetLatencyFactor630() argument
2379 if(SiS_Pr->ChipType == SIS_730) { in SiS_GetLatencyFactor630()
2387 SiS_CalcDelay2(struct SiS_Private *SiS_Pr, unsigned char key) in SiS_CalcDelay2() argument
2391 if(SiS_Pr->ChipType == SIS_730) { in SiS_CalcDelay2()
2397 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80) index += 12; in SiS_CalcDelay2()
2399 return SiS_GetLatencyFactor630(SiS_Pr, index); in SiS_CalcDelay2()
2403 SiS_SetCRT1FIFO_630(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1FIFO_630() argument
2431 if (SiS_Pr->ChipType == SIS_730) in SiS_SetCRT1FIFO_630()
2439 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1FIFO_630()
2440 VCLK = SiS_Pr->CSRClock; in SiS_SetCRT1FIFO_630()
2442 data = SiS_GetRefCRTVCLK(SiS_Pr, RefreshRateTableIndex, SiS_Pr->SiS_UseWide); in SiS_SetCRT1FIFO_630()
2443 VCLK = SiS_Pr->SiS_VCLKData[data].CLOCK; in SiS_SetCRT1FIFO_630()
2447 data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A) & 0x07; in SiS_SetCRT1FIFO_630()
2448 MCLK16 = SiS_Pr->SiS_MCLKData_0[data].CLOCK * 16; in SiS_SetCRT1FIFO_630()
2451 colorth = colortharray[(SiS_Pr->SiS_ModeType - ModeEGA)]; in SiS_SetCRT1FIFO_630()
2454 templ = SiS_CalcDelay2(SiS_Pr, queuedata[i]) * VCLK * colorth; in SiS_SetCRT1FIFO_630()
2474 if(SiS_Pr->ChipType != SIS_730) i = 9; in SiS_SetCRT1FIFO_630()
2481 SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,data); in SiS_SetCRT1FIFO_630()
2484 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xDF,data); in SiS_SetCRT1FIFO_630()
2487 SiS_SetReg(SiS_Pr->SiS_P3c4,0x3B,0x09); in SiS_SetCRT1FIFO_630()
2492 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x09,0x80,data); in SiS_SetCRT1FIFO_630()
2495 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); in SiS_SetCRT1FIFO_630()
2497 if(SiS_Pr->ChipType == SIS_730) { in SiS_SetCRT1FIFO_630()
2506 (SiS_Pr->ChipType == SIS_630) && in SiS_SetCRT1FIFO_630()
2507 (SiS_Pr->ChipRevision >= 0x30) ) { in SiS_SetCRT1FIFO_630()
2515 sisfb_write_nbridge_pci_dword(SiS_Pr, 0x50, templ); in SiS_SetCRT1FIFO_630()
2516 templ = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xA0); in SiS_SetCRT1FIFO_630()
2519 if(SiS_Pr->ChipType == SIS_730) { in SiS_SetCRT1FIFO_630()
2532 sisfb_write_nbridge_pci_dword(SiS_Pr, 0xA0, templ); in SiS_SetCRT1FIFO_630()
2538 SiS_SetCRT1FIFO_310(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetCRT1FIFO_310() argument
2543 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x3D,0xFE); in SiS_SetCRT1FIFO_310()
2545 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1FIFO_310()
2547 SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE); in SiS_SetCRT1FIFO_310()
2548 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0); in SiS_SetCRT1FIFO_310()
2550 if(SiS_Pr->ChipType >= XGI_20) { in SiS_SetCRT1FIFO_310()
2551 SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34); in SiS_SetCRT1FIFO_310()
2552 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01); in SiS_SetCRT1FIFO_310()
2553 } else if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetCRT1FIFO_310()
2555 SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34); in SiS_SetCRT1FIFO_310()
2556 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01); in SiS_SetCRT1FIFO_310()
2560 SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34); in SiS_SetCRT1FIFO_310()
2561 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01); in SiS_SetCRT1FIFO_310()
2573 SiS_SetVCLKState(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetVCLKState() argument
2579 if(SiS_Pr->UseCustomMode) { in SiS_SetVCLKState()
2580 VCLK = SiS_Pr->CSRClock; in SiS_SetVCLKState()
2582 index = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetVCLKState()
2583 VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK; in SiS_SetVCLKState()
2587 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetVCLKState()
2590 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data); in SiS_SetVCLKState()
2594 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data); in SiS_SetVCLKState()
2596 } else if(SiS_Pr->ChipType < XGI_20) { in SiS_SetVCLKState()
2599 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); in SiS_SetVCLKState()
2602 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1f,0xe7); in SiS_SetVCLKState()
2608 if(SiS_Pr->ChipType == XGI_20) data &= ~0x04; in SiS_SetVCLKState()
2609 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data); in SiS_SetVCLKState()
2610 if(SiS_Pr->ChipType != XGI_20) { in SiS_SetVCLKState()
2611 data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xe7; in SiS_SetVCLKState()
2613 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,data); in SiS_SetVCLKState()
2619 if(SiS_Pr->ChipType >= SIS_661) { in SiS_SetVCLKState()
2621 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xE8,0x10); in SiS_SetVCLKState()
2630 if(SiS_Pr->ChipType == SIS_540) { in SiS_SetVCLKState()
2635 if(SiS_Pr->ChipType < SIS_315H) { in SiS_SetVCLKState()
2636 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xFC,data); in SiS_SetVCLKState()
2638 if(SiS_Pr->ChipType > SIS_315PRO) { in SiS_SetVCLKState()
2641 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xF8,data); in SiS_SetVCLKState()
2648 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_SetCRT1ModeRegs() argument
2653 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_SetCRT1ModeRegs()
2657 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1ModeRegs()
2659 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1ModeRegs()
2660 infoflag = SiS_Pr->CInfoFlag; in SiS_SetCRT1ModeRegs()
2663 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag; in SiS_SetCRT1ModeRegs()
2668 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1F,0x3F); in SiS_SetCRT1ModeRegs()
2672 if(SiS_Pr->SiS_ModeType > ModeEGA) { in SiS_SetCRT1ModeRegs()
2674 data |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2); in SiS_SetCRT1ModeRegs()
2678 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x06,0xC0,data); in SiS_SetCRT1ModeRegs()
2680 if(SiS_Pr->ChipType != SIS_300) { in SiS_SetCRT1ModeRegs()
2684 int hrs = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x04) | in SiS_SetCRT1ModeRegs()
2685 ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0xc0) << 2)) - 3; in SiS_SetCRT1ModeRegs()
2686 int hto = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x00) | in SiS_SetCRT1ModeRegs()
2687 ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0x03) << 8)) + 5; in SiS_SetCRT1ModeRegs()
2690 SiS_SetReg(SiS_Pr->SiS_P3d4,0x19,data); in SiS_SetCRT1ModeRegs()
2691 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x1a,0xFC,((data >> 8) & 0x03)); in SiS_SetCRT1ModeRegs()
2695 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x08); in SiS_SetCRT1ModeRegs()
2700 if(SiS_Pr->ChipType == SIS_300) { in SiS_SetCRT1ModeRegs()
2701 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xF7,data); in SiS_SetCRT1ModeRegs()
2703 if(SiS_Pr->ChipType >= XGI_20) data |= 0x20; in SiS_SetCRT1ModeRegs()
2704 if(SiS_Pr->SiS_ModeType == ModeEGA) { in SiS_SetCRT1ModeRegs()
2709 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,data); in SiS_SetCRT1ModeRegs()
2713 if(SiS_Pr->ChipType >= SIS_315H) { in SiS_SetCRT1ModeRegs()
2714 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xfb); in SiS_SetCRT1ModeRegs()
2717 if(SiS_Pr->ChipType == SIS_315PRO) { in SiS_SetCRT1ModeRegs()
2719 data = SiS_Pr->SiS_SR15[(2 * 4) + SiS_Get310DRAMType(SiS_Pr)]; in SiS_SetCRT1ModeRegs()
2720 if(SiS_Pr->SiS_ModeType == ModeText) { in SiS_SetCRT1ModeRegs()
2723 data2 = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, RRTI) >> 1; in SiS_SetCRT1ModeRegs()
2725 data3 = SiS_GetColorDepth(SiS_Pr, ModeNo, ModeIdIndex) >> 1; in SiS_SetCRT1ModeRegs()
2732 SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data); in SiS_SetCRT1ModeRegs()
2734 } else if((SiS_Pr->ChipType == SIS_330) || (SiS_Pr->SiS_SysFlags & SF_760LFB)) { in SiS_SetCRT1ModeRegs()
2736 data = SiS_Get310DRAMType(SiS_Pr); in SiS_SetCRT1ModeRegs()
2737 if(SiS_Pr->ChipType == SIS_330) { in SiS_SetCRT1ModeRegs()
2738 data = SiS_Pr->SiS_SR15[(2 * 4) + data]; in SiS_SetCRT1ModeRegs()
2740 if(SiS_Pr->SiS_ROMNew) data = ROMAddr[0xf6]; in SiS_SetCRT1ModeRegs()
2741 else if(SiS_Pr->SiS_UseROM) data = ROMAddr[0x100 + data]; in SiS_SetCRT1ModeRegs()
2744 if(SiS_Pr->SiS_ModeType <= ModeEGA) { in SiS_SetCRT1ModeRegs()
2747 if(SiS_Pr->UseCustomMode) { in SiS_SetCRT1ModeRegs()
2748 data2 = SiS_Pr->CSRClock; in SiS_SetCRT1ModeRegs()
2750 data2 = SiS_GetVCLK2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RRTI); in SiS_SetCRT1ModeRegs()
2751 data2 = SiS_Pr->SiS_VCLKData[data2].CLOCK; in SiS_SetCRT1ModeRegs()
2754 data3 = SiS_GetColorDepth(SiS_Pr, ModeNo, ModeIdIndex) >> 1; in SiS_SetCRT1ModeRegs()
2757 data2 = ((unsigned int)(SiS_GetMCLK(SiS_Pr) * 1024)) / data2; in SiS_SetCRT1ModeRegs()
2759 if(SiS_Pr->ChipType == SIS_330) { in SiS_SetCRT1ModeRegs()
2760 if(SiS_Pr->SiS_ModeType != Mode16Bpp) { in SiS_SetCRT1ModeRegs()
2784 SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data); in SiS_SetCRT1ModeRegs()
2792 if(SiS_Pr->SiS_ModeType != ModeText) { in SiS_SetCRT1ModeRegs()
2794 if(SiS_Pr->SiS_ModeType != ModeEGA) { in SiS_SetCRT1ModeRegs()
2798 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x21,0x1F,data); in SiS_SetCRT1ModeRegs()
2800 SiS_SetVCLKState(SiS_Pr, ModeNo, RRTI, ModeIdIndex); in SiS_SetCRT1ModeRegs()
2803 if(((SiS_Pr->ChipType >= SIS_315H) && (SiS_Pr->ChipType < SIS_661)) || in SiS_SetCRT1ModeRegs()
2804 (SiS_Pr->ChipType == XGI_40)) { in SiS_SetCRT1ModeRegs()
2805 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) { in SiS_SetCRT1ModeRegs()
2806 SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x2c); in SiS_SetCRT1ModeRegs()
2808 SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x6c); in SiS_SetCRT1ModeRegs()
2810 } else if(SiS_Pr->ChipType == XGI_20) { in SiS_SetCRT1ModeRegs()
2811 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) { in SiS_SetCRT1ModeRegs()
2812 SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x33); in SiS_SetCRT1ModeRegs()
2814 SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x73); in SiS_SetCRT1ModeRegs()
2816 SiS_SetReg(SiS_Pr->SiS_P3d4,0x51,0x02); in SiS_SetCRT1ModeRegs()
2823 SiS_SetupDualChip(struct SiS_Private *SiS_Pr) in SiS_SetupDualChip() argument
2827 SISIOADDRESS P2_3c2 = SiS_Pr->IOAddress2 + 0x12; in SiS_SetupDualChip()
2828 SISIOADDRESS P2_3c4 = SiS_Pr->IOAddress2 + 0x14; in SiS_SetupDualChip()
2829 SISIOADDRESS P2_3ce = SiS_Pr->IOAddress2 + 0x1e; in SiS_SetupDualChip()
2832 if((SiS_Pr->ChipRevision != 0) || in SiS_SetupDualChip()
2833 (!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x3a) & 0x04))) in SiS_SetupDualChip()
2837 SiS_SetReg(P2_3c4,i,SiS_GetReg(SiS_Pr->SiS_P3c4,i)); in SiS_SetupDualChip()
2840 SiS_SetReg(P2_3ce,i,SiS_GetReg(SiS_Pr->SiS_P3ce,i)); in SiS_SetupDualChip()
2843 SiS_SetReg(P2_3c4,0x06,SiS_GetReg(SiS_Pr->SiS_P3c4,0x06)); /* SR06 */ in SiS_SetupDualChip()
2844 SiS_SetReg(P2_3c4,0x21,SiS_GetReg(SiS_Pr->SiS_P3c4,0x21)); /* SR21 */ in SiS_SetupDualChip()
2845 SiS_SetRegByte(P2_3c2,SiS_GetRegByte(SiS_Pr->SiS_P3cc)); /* MISC */ in SiS_SetupDualChip()
2856 SiS_WriteDAC(struct SiS_Private *SiS_Pr, SISIOADDRESS DACData, unsigned short shiftflag, in SiS_WriteDAC() argument
2872 SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_LoadDAC() argument
2879 data = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex) & DACInfoFlag; in SiS_LoadDAC()
2891 if( ( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && /* 301B-DH LCD */ in SiS_LoadDAC()
2892 (SiS_Pr->SiS_VBType & VB_NoLCD) ) || in SiS_LoadDAC()
2893 (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) || /* LCDA */ in SiS_LoadDAC()
2894 (!(SiS_Pr->SiS_SetFlag & ProgrammingCRT2)) ) { /* Programming CRT1 */ in SiS_LoadDAC()
2895 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); in SiS_LoadDAC()
2896 DACAddr = SiS_Pr->SiS_P3c8; in SiS_LoadDAC()
2897 DACData = SiS_Pr->SiS_P3c9; in SiS_LoadDAC()
2900 DACAddr = SiS_Pr->SiS_Part5Port; in SiS_LoadDAC()
2901 DACData = SiS_Pr->SiS_Part5Port + 1; in SiS_LoadDAC()
2929 SiS_WriteDAC(SiS_Pr, DACData, sf, n, table[di], table[bx], table[si]); in SiS_LoadDAC()
2934 SiS_WriteDAC(SiS_Pr, DACData, sf, n, table[di], table[si], table[bx]); in SiS_LoadDAC()
2948 SiS_SetCRT1Group(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex) in SiS_SetCRT1Group() argument
2952 SiS_Pr->SiS_CRT1Mode = ModeNo; in SiS_SetCRT1Group()
2954 StandTableIndex = SiS_GetModePtr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
2956 if(SiS_Pr->SiS_SetFlag & LowModeTests) { in SiS_SetCRT1Group()
2957 if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2)) { in SiS_SetCRT1Group()
2958 SiS_DisableBridge(SiS_Pr); in SiS_SetCRT1Group()
2962 SiS_ResetSegmentRegisters(SiS_Pr); in SiS_SetCRT1Group()
2964 SiS_SetSeqRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
2965 SiS_SetMiscRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
2966 SiS_SetCRTCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
2967 SiS_SetATTRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
2968 SiS_SetGRCRegs(SiS_Pr, StandTableIndex); in SiS_SetCRT1Group()
2969 SiS_ClearExt1Regs(SiS_Pr, ModeNo); in SiS_SetCRT1Group()
2970 SiS_ResetCRT1VCLK(SiS_Pr); in SiS_SetCRT1Group()
2972 SiS_Pr->SiS_SelectCRT2Rate = 0; in SiS_SetCRT1Group()
2973 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); in SiS_SetCRT1Group()
2975 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { in SiS_SetCRT1Group()
2976 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { in SiS_SetCRT1Group()
2977 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT1Group()
2981 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { in SiS_SetCRT1Group()
2982 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; in SiS_SetCRT1Group()
2985 RefreshRateTableIndex = SiS_GetRatePtr(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
2987 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) { in SiS_SetCRT1Group()
2988 SiS_Pr->SiS_SetFlag &= ~ProgrammingCRT2; in SiS_SetCRT1Group()
2992 SiS_SetCRT1Sync(SiS_Pr, RefreshRateTableIndex); in SiS_SetCRT1Group()
2993 SiS_SetCRT1CRTC(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT1Group()
2994 SiS_SetCRT1Offset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT1Group()
2995 SiS_SetCRT1VCLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT1Group()
2998 switch(SiS_Pr->ChipType) { in SiS_SetCRT1Group()
3001 SiS_SetCRT1FIFO_300(SiS_Pr, ModeNo, RefreshRateTableIndex); in SiS_SetCRT1Group()
3006 SiS_SetCRT1FIFO_630(SiS_Pr, ModeNo, RefreshRateTableIndex); in SiS_SetCRT1Group()
3011 if(SiS_Pr->ChipType == XGI_20) { in SiS_SetCRT1Group()
3021 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2b,sr2b); in SiS_SetCRT1Group()
3022 SiS_SetReg(SiS_Pr->SiS_P3c4,0x2c,sr2c); in SiS_SetCRT1Group()
3023 SiS_SetRegByte(SiS_Pr->SiS_P3c2,(SiS_GetRegByte(SiS_Pr->SiS_P3cc) | 0x0c)); in SiS_SetCRT1Group()
3026 SiS_SetCRT1FIFO_310(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
3031 SiS_SetCRT1ModeRegs(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); in SiS_SetCRT1Group()
3034 if(SiS_Pr->ChipType == XGI_40) { in SiS_SetCRT1Group()
3035 SiS_SetupDualChip(SiS_Pr); in SiS_SetCRT1Group()
3039 SiS_LoadDAC(SiS_Pr, ModeNo, ModeIdIndex); in SiS_SetCRT1Group()
3041 if(SiS_Pr->SiS_flag_clearbuffer) { in SiS_SetCRT1Group()
3042 SiS_ClearBuffer(SiS_Pr, ModeNo); in SiS_SetCRT1Group()
3045 if(!(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) { in SiS_SetCRT1Group()
3046 SiS_WaitRetrace1(SiS_Pr); in SiS_SetCRT1Group()
3047 SiS_DisplayOn(SiS_Pr); in SiS_SetCRT1Group()
3056 SiS_InitVB(struct SiS_Private *SiS_Pr) in SiS_InitVB() argument
3058 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_InitVB()
3060 SiS_Pr->Init_P4_0E = 0; in SiS_InitVB()
3061 if(SiS_Pr->SiS_ROMNew) { in SiS_InitVB()
3062 SiS_Pr->Init_P4_0E = ROMAddr[0x82]; in SiS_InitVB()
3063 } else if(SiS_Pr->ChipType >= XGI_40) { in SiS_InitVB()
3064 if(SiS_Pr->SiS_XGIROM) { in SiS_InitVB()
3065 SiS_Pr->Init_P4_0E = ROMAddr[0x80]; in SiS_InitVB()
3071 SiS_ResetVB(struct SiS_Private *SiS_Pr) in SiS_ResetVB() argument
3074 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; in SiS_ResetVB()
3078 if(SiS_Pr->SiS_UseROM) { in SiS_ResetVB()
3079 if(SiS_Pr->ChipType < SIS_330) { in SiS_ResetVB()
3081 if(SiS_Pr->SiS_ROMNew) temp = ROMAddr[0x80] | 0x40; in SiS_ResetVB()
3082 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp); in SiS_ResetVB()
3083 } else if(SiS_Pr->ChipType >= SIS_661 && SiS_Pr->ChipType < XGI_20) { in SiS_ResetVB()
3085 if(SiS_Pr->SiS_ROMNew) temp = ROMAddr[0x80] | 0x40; in SiS_ResetVB()
3086 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp); in SiS_ResetVB()
3088 } else if(SiS_Pr->ChipType >= XGI_40) { in SiS_ResetVB()
3090 if(SiS_Pr->SiS_XGIROM) temp |= ROMAddr[0x7e]; in SiS_ResetVB()
3092 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp); in SiS_ResetVB()
3102 SiS_StrangeStuff(struct SiS_Private *SiS_Pr) in SiS_StrangeStuff() argument
3110 SiS_Pr->ChipType == SIS_340 || in SiS_StrangeStuff()
3111 SiS_Pr->ChipType == XGI_40) { in SiS_StrangeStuff()
3112 SiS_SetReg(SiS_Pr->SiS_VidCapt, 0x3f, 0x00); /* Fiddle with capture regs */ in SiS_StrangeStuff()
3113 SiS_SetReg(SiS_Pr->SiS_VidCapt, 0x00, 0x00); in SiS_StrangeStuff()
3114 SiS_SetReg(SiS_Pr->SiS_VidPlay, 0x00, 0x86); /* (BIOS does NOT unlock) */ in SiS_StrangeStuff()
3115 SiS_SetRegAND(SiS_Pr->SiS_VidPlay, 0x30, 0xfe); /* Fiddle with video regs */ in SiS_StrangeStuff()
3116 SiS_SetRegAND(SiS_Pr->SiS_VidPlay, 0x3f, 0xef); in SiS_StrangeStuff()
3127 SiS_Handle760(struct SiS_Private *SiS_Pr) in SiS_Handle760() argument
3133 if( (SiS_Pr->ChipType != SIS_760) || in SiS_Handle760()
3134 ((SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5c) & 0xf8) != 0x80) || in SiS_Handle760()
3135 (!(SiS_Pr->SiS_SysFlags & SF_760LFB)) || in SiS_Handle760()
3136 (!(SiS_Pr->SiS_SysFlags & SF_760UMA)) ) in SiS_Handle760()
3139 somebase = sisfb_read_mio_pci_word(SiS_Pr, 0x74); in SiS_Handle760()
3146 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40) { in SiS_Handle760()
3155 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x7e, temp1); in SiS_Handle760()
3156 sisfb_write_nbridge_pci_byte(SiS_Pr, 0x8d, temp2); in SiS_Handle760()
3167 SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) in SiSSetMode() argument
3169 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; in SiSSetMode()
3174 SiS_Pr->UseCustomMode = false; in SiSSetMode()
3175 SiS_Pr->CRT1UsesCustomMode = false; in SiSSetMode()
3177 SiS_Pr->SiS_flag_clearbuffer = 0; in SiSSetMode()
3179 if(SiS_Pr->UseCustomMode) { in SiSSetMode()
3182 if(!(ModeNo & 0x80)) SiS_Pr->SiS_flag_clearbuffer = 1; in SiSSetMode()
3190 SiSInitPtr(SiS_Pr); in SiSSetMode()
3191 SiSRegInit(SiS_Pr, BaseAddr); in SiSSetMode()
3192 SiS_GetSysFlags(SiS_Pr); in SiSSetMode()
3194 SiS_Pr->SiS_VGAINFO = 0x11; in SiSSetMode()
3196 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); in SiSSetMode()
3197 SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); in SiSSetMode()
3199 SiSInitPCIetc(SiS_Pr); in SiSSetMode()
3200 SiSSetLVDSetc(SiS_Pr); in SiSSetMode()
3201 SiSDetermineROMUsage(SiS_Pr); in SiSSetMode()
3203 SiS_UnLockCRT2(SiS_Pr); in SiSSetMode()
3205 if(!SiS_Pr->UseCustomMode) { in SiSSetMode()
3206 if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; in SiSSetMode()
3211 SiS_GetVBType(SiS_Pr); in SiSSetMode()
3214 SiS_InitVB(SiS_Pr); in SiSSetMode()
3215 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiSSetMode()
3216 if(SiS_Pr->ChipType >= SIS_315H) { in SiSSetMode()
3217 SiS_ResetVB(SiS_Pr); in SiSSetMode()
3218 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10); in SiSSetMode()
3219 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c); in SiSSetMode()
3220 backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiSSetMode()
3222 backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiSSetMode()
3227 SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, (SiS_Pr->UseCustomMode) ? 0 : 1); in SiSSetMode()
3228 SiS_SetYPbPr(SiS_Pr); in SiSSetMode()
3229 SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex); in SiSSetMode()
3230 SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); in SiSSetMode()
3231 SiS_SetLowModeTest(SiS_Pr, ModeNo); in SiSSetMode()
3234 if(!SiS_CheckMemorySize(SiS_Pr, ModeNo, ModeIdIndex)) { in SiSSetMode()
3238 SiS_OpenCRTC(SiS_Pr); in SiSSetMode()
3240 if(SiS_Pr->UseCustomMode) { in SiSSetMode()
3241 SiS_Pr->CRT1UsesCustomMode = true; in SiSSetMode()
3242 SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; in SiSSetMode()
3243 SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; in SiSSetMode()
3245 SiS_Pr->CRT1UsesCustomMode = false; in SiSSetMode()
3249 if( (SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SetCRT2ToLCDA)) || in SiSSetMode()
3250 (!(SiS_Pr->SiS_VBInfo & SwitchCRT2)) ) { in SiSSetMode()
3251 SiS_SetCRT1Group(SiS_Pr, ModeNo, ModeIdIndex); in SiSSetMode()
3255 if(SiS_Pr->SiS_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA)) { in SiSSetMode()
3256 if( (SiS_Pr->SiS_VBType & VB_SISVB) || in SiSSetMode()
3257 (SiS_Pr->SiS_IF_DEF_LVDS == 1) || in SiSSetMode()
3258 (SiS_Pr->SiS_IF_DEF_CH70xx != 0) || in SiSSetMode()
3259 (SiS_Pr->SiS_IF_DEF_TRUMPION != 0) ) { in SiSSetMode()
3260 SiS_SetCRT2Group(SiS_Pr, RealModeNo); in SiSSetMode()
3264 SiS_HandleCRT1(SiS_Pr); in SiSSetMode()
3266 SiS_StrangeStuff(SiS_Pr); in SiSSetMode()
3268 SiS_DisplayOn(SiS_Pr); in SiSSetMode()
3269 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); in SiSSetMode()
3272 if(SiS_Pr->ChipType >= SIS_315H) { in SiSSetMode()
3273 if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { in SiSSetMode()
3274 if(!(SiS_IsDualEdge(SiS_Pr))) { in SiSSetMode()
3275 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiSSetMode()
3281 if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { in SiSSetMode()
3282 if(SiS_Pr->ChipType >= SIS_315H) { in SiSSetMode()
3284 if(!SiS_Pr->SiS_ROMNew) { in SiSSetMode()
3285 if(SiS_IsVAMode(SiS_Pr)) { in SiSSetMode()
3286 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); in SiSSetMode()
3288 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE); in SiSSetMode()
3292 SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg); in SiSSetMode()
3294 if((IS_SIS650) && (SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0xfc)) { in SiSSetMode()
3296 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x80); in SiSSetMode()
3297 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x56,0x08); in SiSSetMode()
3301 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & SetCRT2ToLCD) { in SiSSetMode()
3302 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); in SiSSetMode()
3305 } else if((SiS_Pr->ChipType == SIS_630) || in SiSSetMode()
3306 (SiS_Pr->ChipType == SIS_730)) { in SiSSetMode()
3307 SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg); in SiSSetMode()
3311 SiS_CloseCRTC(SiS_Pr); in SiSSetMode()
3313 SiS_Handle760(SiS_Pr); in SiSSetMode()
3316 if(KeepLockReg != 0xA1) SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x00); in SiSSetMode()
3328 SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth) in SiS_CalcCRRegisters() argument
3332 SiS_Pr->CCRT1CRTC[0] = ((SiS_Pr->CHTotal >> 3) - 5) & 0xff; /* CR0 */ in SiS_CalcCRRegisters()
3333 SiS_Pr->CCRT1CRTC[1] = (SiS_Pr->CHDisplay >> 3) - 1; /* CR1 */ in SiS_CalcCRRegisters()
3334 SiS_Pr->CCRT1CRTC[2] = (SiS_Pr->CHBlankStart >> 3) - 1; /* CR2 */ in SiS_CalcCRRegisters()
3335 SiS_Pr->CCRT1CRTC[3] = (((SiS_Pr->CHBlankEnd >> 3) - 1) & 0x1F) | 0x80; /* CR3 */ in SiS_CalcCRRegisters()
3336 SiS_Pr->CCRT1CRTC[4] = (SiS_Pr->CHSyncStart >> 3) + 3; /* CR4 */ in SiS_CalcCRRegisters()
3337 SiS_Pr->CCRT1CRTC[5] = ((((SiS_Pr->CHBlankEnd >> 3) - 1) & 0x20) << 2) | /* CR5 */ in SiS_CalcCRRegisters()
3338 (((SiS_Pr->CHSyncEnd >> 3) + 3) & 0x1F); in SiS_CalcCRRegisters()
3340 SiS_Pr->CCRT1CRTC[6] = (SiS_Pr->CVTotal - 2) & 0xFF; /* CR6 */ in SiS_CalcCRRegisters()
3341 SiS_Pr->CCRT1CRTC[7] = (((SiS_Pr->CVTotal - 2) & 0x100) >> 8) /* CR7 */ in SiS_CalcCRRegisters()
3342 | (((SiS_Pr->CVDisplay - 1) & 0x100) >> 7) in SiS_CalcCRRegisters()
3343 | (((SiS_Pr->CVSyncStart - x) & 0x100) >> 6) in SiS_CalcCRRegisters()
3344 | (((SiS_Pr->CVBlankStart- 1) & 0x100) >> 5) in SiS_CalcCRRegisters()
3346 | (((SiS_Pr->CVTotal - 2) & 0x200) >> 4) in SiS_CalcCRRegisters()
3347 | (((SiS_Pr->CVDisplay - 1) & 0x200) >> 3) in SiS_CalcCRRegisters()
3348 | (((SiS_Pr->CVSyncStart - x) & 0x200) >> 2); in SiS_CalcCRRegisters()
3350 SiS_Pr->CCRT1CRTC[16] = ((((SiS_Pr->CVBlankStart - 1) & 0x200) >> 4) >> 5); /* CR9 */ in SiS_CalcCRRegisters()
3353 if(SiS_Pr->CHDisplay >= 1600) SiS_Pr->CCRT1CRTC[16] |= 0x60; /* SRE */ in SiS_CalcCRRegisters()
3354 else if(SiS_Pr->CHDisplay >= 640) SiS_Pr->CCRT1CRTC[16] |= 0x40; in SiS_CalcCRRegisters()
3357 SiS_Pr->CCRT1CRTC[8] = (SiS_Pr->CVSyncStart - x) & 0xFF; /* CR10 */ in SiS_CalcCRRegisters()
3358 SiS_Pr->CCRT1CRTC[9] = ((SiS_Pr->CVSyncEnd - x) & 0x0F) | 0x80; /* CR11 */ in SiS_CalcCRRegisters()
3359 SiS_Pr->CCRT1CRTC[10] = (SiS_Pr->CVDisplay - 1) & 0xFF; /* CR12 */ in SiS_CalcCRRegisters()
3360 SiS_Pr->CCRT1CRTC[11] = (SiS_Pr->CVBlankStart - 1) & 0xFF; /* CR15 */ in SiS_CalcCRRegisters()
3361 SiS_Pr->CCRT1CRTC[12] = (SiS_Pr->CVBlankEnd - 1) & 0xFF; /* CR16 */ in SiS_CalcCRRegisters()
3363 SiS_Pr->CCRT1CRTC[13] = /* SRA */ in SiS_CalcCRRegisters()
3364 GETBITSTR((SiS_Pr->CVTotal -2), 10:10, 0:0) | in SiS_CalcCRRegisters()
3365 GETBITSTR((SiS_Pr->CVDisplay -1), 10:10, 1:1) | in SiS_CalcCRRegisters()
3366 GETBITSTR((SiS_Pr->CVBlankStart-1), 10:10, 2:2) | in SiS_CalcCRRegisters()
3367 GETBITSTR((SiS_Pr->CVSyncStart -x), 10:10, 3:3) | in SiS_CalcCRRegisters()
3368 GETBITSTR((SiS_Pr->CVBlankEnd -1), 8:8, 4:4) | in SiS_CalcCRRegisters()
3369 GETBITSTR((SiS_Pr->CVSyncEnd ), 4:4, 5:5) ; in SiS_CalcCRRegisters()
3371 SiS_Pr->CCRT1CRTC[14] = /* SRB */ in SiS_CalcCRRegisters()
3372 GETBITSTR((SiS_Pr->CHTotal >> 3) - 5, 9:8, 1:0) | in SiS_CalcCRRegisters()
3373 GETBITSTR((SiS_Pr->CHDisplay >> 3) - 1, 9:8, 3:2) | in SiS_CalcCRRegisters()
3374 GETBITSTR((SiS_Pr->CHBlankStart >> 3) - 1, 9:8, 5:4) | in SiS_CalcCRRegisters()
3375 GETBITSTR((SiS_Pr->CHSyncStart >> 3) + 3, 9:8, 7:6) ; in SiS_CalcCRRegisters()
3378 SiS_Pr->CCRT1CRTC[15] = /* SRC */ in SiS_CalcCRRegisters()
3379 GETBITSTR((SiS_Pr->CHBlankEnd >> 3) - 1, 7:6, 1:0) | in SiS_CalcCRRegisters()
3380 GETBITSTR((SiS_Pr->CHSyncEnd >> 3) + 3, 5:5, 2:2) ; in SiS_CalcCRRegisters()
3384 SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, in SiS_CalcLCDACRT1Timing() argument
3388 unsigned short VGAHDE = SiS_Pr->SiS_VGAHDE; in SiS_CalcLCDACRT1Timing()
3392 if(SiS_Pr->SiS_LCDInfo & LCDPass11) return; in SiS_CalcLCDACRT1Timing()
3394 modeflag = SiS_GetModeFlag(SiS_Pr, ModeNo, ModeIdIndex); in SiS_CalcLCDACRT1Timing()
3398 SiS_Pr->CHDisplay = VGAHDE; in SiS_CalcLCDACRT1Timing()
3399 SiS_Pr->CHBlankStart = VGAHDE; in SiS_CalcLCDACRT1Timing()
3401 SiS_Pr->CVDisplay = SiS_Pr->SiS_VGAVDE; in SiS_CalcLCDACRT1Timing()
3402 SiS_Pr->CVBlankStart = SiS_Pr->SiS_VGAVDE; in SiS_CalcLCDACRT1Timing()
3404 if(SiS_Pr->ChipType < SIS_315H) { in SiS_CalcLCDACRT1Timing()
3406 tempbx = SiS_Pr->SiS_VGAHT; in SiS_CalcLCDACRT1Timing()
3407 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcLCDACRT1Timing()
3408 tempbx = SiS_Pr->PanelHT; in SiS_CalcLCDACRT1Timing()
3416 tempbx = SiS_Pr->PanelHT - SiS_Pr->PanelXRes; in SiS_CalcLCDACRT1Timing()
3417 tempax = SiS_Pr->SiS_VGAHDE; /* not /2 ! */ in SiS_CalcLCDACRT1Timing()
3418 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcLCDACRT1Timing()
3419 tempax = SiS_Pr->PanelXRes; in SiS_CalcLCDACRT1Timing()
3425 SiS_Pr->CHTotal = SiS_Pr->CHBlankEnd = tempbx; in SiS_CalcLCDACRT1Timing()
3427 if(SiS_Pr->ChipType < SIS_315H) { in SiS_CalcLCDACRT1Timing()
3429 if(SiS_Pr->SiS_VGAHDE == SiS_Pr->PanelXRes) { in SiS_CalcLCDACRT1Timing()
3430 SiS_Pr->CHSyncStart = SiS_Pr->SiS_VGAHDE + ((SiS_Pr->PanelHRS + 1) & ~1); in SiS_CalcLCDACRT1Timing()
3431 SiS_Pr->CHSyncEnd = SiS_Pr->CHSyncStart + SiS_Pr->PanelHRE; in SiS_CalcLCDACRT1Timing()
3433 SiS_Pr->CHSyncStart >>= 1; in SiS_CalcLCDACRT1Timing()
3434 SiS_Pr->CHSyncEnd >>= 1; in SiS_CalcLCDACRT1Timing()
3436 } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcLCDACRT1Timing()
3437 tempax = (SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) >> 1; in SiS_CalcLCDACRT1Timing()
3438 tempbx = (SiS_Pr->PanelHRS + 1) & ~1; in SiS_CalcLCDACRT1Timing()
3443 SiS_Pr->CHSyncStart = (VGAHDE + tempax + tempbx + 7) & ~7; in SiS_CalcLCDACRT1Timing()
3444 tempax = SiS_Pr->PanelHRE + 7; in SiS_CalcLCDACRT1Timing()
3446 SiS_Pr->CHSyncEnd = (SiS_Pr->CHSyncStart + tempax) & ~7; in SiS_CalcLCDACRT1Timing()
3448 SiS_Pr->CHSyncStart = SiS_Pr->SiS_VGAHDE; in SiS_CalcLCDACRT1Timing()
3450 SiS_Pr->CHSyncStart >>= 1; in SiS_CalcLCDACRT1Timing()
3451 tempax = ((SiS_Pr->CHTotal - SiS_Pr->CHSyncStart) / 3) << 1; in SiS_CalcLCDACRT1Timing()
3452 SiS_Pr->CHSyncEnd = SiS_Pr->CHSyncStart + tempax; in SiS_CalcLCDACRT1Timing()
3454 SiS_Pr->CHSyncEnd = (SiS_Pr->CHSyncStart + (SiS_Pr->CHTotal / 10) + 7) & ~7; in SiS_CalcLCDACRT1Timing()
3455 SiS_Pr->CHSyncStart += 8; in SiS_CalcLCDACRT1Timing()
3462 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcLCDACRT1Timing()
3463 tempbx = SiS_Pr->PanelXRes; in SiS_CalcLCDACRT1Timing()
3467 tempax += SiS_Pr->PanelHRS; in SiS_CalcLCDACRT1Timing()
3468 SiS_Pr->CHSyncStart = tempax; in SiS_CalcLCDACRT1Timing()
3469 tempax += SiS_Pr->PanelHRE; in SiS_CalcLCDACRT1Timing()
3470 SiS_Pr->CHSyncEnd = tempax; in SiS_CalcLCDACRT1Timing()
3474 tempbx = SiS_Pr->PanelVT - SiS_Pr->PanelYRes; in SiS_CalcLCDACRT1Timing()
3475 tempax = SiS_Pr->SiS_VGAVDE; in SiS_CalcLCDACRT1Timing()
3476 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcLCDACRT1Timing()
3477 tempax = SiS_Pr->PanelYRes; in SiS_CalcLCDACRT1Timing()
3478 } else if(SiS_Pr->ChipType < SIS_315H) { in SiS_CalcLCDACRT1Timing()
3481 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) { in SiS_CalcLCDACRT1Timing()
3483 } else if((SiS_Pr->SiS_LCDResInfo == Panel_800x600) || in SiS_CalcLCDACRT1Timing()
3484 (SiS_Pr->SiS_LCDResInfo == Panel_1024x600)) { in SiS_CalcLCDACRT1Timing()
3486 tempbx = SiS_Pr->SiS_VGAVT; in SiS_CalcLCDACRT1Timing()
3490 SiS_Pr->CVTotal = SiS_Pr->CVBlankEnd = tempbx + tempax; in SiS_CalcLCDACRT1Timing()
3492 tempax = SiS_Pr->SiS_VGAVDE; in SiS_CalcLCDACRT1Timing()
3493 if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { in SiS_CalcLCDACRT1Timing()
3494 tempax += (SiS_Pr->PanelYRes - tempax) >> 1; in SiS_CalcLCDACRT1Timing()
3496 tempax += SiS_Pr->PanelVRS; in SiS_CalcLCDACRT1Timing()
3497 SiS_Pr->CVSyncStart = tempax; in SiS_CalcLCDACRT1Timing()
3498 tempax += SiS_Pr->PanelVRE; in SiS_CalcLCDACRT1Timing()
3499 SiS_Pr->CVSyncEnd = tempax; in SiS_CalcLCDACRT1Timing()
3500 if(SiS_Pr->ChipType < SIS_315H) { in SiS_CalcLCDACRT1Timing()
3501 SiS_Pr->CVSyncStart--; in SiS_CalcLCDACRT1Timing()
3502 SiS_Pr->CVSyncEnd--; in SiS_CalcLCDACRT1Timing()
3505 SiS_CalcCRRegisters(SiS_Pr, 8); in SiS_CalcLCDACRT1Timing()
3506 SiS_Pr->CCRT1CRTC[15] &= ~0xF8; in SiS_CalcLCDACRT1Timing()
3507 SiS_Pr->CCRT1CRTC[15] |= (remaining << 4); in SiS_CalcLCDACRT1Timing()
3508 SiS_Pr->CCRT1CRTC[16] &= ~0xE0; in SiS_CalcLCDACRT1Timing()
3510 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_CalcLCDACRT1Timing()
3513 SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]); in SiS_CalcLCDACRT1Timing()
3516 SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]); in SiS_CalcLCDACRT1Timing()
3519 SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]); in SiS_CalcLCDACRT1Timing()
3522 SiS_SetReg(SiS_Pr->SiS_P3c4,j,SiS_Pr->CCRT1CRTC[i]); in SiS_CalcLCDACRT1Timing()
3525 tempax = SiS_Pr->CCRT1CRTC[16] & 0xE0; in SiS_CalcLCDACRT1Timing()
3526 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1F,tempax); in SiS_CalcLCDACRT1Timing()
3528 tempax = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5; in SiS_CalcLCDACRT1Timing()
3530 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,tempax); in SiS_CalcLCDACRT1Timing()
3535 SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, in SiS_Generic_ConvertCRData() argument