Lines Matching +full:0 +full:x255
87 0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
88 0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
89 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
90 0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
91 0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
92 0x03,0x0a,0x65,0x9d /*0x8d*/,0x08,0x92,0x8f,0x40,
93 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53 /*0x50*/,
94 0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
97 0x33,0x06,0x06,0x09,0x0b,0x0c,0x0c,0x0c,
98 0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a,
99 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
100 0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4f,0x13,
101 0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8,
102 0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40,
103 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4e,
104 0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00
107 #if 0 /* OK, but sticks to left edge */
108 0x13,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c,
109 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
110 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
111 0xed,0x50,0x70,0x9f,0x16,0x59,0x21 /*0x2b*/,0x13,
112 0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0,
113 0x4b,0x4b,0x65 /*0x6f*/,0x2f,0x63,0x92,0x0f,0x40,
114 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27,
115 0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00
118 0x23,0x2d,0xe8,0x09,0x09,0xed,0x0c,0x0c,
119 0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
120 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
121 0xed,0x50,0x70,0x9f,0x16,0x59,0x60,0x13,
122 0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0,
123 0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40,
124 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x73,
125 0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00
132 0x21,0xED,0xBA,0x08, /* 0x00 SiS_NTSCPhase */
133 0x2A,0x05,0xE3,0x00, /* 0x01 SiS_PALPhase */
134 0x21,0xE4,0x2E,0x9B, /* 0x02 SiS_PALMPhase */
135 0x21,0xF4,0x3E,0xBA, /* 0x03 SiS_PALNPhase */
136 0x1E,0x8B,0xA2,0xA7,
137 0x1E,0x83,0x0A,0xE0, /* 0x05 SiS_SpecialPhaseM */
138 0x00,0x00,0x00,0x00,
139 0x00,0x00,0x00,0x00,
140 0x21,0xF0,0x7B,0xD6, /* 0x08 SiS_NTSCPhase2 */
141 0x2A,0x09,0x86,0xE9, /* 0x09 SiS_PALPhase2 */
142 0x21,0xE6,0xEF,0xA4, /* 0x0a SiS_PALMPhase2 */
143 0x21,0xF6,0x94,0x46, /* 0x0b SiS_PALNPhase2 */
144 0x1E,0x8B,0xA2,0xA7,
145 0x1E,0x83,0x0A,0xE0, /* 0x0d SiS_SpecialPhaseM */
146 0x00,0x00,0x00,0x00,
147 0x00,0x00,0x00,0x00,
148 0x1e,0x8c,0x5c,0x7a, /* 0x10 SiS_SpecialPhase */
149 0x25,0xd4,0xfd,0x5e /* 0x11 SiS_SpecialPhaseJ */
153 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13,
154 0xb1, 0x41, 0x62, 0x62, 0xff, 0xf4, 0x45, 0xa6,
155 0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
156 0xac, 0xda, 0x60, 0xfe, 0x6a, 0x9a, 0x06, 0x10,
157 0xd1, 0x04, 0x18, 0x0a, 0xff, 0x80, 0x00, 0x80,
158 0x3b, 0x77, 0x00, 0xef, 0xe0, 0x10, 0xb0, 0xe0,
159 0x10, 0x4f, 0x0f, 0x0f, 0x05, 0x0f, 0x08, 0x6e,
160 0x1a, 0x1f, 0x25, 0x2a, 0x4c, 0xaa, 0x01
164 0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a,
165 0x54, 0x41, 0xe7, 0xe7, 0xff, 0xf4, 0x45, 0xa6,
166 0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
167 0xac, 0x6a, 0x60, 0x2b, 0x52, 0xcd, 0x61, 0x10,
168 0x51, 0x04, 0x18, 0x0a, 0x1f, 0x80, 0x00, 0x80,
169 0xff, 0xa4, 0x04, 0x2b, 0x94, 0x21, 0x72, 0x94,
170 0x26, 0x05, 0x01, 0x0f, 0xed, 0x0f, 0x0a, 0x64,
171 0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
177 0x00,0x00,
178 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
179 0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C,
180 0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C,
181 0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E
185 0x00,0x00,
186 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
187 0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C,
188 0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C,
189 0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E
193 0xE0,0x01,
194 0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D,0x01,0x1A,0x08,0x7D,0x00,0x19,0x0A,0x7D,
195 0x7F,0x19,0x0C,0x7C,0x7E,0x18,0x0E,0x7C,0x7E,0x17,0x10,0x7B,0x7D,0x15,0x12,0x7C,
196 0x7D,0x13,0x13,0x7D,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0E,0x18,0x7E,
197 0x7D,0x0C,0x19,0x7E,0x7D,0x0A,0x19,0x00,0x7D,0x08,0x1A,0x01,0x7E,0x06,0x1A,0x02,
198 0x58,0x02,
199 0x07,0x14,0x07,0x7E,0x06,0x14,0x09,0x7D,0x05,0x14,0x0A,0x7D,0x04,0x13,0x0B,0x7E,
200 0x03,0x13,0x0C,0x7E,0x02,0x12,0x0D,0x7F,0x01,0x12,0x0E,0x7F,0x01,0x11,0x0F,0x7F,
201 0x00,0x10,0x10,0x00,0x7F,0x0F,0x11,0x01,0x7F,0x0E,0x12,0x01,0x7E,0x0D,0x12,0x03,
202 0x7E,0x0C,0x13,0x03,0x7E,0x0B,0x13,0x04,0x7E,0x0A,0x14,0x04,0x7D,0x09,0x14,0x06,
203 0x00,0x03,
204 0x09,0x0F,0x09,0x7F,0x08,0x0F,0x09,0x00,0x07,0x0F,0x0A,0x00,0x06,0x0F,0x0A,0x01,
205 0x06,0x0E,0x0B,0x01,0x05,0x0E,0x0B,0x02,0x04,0x0E,0x0C,0x02,0x04,0x0D,0x0C,0x03,
206 0x03,0x0D,0x0D,0x03,0x02,0x0C,0x0D,0x05,0x02,0x0C,0x0E,0x04,0x01,0x0B,0x0E,0x06,
207 0x01,0x0B,0x0E,0x06,0x00,0x0A,0x0F,0x07,0x00,0x0A,0x0F,0x07,0x00,0x09,0x0F,0x08,
208 0xFF,0xFF
212 0x58,0x02,
213 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D,
214 0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D,
215 0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E,
216 0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04,
217 0x00,0x03,
218 0x08,0x12,0x08,0x7E,0x07,0x12,0x09,0x7E,0x06,0x12,0x0A,0x7E,0x05,0x11,0x0B,0x7F,
219 0x04,0x11,0x0C,0x7F,0x03,0x11,0x0C,0x00,0x03,0x10,0x0D,0x00,0x02,0x0F,0x0E,0x01,
220 0x01,0x0F,0x0F,0x01,0x01,0x0E,0x0F,0x02,0x00,0x0D,0x10,0x03,0x7F,0x0C,0x11,0x04,
221 0x7F,0x0C,0x11,0x04,0x7F,0x0B,0x11,0x05,0x7E,0x0A,0x12,0x06,0x7E,0x09,0x12,0x07,
222 0x40,0x02,
223 0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
224 0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
225 0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F,
226 0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
227 0xFF,0xFF
231 0x00,0x03,
232 0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D,
233 0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D,
234 0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E,
235 0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04,
236 0xFF,0xFF
240 0x00,0x04,
241 0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
242 0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
243 0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F,
244 0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
245 0xFF,0xFF,
252 0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88,
253 0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04,
257 0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70,
258 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x08,
260 0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38,
261 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09,
263 0x0B,0xE0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0,
264 0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0A,
266 0x0A,0xE0,0x00,0x05,0x00,0x03,0x7C,0x06,0x26,0x03,0x30,0x00,0x70,
267 0x00,0x03,0x00,0x06,0x00,0x4D,0xC8,0x48,0x00,0x00,0x00,0x00,0x06,
269 0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x20,
270 0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05,
272 0x0C,0xE0,0x00,0x05,0x20,0x03,0x10,0x06,0x2C,0x03,0x30,0x00,0x70,
273 0x00,0x04,0x00,0x03,0x00,0x49,0xCE,0x1E,0x00,0x00,0x00,0x00,0x09,
275 0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C,
276 0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06,
278 0x0C,0xE0,0x00,0x05,0x20,0x03,0xAA,0x05,0x2E,0x03,0x30,0x00,0x50,
279 0x00,0x04,0x00,0x03,0x00,0x47,0xA9,0x10,0x00,0x00,0x00,0x00,0x07,
281 0x01,0xC0,0x20,0x03,0x58,0x02,0x20,0x04,0x74,0x02,0x2A,0x00,0x80,
282 0x00,0x06,0x00,0x04,0x00,0x28,0x63,0x4B,0x00,0x00,0x00,0x00,0x00,
284 0x08,0xE0,0x00,0x05,0x56,0x03,0x80,0x06,0x5d,0x03,0x10,0x00,0x70,
285 0x00,0x01,0x00,0x03,0x00,0x54,0x75,0x13,0x00,0x00,0x00,0x00,0x08
291 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
292 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23,
293 0x00,0x00,0x03,0x28,0x03,0x10,0x05,0x08,0x40,0x10,0x00,0x10,0x04,0x23,0x00,0x23,
294 0x03,0x11,0x60,0xBC,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x09,0x04,0x04,0x05,
295 0x04,0x0C,0x09,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5A,0x01,0xBE,0x01,0x00 },
296 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x27,0x00,0x80,0x02,
297 0x20,0x03,0x07,0x00,0x5E,0x01,0x0D,0x02,0x60,0x0C,0x30,0x11,0x00,0x00,0x04,0x23,
298 0x00,0x00,0x03,0x80,0x03,0x28,0x06,0x08,0x40,0x11,0x00,0x11,0x04,0x23,0x00,0x23,
299 0x03,0x11,0x60,0x90,0x01,0xFF,0x0F,0xF4,0x19,0x01,0x00,0x05,0x01,0x00,0x04,0x05,
300 0x04,0x0C,0x02,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEC,0x57,0x01,0xBE,0x01,0x00 },
301 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02,
302 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
303 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
304 0x03,0x11,0x60,0xD9,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
305 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x59,0x01,0xBE,0x01,0x00 },
306 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02,
307 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
308 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
309 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
310 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
311 { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
312 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23,
313 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23,
314 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05,
315 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
316 { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03,
317 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D,
318 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D,
319 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B,
320 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
321 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04,
322 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23,
323 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23,
324 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01,
325 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
327 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
328 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23,
329 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23,
330 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05,
331 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
332 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
333 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23,
334 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23,
335 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05,
336 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
337 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02,
338 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
339 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
340 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
341 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
342 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02,
343 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
344 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
345 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
346 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
347 { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
348 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23,
349 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23,
350 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05,
351 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 },
352 { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03,
353 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D,
354 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D,
355 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B,
356 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 },
357 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04,
358 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23,
359 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23,
360 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01,
361 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 }
423 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_UnLockCRT2()
425 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); in SiS_UnLockCRT2()
435 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE); in SiS_LockCRT2()
437 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE); in SiS_LockCRT2()
448 DataAND &= 0x0f; in SiS_SetRegSR11ANDOR()
449 DataOR &= 0x0f; in SiS_SetRegSR11ANDOR()
451 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR); in SiS_SetRegSR11ANDOR()
464 unsigned short romindex = 0, reg = 0, idx = 0; in GetLCDStructPtr661()
476 if(SiS_Pr->ChipType < SIS_661) reg = 0x3c; in GetLCDStructPtr661()
477 else reg = 0x7d; in GetLCDStructPtr661()
479 idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26; in GetLCDStructPtr661()
484 romindex = SISGETROMW(0x100); in GetLCDStructPtr661()
497 unsigned short romptr = 0; in GetLCDStructPtr661_2()
508 romptr = SISGETROMW(0x102); in GetLCDStructPtr661_2()
509 romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize); in GetLCDStructPtr661_2()
524 unsigned short checkmask=0, modeid, infoflag; in SiS_AdjustCRT2Rate()
549 if(modeid == 0x2e) checkmask |= Support64048060Hz; in SiS_AdjustCRT2Rate()
574 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_AdjustCRT2Rate()
590 if((*i) == 0) break; in SiS_AdjustCRT2Rate()
596 for((*i) = 0; ; (*i)++) { in SiS_AdjustCRT2Rate()
614 0x00, 0x00, 0x01, 0x01, in SiS_GetRatePtr()
615 0x01, 0x01, 0x01, 0x01, in SiS_GetRatePtr()
616 0x01, 0x01, 0x01, 0x01, in SiS_GetRatePtr()
617 0x01, 0x01, 0x01, 0x01, in SiS_GetRatePtr()
618 0x00, 0x00, 0x00, 0x00 in SiS_GetRatePtr()
622 if(ModeNo == 0xfe) return 0; in SiS_GetRatePtr()
624 if(ModeNo <= 0x13) { in SiS_GetRatePtr()
630 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
632 if(modeflag & HalfDCLK) return 0; in SiS_GetRatePtr()
636 if(ModeNo < 0x14) return 0xFFFF; in SiS_GetRatePtr()
638 index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; in SiS_GetRatePtr()
641 if(index > 0) index--; in SiS_GetRatePtr()
646 if(SiS_Pr->SiS_VBType & VB_NoLCD) index = 0; in SiS_GetRatePtr()
647 else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0; in SiS_GetRatePtr()
656 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0; in SiS_GetRatePtr()
657 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
658 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0; in SiS_GetRatePtr()
668 if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) || in SiS_GetRatePtr()
669 (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) { in SiS_GetRatePtr()
675 i = 0; in SiS_GetRatePtr()
683 } while(index != 0xFFFF); in SiS_GetRatePtr()
714 SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo); in SiS_SaveCRT2Info()
717 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1); in SiS_SaveCRT2Info()
732 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_CR36BIOSWord23b()
733 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23b()
734 temp1 = SISGETROMW(0x23b); in SiS_CR36BIOSWord23b()
748 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_CR36BIOSWord23d()
749 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23d()
750 temp1 = SISGETROMW(0x23d); in SiS_CR36BIOSWord23d()
765 while (delaytime-- > 0) in SiS_DDC2Delay()
766 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); in SiS_DDC2Delay()
802 unsigned short PanelID, DelayIndex, Delay=0; in SiS_PanelDelay()
809 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
811 if(SiS_Pr->SiS_VBType & VB_SIS301) PanelID &= 0xf7; in SiS_PanelDelay()
812 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
815 if((DelayTime >= 2) && ((PanelID & 0x0f) == 1)) { in SiS_PanelDelay()
819 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
820 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
825 if(ROMAddr[0x220] & 0x40) { in SiS_PanelDelay()
826 if(!(DelayTime & 0x01)) Delay = (unsigned short)ROMAddr[0x225]; in SiS_PanelDelay()
827 else Delay = (unsigned short)ROMAddr[0x226]; in SiS_PanelDelay()
844 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
845 SiS_DDC2Delay(SiS_Pr, 0x1000); in SiS_PanelDelay()
847 SiS_DDC2Delay(SiS_Pr, 0x4000); in SiS_PanelDelay()
852 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_PanelDelay()
853 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
855 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
858 DelayIndex = PanelID & 0x0f; in SiS_PanelDelay()
862 if((DelayTime >= 2) && ((PanelID & 0x0f) == 1)) { in SiS_PanelDelay()
866 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
867 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0]; in SiS_PanelDelay()
872 if(ROMAddr[0x13c] & 0x40) { in SiS_PanelDelay()
873 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
874 Delay = (unsigned short)ROMAddr[0x17e]; in SiS_PanelDelay()
876 Delay = (unsigned short)ROMAddr[0x17f]; in SiS_PanelDelay()
886 DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_PanelDelay()
887 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
888 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
907 for(i = 0; i < DelayLoop; i++) { in SiS_PanelDelayLoop()
922 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return; in SiS_WaitRetrace1()
923 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return; in SiS_WaitRetrace1()
926 while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog); in SiS_WaitRetrace1()
928 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); in SiS_WaitRetrace1()
938 while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog); in SiS_WaitRetrace2()
940 while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog); in SiS_WaitRetrace2()
950 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; in SiS_WaitVBRetrace()
952 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) { in SiS_WaitVBRetrace()
955 SiS_WaitRetrace2(SiS_Pr, 0x25); in SiS_WaitVBRetrace()
960 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { in SiS_WaitVBRetrace()
963 SiS_WaitRetrace2(SiS_Pr, 0x30); in SiS_WaitVBRetrace()
974 temp = 0; in SiS_VBWait()
975 for(i = 0; i < 3; i++) { in SiS_VBWait()
976 for(j = 0; j < 100; j++) { in SiS_VBWait()
978 if(temp & 0x01) { in SiS_VBWait()
979 if((tempal & 0x08)) continue; in SiS_VBWait()
982 if(!(tempal & 0x08)) continue; in SiS_VBWait()
986 temp ^= 0x01; in SiS_VBWait()
1008 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return true; in SiS_Is301B()
1017 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return true; in SiS_CRT2IsLCD()
1019 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return true; in SiS_CRT2IsLCD()
1028 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { in SiS_IsDualEdge()
1029 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; in SiS_IsDualEdge()
1043 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsVAMode()
1078 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return true; in SiS_TVEnabled()
1080 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return true; in SiS_TVEnabled()
1090 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return true; in SiS_LCDAEnabled()
1100 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return true; in SiS_WeHaveBacklightCtrl()
1113 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; in SiS_IsNotM650orLater()
1115 if((flag == 0xe0) || (flag == 0xc0) || in SiS_IsNotM650orLater()
1116 (flag == 0xb0) || (flag == 0x90)) return false; in SiS_IsNotM650orLater()
1127 /* YPrPb = 0x08 */ in SiS_IsYPbPr()
1128 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return true; in SiS_IsYPbPr()
1139 /* Scart = 0x04 */ in SiS_IsChScart()
1140 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return true; in SiS_IsChScart()
1153 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1155 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsTVOrYPbPrOrScart()
1156 if(flag & EnableCHYPbPr) return true; /* = YPrPb = 0x08 */ in SiS_IsTVOrYPbPrOrScart()
1157 if(flag & EnableCHScart) return true; /* = Scart = 0x04 - TW */ in SiS_IsTVOrYPbPrOrScart()
1159 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1173 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1175 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsLCDOrLCDA()
1178 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1193 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiS_HaveBridge()
1205 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_BridgeIsEnabled()
1207 flag &= 0xa0; in SiS_BridgeIsEnabled()
1208 if((flag == 0x80) || (flag == 0x20)) return true; in SiS_BridgeIsEnabled()
1210 flag &= 0x50; in SiS_BridgeIsEnabled()
1211 if((flag == 0x40) || (flag == 0x10)) return true; in SiS_BridgeIsEnabled()
1222 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); in SiS_BridgeInSlavemode()
1241 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); in SiS_SetChrontelGPIO()
1242 acpibase &= 0xFFFF; in SiS_SetChrontelGPIO()
1244 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ in SiS_SetChrontelGPIO()
1245 temp &= 0xFEFF; in SiS_SetChrontelGPIO()
1246 SiS_SetRegShort((acpibase + 0x3c), temp); in SiS_SetChrontelGPIO()
1247 temp = SiS_GetRegShort((acpibase + 0x3c)); in SiS_SetChrontelGPIO()
1248 temp = SiS_GetRegShort((acpibase + 0x3a)); /* ACPI register 0x3a: GP Pin Level (low/high) */ in SiS_SetChrontelGPIO()
1249 temp &= 0xFEFF; in SiS_SetChrontelGPIO()
1250 if(!(myvbinfo & SetCRT2ToTV)) temp |= 0x0100; in SiS_SetChrontelGPIO()
1251 SiS_SetRegShort((acpibase + 0x3a), temp); in SiS_SetChrontelGPIO()
1252 temp = SiS_GetRegShort((acpibase + 0x3a)); in SiS_SetChrontelGPIO()
1261 unsigned short modeflag, resinfo = 0; in SiS_GetVBInfo()
1263 SiS_Pr->SiS_SetFlag = 0; in SiS_GetVBInfo()
1269 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetVBInfo()
1273 tempbx = 0; in SiS_GetVBInfo()
1277 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_GetVBInfo()
1279 tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8; in SiS_GetVBInfo()
1286 if(ModeNo == 0x03) { in SiS_GetVBInfo()
1287 /* Mode 0x03 is never in driver mode */ in SiS_GetVBInfo()
1288 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf); in SiS_GetVBInfo()
1290 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) { in SiS_GetVBInfo()
1292 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); in SiS_GetVBInfo()
1296 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) { in SiS_GetVBInfo()
1297 if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) { in SiS_GetVBInfo()
1298 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA)); in SiS_GetVBInfo()
1303 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1311 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & 0x04) { in SiS_GetVBInfo()
1312 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; in SiS_GetVBInfo()
1313 if(temp == 0x60) tempbx |= SetCRT2ToHiVision; in SiS_GetVBInfo()
1321 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1325 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1350 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1362 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1372 tempbx = 0; in SiS_GetVBInfo()
1397 tempbx &= (0xFF00|SwitchCRT2|SetSimuScanMode); in SiS_GetVBInfo()
1400 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1402 tempbx &= (0xFF00|SetCRT2ToTV|SwitchCRT2|SetSimuScanMode); in SiS_GetVBInfo()
1406 tempbx &= (0xFF00|SetCRT2ToLCD|SwitchCRT2|SetSimuScanMode); in SiS_GetVBInfo()
1474 #if 0 in SiS_GetVBInfo()
1475 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n", in SiS_GetVBInfo()
1498 SiS_Pr->SiS_YPbPr = 0; in SiS_SetYPbPr()
1509 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetYPbPr()
1510 if(temp & 0x08) { in SiS_SetYPbPr()
1512 case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i; break; in SiS_SetYPbPr()
1513 case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p; break; in SiS_SetYPbPr()
1514 case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p; break; in SiS_SetYPbPr()
1515 case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break; in SiS_SetYPbPr()
1531 unsigned short temp, temp1, resinfo = 0, romindex = 0; in SiS_SetTVMode()
1534 SiS_Pr->SiS_TVMode = 0; in SiS_SetTVMode()
1539 if(ModeNo > 0x13) { in SiS_SetTVMode()
1548 temp = 0; in SiS_SetTVMode()
1551 temp = 0x35; in SiS_SetTVMode()
1552 romindex = 0xfe; in SiS_SetTVMode()
1554 temp = 0x38; in SiS_SetTVMode()
1556 romindex = 0xf3; in SiS_SetTVMode()
1557 if(SiS_Pr->ChipType >= SIS_330) romindex = 0x11b; in SiS_SetTVMode()
1564 SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F); in SiS_SetTVMode()
1569 if(temp1 & EnablePALM) { /* 0x40 */ in SiS_SetTVMode()
1572 } else if(temp1 & EnablePALN) { /* 0x80 */ in SiS_SetTVMode()
1576 if(temp1 & EnableNTSCJ) { /* 0x40 */ in SiS_SetTVMode()
1594 } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetTVMode()
1597 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1602 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79); in SiS_SetTVMode()
1603 if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1612 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetTVMode()
1626 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1627 if(temp1 & 0x01) { in SiS_SetTVMode()
1629 if(temp1 & 0x08) { in SiS_SetTVMode()
1631 } else if(temp1 & 0x04) { in SiS_SetTVMode()
1638 if(temp1 & 0x02) { in SiS_SetTVMode()
1644 if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1651 temp1 &= 0xe0; in SiS_SetTVMode()
1652 if(temp1 == 0x00) SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1653 else if(temp1 == 0x20) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1654 else if(temp1 == 0x40) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1662 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39); in SiS_SetTVMode()
1663 if(temp1 & 0x02) { in SiS_SetTVMode()
1776 int i = 0; in SiS_CheckScaling()
1777 while(nonscalingmodes[i] != 0xff) { in SiS_CheckScaling()
1791 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; in SiS_GetLCDResInfo()
1796 { 0, 1, 2, 3, 7, 4, 5, 8, in SiS_GetLCDResInfo()
1797 0, 0, 10, 0, 0, 0, 0, 15 }; in SiS_GetLCDResInfo()
1803 SiS_Pr->SiS_LCDResInfo = 0; in SiS_GetLCDResInfo()
1804 SiS_Pr->SiS_LCDTypeInfo = 0; in SiS_GetLCDResInfo()
1805 SiS_Pr->SiS_LCDInfo = 0; in SiS_GetLCDResInfo()
1819 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetLCDResInfo()
1825 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_GetLCDResInfo()
1828 if(temp == 0) temp = 0x02; in SiS_GetLCDResInfo()
1831 SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; in SiS_GetLCDResInfo()
1835 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; in SiS_GetLCDResInfo()
1837 temp &= 0x0f; in SiS_GetLCDResInfo()
1842 if(temp < 0x0f) temp &= 0x07; in SiS_GetLCDResInfo()
1893 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_GetLCDResInfo()
1894 SiS_Pr->SiS_LCDInfo = temp & ~0x000e; in SiS_GetLCDResInfo()
1918 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1922 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1924 if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1929 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1933 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_GetLCDResInfo()
1934 if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; in SiS_GetLCDResInfo()
1936 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
2208 SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, 0xff in SiS_GetLCDResInfo()
2217 0xff in SiS_GetLCDResInfo()
2226 0xff in SiS_GetLCDResInfo()
2238 SIS_RI_1152x768,0xff in SiS_GetLCDResInfo()
2253 SIS_RI_1152x768,SIS_RI_1280x720,SIS_RI_1280x768,0xff in SiS_GetLCDResInfo()
2262 SIS_RI_1152x768,0xff in SiS_GetLCDResInfo()
2278 SIS_RI_1152x768,0xff in SiS_GetLCDResInfo()
2296 SIS_RI_1280x854,0xff in SiS_GetLCDResInfo()
2306 SIS_RI_1280x854,SIS_RI_1280x960,0xff in SiS_GetLCDResInfo()
2316 SIS_RI_1280x960,0xff in SiS_GetLCDResInfo()
2334 SIS_RI_1280x854,SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,0xff in SiS_GetLCDResInfo()
2344 SIS_RI_1360x1024,0xff in SiS_GetLCDResInfo()
2355 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ in SiS_GetLCDResInfo()
2362 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_GetLCDResInfo()
2363 if(!(ROMAddr[0x235] & 0x02)) { in SiS_GetLCDResInfo()
2369 if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) { in SiS_GetLCDResInfo()
2418 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { in SiS_GetLCDResInfo()
2419 if(ModeNo == 0x12) { in SiS_GetLCDResInfo()
2423 } else if(ModeNo > 0x13) { in SiS_GetLCDResInfo()
2442 } else if(ModeNo > 0x13) { in SiS_GetLCDResInfo()
2462 #if 0 in SiS_GetLCDResInfo()
2463 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n", in SiS_GetLCDResInfo()
2476 unsigned short CRT2Index, VCLKIndex = 0, VCLKIndexGEN = 0, VCLKIndexGENCRT = 0; in SiS_GetVCLK2Ptr()
2480 if(ModeNo <= 0x13) { in SiS_GetVCLK2Ptr()
2483 VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03; in SiS_GetVCLK2Ptr()
2523 if(ModeNo <= 0x13) { in SiS_GetVCLK2Ptr()
2525 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42; in SiS_GetVCLK2Ptr()
2527 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00; in SiS_GetVCLK2Ptr()
2531 if(VCLKIndex == 0) VCLKIndex = 0x41; in SiS_GetVCLK2Ptr()
2532 if(VCLKIndex == 1) VCLKIndex = 0x43; in SiS_GetVCLK2Ptr()
2533 if(VCLKIndex == 4) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2556 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2558 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_GetVCLK2Ptr()
2559 if(VCLKIndex == 0x14) VCLKIndex = 0x34; in SiS_GetVCLK2Ptr()
2562 if(VCLKIndex == 0x17) VCLKIndex = 0x45; in SiS_GetVCLK2Ptr()
2571 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2574 if(VCLKIndex == 0x1b) VCLKIndex = 0x48; in SiS_GetVCLK2Ptr()
2586 if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) { in SiS_GetVCLK2Ptr()
2588 VCLKIndex &= 0x1f; in SiS_GetVCLK2Ptr()
2589 tempbx = 0; in SiS_GetVCLK2Ptr()
2605 case 0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC; break; in SiS_GetVCLK2Ptr()
2628 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2646 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2648 (SiS_Pr->ChipRevision >= 0x30) ) { in SiS_GetVCLK2Ptr()
2649 if(VCLKIndex == 0x14) VCLKIndex = 0x2e; in SiS_GetVCLK2Ptr()
2659 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2662 if(VCLKIndex == 0x1b) VCLKIndex = 0x48; in SiS_GetVCLK2Ptr()
2664 #if 0 in SiS_GetVCLK2Ptr()
2666 if(VCLKIndex == 0x0b) VCLKIndex = 0x40; /* 1024x768-70 */ in SiS_GetVCLK2Ptr()
2667 if(VCLKIndex == 0x0d) VCLKIndex = 0x41; /* 1024x768-75 */ in SiS_GetVCLK2Ptr()
2687 unsigned short i, j, modeflag, tempah=0; in SiS_SetCRT2ModeRegs()
2701 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); in SiS_SetCRT2ModeRegs()
2702 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7); in SiS_SetCRT2ModeRegs()
2706 for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0); in SiS_SetCRT2ModeRegs()
2708 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F); in SiS_SetCRT2ModeRegs()
2719 tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32); in SiS_SetCRT2ModeRegs()
2720 tempbl &= 0xef; in SiS_SetCRT2ModeRegs()
2721 tempbl |= 0x02; in SiS_SetCRT2ModeRegs()
2723 tempbl |= 0x10; in SiS_SetCRT2ModeRegs()
2724 tempbl &= 0xfd; in SiS_SetCRT2ModeRegs()
2726 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl); in SiS_SetCRT2ModeRegs()
2729 if(ModeNo > 0x13) { in SiS_SetCRT2ModeRegs()
2731 if(tempcl >= 0) { in SiS_SetCRT2ModeRegs()
2732 tempah = ((0x10 >> tempcl) | 0x80); in SiS_SetCRT2ModeRegs()
2734 } else tempah = 0x80; in SiS_SetCRT2ModeRegs()
2736 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; in SiS_SetCRT2ModeRegs()
2744 if(ModeNo > 0x13) { in SiS_SetCRT2ModeRegs()
2746 if(tempcl >= 0) { in SiS_SetCRT2ModeRegs()
2747 tempah = (0x08 >> tempcl); in SiS_SetCRT2ModeRegs()
2748 if (tempah == 0) tempah = 1; in SiS_SetCRT2ModeRegs()
2749 tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2751 } else tempah = 0x40; in SiS_SetCRT2ModeRegs()
2753 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; in SiS_SetCRT2ModeRegs()
2759 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2762 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2766 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2769 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2771 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2779 tempah = 0x01; in SiS_SetCRT2ModeRegs()
2781 tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2784 tempah ^= 0x05; in SiS_SetCRT2ModeRegs()
2786 tempah ^= 0x01; in SiS_SetCRT2ModeRegs()
2792 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2794 tempah = (tempah << 5) & 0xFF; in SiS_SetCRT2ModeRegs()
2795 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2796 tempah = (tempah >> 5) & 0xFF; in SiS_SetCRT2ModeRegs()
2800 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x08; in SiS_SetCRT2ModeRegs()
2801 else if(!(SiS_IsDualEdge(SiS_Pr))) tempah |= 0x08; in SiS_SetCRT2ModeRegs()
2802 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2803 tempah &= ~0x08; in SiS_SetCRT2ModeRegs()
2808 tempah |= 0x10; in SiS_SetCRT2ModeRegs()
2811 tempah |= 0x80; in SiS_SetCRT2ModeRegs()
2813 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah &= ~0x80; in SiS_SetCRT2ModeRegs()
2819 tempah |= 0x20; in SiS_SetCRT2ModeRegs()
2824 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah); in SiS_SetCRT2ModeRegs()
2826 tempah = 0x80; in SiS_SetCRT2ModeRegs()
2828 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah = 0; in SiS_SetCRT2ModeRegs()
2831 if(SiS_IsDualLink(SiS_Pr)) tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2835 tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2839 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah); in SiS_SetCRT2ModeRegs()
2847 tempah = 0x80; in SiS_SetCRT2ModeRegs()
2850 tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2854 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2856 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah ^= 0x01; in SiS_SetCRT2ModeRegs()
2860 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2866 tempah = 0; in SiS_SetCRT2ModeRegs()
2868 tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2872 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2874 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2888 /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ in SiS_SetCRT2ModeRegs()
2902 tempah = 0x04; /* For all bridges */ in SiS_SetCRT2ModeRegs()
2903 tempbl = 0xfb; in SiS_SetCRT2ModeRegs()
2905 tempah = 0x00; in SiS_SetCRT2ModeRegs()
2907 tempbl = 0xff; in SiS_SetCRT2ModeRegs()
2910 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2915 * b0 was found in some 651 machine (Pim; P4_23=0xe5); the b1 version in SiS_SetCRT2ModeRegs()
2923 tempah = 0x30; in SiS_SetCRT2ModeRegs()
2924 tempbl = 0xc0; in SiS_SetCRT2ModeRegs()
2926 ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) { in SiS_SetCRT2ModeRegs()
2927 tempah = 0x00; in SiS_SetCRT2ModeRegs()
2928 tempbl = 0x00; in SiS_SetCRT2ModeRegs()
2930 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah); in SiS_SetCRT2ModeRegs()
2931 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl); in SiS_SetCRT2ModeRegs()
2934 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf); /* For 301 */ in SiS_SetCRT2ModeRegs()
2935 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2937 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xLV */ in SiS_SetCRT2ModeRegs()
2938 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); in SiS_SetCRT2ModeRegs()
2940 tempah = 0x30; tempah2 = 0xc0; in SiS_SetCRT2ModeRegs()
2941 tempbl = 0xcf; tempbl2 = 0x3f; in SiS_SetCRT2ModeRegs()
2942 if(SiS_Pr->SiS_TVBlue == 0) { in SiS_SetCRT2ModeRegs()
2943 tempah = tempah2 = 0x00; in SiS_SetCRT2ModeRegs()
2946 if(!(IS_SIS65x)) /* (bridgerev != 0xb0) */ { in SiS_SetCRT2ModeRegs()
2947 tempah = tempah2 = 0x00; in SiS_SetCRT2ModeRegs()
2950 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2951 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2953 tempah = 0x30; tempah2 = 0xc0; /* For 30xB, 301C */ in SiS_SetCRT2ModeRegs()
2954 tempbl = 0xcf; tempbl2 = 0x3f; in SiS_SetCRT2ModeRegs()
2956 tempah = tempah2 = 0x00; in SiS_SetCRT2ModeRegs()
2958 tempbl = tempbl2 = 0xff; in SiS_SetCRT2ModeRegs()
2961 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2962 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2966 tempah = 0x80; in SiS_SetCRT2ModeRegs()
2967 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00; in SiS_SetCRT2ModeRegs()
2968 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah); in SiS_SetCRT2ModeRegs()
2970 tempah = 0x00; in SiS_SetCRT2ModeRegs()
2971 tempbl = 0x7f; in SiS_SetCRT2ModeRegs()
2973 tempbl = 0xff; in SiS_SetCRT2ModeRegs()
2974 if(!(SiS_IsDualEdge(SiS_Pr))) tempah = 0x80; in SiS_SetCRT2ModeRegs()
2976 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2984 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2989 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F); in SiS_SetCRT2ModeRegs()
2991 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80); in SiS_SetCRT2ModeRegs()
2998 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x0D,0x80); in SiS_SetCRT2ModeRegs()
3000 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3A,0xC0); in SiS_SetCRT2ModeRegs()
3009 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2ModeRegs()
3011 tempah = 0x04; in SiS_SetCRT2ModeRegs()
3012 tempbl = 0xfb; in SiS_SetCRT2ModeRegs()
3014 tempah = 0x00; in SiS_SetCRT2ModeRegs()
3015 if(SiS_IsDualEdge(SiS_Pr)) tempbl = 0xff; in SiS_SetCRT2ModeRegs()
3017 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
3020 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3023 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3027 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3028 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3046 if(ModeNo <= 0x13) in SiS_GetResInfo()
3055 unsigned short xres, yres, modeflag=0, resindex; in SiS_GetCRT2ResInfo()
3068 if(ModeNo <= 0x13) { in SiS_GetCRT2ResInfo()
3080 if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetCRT2ResInfo()
3083 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) { in SiS_GetCRT2ResInfo()
3084 if(ModeNo == 0x12) yres = 400; in SiS_GetCRT2ResInfo()
3135 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3137 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3156 unsigned short tempbx=0, tempal=0, resinfo=0; in SiS_GetCRT2Ptr()
3158 if(ModeNo <= 0x13) { in SiS_GetCRT2Ptr()
3165 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) { in SiS_GetCRT2Ptr()
3187 if(ModeNo >= 0x13) { in SiS_GetCRT2Ptr()
3225 tempal &= 0x3F; in SiS_GetCRT2Ptr()
3227 if(ModeNo > 0x13) { in SiS_GetCRT2Ptr()
3266 tempbx = 0; in SiS_GetCRT2Ptr()
3327 (*ResIndex) = tempal & 0x1F; in SiS_GetCRT2Ptr()
3335 unsigned short tempax=0, tempbx=0, index, dotclock; in SiS_GetRAMDAC2DATA()
3336 unsigned short temp1=0, modeflag=0, tempcx=0; in SiS_GetRAMDAC2DATA()
3341 if(ModeNo <= 0x13) { in SiS_GetRAMDAC2DATA()
3346 tempax = SiS_Pr->SiS_StandTable[index].CRTC[0]; in SiS_GetRAMDAC2DATA()
3357 tempax = SiS_Pr->SiS_CRT1Table[index].CR[0]; in SiS_GetRAMDAC2DATA()
3359 tempax &= 0x03FF; in SiS_GetRAMDAC2DATA()
3362 tempcx &= 0x0100; in SiS_GetRAMDAC2DATA()
3371 if(temp1 & 0x01) tempbx |= 0x0100; in SiS_GetRAMDAC2DATA()
3372 if(temp1 & 0x20) tempbx |= 0x0200; in SiS_GetRAMDAC2DATA()
3398 if(ModeNo < 0x13) { in SiS_CalcPanelLinkTiming()
3403 if(ResIndex == 0x09) { in SiS_CalcPanelLinkTiming()
3404 if(SiS_Pr->Alternate1600x1200) ResIndex = 0x20; /* 1600x1200 LCDA */ in SiS_CalcPanelLinkTiming()
3405 else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) ResIndex = 0x21; /* 1600x1200 LVDS */ in SiS_CalcPanelLinkTiming()
3439 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2DataLVDS()
3441 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2DataLVDS()
3442 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2DataLVDS()
3443 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2DataLVDS()
3444 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2DataLVDS()
3445 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2DataLVDS()
3511 if(ResIndex < 0x08) { in SiS_GetCRT2DataLVDS()
3527 unsigned short tempax, tempbx, modeflag, romptr=0; in SiS_GetCRT2Data301()
3535 if(ModeNo <= 0x13) { in SiS_GetCRT2Data301()
3540 resinfo = 0; in SiS_GetCRT2Data301()
3548 (resinfo661 >= 0) && in SiS_GetCRT2Data301()
3560 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2Data301()
3562 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2Data301()
3563 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2Data301()
3564 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2Data301()
3565 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2Data301()
3566 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3618 SiS_Pr->SiS_RVBHRS2 = (TVPtr+ResIndex)->RVBHRS2 & 0x0fff; in SiS_GetCRT2Data301()
3623 tempax = ((TVPtr+ResIndex)->RVBHRS2 >> 12) & 0x07; in SiS_GetCRT2Data301()
3624 if((TVPtr+ResIndex)->RVBHRS2 & 0x8000) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3638 SiS_Pr->SiS_NewFlickerMode = 0x40; in SiS_GetCRT2Data301()
3675 SiS_Pr->SiS_RY1COE = 0x00; in SiS_GetCRT2Data301()
3676 SiS_Pr->SiS_RY2COE = 0xf4; in SiS_GetCRT2Data301()
3677 SiS_Pr->SiS_RY3COE = 0x10; in SiS_GetCRT2Data301()
3678 SiS_Pr->SiS_RY4COE = 0x38; in SiS_GetCRT2Data301()
3724 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); in SiS_GetCRT2Data301()
3725 SiS_Pr->SiS_VGAVT = (ROMAddr[romptr+4] << 4) | ((ROMAddr[romptr+3] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3726 SiS_Pr->SiS_HT = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8); in SiS_GetCRT2Data301()
3727 SiS_Pr->SiS_VT = (ROMAddr[romptr+7] << 4) | ((ROMAddr[romptr+6] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3728 SiS_Pr->SiS_RVBHRS2 = ROMAddr[romptr+8] | ((ROMAddr[romptr+9] & 0x0f) << 8); in SiS_GetCRT2Data301()
3731 tempax = (ROMAddr[romptr+9] >> 4) & 0x07; in SiS_GetCRT2Data301()
3732 if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3745 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3909 SiS_Pr->SiS_LCDHDES = 0; in SiS_GetLVDSDesData()
3910 SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
3946 if(ModeNo <= 0x13) ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSDesData()
3988 if((SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSDesData()
4060 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
4089 if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLVDSDesData()
4125 int ret = 0; in SiS_HandlePWD()
4129 unsigned char drivermode = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40; in SiS_HandlePWD()
4135 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2b,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 0]); in SiS_HandlePWD()
4136 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2c,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 1]); in SiS_HandlePWD()
4137 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2d,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 2]); in SiS_HandlePWD()
4138 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2e,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 3]); in SiS_HandlePWD()
4139 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2f,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 4]); in SiS_HandlePWD()
4140 temp = 0x00; in SiS_HandlePWD()
4141 if((ROMAddr[romptr + 2] & (0x06 << 1)) && !drivermode) { in SiS_HandlePWD()
4142 temp = 0x80; in SiS_HandlePWD()
4145 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); in SiS_HandlePWD()
4160 unsigned short tempah, pushax=0, modenum; in SiS_DisableBridge()
4162 unsigned short temp=0; in SiS_DisableBridge()
4174 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_DisableBridge()
4176 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4181 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f); in SiS_DisableBridge()
4184 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); in SiS_DisableBridge()
4186 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4187 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4190 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4191 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4197 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4199 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4209 int didpwd = 0; in SiS_DisableBridge()
4213 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; in SiS_DisableBridge()
4220 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_DisableBridge()
4227 if( (modenum <= 0x13) || in SiS_DisableBridge()
4231 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfe); in SiS_DisableBridge()
4234 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfc); in SiS_DisableBridge()
4239 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_DisableBridge()
4240 SiS_DDC2Delay(SiS_Pr,0xe000); in SiS_DisableBridge()
4241 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_DisableBridge()
4242 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_DisableBridge()
4244 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_DisableBridge()
4253 tempah = 0xef; in SiS_DisableBridge()
4254 if(SiS_IsVAMode(SiS_Pr)) tempah = 0xf7; in SiS_DisableBridge()
4255 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_DisableBridge()
4260 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10); in SiS_DisableBridge()
4263 tempah = 0x3f; in SiS_DisableBridge()
4265 tempah = 0x7f; in SiS_DisableBridge()
4266 if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0xbf; in SiS_DisableBridge()
4268 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_DisableBridge()
4271 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4277 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4278 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF); in SiS_DisableBridge()
4283 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4286 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf); in SiS_DisableBridge()
4289 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4295 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4296 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4297 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4298 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4299 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4304 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4315 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4321 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_DisableBridge()
4340 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4346 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); /* disable VB */ in SiS_DisableBridge()
4350 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4353 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); /* disable lock mode */ in SiS_DisableBridge()
4356 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4357 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4358 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_DisableBridge()
4359 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4362 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ in SiS_DisableBridge()
4366 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4380 SiS_SetCH700x(SiS_Pr,0x0E,0x09); in SiS_DisableBridge()
4384 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4388 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4392 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4393 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_DisableBridge()
4396 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) { in SiS_DisableBridge()
4399 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4408 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4410 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4412 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4413 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4418 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4429 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18); in SiS_DisableBridge()
4433 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4436 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_DisableBridge()
4438 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_DisableBridge()
4439 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_DisableBridge()
4444 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_DisableBridge()
4457 SiS_SetCH701x(SiS_Pr,0x49,0x01); in SiS_DisableBridge()
4463 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4464 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4468 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4474 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4477 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4481 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4484 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4486 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4489 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4492 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4494 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4496 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf); in SiS_DisableBridge()
4497 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef); in SiS_DisableBridge()
4503 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4506 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4510 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4512 /* SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff); */ in SiS_DisableBridge()
4514 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_DisableBridge()
4521 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/ in SiS_DisableBridge()
4522 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */ in SiS_DisableBridge()
4523 } else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4526 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_DisableBridge()
4529 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4533 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4558 unsigned short temp=0, tempah; in SiS_EnableBridge()
4560 unsigned short temp1, pushax=0; in SiS_EnableBridge()
4574 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4576 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4580 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
4588 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* Enable CRT2 */ in SiS_EnableBridge()
4591 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
4593 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
4595 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
4597 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
4598 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4603 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
4609 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4611 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4612 if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; in SiS_EnableBridge()
4614 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4615 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4616 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4617 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0); in SiS_EnableBridge()
4621 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4625 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4640 unsigned char r30=0, r31=0, r32=0, r33=0, cr36=0; in SiS_EnableBridge()
4641 int didpwd = 0; in SiS_EnableBridge()
4642 /* unsigned short emidelay=0; */ in SiS_EnableBridge()
4646 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef); in SiS_EnableBridge()
4649 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4656 tempah = 0x10; in SiS_EnableBridge()
4658 if(SiS_TVEnabled(SiS_Pr)) tempah = 0x18; in SiS_EnableBridge()
4659 else tempah = 0x08; in SiS_EnableBridge()
4661 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_EnableBridge()
4667 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_EnableBridge()
4669 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_EnableBridge()
4671 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_EnableBridge()
4678 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_EnableBridge()
4680 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4694 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { in SiS_EnableBridge()
4703 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; in SiS_EnableBridge()
4705 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4707 if(!(SiS_LCDAEnabled(SiS_Pr))) temp |= 0x20; in SiS_EnableBridge()
4710 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4712 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4714 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
4715 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4723 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_EnableBridge()
4727 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20); in SiS_EnableBridge()
4728 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4734 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f); in SiS_EnableBridge()
4736 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x7f); in SiS_EnableBridge()
4740 tempah = 0xc0; in SiS_EnableBridge()
4742 tempah = 0x80; in SiS_EnableBridge()
4743 if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0x40; in SiS_EnableBridge()
4745 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_EnableBridge()
4751 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10); in SiS_EnableBridge()
4752 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4757 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4761 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c); in SiS_EnableBridge()
4765 cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_EnableBridge()
4771 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4772 SiS_Pr->EMI_30 = 0; in SiS_EnableBridge()
4773 SiS_Pr->EMI_31 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 0]; in SiS_EnableBridge()
4776 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; in SiS_EnableBridge()
4777 /* emidelay = SISGETROMW((romptr + 0x22)); */ in SiS_EnableBridge()
4782 /* (P4_30|0x40) */ in SiS_EnableBridge()
4783 /* Compal 1400x1050: 0x05, 0x60, 0x00 YES (1.10.7w; CR36=69) */ in SiS_EnableBridge()
4784 /* Compal 1400x1050: 0x0d, 0x70, 0x40 YES (1.10.7x; CR36=69) */ in SiS_EnableBridge()
4785 /* Acer 1280x1024: 0x12, 0xd0, 0x6b NO (1.10.9k; CR36=73) */ in SiS_EnableBridge()
4786 /* Compaq 1280x1024: 0x0d, 0x70, 0x6b YES (1.12.04b; CR36=03) */ in SiS_EnableBridge()
4787 /* Clevo 1024x768: 0x05, 0x60, 0x33 NO (1.10.8e; CR36=12, DL!) */ in SiS_EnableBridge()
4788 /* Clevo 1024x768: 0x0d, 0x70, 0x40 (if type == 3) YES (1.10.8y; CR36=?2) */ in SiS_EnableBridge()
4789 /* Clevo 1024x768: 0x05, 0x60, 0x33 (if type != 3) YES (1.10.8y; CR36=?2) */ in SiS_EnableBridge()
4791 /* Asus 1024x768: 0x08, 0x10, 0x3c (problematic) YES (1.10.8q; CR36=22) */ in SiS_EnableBridge()
4797 r30 = 0; in SiS_EnableBridge()
4808 switch((cr36 & 0x0f)) { in SiS_EnableBridge()
4810 r30 |= 0x40; in SiS_EnableBridge()
4811 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40; in SiS_EnableBridge()
4813 r31 = 0x05; r32 = 0x60; r33 = 0x33; in SiS_EnableBridge()
4814 if((cr36 & 0xf0) == 0x30) { in SiS_EnableBridge()
4815 r31 = 0x0d; r32 = 0x70; r33 = 0x40; in SiS_EnableBridge()
4820 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40; in SiS_EnableBridge()
4822 r31 = 0x12; r32 = 0xd0; r33 = 0x6b; in SiS_EnableBridge()
4824 r31 = 0x0d; r32 = 0x70; r33 = 0x6b; in SiS_EnableBridge()
4829 r30 |= 0x40; in SiS_EnableBridge()
4831 r31 = 0x05; r32 = 0x60; r33 = 0x00; in SiS_EnableBridge()
4833 r31 = 0x0d; r32 = 0x70; r33 = 0x40; /* BIOS values */ in SiS_EnableBridge()
4838 r30 |= 0x40; in SiS_EnableBridge()
4840 r31 = 0x05; r32 = 0x60; r33 = 0x00; in SiS_EnableBridge()
4849 if((cr36 & 0x0f) == 0x09) { in SiS_EnableBridge()
4850 r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x00; in SiS_EnableBridge()
4856 if((cr36 & 0x0f) == 0x03) { in SiS_EnableBridge()
4857 r30 = 0x20; r31 = 0x12; r32 = 0xd0; r33 = 0x6b; in SiS_EnableBridge()
4863 if((cr36 & 0x0f) == 0x02) { in SiS_EnableBridge()
4864 /* r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x33; */ /* rev 2 */ in SiS_EnableBridge()
4865 /* r30 = 0x20; r31 = 0x05; r32 = 0x60; r33 = 0x33; */ /* rev 3 */ in SiS_EnableBridge()
4866 /* r30 = 0x60; r31 = 0x0d; r32 = 0x70; r33 = 0x40; */ /* rev 4 */ in SiS_EnableBridge()
4867 /* r30 = 0x20; r31 = 0x0d; r32 = 0x70; r33 = 0x40; */ /* rev 5 */ in SiS_EnableBridge()
4874 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4877 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31); in SiS_EnableBridge()
4878 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32); in SiS_EnableBridge()
4879 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33); in SiS_EnableBridge()
4882 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_EnableBridge()
4887 if(r30 & 0x40) { in SiS_EnableBridge()
4888 /*SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x2a,0x80);*/ in SiS_EnableBridge()
4899 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); /* Enable */ in SiS_EnableBridge()
4900 /*SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f);*/ in SiS_EnableBridge()
4919 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4921 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x03); in SiS_EnableBridge()
4926 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_EnableBridge()
4928 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff); in SiS_EnableBridge()
4933 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4944 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4945 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
4949 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4951 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4952 if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; in SiS_EnableBridge()
4954 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4956 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4959 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
4960 if(!(temp & 0x80)) { in SiS_EnableBridge()
4961 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); /* BVBDOENABLE=1 */ in SiS_EnableBridge()
4965 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4970 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4977 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
4995 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4997 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
5001 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5004 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
5006 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
5008 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
5014 SiS_SetCH700x(SiS_Pr,0x0E,0x0B); in SiS_EnableBridge()
5019 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
5020 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
5026 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
5039 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18); in SiS_EnableBridge()
5043 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5045 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
5046 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
5050 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5053 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_EnableBridge()
5056 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_EnableBridge()
5057 temp &= 0x20; in SiS_EnableBridge()
5062 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
5068 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5073 temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
5074 if(!(temp1 & 0x80)) { in SiS_EnableBridge()
5075 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); in SiS_EnableBridge()
5084 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5086 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5088 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40); in SiS_EnableBridge()
5089 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10); in SiS_EnableBridge()
5094 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5099 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
5120 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5124 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
5153 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF)); in SiS_SetCRT2Offset()
5154 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8)); in SiS_SetCRT2Offset()
5156 temp = (unsigned char)(((offset >> 3) & 0xFF) + 1); in SiS_SetCRT2Offset()
5157 if(offset & 0x07) temp++; in SiS_SetCRT2Offset()
5158 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp); in SiS_SetCRT2Offset()
5165 unsigned short tempah=0, tempbl, infoflag; in SiS_SetCRT2Sync()
5167 tempbl = 0xC0; in SiS_SetCRT2Sync()
5178 tempah = 0; in SiS_SetCRT2Sync()
5182 tempah &= 0xC0; in SiS_SetCRT2Sync()
5183 tempah |= 0x20; in SiS_SetCRT2Sync()
5184 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5188 tempah |= 0xf0; in SiS_SetCRT2Sync()
5195 tempah |= 0x30; in SiS_SetCRT2Sync()
5199 tempah &= ~0xc0; in SiS_SetCRT2Sync()
5205 tempah &= 0x18; in SiS_SetCRT2Sync()
5206 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah); in SiS_SetCRT2Sync()
5209 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0); in SiS_SetCRT2Sync()
5212 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5224 tempbl = 0; in SiS_SetCRT2Sync()
5228 tempbl = (tempah >> 6) & 0x03; in SiS_SetCRT2Sync()
5231 tempah &= 0xC0; in SiS_SetCRT2Sync()
5232 tempah |= 0x20; in SiS_SetCRT2Sync()
5233 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5234 tempah |= 0xc0; in SiS_SetCRT2Sync()
5235 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5237 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5242 tempah = ((infoflag >> 8) & 0xc0) | 0x20; in SiS_SetCRT2Sync()
5243 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5244 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5256 tempbl = 0; in SiS_SetCRT2Sync()
5261 tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6); in SiS_SetCRT2Sync()
5266 tempbl = 0x03; in SiS_SetCRT2Sync()
5268 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_SetCRT2Sync()
5269 tempbl = (tempah >> 6) & 0x03; in SiS_SetCRT2Sync()
5270 tempbl |= 0x08; in SiS_SetCRT2Sync()
5271 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04; in SiS_SetCRT2Sync()
5273 tempah &= 0xC0; in SiS_SetCRT2Sync()
5274 tempah |= 0x20; in SiS_SetCRT2Sync()
5275 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5276 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) tempah |= 0xc0; in SiS_SetCRT2Sync()
5277 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5280 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5288 tempbl = 0; in SiS_SetCRT2Sync()
5290 if(ModeNo <= 0x13) { in SiS_SetCRT2Sync()
5291 tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetCRT2Sync()
5298 tempbl = (tempah >> 6) & 0x03; in SiS_SetCRT2Sync()
5303 tempah &= 0xC0; in SiS_SetCRT2Sync()
5304 tempah |= 0x20; in SiS_SetCRT2Sync()
5305 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5308 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah |= 0xc0; in SiS_SetCRT2Sync()
5312 tempah &= 0x18; in SiS_SetCRT2Sync()
5313 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah); in SiS_SetCRT2Sync()
5315 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5318 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5336 unsigned short VCLK = 0, MCLK, colorth = 0, data2 = 0; in SiS_SetCRT2FIFO_300()
5350 SiS_Pr->SiS_SelectCRT2Rate = 0; in SiS_SetCRT2FIFO_300()
5353 if(CRT1ModeNo >= 0x13) { in SiS_SetCRT2FIFO_300()
5365 CRT1ModeNo = 0xfe; in SiS_SetCRT2FIFO_300()
5375 if(CRT1ModeNo >= 0x13) { in SiS_SetCRT2FIFO_300()
5378 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A); in SiS_SetCRT2FIFO_300()
5380 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A); in SiS_SetCRT2FIFO_300()
5382 index &= 0x07; in SiS_SetCRT2FIFO_300()
5385 temp = ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) >> 6) & 0x03) << 1; in SiS_SetCRT2FIFO_300()
5402 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); in SiS_SetCRT2FIFO_300()
5403 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); in SiS_SetCRT2FIFO_300()
5407 index = (unsigned short)(((pciA0 >> 28) & 0x0f) * 3); in SiS_SetCRT2FIFO_300()
5408 index += (unsigned short)(((pci50 >> 9)) & 0x03); in SiS_SetCRT2FIFO_300()
5411 index = 0; /* -- do it like the BIOS anyway... */ in SiS_SetCRT2FIFO_300()
5418 index = (pci50 >> 1) & 0x07; in SiS_SetCRT2FIFO_300()
5420 if(pci50 & 0x01) index += 6; in SiS_SetCRT2FIFO_300()
5421 if(!(pciA0 & 0x01)) index += 24; in SiS_SetCRT2FIFO_300()
5423 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80) index += 12; in SiS_SetCRT2FIFO_300()
5428 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80)) data += 5; in SiS_SetCRT2FIFO_300()
5450 if(ROMAddr[0x220] & 0x01) { in SiS_SetCRT2FIFO_300()
5451 VCLK = ROMAddr[0x229] | (ROMAddr[0x22a] << 8); in SiS_SetCRT2FIFO_300()
5459 CRT2ModeNo = 0xfe; in SiS_SetCRT2FIFO_300()
5474 else if(data > 0x14) data = 0x14; in SiS_SetCRT2FIFO_300()
5477 temp = 0x16; in SiS_SetCRT2FIFO_300()
5478 if((data <= 0x0f) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) in SiS_SetCRT2FIFO_300()
5479 temp = 0x13; in SiS_SetCRT2FIFO_300()
5481 temp = 0x16; in SiS_SetCRT2FIFO_300()
5484 (SiS_Pr->ChipRevision >= 0x30)) in SiS_SetCRT2FIFO_300()
5485 temp = 0x1b; in SiS_SetCRT2FIFO_300()
5487 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp); in SiS_SetCRT2FIFO_300()
5490 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetCRT2FIFO_300()
5491 if(data > 0x13) data = 0x13; in SiS_SetCRT2FIFO_300()
5493 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data); in SiS_SetCRT2FIFO_300()
5495 } else { /* If mode <= 0x13, we just restore everything */ in SiS_SetCRT2FIFO_300()
5509 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B); in SiS_SetCRT2FIFO_310()
5515 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03); in SiS_SetCRT2FIFO_310()
5516 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b); in SiS_SetCRT2FIFO_310()
5517 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5518 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_SetCRT2FIFO_310()
5519 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5520 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e); in SiS_SetCRT2FIFO_310()
5522 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04); in SiS_SetCRT2FIFO_310()
5544 unsigned short temp, modeflag, i, j, xres=0, VGAVDE; in SiS_SetGroup1_301()
5547 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, in SiS_SetGroup1_301()
5549 0x00, 0x0b, 0x17, 0x18, 0x19, 0x00, 0x1a, 0x00, in SiS_SetGroup1_301()
5551 0x0c, 0x0d, 0x0e, 0x00, 0x0f, 0x10, 0x11, 0x00 in SiS_SetGroup1_301()
5554 if(ModeNo <= 0x13) { in SiS_SetGroup1_301()
5568 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04); in SiS_SetGroup1_301()
5572 SiS_Pr->CHTotal = 8224; /* Max HT, 0x2020, results in 0x3ff in registers */ in SiS_SetGroup1_301()
5590 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x04); in SiS_SetGroup1_301()
5591 temp |= ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0xc0) << 2); in SiS_SetGroup1_301()
5599 SiS_Pr->CHSyncEnd = 0xffe8; /* results in 0x2000 in registers */ in SiS_SetGroup1_301()
5601 SiS_Pr->CVTotal = 2049; /* Max VT, 0x0801, results in 0x7ff in registers */ in SiS_SetGroup1_301()
5616 if(ModeNo == 0x3c) SiS_Pr->CVBlankEnd = 226; in SiS_SetGroup1_301()
5624 SiS_CalcCRRegisters(SiS_Pr, 0); in SiS_SetGroup1_301()
5625 SiS_Pr->CCRT1CRTC[16] &= ~0xE0; in SiS_SetGroup1_301()
5627 for(i = 0; i <= 7; i++) { in SiS_SetGroup1_301()
5630 for(i = 0x10, j = 8; i <= 0x12; i++, j++) { in SiS_SetGroup1_301()
5633 for(i = 0x15, j = 11; i <= 0x16; i++, j++) { in SiS_SetGroup1_301()
5636 for(i = 0x0a, j = 13; i <= 0x0c; i++, j++) { in SiS_SetGroup1_301()
5640 temp = SiS_Pr->CCRT1CRTC[16] & 0xE0; in SiS_SetGroup1_301()
5641 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x0E],0x1F,temp); in SiS_SetGroup1_301()
5643 temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5; in SiS_SetGroup1_301()
5644 if(modeflag & DoubleScanMode) temp |= 0x80; in SiS_SetGroup1_301()
5645 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x09],0x5F,temp); in SiS_SetGroup1_301()
5647 temp = 0; in SiS_SetGroup1_301()
5648 temp |= (SiS_GetReg(SiS_Pr->SiS_P3c4,0x01) & 0x01); in SiS_SetGroup1_301()
5649 if(modeflag & HalfDCLK) temp |= 0x08; in SiS_SetGroup1_301()
5650 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* SR01: HalfDCLK[3], 8/9 div dotclock[… in SiS_SetGroup1_301()
5652 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00); /* CR14: (text mode: underline location… in SiS_SetGroup1_301()
5653 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00); /* CR17: n/a */ in SiS_SetGroup1_301()
5655 temp = 0; in SiS_SetGroup1_301()
5657 temp = (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) << 7; in SiS_SetGroup1_301()
5659 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* SR0E, dither[7] */ in SiS_SetGroup1_301()
5661 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetGroup1_301()
5662 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ in SiS_SetGroup1_301()
5673 unsigned short modeflag, resinfo = 0; in SiS_SetGroup1_LVDS()
5675 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; in SiS_SetGroup1_LVDS()
5678 unsigned short crt2crtc = 0; in SiS_SetGroup1_LVDS()
5684 if(ModeNo <= 0x13) { in SiS_SetGroup1_LVDS()
5719 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5722 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5723 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03); in SiS_SetGroup1_LVDS()
5725 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5729 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5730 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00); in SiS_SetGroup1_LVDS()
5732 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f); in SiS_SetGroup1_LVDS()
5736 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20); in SiS_SetGroup1_LVDS()
5758 temp = (tempax & 0x0007); in SiS_SetGroup1_LVDS()
5759 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* BPLHDESKEW[2:0] */ in SiS_SetGroup1_LVDS()
5760 temp = (tempax >> 3) & 0x00FF; in SiS_SetGroup1_LVDS()
5761 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* BPLHDESKEW[10:3] */ in SiS_SetGroup1_LVDS()
5779 if(temp & 0x07) temp += 8; in SiS_SetGroup1_LVDS()
5781 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* BPLHDEE */ in SiS_SetGroup1_LVDS()
5794 temp = (tempcx >> 3) & 0x00FF; in SiS_SetGroup1_LVDS()
5799 case 0x04: in SiS_SetGroup1_LVDS()
5800 case 0x05: in SiS_SetGroup1_LVDS()
5801 case 0x0d: temp = 0x56; break; in SiS_SetGroup1_LVDS()
5802 case 0x10: temp = 0x60; break; in SiS_SetGroup1_LVDS()
5803 case 0x13: temp = 0x5f; break; in SiS_SetGroup1_LVDS()
5804 case 0x40: in SiS_SetGroup1_LVDS()
5805 case 0x41: in SiS_SetGroup1_LVDS()
5806 case 0x4f: in SiS_SetGroup1_LVDS()
5807 case 0x43: in SiS_SetGroup1_LVDS()
5808 case 0x44: in SiS_SetGroup1_LVDS()
5809 case 0x62: in SiS_SetGroup1_LVDS()
5810 case 0x56: in SiS_SetGroup1_LVDS()
5811 case 0x53: in SiS_SetGroup1_LVDS()
5812 case 0x5d: in SiS_SetGroup1_LVDS()
5813 case 0x5e: temp = 0x54; break; in SiS_SetGroup1_LVDS()
5818 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp); /* BPLHRS */ in SiS_SetGroup1_LVDS()
5834 temp &= 0x1F; in SiS_SetGroup1_LVDS()
5835 temp |= ((tempcx & 0x07) << 5); in SiS_SetGroup1_LVDS()
5836 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp); /* BPLHRE */ in SiS_SetGroup1_LVDS()
5877 temp = tempbx & 0x00FF; in SiS_SetGroup1_LVDS()
5880 if(ModeNo == 0x10) temp = 0xa9; in SiS_SetGroup1_LVDS()
5883 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); /* BPLVRS */ in SiS_SetGroup1_LVDS()
5895 temp = tempcx & 0x000F; in SiS_SetGroup1_LVDS()
5896 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); /* BPLVRE */ in SiS_SetGroup1_LVDS()
5898 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
5901 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5903 } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5904 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) temp |= 0x40; in SiS_SetGroup1_LVDS()
5905 tempbx = 0x87; in SiS_SetGroup1_LVDS()
5907 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetGroup1_LVDS()
5908 tempbx = 0x07; in SiS_SetGroup1_LVDS()
5910 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03) temp |= 0x80; in SiS_SetGroup1_LVDS()
5915 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80; in SiS_SetGroup1_LVDS()
5917 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80; in SiS_SetGroup1_LVDS()
5921 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp); in SiS_SetGroup1_LVDS()
5956 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
5957 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup1_LVDS()
5958 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp); in SiS_SetGroup1_LVDS()
5959 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx); in SiS_SetGroup1_LVDS()
5960 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx); in SiS_SetGroup1_LVDS()
5972 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F; in SiS_SetGroup1_LVDS()
5974 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5975 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ in SiS_SetGroup1_LVDS()
5989 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5990 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp); in SiS_SetGroup1_LVDS()
5991 temp = (unsigned short)((tempeax & 0x00FF00) >> 8); in SiS_SetGroup1_LVDS()
5992 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp); in SiS_SetGroup1_LVDS()
5993 temp = (unsigned short)((tempeax & 0x00030000) >> 16); in SiS_SetGroup1_LVDS()
5994 if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04; in SiS_SetGroup1_LVDS()
5995 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp); in SiS_SetGroup1_LVDS()
5998 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5999 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp); in SiS_SetGroup1_LVDS()
6000 temp = (unsigned short)((tempeax & 0x00FF00) >> 8); in SiS_SetGroup1_LVDS()
6001 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp); in SiS_SetGroup1_LVDS()
6002 temp = (unsigned short)(((tempeax & 0x00030000) >> 16) << 6); in SiS_SetGroup1_LVDS()
6003 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp); in SiS_SetGroup1_LVDS()
6004 temp = 0; in SiS_SetGroup1_LVDS()
6005 if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08; in SiS_SetGroup1_LVDS()
6006 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp); in SiS_SetGroup1_LVDS()
6020 tempecx = 0xFFFF; in SiS_SetGroup1_LVDS()
6033 tempecx = (tempecx << 16) | (tempeax & 0xFFFF); in SiS_SetGroup1_LVDS()
6034 temp = (unsigned short)(tempecx & 0x00FF); in SiS_SetGroup1_LVDS()
6035 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp); in SiS_SetGroup1_LVDS()
6039 tempbx = (unsigned short)(tempeax & 0xFFFF); in SiS_SetGroup1_LVDS()
6042 tempbx = tempvcfact & 0x3f; in SiS_SetGroup1_LVDS()
6043 if(tempbx == 0) tempbx = 64; in SiS_SetGroup1_LVDS()
6045 tempbx = (unsigned short)(tempeax & 0xFFFF); in SiS_SetGroup1_LVDS()
6053 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
6054 temp = temp | ((tempecx >> 8) & 0x07); in SiS_SetGroup1_LVDS()
6055 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp); in SiS_SetGroup1_LVDS()
6056 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx); in SiS_SetGroup1_LVDS()
6062 temp = (unsigned short)((tempecx & 0xFF00) >> 8); in SiS_SetGroup1_LVDS()
6063 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp); in SiS_SetGroup1_LVDS()
6064 temp = (unsigned short)(tempecx & 0x00FF); in SiS_SetGroup1_LVDS()
6065 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); in SiS_SetGroup1_LVDS()
6071 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_SetGroup1_LVDS()
6076 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_SetGroup1_LVDS()
6078 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23); in SiS_SetGroup1_LVDS()
6090 unsigned char TrumpMode13[4] = { 0x01, 0x10, 0x2c, 0x00 }; in SiS_SetGroup1_LVDS()
6091 unsigned char TrumpMode10_1[4] = { 0x01, 0x10, 0x27, 0x00 }; in SiS_SetGroup1_LVDS()
6092 unsigned char TrumpMode10_2[4] = { 0x01, 0x16, 0x10, 0x00 }; in SiS_SetGroup1_LVDS()
6095 trumpdata = &ROMAddr[0x8001 + (j * 80)]; in SiS_SetGroup1_LVDS()
6097 if(SiS_Pr->SiS_LCDTypeInfo == 0x0e) j += 7; in SiS_SetGroup1_LVDS()
6098 trumpdata = &SiS300_TrumpionData[j][0]; in SiS_SetGroup1_LVDS()
6101 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf); in SiS_SetGroup1_LVDS()
6102 for(i=0; i<5; i++) { in SiS_SetGroup1_LVDS()
6106 if(ModeNo == 0x13) { in SiS_SetGroup1_LVDS()
6107 for(i=0; i<4; i++) { in SiS_SetGroup1_LVDS()
6108 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode13[0]); in SiS_SetGroup1_LVDS()
6110 } else if(ModeNo == 0x10) { in SiS_SetGroup1_LVDS()
6111 for(i=0; i<4; i++) { in SiS_SetGroup1_LVDS()
6112 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_1[0]); in SiS_SetGroup1_LVDS()
6113 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_2[0]); in SiS_SetGroup1_LVDS()
6117 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_SetGroup1_LVDS()
6123 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); in SiS_SetGroup1_LVDS()
6124 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); in SiS_SetGroup1_LVDS()
6125 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00); in SiS_SetGroup1_LVDS()
6126 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87); in SiS_SetGroup1_LVDS()
6127 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A); in SiS_SetGroup1_LVDS()
6128 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B); in SiS_SetGroup1_LVDS()
6129 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03); in SiS_SetGroup1_LVDS()
6135 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,tempax & 0xff); in SiS_SetGroup1_LVDS()
6137 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp); in SiS_SetGroup1_LVDS()
6139 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,tempax & 0xff); in SiS_SetGroup1_LVDS()
6140 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00); /* Bflml = 0 */ in SiS_SetGroup1_LVDS()
6141 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x007); in SiS_SetGroup1_LVDS()
6148 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,tempax & 0xff); in SiS_SetGroup1_LVDS()
6150 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp); in SiS_SetGroup1_LVDS()
6157 temp = tempeax & 0x7f; in SiS_SetGroup1_LVDS()
6160 temp = tempeax & 0x3f; in SiS_SetGroup1_LVDS()
6161 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,temp); in SiS_SetGroup1_LVDS()
6162 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00); /* BDxWadrst0 */ in SiS_SetGroup1_LVDS()
6163 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00); in SiS_SetGroup1_LVDS()
6164 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10); in SiS_SetGroup1_LVDS()
6165 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x040); in SiS_SetGroup1_LVDS()
6173 temp = tempax & 0x00FF; in SiS_SetGroup1_LVDS()
6174 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp); in SiS_SetGroup1_LVDS()
6175 temp = ((tempax & 0xFF00) >> 8) << 3; in SiS_SetGroup1_LVDS()
6176 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x44, 0x07, temp); in SiS_SetGroup1_LVDS()
6183 temp = tempeax & 0xFF; in SiS_SetGroup1_LVDS()
6184 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp); in SiS_SetGroup1_LVDS()
6185 temp = (tempeax & 0xFF00) >> 8; in SiS_SetGroup1_LVDS()
6186 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp); in SiS_SetGroup1_LVDS()
6187 temp = ((tempeax & 0xFF0000) >> 16) | 0x10; in SiS_SetGroup1_LVDS()
6188 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp); in SiS_SetGroup1_LVDS()
6189 temp = ((tempeax & 0x01000000) >> 24) << 7; in SiS_SetGroup1_LVDS()
6190 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x3C, 0x7F, temp); in SiS_SetGroup1_LVDS()
6192 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03); in SiS_SetGroup1_LVDS()
6193 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50); in SiS_SetGroup1_LVDS()
6194 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00); in SiS_SetGroup1_LVDS()
6195 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01); in SiS_SetGroup1_LVDS()
6196 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38); in SiS_SetGroup1_LVDS()
6199 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02); in SiS_SetGroup1_LVDS()
6200 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00); in SiS_SetGroup1_LVDS()
6201 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00); in SiS_SetGroup1_LVDS()
6202 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c); in SiS_SetGroup1_LVDS()
6203 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00); in SiS_SetGroup1_LVDS()
6204 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00); in SiS_SetGroup1_LVDS()
6205 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80); in SiS_SetGroup1_LVDS()
6206 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0); in SiS_SetGroup1_LVDS()
6207 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00); in SiS_SetGroup1_LVDS()
6208 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0); in SiS_SetGroup1_LVDS()
6209 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00); in SiS_SetGroup1_LVDS()
6210 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10); in SiS_SetGroup1_LVDS()
6211 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00); in SiS_SetGroup1_LVDS()
6212 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00); in SiS_SetGroup1_LVDS()
6213 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10); in SiS_SetGroup1_LVDS()
6214 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25); in SiS_SetGroup1_LVDS()
6215 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80); in SiS_SetGroup1_LVDS()
6216 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14); in SiS_SetGroup1_LVDS()
6217 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03); in SiS_SetGroup1_LVDS()
6218 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); in SiS_SetGroup1_LVDS()
6232 unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; in SiS_SetGroup1()
6233 unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0; in SiS_SetGroup1()
6235 unsigned short tempbl=0; in SiS_SetGroup1()
6243 if(ModeNo <= 0x13) { in SiS_SetGroup1()
6275 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6276 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6278 temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4; in SiS_SetGroup1()
6279 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6281 temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6282 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6284 pushbx = SiS_Pr->SiS_VGAHDE + 12; /* bx BTVGA2HRS 0x0B,0x0C */ in SiS_SetGroup1()
6298 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6311 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6312 temp = (tempcx >> 4) & 0xF0; in SiS_SetGroup1()
6313 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6315 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6325 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6339 tempcx = (tempcx & 0xff00) | 0x30; in SiS_SetGroup1()
6341 tempcx = (tempcx & 0xff00) | 0xff; in SiS_SetGroup1()
6375 tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; /* (VGAHRS-3)*8 */ in SiS_SetGroup1()
6376 tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3; /* (VGAHRE-3)*8 */ in SiS_SetGroup1()
6377 tempcx &= 0x00FF; in SiS_SetGroup1()
6378 tempcx |= (tempbx & 0xFF00); in SiS_SetGroup1()
6394 … SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx); /* CRT2 Horizontal Retrace Start */ in SiS_SetGroup1()
6396 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx); /* CRT2 Horizontal Retrace End */ in SiS_SetGroup1()
6398 temp = ((tempbx >> 8) & 0x0F) | ((pushbx >> 4) & 0xF0); in SiS_SetGroup1()
6399 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* Overflow */ in SiS_SetGroup1()
6404 temp = tempcx & 0x00FF; in SiS_SetGroup1()
6409 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6421 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); /* CRT2 Vertical Total */ in SiS_SetGroup1()
6424 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx); /* CRT2 Vertical Display Enable End */ in SiS_SetGroup1()
6426 temp = ((tempbx >> 5) & 0x38) | ((tempcx >> 8) & 0x07); in SiS_SetGroup1()
6427 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp); /* Overflow */ in SiS_SetGroup1()
6441 …tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x1… in SiS_SetGroup1()
6442 …tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 … in SiS_SetGroup1()
6464 if(cr7 & 0x04) tempbx |= 0x0100; in SiS_SetGroup1()
6465 if(cr7 & 0x80) tempbx |= 0x0200; in SiS_SetGroup1()
6466 if(cr13 & 0x08) tempbx |= 0x0400; in SiS_SetGroup1()
6469 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx); /* CRT2 Vertical Retrace Start */ in SiS_SetGroup1()
6471 temp = ((tempbx >> 4) & 0x70) | (tempcx & 0x0F); in SiS_SetGroup1()
6472 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp); /* CRT2 Vert. Retrace End; Overflow */ in SiS_SetGroup1()
6481 temp = 0x20; in SiS_SetGroup1()
6483 temp = 0x10; in SiS_SetGroup1()
6484 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) temp = 0x2c; in SiS_SetGroup1()
6485 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6488 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6490 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) temp = 0x24; in SiS_SetGroup1()
6491 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) temp = 0x2c; in SiS_SetGroup1()
6492 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x08; in SiS_SetGroup1()
6494 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) temp = 0x2c; in SiS_SetGroup1()
6495 else temp = 0x20; in SiS_SetGroup1()
6498 if(ROMAddr[0x220] & 0x80) { in SiS_SetGroup1()
6500 temp = ROMAddr[0x221]; in SiS_SetGroup1()
6502 temp = ROMAddr[0x222]; in SiS_SetGroup1()
6504 temp = ROMAddr[0x223]; in SiS_SetGroup1()
6506 temp = ROMAddr[0x224]; in SiS_SetGroup1()
6514 temp = 0x20; in SiS_SetGroup1()
6516 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04; in SiS_SetGroup1()
6519 if(ROMAddr[0x220] & 0x80) { in SiS_SetGroup1()
6520 temp = ROMAddr[0x220]; in SiS_SetGroup1()
6528 temp &= 0x3c; in SiS_SetGroup1()
6530 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Softw… in SiS_SetGroup1()
6542 if(SiS_Pr->ChipType == SIS_740) temp = 0x03; in SiS_SetGroup1()
6543 else temp = 0x00; in SiS_SetGroup1()
6545 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a; in SiS_SetGroup1()
6546 tempbl = 0xF0; in SiS_SetGroup1()
6548 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6549 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F; in SiS_SetGroup1()
6554 temp = 0x08; in SiS_SetGroup1()
6555 tempbl = 0; in SiS_SetGroup1()
6557 if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0; in SiS_SetGroup1()
6561 … SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp); /* Panel Link Delay Compensation */ in SiS_SetGroup1()
6566 tempax = 0; in SiS_SetGroup1()
6567 if(modeflag & DoubleScanMode) tempax |= 0x80; in SiS_SetGroup1()
6568 if(modeflag & HalfDCLK) tempax |= 0x40; in SiS_SetGroup1()
6569 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); in SiS_SetGroup1()
6588 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6608 unsigned short a, b, p = 0; in SiS_GetGroup2CLVXPtr()
6636 p += 0x42; in SiS_GetGroup2CLVXPtr()
6637 } while((tableptr[p] | tableptr[p+1] << 8) != 0xffff); in SiS_GetGroup2CLVXPtr()
6638 if((tableptr[p] | tableptr[p+1] << 8) == 0xffff) p -= 0x42; in SiS_GetGroup2CLVXPtr()
6654 tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 0); in SiS_SetGroup2_C_ELV()
6655 for(i = 0x80, j = 0; i <= 0xbf; i++, j++) { in SiS_SetGroup2_C_ELV()
6660 for(i = 0xc0, j = 0; i <= 0xff; i++, j++) { in SiS_SetGroup2_C_ELV()
6664 temp = 0x10; in SiS_SetGroup2_C_ELV()
6665 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04; in SiS_SetGroup2_C_ELV()
6666 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); in SiS_SetGroup2_C_ELV()
6677 if(ModeNo <= 0x13) in SiS_GetCRT2Part2Ptr()
6682 (*ResIndex) &= 0x3f; in SiS_GetCRT2Part2Ptr()
6683 (*CRT2Index) = 0; in SiS_GetCRT2Part2Ptr()
6696 return (((*CRT2Index) != 0)); in SiS_GetCRT2Part2Ptr()
6706 0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02, in SiS_Group2LCDSpecial()
6707 0xab,0x87,0xab,0x9e,0xe7,0x02,0x02 in SiS_Group2LCDSpecial()
6717 if(ModeNo == 0x13) { in SiS_Group2LCDSpecial()
6718 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9); in SiS_Group2LCDSpecial()
6719 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC); in SiS_Group2LCDSpecial()
6720 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6); in SiS_Group2LCDSpecial()
6721 } else if((crt2crtc & 0x3F) == 4) { in SiS_Group2LCDSpecial()
6722 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B); in SiS_Group2LCDSpecial()
6723 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13); in SiS_Group2LCDSpecial()
6724 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5); in SiS_Group2LCDSpecial()
6725 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08); in SiS_Group2LCDSpecial()
6726 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2); in SiS_Group2LCDSpecial()
6731 if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) { in SiS_Group2LCDSpecial()
6732 crt2crtc &= 0x1f; in SiS_Group2LCDSpecial()
6733 tempcx = 0; in SiS_Group2LCDSpecial()
6741 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff); in SiS_Group2LCDSpecial()
6747 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28); in SiS_Group2LCDSpecial()
6751 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18); in SiS_Group2LCDSpecial()
6752 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]); in SiS_Group2LCDSpecial()
6771 if(ModeNo <= 0x13) { in SiS_Set300Part2Regs()
6777 resindex = crt2crtc & 0x3F; in SiS_Set300Part2Regs()
6782 if(ModeNo > 0x13) { in SiS_Set300Part2Regs()
6787 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_Set300Part2Regs()
6788 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_Set300Part2Regs()
6789 for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) { in SiS_Set300Part2Regs()
6792 for(j = 0x1c; j <= 0x1d; i++, j++ ) { in SiS_Set300Part2Regs()
6795 for(j = 0x1f; j <= 0x21; i++, j++ ) { in SiS_Set300Part2Regs()
6798 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_Set300Part2Regs()
6799 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_Set300Part2Regs()
6813 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53, in SiS_SetTVSpecial()
6814 0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a, in SiS_SetTVSpecial()
6815 0x58,0xe4,0x73,0xda,0x13 in SiS_SetTVSpecial()
6818 for(i = 0x1c, j = 0; i <= 0x30; i++, j++) { in SiS_SetTVSpecial()
6821 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72); in SiS_SetTVSpecial()
6824 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); in SiS_SetTVSpecial()
6825 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b); in SiS_SetTVSpecial()
6827 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); /* 15 */ in SiS_SetTVSpecial()
6828 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a); /* 1b */ in SiS_SetTVSpecial()
6833 if((ModeNo == 0x38) || (ModeNo == 0x4a) || (ModeNo == 0x64) || in SiS_SetTVSpecial()
6834 (ModeNo == 0x52) || (ModeNo == 0x58) || (ModeNo == 0x5c)) { in SiS_SetTVSpecial()
6835 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 21 */ in SiS_SetTVSpecial()
6836 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 5a */ in SiS_SetTVSpecial()
6838 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a); /* 21 */ in SiS_SetTVSpecial()
6839 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53); /* 5a */ in SiS_SetTVSpecial()
6851 temp = 0xc3; in SiS_SetGroup2_Tail()
6856 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6857 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3); in SiS_SetGroup2_Tail()
6859 temp = 0x4d; in SiS_SetGroup2_Tail()
6864 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6871 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03); in SiS_SetGroup2_Tail()
6875 if(ModeNo <= 0x13) temp = 3; in SiS_SetGroup2_Tail()
6876 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp); in SiS_SetGroup2_Tail()
6878 #if 0 in SiS_SetGroup2_Tail()
6884 SiS_SetReg(SiS_Part2Port,0x01,0x2b); in SiS_SetGroup2_Tail()
6885 SiS_SetReg(SiS_Part2Port,0x02,0x13); in SiS_SetGroup2_Tail()
6886 SiS_SetReg(SiS_Part2Port,0x04,0xe5); in SiS_SetGroup2_Tail()
6887 SiS_SetReg(SiS_Part2Port,0x05,0x08); in SiS_SetGroup2_Tail()
6888 SiS_SetReg(SiS_Part2Port,0x06,0xe2); in SiS_SetGroup2_Tail()
6889 SiS_SetReg(SiS_Part2Port,0x1c,0x21); in SiS_SetGroup2_Tail()
6890 SiS_SetReg(SiS_Part2Port,0x1d,0x45); in SiS_SetGroup2_Tail()
6891 SiS_SetReg(SiS_Part2Port,0x1f,0x0b); in SiS_SetGroup2_Tail()
6892 SiS_SetReg(SiS_Part2Port,0x20,0x00); in SiS_SetGroup2_Tail()
6893 SiS_SetReg(SiS_Part2Port,0x21,0xa9); in SiS_SetGroup2_Tail()
6894 SiS_SetReg(SiS_Part2Port,0x23,0x0b); in SiS_SetGroup2_Tail()
6895 SiS_SetReg(SiS_Part2Port,0x25,0x04); in SiS_SetGroup2_Tail()
6919 if(ModeNo <= 0x13) { in SiS_SetGroup2()
6924 crt2crtc = 0; in SiS_SetGroup2()
6930 temp = 0; in SiS_SetGroup2()
6931 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08; in SiS_SetGroup2()
6932 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04; in SiS_SetGroup2()
6933 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) temp |= 0x02; in SiS_SetGroup2()
6934 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp |= 0x01; in SiS_SetGroup2()
6936 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) temp |= 0x10; in SiS_SetGroup2()
6938 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp); in SiS_SetGroup2()
6940 PhaseIndex = 0x01; /* SiS_PALPhase */ in SiS_SetGroup2()
6962 i = 0; in SiS_SetGroup2()
6966 TimingPoint = &SiS_YPbPrTable[i][0]; in SiS_SetGroup2()
6968 PhaseIndex = 0x00; /* SiS_NTSCPhase */ in SiS_SetGroup2()
6972 if(newtvphase) PhaseIndex = 0x09; /* SiS_PALPhase2 */ in SiS_SetGroup2()
6977 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetNTSCJ) ? 0x01 : 0x00; /* SiS_PALPhase : SiS_NTSCPhase */ in SiS_SetGroup2()
6983 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetPALM) ? 0x02 : 0x03; /* SiS_PALMPhase : SiS_PALNPhase */ in SiS_SetGroup2()
6989 PhaseIndex = 0x05; /* SiS_SpecialPhaseM */ in SiS_SetGroup2()
6991 PhaseIndex = 0x11; /* SiS_SpecialPhaseJ */ in SiS_SetGroup2()
6993 PhaseIndex = 0x10; /* SiS_SpecialPhase */ in SiS_SetGroup2()
6997 for(i = 0x31, j = 0; i <= 0x34; i++, j++) { in SiS_SetGroup2()
7001 for(i = 0x01, j = 0; i <= 0x2D; i++, j++) { in SiS_SetGroup2()
7004 for(i = 0x39; i <= 0x45; i++, j++) { in SiS_SetGroup2()
7010 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F); in SiS_SetGroup2()
7014 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode); in SiS_SetGroup2()
7016 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE); in SiS_SetGroup2()
7017 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE); in SiS_SetGroup2()
7018 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE); in SiS_SetGroup2()
7019 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE); in SiS_SetGroup2()
7035 tempax &= 0x00ff; in SiS_SetGroup2()
7037 temp = tempax + (unsigned short)TimingPoint[0]; in SiS_SetGroup2()
7038 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7041 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7045 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); in SiS_SetGroup2()
7046 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); in SiS_SetGroup2()
7048 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17); in SiS_SetGroup2()
7049 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d); in SiS_SetGroup2()
7059 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx); in SiS_SetGroup2()
7060 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f)); in SiS_SetGroup2()
7066 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7070 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx); in SiS_SetGroup2()
7071 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7078 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0)); in SiS_SetGroup2()
7082 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx); in SiS_SetGroup2()
7083 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0)); in SiS_SetGroup2()
7087 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7093 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7099 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx); in SiS_SetGroup2()
7111 if((ModeNo <= 0x13) && (crt2crtc == 1)) tempbx++; in SiS_SetGroup2()
7120 if((ModeNo == 0x2f) || (ModeNo == 0x5d) || (ModeNo == 0x5e)) tempbx++; in SiS_SetGroup2()
7123 if(ModeNo == 0x03) tempbx++; /* From 1.10.7w - doesn't make sense */ in SiS_SetGroup2()
7128 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx); in SiS_SetGroup2()
7130 temp = (tempcx >> 8) & 0x0F; in SiS_SetGroup2()
7131 temp |= ((tempbx >> 2) & 0xC0); in SiS_SetGroup2()
7133 temp |= 0x10; in SiS_SetGroup2()
7134 if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20; in SiS_SetGroup2()
7136 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp); in SiS_SetGroup2()
7139 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5)); in SiS_SetGroup2()
7149 temp = ((tempbx >> 3) & 0x60) | 0x18; in SiS_SetGroup2()
7150 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp); in SiS_SetGroup2()
7151 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx); in SiS_SetGroup2()
7154 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4)); in SiS_SetGroup2()
7158 tempbx = 0; in SiS_SetGroup2()
7161 tempax = 0; in SiS_SetGroup2()
7162 tempbx |= 0x20; in SiS_SetGroup2()
7166 tempch = tempcl = 0x01; in SiS_SetGroup2()
7170 tempcl = 0x20; in SiS_SetGroup2()
7173 tempbx &= ~0x20; in SiS_SetGroup2()
7181 if(!(tempbx & 0x20)) { in SiS_SetGroup2()
7187 tempbx |= ((tempax >> 8) & 0x1F); in SiS_SetGroup2()
7191 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax); in SiS_SetGroup2()
7192 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx); in SiS_SetGroup2()
7196 tempcx &= 0x07; in SiS_SetGroup2()
7197 if(tempbx & 0x20) tempcx = 0; in SiS_SetGroup2()
7198 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,tempcx); in SiS_SetGroup2()
7201 tempbx = 0x0382; in SiS_SetGroup2()
7202 tempcx = 0x007e; in SiS_SetGroup2()
7204 tempbx = 0x0369; in SiS_SetGroup2()
7205 tempcx = 0x0061; in SiS_SetGroup2()
7207 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx); in SiS_SetGroup2()
7208 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx); in SiS_SetGroup2()
7209 temp = (tempcx & 0x0300) >> 6; in SiS_SetGroup2()
7210 temp |= ((tempbx >> 8) & 0x03); in SiS_SetGroup2()
7212 temp |= 0x10; in SiS_SetGroup2()
7213 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp |= 0x20; in SiS_SetGroup2()
7214 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40; in SiS_SetGroup2()
7216 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp); in SiS_SetGroup2()
7218 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); in SiS_SetGroup2()
7219 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3)); in SiS_SetGroup2()
7224 temp = 0; in SiS_SetGroup2()
7226 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp); in SiS_SetGroup2()
7233 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_SetGroup2()
7234 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1)); in SiS_SetGroup2()
7236 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF); in SiS_SetGroup2()
7241 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00); in SiS_SetGroup2()
7252 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx); in SiS_SetGroup2()
7253 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7255 temp = 0x01; in SiS_SetGroup2()
7259 temp = 0x02; in SiS_SetGroup2()
7261 temp = 0x01; in SiS_SetGroup2()
7266 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp); in SiS_SetGroup2()
7269 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx); in SiS_SetGroup2()
7270 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07)); in SiS_SetGroup2()
7273 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx); in SiS_SetGroup2()
7274 temp = (tempcx >> 3) & 0xE0; in SiS_SetGroup2()
7277 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { in SiS_SetGroup2()
7278 temp |= 0x10; in SiS_SetGroup2()
7281 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp); in SiS_SetGroup2()
7283 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0); in SiS_SetGroup2()
7284 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0); in SiS_SetGroup2()
7286 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); in SiS_SetGroup2()
7287 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); in SiS_SetGroup2()
7298 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_SetGroup2()
7299 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_SetGroup2()
7300 for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) { in SiS_SetGroup2()
7303 for(j = 0x1c; j <= 0x1d; i++, j++ ) { in SiS_SetGroup2()
7306 for(j = 0x1f; j <= 0x21; i++, j++ ) { in SiS_SetGroup2()
7309 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_SetGroup2()
7310 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_SetGroup2()
7336 /* if(SiS_Pr->SiS_VGAVDE == 525) tempax += 0x3c; */ /* 651+301C */ in SiS_SetGroup2()
7338 tempax = tempcx = 0; in SiS_SetGroup2()
7350 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ in SiS_SetGroup2()
7351 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ in SiS_SetGroup2()
7353 temp = (tempbx >> 5) & 0x38; in SiS_SetGroup2()
7354 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup2()
7355 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7398 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ in SiS_SetGroup2()
7400 temp = (tempbx >> 4) & 0xF0; in SiS_SetGroup2()
7402 temp |= (tempbx & 0x0F); in SiS_SetGroup2()
7405 temp &= 0xf0; in SiS_SetGroup2()
7406 temp |= (SiS_Pr->CVSyncEnd & 0x0f); in SiS_SetGroup2()
7409 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7422 temp = 0; in SiS_SetGroup2()
7430 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp); /* lcdhdes */ in SiS_SetGroup2()
7431 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0)); in SiS_SetGroup2()
7449 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ in SiS_SetGroup2()
7450 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f)); in SiS_SetGroup2()
7460 if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47; in SiS_SetGroup2()
7472 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ in SiS_SetGroup2()
7473 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7490 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ in SiS_SetGroup2()
7515 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00); in SiS_SetGroup3()
7521 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7522 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7524 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5); in SiS_SetGroup3()
7525 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7); in SiS_SetGroup3()
7529 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7530 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7531 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8); in SiS_SetGroup3()
7547 for(i=0; i<=0x3E; i++) { in SiS_SetGroup3()
7552 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f); in SiS_SetGroup3()
7567 #if 0
7573 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f);
7574 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20);
7575 temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
7576 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp);
7577 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0));
7578 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f;
7580 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f));
7581 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
7582 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42);
7583 temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
7584 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp);
7585 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0));
7601 if(!(ROMAddr[0x61] & 0x04)) return; in SiS_SetGroup4_C_ELV()
7604 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08); in SiS_SetGroup4_C_ELV()
7605 temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a); in SiS_SetGroup4_C_ELV()
7606 if(!(temp & 0x01)) { in SiS_SetGroup4_C_ELV()
7607 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf); in SiS_SetGroup4_C_ELV()
7608 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc); in SiS_SetGroup4_C_ELV()
7610 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8); in SiS_SetGroup4_C_ELV()
7612 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb); in SiS_SetGroup4_C_ELV()
7613 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp = 0x0000; in SiS_SetGroup4_C_ELV()
7614 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp = 0x0002; in SiS_SetGroup4_C_ELV()
7615 else if(SiS_Pr->SiS_TVMode & TVSetHiVision) temp = 0x0400; in SiS_SetGroup4_C_ELV()
7616 else temp = 0x0402; in SiS_SetGroup4_C_ELV()
7618 temp1 = 0; in SiS_SetGroup4_C_ELV()
7620 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1); in SiS_SetGroup4_C_ELV()
7621 if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7622 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7623 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7624 if(ModeNo > 0x13) { in SiS_SetGroup4_C_ELV()
7625 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x39,0xfd); in SiS_SetGroup4_C_ELV()
7628 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03; in SiS_SetGroup4_C_ELV()
7629 if(temp1 == 0x01) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7630 if(temp1 == 0x03) temp |= 0x04; /* ? why not 0x10? */ in SiS_SetGroup4_C_ELV()
7631 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7632 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7633 if(ModeNo > 0x13) { in SiS_SetGroup4_C_ELV()
7634 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3b,0xfd); in SiS_SetGroup4_C_ELV()
7638 #if 0 in SiS_SetGroup4_C_ELV()
7676 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57); in SiS_SetCRT2VCLK()
7677 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46); in SiS_SetCRT2VCLK()
7678 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6); in SiS_SetCRT2VCLK()
7680 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7681 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7684 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01); in SiS_SetCRT2VCLK()
7685 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7686 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7688 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00); in SiS_SetCRT2VCLK()
7689 temp = 0x08; in SiS_SetCRT2VCLK()
7690 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20; in SiS_SetCRT2VCLK()
7691 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp); in SiS_SetCRT2VCLK()
7702 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); in SiS_SetDualLinkEtc()
7704 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20); in SiS_SetDualLinkEtc()
7710 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_SetDualLinkEtc()
7712 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_SetDualLinkEtc()
7714 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_SetDualLinkEtc()
7725 if(ModeNo <= 0x13) { in SiS_SetGroup4()
7730 resinfo = 0; in SiS_SetGroup4()
7739 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7746 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f); in SiS_SetGroup4()
7757 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT); in SiS_SetGroup4()
7760 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx); in SiS_SetGroup4()
7762 temp = (tempbx >> 1) & 0x80; in SiS_SetGroup4()
7765 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx); in SiS_SetGroup4()
7767 temp |= ((tempcx >> 5) & 0x78); in SiS_SetGroup4()
7771 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx); in SiS_SetGroup4()
7773 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup4()
7774 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp); in SiS_SetGroup4()
7781 temp = 0; in SiS_SetGroup4()
7782 if(tempbx > 800) temp = 0x60; in SiS_SetGroup4()
7784 temp = 0; in SiS_SetGroup4()
7785 if(tempbx > 1024) temp = 0xC0; in SiS_SetGroup4()
7786 else if(tempbx >= 960) temp = 0xA0; in SiS_SetGroup4()
7788 temp = 0; in SiS_SetGroup4()
7789 if(tempbx >= 1280) temp = 0x40; in SiS_SetGroup4()
7790 else if(tempbx >= 1024) temp = 0x20; in SiS_SetGroup4()
7792 temp = 0x80; in SiS_SetGroup4()
7793 if(tempbx >= 1024) temp = 0xA0; in SiS_SetGroup4()
7800 temp &= 0xf0; in SiS_SetGroup4()
7801 temp |= 0x0A; in SiS_SetGroup4()
7805 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp); in SiS_SetGroup4()
7810 if(!(temp & 0xE0)) tempebx >>=1; in SiS_SetGroup4()
7814 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx); in SiS_SetGroup4()
7816 tempcx |= 0x40; in SiS_SetGroup4()
7819 tempcx ^= 0x40; in SiS_SetGroup4()
7829 temp = (unsigned short)(tempeax & 0x000000FF); in SiS_SetGroup4()
7830 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp); in SiS_SetGroup4()
7831 temp = (unsigned short)((tempeax & 0x0000FF00) >> 8); in SiS_SetGroup4()
7832 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp); in SiS_SetGroup4()
7833 temp = (unsigned short)((tempeax >> 12) & 0x70); /* sic! */ in SiS_SetGroup4()
7834 temp |= (tempcx & 0x4F); in SiS_SetGroup4()
7835 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp); in SiS_SetGroup4()
7839 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28); in SiS_SetGroup4()
7842 tempbx = 0; in SiS_SetGroup4()
7843 if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08; in SiS_SetGroup4()
7851 tempbx = 0x08; in SiS_SetGroup4()
7865 tempax = (tempax & 0xff00) | 0x20; in SiS_SetGroup4()
7871 temp = ((tempax >> 4) & 0x30) | tempbx; in SiS_SetGroup4()
7872 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax); in SiS_SetGroup4()
7873 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp); in SiS_SetGroup4()
7875 temp = 0x0036; tempbx = 0xD0; in SiS_SetGroup4()
7877 temp = 0x0026; tempbx = 0xC0; /* See En/DisableBridge() */ in SiS_SetGroup4()
7881 temp |= 0x01; in SiS_SetGroup4()
7884 temp &= ~0x01; in SiS_SetGroup4()
7889 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp); in SiS_SetGroup4()
7894 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx); in SiS_SetGroup4()
7895 temp = (tempbx >> 5) & 0x38; in SiS_SetGroup4()
7896 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp); in SiS_SetGroup4()
7900 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7924 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_SetGroup5()
7939 unsigned short modeflag = 0; in SiS_GetLVDSCRT1Ptr()
7944 if(ModeNo <= 0x13) { in SiS_GetLVDSCRT1Ptr()
7952 (*ResIndex) &= 0x3F; in SiS_GetLVDSCRT1Ptr()
7969 (*DisplayType = 0); in SiS_GetLVDSCRT1Ptr()
8005 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, in SiS_ModCRT1CRTC()
8006 0x07, 0x10, 0x11, 0x15, 0x16 in SiS_ModCRT1CRTC()
8042 #if 0 /* Works better with calculated numbers */ in SiS_ModCRT1CRTC()
8057 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_ModCRT1CRTC()
8059 for(i = 0; i <= 10; i++) { in SiS_ModCRT1CRTC()
8064 for(i = 0x0A, j = 11; i <= 0x0C; i++, j++) { in SiS_ModCRT1CRTC()
8069 tempah = (LVDSCRT1Ptr + ResIndex)->CR[14] & 0xE0; in SiS_ModCRT1CRTC()
8070 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah); in SiS_ModCRT1CRTC()
8072 if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_ModCRT1CRTC()
8075 tempah = ((LVDSCRT1Ptr + ResIndex)->CR[14] & 0x01) << 5; in SiS_ModCRT1CRTC()
8076 if(modeflag & DoubleScanMode) tempah |= 0x80; in SiS_ModCRT1CRTC()
8077 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah); in SiS_ModCRT1CRTC()
8095 unsigned short clkbase, vclkindex = 0; in SiS_SetCRT2ECLK()
8116 if(ROMAddr[0x220] & 0x01) { in SiS_SetCRT2ECLK()
8117 sr2b = ROMAddr[0x227]; in SiS_SetCRT2ECLK()
8118 sr2c = ROMAddr[0x228]; in SiS_SetCRT2ECLK()
8123 clkbase = 0x02B; in SiS_SetCRT2ECLK()
8130 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20); in SiS_SetCRT2ECLK()
8133 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10); in SiS_SetCRT2ECLK()
8136 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00); in SiS_SetCRT2ECLK()
8152 if(ModeNo <= 0x13) in SiS_SetCHTVReg()
8157 resindex &= 0x3F; in SiS_SetCHTVReg()
8159 TVType = 0; in SiS_SetCHTVReg()
8176 case 0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break; in SiS_SetCHTVReg()
8199 SiS_SetCH700x(SiS_Pr,0x04,0x43); /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8200 SiS_SetCH700x(SiS_Pr,0x09,0x69); /* Black level for PAL (105)*/ in SiS_SetCHTVReg()
8202 SiS_SetCH700x(SiS_Pr,0x04,0x03); /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8203 SiS_SetCH700x(SiS_Pr,0x09,0x71); /* Black level for NTSC (113)*/ in SiS_SetCHTVReg()
8206 SiS_SetCH700x(SiS_Pr,0x00,CHTVRegData[resindex].Reg[0]); /* Mode register */ in SiS_SetCHTVReg()
8207 SiS_SetCH700x(SiS_Pr,0x07,CHTVRegData[resindex].Reg[1]); /* Start active video register */ in SiS_SetCHTVReg()
8208 SiS_SetCH700x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[2]); /* Position overflow register */ in SiS_SetCHTVReg()
8209 SiS_SetCH700x(SiS_Pr,0x0a,CHTVRegData[resindex].Reg[3]); /* Horiz Position register */ in SiS_SetCHTVReg()
8210 SiS_SetCH700x(SiS_Pr,0x0b,CHTVRegData[resindex].Reg[4]); /* Vertical Position register */ in SiS_SetCHTVReg()
8212 /* Set minimum flicker filter for Luma channel (SR1-0=00), in SiS_SetCHTVReg()
8215 =00101000=0x28 (When reading, S1-0->S3-2, and S3-2->S1-0!) in SiS_SetCHTVReg()
8217 SiS_SetCH700x(SiS_Pr,0x01,0x28); in SiS_SetCHTVReg()
8222 disable peak filter in S-video channel (S3=0) in SiS_SetCHTVReg()
8224 =00110001=0x31 in SiS_SetCHTVReg()
8226 SiS_SetCH700x(SiS_Pr,0x03,0xb1); /* old: 3103 */ in SiS_SetCHTVReg()
8228 /* Register 0x3D does not exist in non-macrovision register map in SiS_SetCHTVReg()
8232 SiS_SetCH70xx(SiS_Pr,0x3d,0x00); in SiS_SetCHTVReg()
8235 /* Register 0x10 only contains 1 writable bit (S0) for sensing, in SiS_SetCHTVReg()
8238 SiS_SetCH70xxANDOR(SiS_Pr,0x10,0x00,0x1F); in SiS_SetCHTVReg()
8240 /* Register 0x11 only contains 3 writable bits (S0-S2) for in SiS_SetCHTVReg()
8243 SiS_SetCH70xxANDOR(SiS_Pr,0x11,0x02,0xF8); in SiS_SetCHTVReg()
8247 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xEF); in SiS_SetCHTVReg()
8251 if(resindex == 0x04) { /* 640x480 overscan: Mode 16 */ in SiS_SetCHTVReg()
8252 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8253 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on, no need to set FSCI */ in SiS_SetCHTVReg()
8254 } else if(resindex == 0x05) { /* 800x600 overscan: Mode 23 */ in SiS_SetCHTVReg()
8255 SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* 0x18-0x1f: FSCI 469,762,048 */ in SiS_SetCHTVReg()
8256 SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x0C,0xF0); in SiS_SetCHTVReg()
8257 SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x00,0xF0); in SiS_SetCHTVReg()
8258 SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x00,0xF0); in SiS_SetCHTVReg()
8259 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xF0); in SiS_SetCHTVReg()
8260 SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x00,0xF0); in SiS_SetCHTVReg()
8261 SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x00,0xF0); in SiS_SetCHTVReg()
8262 SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x00,0xF0); in SiS_SetCHTVReg()
8263 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x01,0xEF); /* Loop filter on for mode 23 */ in SiS_SetCHTVReg()
8264 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); /* ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8267 if(resindex == 0x04) { /* ----- 640x480 underscan; Mode 17 */ in SiS_SetCHTVReg()
8268 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8269 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); in SiS_SetCHTVReg()
8270 } else if(resindex == 0x05) { /* ----- 800x600 underscan: Mode 24 */ in SiS_SetCHTVReg()
8271 #if 0 in SiS_SetCHTVReg()
8272 … SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* (FSCI was 0x1f1c71c7 - this is for mode 22) */ in SiS_SetCHTVReg()
8273 SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x09,0xF0); /* FSCI for mode 24 is 428,554,851 */ in SiS_SetCHTVReg()
8274 SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x08,0xF0); /* 198b3a63 */ in SiS_SetCHTVReg()
8275 SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x0b,0xF0); in SiS_SetCHTVReg()
8276 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x04,0xF0); in SiS_SetCHTVReg()
8277 SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x01,0xF0); in SiS_SetCHTVReg()
8278 SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x06,0xF0); in SiS_SetCHTVReg()
8279 SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x05,0xF0); in SiS_SetCHTVReg()
8280 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off for mode 24 */ in SiS_SetCHTVReg()
8281 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); * ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8283 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8284 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); in SiS_SetCHTVReg()
8289 SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8290 SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE); /* ACIV on */ in SiS_SetCHTVReg()
8306 temp = CHTVRegData[resindex].Reg[0]; in SiS_SetCHTVReg()
8307 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp |= 0x10; in SiS_SetCHTVReg()
8308 SiS_SetCH701x(SiS_Pr,0x00,temp); in SiS_SetCHTVReg()
8310 SiS_SetCH701x(SiS_Pr,0x01,CHTVRegData[resindex].Reg[1]); in SiS_SetCHTVReg()
8311 SiS_SetCH701x(SiS_Pr,0x02,CHTVRegData[resindex].Reg[2]); in SiS_SetCHTVReg()
8312 SiS_SetCH701x(SiS_Pr,0x04,CHTVRegData[resindex].Reg[3]); in SiS_SetCHTVReg()
8313 SiS_SetCH701x(SiS_Pr,0x03,CHTVRegData[resindex].Reg[4]); in SiS_SetCHTVReg()
8314 SiS_SetCH701x(SiS_Pr,0x05,CHTVRegData[resindex].Reg[5]); in SiS_SetCHTVReg()
8315 SiS_SetCH701x(SiS_Pr,0x06,CHTVRegData[resindex].Reg[6]); in SiS_SetCHTVReg()
8318 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 0x66; in SiS_SetCHTVReg()
8319 SiS_SetCH701x(SiS_Pr,0x07,temp); in SiS_SetCHTVReg()
8321 SiS_SetCH701x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[8]); in SiS_SetCHTVReg()
8322 SiS_SetCH701x(SiS_Pr,0x15,CHTVRegData[resindex].Reg[9]); in SiS_SetCHTVReg()
8323 SiS_SetCH701x(SiS_Pr,0x1f,CHTVRegData[resindex].Reg[10]); in SiS_SetCHTVReg()
8324 SiS_SetCH701x(SiS_Pr,0x0c,CHTVRegData[resindex].Reg[11]); in SiS_SetCHTVReg()
8325 SiS_SetCH701x(SiS_Pr,0x0d,CHTVRegData[resindex].Reg[12]); in SiS_SetCHTVReg()
8326 SiS_SetCH701x(SiS_Pr,0x0e,CHTVRegData[resindex].Reg[13]); in SiS_SetCHTVReg()
8327 SiS_SetCH701x(SiS_Pr,0x0f,CHTVRegData[resindex].Reg[14]); in SiS_SetCHTVReg()
8328 SiS_SetCH701x(SiS_Pr,0x10,CHTVRegData[resindex].Reg[15]); in SiS_SetCHTVReg()
8330 temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02; in SiS_SetCHTVReg()
8337 if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02; in SiS_SetCHTVReg()
8338 SiS_SetCH701x(SiS_Pr,0x21,temp); in SiS_SetCHTVReg()
8360 SiS_SetCH701x(SiS_Pr,0x66,0x65); in SiS_Chrontel701xBLOn()
8362 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOn()
8363 temp |= 0x20; in SiS_Chrontel701xBLOn()
8364 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOn()
8376 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOff()
8377 temp &= 0xDF; in SiS_Chrontel701xBLOff()
8378 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOff()
8385 static const unsigned char regtable[] = { 0x67, 0x68, 0x69, 0x6a, 0x6b }; in SiS_ChrontelPowerSequencing()
8386 static const unsigned char table1024_740[] = { 0x01, 0x02, 0x01, 0x01, 0x01 }; in SiS_ChrontelPowerSequencing()
8387 static const unsigned char table1400_740[] = { 0x01, 0x6e, 0x01, 0x01, 0x01 }; in SiS_ChrontelPowerSequencing()
8388 static const unsigned char asus1024_740[] = { 0x19, 0x6e, 0x01, 0x19, 0x09 }; in SiS_ChrontelPowerSequencing()
8389 static const unsigned char asus1400_740[] = { 0x19, 0x6e, 0x01, 0x19, 0x09 }; in SiS_ChrontelPowerSequencing()
8390 static const unsigned char table1024_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 }; in SiS_ChrontelPowerSequencing()
8391 static const unsigned char table1400_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 }; in SiS_ChrontelPowerSequencing()
8417 for(i=0; i<5; i++) { in SiS_ChrontelPowerSequencing()
8429 0x1c, 0x5f, 0x64, 0x6f, 0x70, 0x71, in SiS_SetCH701xForLCD()
8430 0x72, 0x73, 0x74, 0x76, 0x78, 0x7d, 0x66 in SiS_SetCH701xForLCD()
8433 0x60, 0x02, 0x00, 0x07, 0x40, 0xed, in SiS_SetCH701xForLCD()
8434 0xa3, 0xc8, 0xc7, 0xac, 0xe0, 0x02, 0x44 in SiS_SetCH701xForLCD()
8437 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8438 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 in SiS_SetCH701xForLCD()
8441 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8442 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 in SiS_SetCH701xForLCD()
8445 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8446 0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a, 0x44 in SiS_SetCH701xForLCD()
8449 0x60, 0x02, 0x00, 0x07, 0x40, 0xed, in SiS_SetCH701xForLCD()
8450 0xa3, 0xc8, 0xc7, 0xac, 0x60, 0x02 in SiS_SetCH701xForLCD()
8453 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8454 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02 in SiS_SetCH701xForLCD()
8457 0x60, 0x03, 0x11, 0x00, 0x40, 0xef, in SiS_SetCH701xForLCD()
8458 0xad, 0xdb, 0xf6, 0xac, 0x60, 0x02 in SiS_SetCH701xForLCD()
8461 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8462 0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a in SiS_SetCH701xForLCD()
8479 tempbh = SiS_GetCH701x(SiS_Pr,0x74); in SiS_SetCH701xForLCD()
8480 if((tempbh == 0xf6) || (tempbh == 0xc7)) { in SiS_SetCH701xForLCD()
8481 tempbh = SiS_GetCH701x(SiS_Pr,0x73); in SiS_SetCH701xForLCD()
8482 if(tempbh == 0xc8) { in SiS_SetCH701xForLCD()
8484 } else if(tempbh == 0xdb) { in SiS_SetCH701xForLCD()
8487 } else if(tempbh == 0xde) { in SiS_SetCH701xForLCD()
8492 if(SiS_Pr->ChipType == SIS_740) tempbh = 0x0d; in SiS_SetCH701xForLCD()
8493 else tempbh = 0x0c; in SiS_SetCH701xForLCD()
8495 for(i = 0; i < tempbh; i++) { in SiS_SetCH701xForLCD()
8499 tempbh = SiS_GetCH701x(SiS_Pr,0x1e); in SiS_SetCH701xForLCD()
8500 tempbh |= 0xc0; in SiS_SetCH701xForLCD()
8501 SiS_SetCH701x(SiS_Pr,0x1e,tempbh); in SiS_SetCH701xForLCD()
8504 tempbh = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_SetCH701xForLCD()
8505 tempbh &= 0xfb; in SiS_SetCH701xForLCD()
8506 SiS_SetCH701x(SiS_Pr,0x1c,tempbh); in SiS_SetCH701xForLCD()
8507 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_SetCH701xForLCD()
8508 tempbh = SiS_GetCH701x(SiS_Pr,0x64); in SiS_SetCH701xForLCD()
8509 tempbh |= 0x40; in SiS_SetCH701xForLCD()
8510 SiS_SetCH701x(SiS_Pr,0x64,tempbh); in SiS_SetCH701xForLCD()
8511 tempbh = SiS_GetCH701x(SiS_Pr,0x03); in SiS_SetCH701xForLCD()
8512 tempbh &= 0x3f; in SiS_SetCH701xForLCD()
8513 SiS_SetCH701x(SiS_Pr,0x03,tempbh); in SiS_SetCH701xForLCD()
8522 temp1 = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetVSync()
8523 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_ChrontelResetVSync()
8524 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8525 temp &= 0x7f; /* Use external VSYNC */ in SiS_ChrontelResetVSync()
8526 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8528 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8529 temp |= 0x80; /* Use internal VSYNC */ in SiS_ChrontelResetVSync()
8530 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8531 SiS_SetCH701x(SiS_Pr,0x49,temp1); in SiS_ChrontelResetVSync()
8541 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_Chrontel701xOn()
8542 temp |= 0x04; /* Invert XCLK phase */ in SiS_Chrontel701xOn()
8543 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_Chrontel701xOn()
8546 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8547 temp &= 0x3f; in SiS_Chrontel701xOn()
8548 temp |= 0x80; /* Enable YPrPb (HDTV) */ in SiS_Chrontel701xOn()
8549 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8552 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8553 temp &= 0x3f; in SiS_Chrontel701xOn()
8554 temp |= 0xc0; /* Enable SCART + CVBS */ in SiS_Chrontel701xOn()
8555 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8559 SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ in SiS_Chrontel701xOn()
8561 SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ in SiS_Chrontel701xOn()
8562 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_Chrontel701xOn()
8564 temp = SiS_GetCH701x(SiS_Pr,0x73); in SiS_Chrontel701xOn()
8565 temp |= 0x60; in SiS_Chrontel701xOn()
8566 SiS_SetCH701x(SiS_Pr,0x73,temp); in SiS_Chrontel701xOn()
8568 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8569 temp &= 0x7f; in SiS_Chrontel701xOn()
8570 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8572 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8573 temp |= 0x80; in SiS_Chrontel701xOn()
8574 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8589 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_Chrontel701xOff()
8590 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_Chrontel701xOff()
8593 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_Chrontel701xOff()
8594 temp &= 0xfc; in SiS_Chrontel701xOff()
8595 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_Chrontel701xOff()
8596 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_Chrontel701xOff()
8608 temp = SiS_GetCH701x(SiS_Pr,0x4a); /* Version ID */ in SiS_ChrontelResetDB()
8609 temp &= 0x01; in SiS_ChrontelResetDB()
8613 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetDB()
8614 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_ChrontelResetDB()
8618 SiS_SetCH701x(SiS_Pr,0x48,0x10); in SiS_ChrontelResetDB()
8620 SiS_SetCH701x(SiS_Pr,0x48,0x18); in SiS_ChrontelResetDB()
8624 SiS_SetCH701x(SiS_Pr,0x49,temp); in SiS_ChrontelResetDB()
8630 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8631 temp &= 0xef; in SiS_ChrontelResetDB()
8632 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8633 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8634 temp |= 0x10; in SiS_ChrontelResetDB()
8635 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8636 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8637 temp &= 0xef; in SiS_ChrontelResetDB()
8638 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8639 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelResetDB()
8647 SiS_SetCH701x(SiS_Pr,0x48,0x10); in SiS_ChrontelResetDB()
8649 SiS_SetCH701x(SiS_Pr,0x48,0x18); in SiS_ChrontelResetDB()
8666 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* Power up LVDS block */ in SiS_ChrontelInitTVVSync()
8667 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelInitTVVSync()
8669 if(temp != 1) { /* TV block powered? (0 = yes, 1 = no) */ in SiS_ChrontelInitTVVSync()
8670 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8671 temp &= 0x70; in SiS_ChrontelInitTVVSync()
8672 SiS_SetCH701x(SiS_Pr,0x47,temp); /* enable VSYNC */ in SiS_ChrontelInitTVVSync()
8674 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8675 temp |= 0x80; in SiS_ChrontelInitTVVSync()
8676 SiS_SetCH701x(SiS_Pr,0x47,temp); /* disable VSYNC */ in SiS_ChrontelInitTVVSync()
8689 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8692 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8694 SiS_SetCH701x(SiS_Pr,0x66,0x45); /* Panel power on */ in SiS_ChrontelDoSomething3()
8695 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on */ in SiS_ChrontelDoSomething3()
8701 temp1 = 0; in SiS_ChrontelDoSomething3()
8702 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8705 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8708 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_ChrontelDoSomething3()
8709 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8710 temp |= 0x5f; in SiS_ChrontelDoSomething3()
8711 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8712 if(ModeNo > 0x13) { in SiS_ChrontelDoSomething3()
8722 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething3()
8723 temp |= 0x03; in SiS_ChrontelDoSomething3()
8724 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething3()
8725 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8726 temp &= 0x7f; in SiS_ChrontelDoSomething3()
8727 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8741 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething2()
8742 temp &= 0x04; /* PLL stable? -> bail out */ in SiS_ChrontelDoSomething2()
8743 if(temp == 0x04) break; in SiS_ChrontelDoSomething2()
8747 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_ChrontelDoSomething2()
8752 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8753 temp &= 0xfb; /* Reset PLL */ in SiS_ChrontelDoSomething2()
8754 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8756 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8757 temp |= 0x04; /* PLL normal operation */ in SiS_ChrontelDoSomething2()
8758 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8760 SiS_SetCH701x(SiS_Pr,0x78,0xe0); /* PLL loop filter */ in SiS_ChrontelDoSomething2()
8762 SiS_SetCH701x(SiS_Pr,0x78,0x60); in SiS_ChrontelDoSomething2()
8765 } while(0); in SiS_ChrontelDoSomething2()
8767 SiS_SetCH701x(SiS_Pr,0x77,0x00); /* MV? */ in SiS_ChrontelDoSomething2()
8775 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8776 temp |= 0x80; /* Set datapath 1 to TV */ in SiS_ChrontelDoSomething1()
8777 temp &= 0xbf; /* Set datapath 2 to LVDS */ in SiS_ChrontelDoSomething1()
8778 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8782 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_ChrontelDoSomething1()
8783 temp &= 0xfb; /* Normal XCLK phase */ in SiS_ChrontelDoSomething1()
8784 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_ChrontelDoSomething1()
8786 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_ChrontelDoSomething1()
8788 temp = SiS_GetCH701x(SiS_Pr,0x64); in SiS_ChrontelDoSomething1()
8789 temp |= 0x40; /* ? Bit not defined */ in SiS_ChrontelDoSomething1()
8790 SiS_SetCH701x(SiS_Pr,0x64,temp); in SiS_ChrontelDoSomething1()
8792 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8793 temp &= 0x3f; /* D1 input to both LVDS and TV */ in SiS_ChrontelDoSomething1()
8794 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8797 SiS_SetCH701x(SiS_Pr,0x63,0x40); /* LVDS off */ in SiS_ChrontelDoSomething1()
8799 SiS_SetCH701x(SiS_Pr,0x63,0x00); /* LVDS on */ in SiS_ChrontelDoSomething1()
8802 SiS_ChrontelDoSomething3(SiS_Pr, 0); in SiS_ChrontelDoSomething1()
8804 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething1()
8805 if(temp != 0x45) { in SiS_ChrontelDoSomething1()
8808 SiS_ChrontelDoSomething3(SiS_Pr, 0); in SiS_ChrontelDoSomething1()
8816 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34); in SiS_ChrontelDoSomething1()
8818 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on, LVDS normal operation */ in SiS_ChrontelDoSomething1()
8842 ModeIdIndex = 0; in SiS_SetCRT2Group()
8857 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_SetCRT2Group()
8871 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_SetCRT2Group()
8902 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) { in SiS_SetCRT2Group()
8920 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2Group()
8941 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_SetCRT2Group()
8968 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); in SiS_SetCRT2Group()
8982 SiS_SetRegSR11ANDOR(SiS_Pr,0xFF,0x0C); in SiS_SetCRT2Group()
8985 SiS_SetCH70xxANDOR(SiS_Pr,0x0e,0x01,0xf8); in SiS_SetCRT2Group()
9005 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOn()
9006 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_SiS30xBLOn()
9007 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_SiS30xBLOn()
9010 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) { in SiS_SiS30xBLOn()
9011 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_SiS30xBLOn()
9019 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_SiS30xBLOff()
9020 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOff()
9032 if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) { in SiS_SetupDDCN()
9033 SiS_Pr->SiS_DDC_NData &= 0x0f; in SiS_SetupDDCN()
9034 SiS_Pr->SiS_DDC_NClk &= 0x0f; in SiS_SetupDDCN()
9046 for(i=0; i<20; i++) { /* Do 20 attempts to write */ in SiS_SetTrumpBlockLoop()
9056 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9061 for(j=0; j<num; j++) { in SiS_SetTrumpBlockLoop()
9063 temp = SiS_WriteDDC2Data(SiS_Pr,tempah);/* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9076 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ in SiS_SetTrumpionBlock()
9077 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetTrumpionBlock()
9078 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetTrumpionBlock()
9079 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetTrumpionBlock()
9095 * On 630(S)T chipset, the index changed from 0x11 to
9096 * 0x0a, possibly for working around the DDC problems
9104 for(i=0; i<20; i++) { /* Do 20 attempts to write */ in SiS_SetChReg()
9110 temp = SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_SetChReg()
9127 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH700x()
9132 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH700x()
9133 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetCH700x()
9134 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetCH700x()
9138 if( (!(SiS_SetChReg(SiS_Pr, reg, val, 0x80))) && in SiS_SetCH700x()
9140 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_SetCH700x()
9141 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_SetCH700x()
9142 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_SetCH700x()
9145 SiS_SetChReg(SiS_Pr, reg, val, 0x80); in SiS_SetCH700x()
9154 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH701x()
9155 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_SetCH701x()
9156 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_SetCH701x()
9158 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH701x()
9159 SiS_SetChReg(SiS_Pr, reg, val, 0); in SiS_SetCH701x()
9177 for(i=0; i<20; i++) { /* Do 20 attempts to read */ in SiS_GetChReg()
9183 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_GetChReg()
9185 … temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_ReadAddr | myor); /* Write RAB (700x: | 0x80) */ in SiS_GetChReg()
9188 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr | 0x01);/* DAB (S0=1=read) */ in SiS_GetChReg()
9195 return 0xFFFF; in SiS_GetChReg()
9205 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH700x()
9210 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH700x()
9211 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_GetCH700x()
9212 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_GetCH700x()
9218 if( ((result = SiS_GetChReg(SiS_Pr,0x80)) == 0xFFFF) && in SiS_GetCH700x()
9221 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_GetCH700x()
9222 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_GetCH700x()
9223 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_GetCH700x()
9226 result = SiS_GetChReg(SiS_Pr,0x80); in SiS_GetCH700x()
9236 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH701x()
9237 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_GetCH701x()
9238 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_GetCH701x()
9240 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH701x()
9244 return SiS_GetChReg(SiS_Pr,0); in SiS_GetCH701x()
9265 tempbl = (SiS_GetCH70xx(SiS_Pr, (reg & 0xFF)) & myand) | myor; in SiS_SetCH70xxANDOR()
9276 unsigned char ddcdtype[] = { 0xa0, 0xa0, 0xa0, 0xa2, 0xa6 }; in SiS_InitDDCRegs()
9278 unsigned short temp = 0, myadaptnum = adaptnum; in SiS_InitDDCRegs()
9280 if(adaptnum != 0) { in SiS_InitDDCRegs()
9281 if(!(VBFlags2 & VB2_SISTMDSBRIDGE)) return 0xFFFF; in SiS_InitDDCRegs()
9282 if((VBFlags2 & VB2_30xBDH) && (adaptnum == 1)) return 0xFFFF; in SiS_InitDDCRegs()
9285 /* adapternum for SiS bridges: 0 = CRT1, 1 = LCD, 2 = VGA2 */ in SiS_InitDDCRegs()
9287 SiS_Pr->SiS_ChrontelInit = 0; /* force re-detection! */ in SiS_InitDDCRegs()
9289 SiS_Pr->SiS_DDC_SecAddr = 0; in SiS_InitDDCRegs()
9292 SiS_Pr->SiS_DDC_Index = 0x11; in SiS_InitDDCRegs()
9293 flag = 0xff; in SiS_InitDDCRegs()
9295 cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32); in SiS_InitDDCRegs()
9297 #if 0 in SiS_InitDDCRegs()
9299 if(myadaptnum == 0) { in SiS_InitDDCRegs()
9300 if(!(cr32 & 0x20)) { in SiS_InitDDCRegs()
9302 if(!(cr32 & 0x10)) { in SiS_InitDDCRegs()
9304 if(!(cr32 & 0x08)) { in SiS_InitDDCRegs()
9305 myadaptnum = 0; in SiS_InitDDCRegs()
9315 if(myadaptnum != 0) { in SiS_InitDDCRegs()
9316 flag = 0; in SiS_InitDDCRegs()
9319 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9324 if((cr32 & 0x80) && (checkcr32)) { in SiS_InitDDCRegs()
9326 if(!(cr32 & 0x08)) { in SiS_InitDDCRegs()
9328 if(!(cr32 & 0x10)) return 0xFFFF; in SiS_InitDDCRegs()
9335 if(flag) temp = 0; in SiS_InitDDCRegs()
9339 /* here we simplify: 0 = CRT1, 1 = CRT2 (VGA, LCD) */ in SiS_InitDDCRegs()
9348 flag = 0; in SiS_InitDDCRegs()
9351 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9355 if((cr32 & 0x80) && (checkcr32)) { in SiS_InitDDCRegs()
9357 if(!(cr32 & 0x08)) { in SiS_InitDDCRegs()
9359 if(!(cr32 & 0x10)) return 0xFFFF; in SiS_InitDDCRegs()
9366 temp = 0; in SiS_InitDDCRegs()
9367 if(VBFlags2 & VB2_LVDS) flag = 0xff; in SiS_InitDDCRegs()
9370 if(flag) temp = 0; in SiS_InitDDCRegs()
9373 SiS_Pr->SiS_DDC_Data = 0x02 << temp; in SiS_InitDDCRegs()
9374 SiS_Pr->SiS_DDC_Clk = 0x01 << temp; in SiS_InitDDCRegs()
9378 return 0; in SiS_InitDDCRegs()
9384 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_WriteDABDDC()
9386 return 0xFFFF; in SiS_WriteDABDDC()
9389 return 0xFFFF; in SiS_WriteDABDDC()
9391 return 0; in SiS_WriteDABDDC()
9397 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_PrepareReadDDC()
9398 if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) { in SiS_PrepareReadDDC()
9399 return 0xFFFF; in SiS_PrepareReadDDC()
9401 return 0; in SiS_PrepareReadDDC()
9409 return 0; in SiS_PrepareDDC()
9425 0); in SiS_SendACK()
9434 unsigned short temp, ret=0; in SiS_DoProbeDDC()
9440 return 0xFFFF; in SiS_DoProbeDDC()
9442 mask = 0xf0; in SiS_DoProbeDDC()
9443 value = 0x20; in SiS_DoProbeDDC()
9444 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9446 SiS_SendACK(SiS_Pr, 0); in SiS_DoProbeDDC()
9447 if(temp == 0) { in SiS_DoProbeDDC()
9448 mask = 0xff; in SiS_DoProbeDDC()
9449 value = 0xff; in SiS_DoProbeDDC()
9452 ret = 0xFFFF; in SiS_DoProbeDDC()
9459 if(temp == value) ret = 0; in SiS_DoProbeDDC()
9461 ret = 0xFFFF; in SiS_DoProbeDDC()
9462 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9463 if(temp == 0x30) ret = 0; in SiS_DoProbeDDC()
9477 flag = 0x180; in SiS_ProbeDDC()
9478 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; in SiS_ProbeDDC()
9479 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x02; in SiS_ProbeDDC()
9480 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; in SiS_ProbeDDC()
9481 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x08; in SiS_ProbeDDC()
9482 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; in SiS_ProbeDDC()
9483 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x10; in SiS_ProbeDDC()
9484 if(!(flag & 0x1a)) flag = 0; in SiS_ProbeDDC()
9495 if(DDCdatatype > 4) return 0xFFFF; in SiS_ReadDDC()
9497 flag = 0; in SiS_ReadDDC()
9502 chksum = 0; in SiS_ReadDDC()
9503 gotcha = 0; in SiS_ReadDDC()
9504 for(i=0; i<length; i++) { in SiS_ReadDDC()
9508 SiS_SendACK(SiS_Pr, 0); in SiS_ReadDDC()
9514 else flag = 0xFFFF; in SiS_ReadDDC()
9516 flag = 0xFFFF; in SiS_ReadDDC()
9532 adaptnum: 0=CRT1(analog), 1=CRT2/LCD(digital), 2=CRT2/VGA2(analog)
9535 DDCdatatype: 0=Probe, 1=EDID, 2=EDID+VDIF, 3=EDID V2 (P&D), 4=EDID V2 (FPDI-2)
9538 Returns 0xFFFF if error, otherwise
9539 if DDCdatatype > 0: Returns 0 if reading OK (included a correct checksum)
9540 if DDCdatatype = 0: Returns supported DDC modes
9552 return 0xFFFF; in SiS_HandleDDC()
9555 return 0xFFFF; in SiS_HandleDDC()
9557 if((!(VBFlags2 & VB2_VIDEOBRIDGE)) && (adaptnum > 0)) in SiS_HandleDDC()
9558 return 0xFFFF; in SiS_HandleDDC()
9560 if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, false, VBFlags2) == 0xFFFF) in SiS_HandleDDC()
9561 return 0xFFFF; in SiS_HandleDDC()
9563 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); in SiS_HandleDDC()
9564 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04); in SiS_HandleDDC()
9566 cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80; in SiS_HandleDDC()
9568 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80); in SiS_HandleDDC()
9569 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01); in SiS_HandleDDC()
9570 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); in SiS_HandleDDC()
9580 if(DDCdatatype == 0) { in SiS_HandleDDC()
9585 if((buffer[0] == 0x00) && (buffer[1] == 0xff) && in SiS_HandleDDC()
9586 (buffer[2] == 0xff) && (buffer[3] == 0xff) && in SiS_HandleDDC()
9587 (buffer[4] == 0xff) && (buffer[5] == 0xff) && in SiS_HandleDDC()
9588 (buffer[6] == 0xff) && (buffer[7] == 0x00) && in SiS_HandleDDC()
9589 (buffer[0x12] == 1)) { in SiS_HandleDDC()
9592 if(!(buffer[0x14] & 0x80)) result = 0xFFFE; in SiS_HandleDDC()
9594 if(buffer[0x14] & 0x80) result = 0xFFFE; in SiS_HandleDDC()
9600 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f); in SiS_HandleDDC()
9602 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17); in SiS_HandleDDC()
9623 return ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1); in SiS_ReadDDC1Bit()
9631 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9636 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStart()
9640 0x00); /* SD->low = start condition */ in SiS_SetStart()
9641 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9642 return 0; in SiS_SetStart()
9650 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStop()
9654 0x00); /* SD->low */ in SiS_SetStop()
9655 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStop()
9660 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->high) */ in SiS_SetStop()
9661 return 0; in SiS_SetStop()
9670 flag = 0x80; in SiS_WriteDDC2Data()
9671 for(i = 0; i < 8; i++) { in SiS_WriteDDC2Data()
9682 0x00); /* Write bit (0) to SD */ in SiS_WriteDDC2Data()
9696 getdata = 0; in SiS_ReadDDC2Data()
9697 for(i = 0; i < 8; i++) { in SiS_ReadDDC2Data()
9706 if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01; in SiS_ReadDDC2Data()
9717 0x00); /* SetSCLKLow() */ in SiS_SetSCLKLow()
9719 return 0; in SiS_SetSCLKLow()
9735 return 0xFFFF; in SiS_SetSCLKHigh()
9738 return 0; in SiS_SetSCLKHigh()
9742 /* Returns 0 if ack ok, non-0 if ack not ok */
9756 if(tempah & SiS_Pr->SiS_DDC_Data) return 1; /* Ack OK if bit = 0 */ in SiS_CheckACK()
9757 return 0; in SiS_CheckACK()
9774 romptr = SISGETROMW(0x128); in GetRAMDACromptr()
9776 romptr = SISGETROMW(0x12a); in GetRAMDACromptr()
9778 romptr = SISGETROMW(0x1a8); in GetRAMDACromptr()
9780 romptr = SISGETROMW(0x1aa); in GetRAMDACromptr()
9792 romptr = SISGETROMW(0x120); in GetLCDromptr()
9794 romptr = SISGETROMW(0x122); in GetLCDromptr()
9796 romptr = SISGETROMW(0x1a0); in GetLCDromptr()
9798 romptr = SISGETROMW(0x1a2); in GetLCDromptr()
9810 romptr = SISGETROMW(0x114); in GetTVromptr()
9812 romptr = SISGETROMW(0x11a); in GetTVromptr()
9814 romptr = SISGETROMW(0x194); in GetTVromptr()
9816 romptr = SISGETROMW(0x19a); in GetTVromptr()
9828 if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) { in GetLCDPtrIndexBIOS()
9838 index = SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F; in GetLCDPtrIndexBIOS()
9858 index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3; in GetLCDPtrIndex()
9869 index = 0; in GetTVPtrIndex()
9873 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) index = 0; in GetTVPtrIndex()
9888 unsigned short index = 0, temp = 0; in GetOEMTVPtr661_2_GEN()
9906 temp += 0x0100; in GetOEMTVPtr661_2_GEN()
9917 #if 0
9928 int index = 0; in GetOEMTVPtr661()
9952 unsigned short delay=0,index,myindex,temp,romptr=0; in SetDelayComp()
9956 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); in SetDelayComp()
9958 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f); in SetDelayComp()
9970 delay = 0x04; in SetDelayComp()
9973 delay = 0x0a; in SetDelayComp()
9975 delay = 0x00; in SetDelayComp()
9977 delay = 0x0c; in SetDelayComp()
9980 delay = 0x00; in SetDelayComp()
9992 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f)); in SetDelayComp()
9993 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7)); in SetDelayComp()
9998 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0)); in SetDelayComp()
9999 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6)); in SetDelayComp()
10008 delay = 0x00; in SetDelayComp()
10010 delay = 0x20; in SetDelayComp()
10012 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay); in SetDelayComp()
10014 delay = 0x0c; in SetDelayComp()
10016 delay = 0x03; in SetDelayComp()
10018 delay = 0x00; in SetDelayComp()
10021 if(IS_SIS740) delay = 0x01; in SetDelayComp()
10022 else delay = 0x03; in SetDelayComp()
10024 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay); in SetDelayComp()
10040 delay = 0x03; in SetDelayComp()
10047 delay = 0x02; in SetDelayComp()
10054 delay = 0x33; in SetDelayComp()
10055 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10056 delay &= 0x0f; in SetDelayComp()
10075 /* romptr = SISGETROMW(0x120); */ in SetDelayComp()
10077 romptr = SISGETROMW(0x122); in SetDelayComp()
10106 if(IS_SIS740) delay = 0x03; in SetDelayComp()
10107 else delay = 0x00; in SetDelayComp()
10113 if(IS_SIS740) delay = 0x01; in SetDelayComp()
10117 if(IS_SIS740) delay = 0x01; /* ? */ in SetDelayComp()
10118 else delay = 0x03; in SetDelayComp()
10119 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) delay = 0x00; /* experience */ in SetDelayComp()
10121 if(IS_SIS740) delay = 0x01; in SetDelayComp()
10130 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); in SetDelayComp()
10145 /* romptr = SISGETROMW(0x114); */ in SetDelayComp()
10147 romptr = SISGETROMW(0x11a); in SetDelayComp()
10164 delay = 0x02; in SetDelayComp()
10169 delay = 0x03; in SetDelayComp()
10199 if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02; in SetDelayComp()
10206 delay &= 0x0f; in SetDelayComp()
10218 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4; in SetDelayComp()
10220 delay &= 0x0f; in SetDelayComp()
10221 delay |= 0xb0; in SetDelayComp()
10223 delay &= 0x0f; in SetDelayComp()
10224 delay |= 0xc0; in SetDelayComp()
10226 delay = 0x35; in SetDelayComp()
10228 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10232 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10239 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10241 if(IS_SIS650 && (SiS_Pr->SiS_IF_DEF_CH70xx != 0)) { in SetDelayComp()
10243 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,delay); in SetDelayComp()
10245 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10257 unsigned short index,temp,temp1,romptr=0; in SetAntiFlicker()
10261 if(ModeNo<=0x13) in SetAntiFlicker()
10267 temp >>= 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetAntiFlicker()
10274 romptr = SISGETROMW(0x260); in SetAntiFlicker()
10276 romptr = SISGETROMW(0x360); in SetAntiFlicker()
10279 romptr = SISGETROMW(0x192); in SetAntiFlicker()
10281 romptr = SISGETROMW(0x112); in SetAntiFlicker()
10293 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8f,temp); /* index 0A D[6:4] */ in SetAntiFlicker()
10300 unsigned short index,temp,temp1,romptr=0; in SetEdgeEnhance()
10302 temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetEdgeEnhance()
10304 if(ModeNo <= 0x13) in SetEdgeEnhance()
10311 romptr = SISGETROMW(0x26c); in SetEdgeEnhance()
10313 romptr = SISGETROMW(0x36c); in SetEdgeEnhance()
10318 romptr = SISGETROMW(0x1a4); in SetEdgeEnhance()
10320 romptr = SISGETROMW(0x124); in SetEdgeEnhance()
10331 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x3A,0x1F,temp); /* index 0A D[7:5] */ in SetEdgeEnhance()
10339 if(ModeNo <= 0x13) { in SetYFilter()
10345 temp = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetYFilter()
10353 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetYFilter()
10356 for(i=0x48; i<=0x4A; i++, j++) { in SetYFilter()
10360 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetYFilter()
10370 unsigned short index,temp,i,j,resinfo,romptr=0; in SetPhaseIncr()
10379 lindex = GetOEMTVPtr661_2_OLD(SiS_Pr) & 0xffff; in SetPhaseIncr()
10381 for(j=0, i=0x31; i<=0x34; i++, j++) { in SetPhaseIncr()
10390 if(ModeNo<=0x13) { in SetPhaseIncr()
10397 /* 0: NTSC Graphics, 1: NTSC Text, 2: PAL Graphics, in SetPhaseIncr()
10401 romptr = SISGETROMW(0x116); in SetPhaseIncr()
10403 romptr = SISGETROMW(0x196); in SetPhaseIncr()
10406 romptr = SISGETROMW(0x11c); in SetPhaseIncr()
10408 romptr = SISGETROMW(0x19c); in SetPhaseIncr()
10411 romptr = SISGETROMW(0x116); in SetPhaseIncr()
10413 romptr = SISGETROMW(0x196); in SetPhaseIncr()
10420 for(j=0, i=0x31; i<=0x34; i++, j++) { in SetPhaseIncr()
10425 temp >>= 1; /* 0:NTSC, 1:PAL, 2:HiTV */ in SetPhaseIncr()
10426 for(j=0, i=0x31; i<=0x34; i++, j++) { in SetPhaseIncr()
10437 if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPr525p | TVSetYPbPr750p))) && (ModeNo > 0x13)) { in SetPhaseIncr()
10440 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21); in SetPhaseIncr()
10441 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0); in SetPhaseIncr()
10442 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5); in SetPhaseIncr()
10443 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f); in SetPhaseIncr()
10445 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e); in SetPhaseIncr()
10446 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b); in SetPhaseIncr()
10447 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb); in SetPhaseIncr()
10448 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b); in SetPhaseIncr()
10458 unsigned short delay = 0, romptr = 0, index, lcdpdcindex; in SetDelayComp661()
10474 } else if(ModeNo > 0x13) { in SetDelayComp661()
10480 if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) { in SetDelayComp661()
10483 romptr = SISGETROMW(0x104); in SetDelayComp661()
10486 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10487 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10489 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10490 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10498 if(SiS_Pr->UseCustomMode) delay = 0x04; in SetDelayComp661()
10499 else if(ModeNo <= 0x13) delay = 0x04; in SetDelayComp661()
10505 delay = 0x0606; in SetDelayComp661()
10508 delay = 0x0404; in SetDelayComp661()
10511 if((romptr = SISGETROMW(0x35e))) { in SetDelayComp661()
10512 delay = (ROMAddr[romptr + index] & 0x0f) << 1; in SetDelayComp661()
10518 if(SiS_Pr->ChipType == XGI_40 && SiS_Pr->ChipRevision == 0x02) { in SetDelayComp661()
10519 delay -= 0x0404; in SetDelayComp661()
10526 delay = 0x0606; in SetDelayComp661()
10528 delay = 0x0404; in SetDelayComp661()
10538 romptr = SISGETROMW(0x106); in SetDelayComp661()
10542 delay = 0x04; in SetDelayComp661()
10543 if(index > 3) delay = 0; in SetDelayComp661()
10565 case Panel_1024x768: delay = 0x0008; break; in SetDelayComp661()
10566 case Panel_1280x720: delay = 0x0004; break; in SetDelayComp661()
10568 case Panel_1280x768_2:delay = 0x0004; break; in SetDelayComp661()
10570 case Panel_1280x800_2:delay = 0x0004; break; /* Verified for 1280x800 */ in SetDelayComp661()
10571 case Panel_1280x854: delay = 0x0004; break; /* FIXME */ in SetDelayComp661()
10572 case Panel_1280x1024: delay = 0x1e04; break; in SetDelayComp661()
10573 case Panel_1400x1050: delay = 0x0004; break; in SetDelayComp661()
10574 case Panel_1600x1200: delay = 0x0400; break; in SetDelayComp661()
10575 case Panel_1680x1050: delay = 0x0e04; break; in SetDelayComp661()
10578 delay = 0x0008; in SetDelayComp661()
10580 delay = 0x1e04; in SetDelayComp661()
10582 delay = 0x0004; in SetDelayComp661()
10584 delay = 0x0400; in SetDelayComp661()
10586 delay = 0x0e04; in SetDelayComp661()
10594 delay = SiS_Pr->PDC & 0x1f; in SetDelayComp661()
10597 delay = (SiS_Pr->PDCA & 0x1f) << 8; in SetDelayComp661()
10606 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10607 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10609 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10610 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10622 if(ModeNo <= 0x13) { in SetCRT2SyncDither661()
10631 infoflag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); /* No longer check D5 */ in SetCRT2SyncDither661()
10634 infoflag &= 0xc0; in SetCRT2SyncDither661()
10637 temp = (infoflag >> 6) | 0x0c; in SetCRT2SyncDither661()
10639 temp ^= 0x04; in SetCRT2SyncDither661()
10640 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x10; in SetCRT2SyncDither661()
10642 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp); in SetCRT2SyncDither661()
10644 temp = 0x30; in SetCRT2SyncDither661()
10645 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) temp = 0x20; in SetCRT2SyncDither661()
10647 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp); in SetCRT2SyncDither661()
10648 temp = 0; in SetCRT2SyncDither661()
10650 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x80; in SetCRT2SyncDither661()
10652 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp); in SetCRT2SyncDither661()
10665 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x24,0x0f); in SetPanelParms661()
10670 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SetPanelParms661()
10678 temp1 = (ROMAddr[romptr] & 0x03) | 0x0c; in SetPanelParms661()
10679 temp2 = 0xfc; in SetPanelParms661()
10681 temp1 &= 0xfc; in SetPanelParms661()
10682 temp2 = 0xf3; in SetPanelParms661()
10684 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1); in SetPanelParms661()
10687 temp1 = (ROMAddr[romptr + 1] & 0x80) >> 1; in SetPanelParms661()
10688 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1); in SetPanelParms661()
10760 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SiS_FinalizeLCD()
10775 if(ModeNo <= 0x13) { in SiS_FinalizeLCD()
10784 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) { in SiS_FinalizeLCD()
10786 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02); in SiS_FinalizeLCD()
10788 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_FinalizeLCD()
10797 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10808 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10811 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10813 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10814 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10815 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10816 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10827 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_FinalizeLCD()
10829 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_FinalizeLCD()
10831 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_FinalizeLCD()
10836 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10839 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10842 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76); in SiS_FinalizeLCD()
10844 if(tempch == 0x03) { in SiS_FinalizeLCD()
10845 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10846 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10847 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10848 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10851 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); in SiS_FinalizeLCD()
10852 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); in SiS_FinalizeLCD()
10853 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); in SiS_FinalizeLCD()
10854 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17); in SiS_FinalizeLCD()
10855 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18); in SiS_FinalizeLCD()
10856 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19); in SiS_FinalizeLCD()
10857 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a); in SiS_FinalizeLCD()
10858 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b); in SiS_FinalizeLCD()
10859 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c); in SiS_FinalizeLCD()
10860 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d); in SiS_FinalizeLCD()
10862 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90); in SiS_FinalizeLCD()
10863 if(ModeNo <= 0x13) { in SiS_FinalizeLCD()
10864 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11); in SiS_FinalizeLCD()
10865 if((resinfo == 0) || (resinfo == 2)) return; in SiS_FinalizeLCD()
10866 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18); in SiS_FinalizeLCD()
10869 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10870 if((ModeNo > 0x13) && (resinfo == SIS_RI_1024x768)) { in SiS_FinalizeLCD()
10871 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); /* 1.10.7u */ in SiS_FinalizeLCD()
10872 #if 0 in SiS_FinalizeLCD()
10873 tempbx = 806; /* 0x326 */ /* other older BIOSes */ in SiS_FinalizeLCD()
10875 temp = tempbx & 0xff; in SiS_FinalizeLCD()
10876 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); in SiS_FinalizeLCD()
10877 temp = (tempbx >> 8) & 0x03; in SiS_FinalizeLCD()
10878 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp); in SiS_FinalizeLCD()
10881 } else if(ModeNo <= 0x13) { in SiS_FinalizeLCD()
10883 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70); in SiS_FinalizeLCD()
10884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff); in SiS_FinalizeLCD()
10885 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10886 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10889 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20); in SiS_FinalizeLCD()
10890 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a); in SiS_FinalizeLCD()
10891 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28); in SiS_FinalizeLCD()
10892 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00); in SiS_FinalizeLCD()
10893 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c); in SiS_FinalizeLCD()
10894 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10895 if(ModeNo == 0x12) { in SiS_FinalizeLCD()
10897 case 0: in SiS_FinalizeLCD()
10898 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10899 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10900 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10); in SiS_FinalizeLCD()
10901 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10902 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48); in SiS_FinalizeLCD()
10903 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10906 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10907 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10910 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10918 tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_FinalizeLCD()
10919 tempcl &= 0x0f; in SiS_FinalizeLCD()
10920 tempbh &= 0x70; in SiS_FinalizeLCD()
10922 tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04); in SiS_FinalizeLCD()
10939 temp = tempbx & 0xff; in SiS_FinalizeLCD()
10940 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp); in SiS_FinalizeLCD()
10941 temp = ((tempbx & 0xff00) >> 4) | tempcl; in SiS_FinalizeLCD()
10942 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp); in SiS_FinalizeLCD()
10957 unsigned short crt2crtc=0, modeflag, myindex=0; in SetOEMLCDData2()
10961 if(ModeNo <= 0x13) { in SetOEMLCDData2()
10969 crt2crtc &= 0x3f; in SetOEMLCDData2()
10972 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf); in SetOEMLCDData2()
10979 for(i=0; i<7; i++) { in SetOEMLCDData2()
10980 if(barco_p1[myindex][crt2crtc][i][0]) { in SetOEMLCDData2()
10982 barco_p1[myindex][crt2crtc][i][0], in SetOEMLCDData2()
10988 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SetOEMLCDData2()
10989 if(temp & 0x80) { in SetOEMLCDData2()
10990 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18); in SetOEMLCDData2()
10992 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); in SetOEMLCDData2()
11001 unsigned short tempbx=0,romptr=0; in GetOEMLCDPtr()
11003 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, in GetOEMLCDPtr()
11004 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff in GetOEMLCDPtr()
11007 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, in GetOEMLCDPtr()
11008 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff in GetOEMLCDPtr()
11013 tempbx = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f; in GetOEMLCDPtr()
11014 if(SiS_Pr->SiS_VBType & VB_SIS301) tempbx &= 0x07; in GetOEMLCDPtr()
11021 if(ROMAddr[0x235] & 0x80) { in GetOEMLCDPtr()
11024 romptr = SISGETROMW(0x255); in GetOEMLCDPtr()
11027 if(tempbx == 0xFF) return 0xFFFF; in GetOEMLCDPtr()
11038 romptr = SISGETROMW(0x255); in GetOEMLCDPtr()
11040 else tempbx = 0xff; in GetOEMLCDPtr()
11044 if(tempbx == 0xFF) return 0xFFFF; in GetOEMLCDPtr()
11063 unsigned short index,temp,romptr=0; in SetOEMLCDDelay()
11068 if(!(ROMAddr[0x237] & 0x01)) return; in SetOEMLCDDelay()
11069 if(!(ROMAddr[0x237] & 0x02)) return; in SetOEMLCDDelay()
11070 romptr = SISGETROMW(0x24b); in SetOEMLCDDelay()
11075 * a uniform way using eg. ROM byte 0x220, but use different in SetOEMLCDDelay()
11076 * hard coded delays (0x04, 0x20, 0x18) in SetGroup1(). in SetOEMLCDDelay()
11082 temp = GetOEMLCDPtr(SiS_Pr, 0); in SetOEMLCDDelay()
11085 index = 0; in SetOEMLCDDelay()
11103 if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) { in SetOEMLCDDelay()
11114 romptr = ROMAddr[0x249] | (ROMAddr[0x24a] << 8); in SetOEMLCDDelay()
11128 temp &= 0x3c; in SetOEMLCDDelay()
11129 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* index 0A D[6:4] */ in SetOEMLCDDelay()
11135 #if 0 /* Unfinished; Data table missing */ in SetOEMLCDData()
11140 if(!(ROMAddr[0x237] & 0x01)) return; in SetOEMLCDData()
11141 if(!(ROMAddr[0x237] & 0x04)) return; in SetOEMLCDData()
11146 if(temp == 0xFFFF) return; in SetOEMLCDData()
11149 for(i=0x14, j=0; i<=0x17; i++, j++) { in SetOEMLCDData()
11152 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1a, 0xf8, (SiS300_LCDHData[temp][index][j] & 0x07)); in SetOEMLCDData()
11155 SiS_SetReg(SiS_SiS_Part1Port,0x18, SiS300_LCDVData[temp][index][0]); in SetOEMLCDData()
11156 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x19, 0xF0, SiS300_LCDVData[temp][index][1]); in SetOEMLCDData()
11157 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1A, 0xC7, (SiS300_LCDVData[temp][index][2] & 0x38)); in SetOEMLCDData()
11158 for(i=0x1b, j=3; i<=0x1d; i++, j++) { in SetOEMLCDData()
11169 index = 0; in GetOEMTVPtr()
11186 unsigned short index,temp,romptr=0; in SetOEMTVDelay()
11189 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMTVDelay()
11190 if(!(ROMAddr[0x238] & 0x02)) return; in SetOEMTVDelay()
11191 romptr = SISGETROMW(0x241); in SetOEMTVDelay()
11210 temp &= 0x3c; in SetOEMTVDelay()
11211 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); in SetOEMTVDelay()
11218 unsigned short index,temp,romptr=0; in SetOEMAntiFlicker()
11221 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMAntiFlicker()
11222 if(!(ROMAddr[0x238] & 0x04)) return; in SetOEMAntiFlicker()
11223 romptr = SISGETROMW(0x243); in SetOEMAntiFlicker()
11238 temp &= 0x70; in SetOEMAntiFlicker()
11239 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp); in SetOEMAntiFlicker()
11246 unsigned short index,i,j,temp,romptr=0; in SetOEMPhaseIncr()
11253 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMPhaseIncr()
11254 if(!(ROMAddr[0x238] & 0x08)) return; in SetOEMPhaseIncr()
11255 romptr = SISGETROMW(0x245); in SetOEMPhaseIncr()
11263 for(i=0x31, j=0; i<=0x34; i++, j++) { in SetOEMPhaseIncr()
11271 for(i=0x31, j=0; i<=0x34; i++, j++) { in SetOEMPhaseIncr()
11275 for(i=0x31, j=0; i<=0x34; i++, j++) { in SetOEMPhaseIncr()
11286 unsigned short index,temp,i,j,romptr=0; in SetOEMYFilter()
11291 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMYFilter()
11292 if(!(ROMAddr[0x238] & 0x10)) return; in SetOEMYFilter()
11293 romptr = SISGETROMW(0x247); in SetOEMYFilter()
11305 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetOEMYFilter()
11308 for(i=0x48; i<=0x4A; i++, j++) { in SetOEMYFilter()
11316 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetOEMYFilter()
11320 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetOEMYFilter()
11335 for(ModeIdIndex=0; ; ModeIdIndex++) { in SiS_SearchVBModeID()
11337 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF) return 0; in SiS_SearchVBModeID()
11340 if(*ModeNo != 0x07) { in SiS_SearchVBModeID()
11341 if(*ModeNo > 0x03) return ModeIdIndex; in SiS_SearchVBModeID()
11342 if(VGAINFO & 0x80) return ModeIdIndex; in SiS_SearchVBModeID()
11346 if(VGAINFO & 0x10) ModeIdIndex++; /* 400 lines */ in SiS_SearchVBModeID()
11355 unsigned short OEMModeIdIndex = 0; in SiS_OEM300Setting()