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,
253 0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88,
254 0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04,
258 0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70,
259 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x08,
261 0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38,
262 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09,
264 0x0B,0xE0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0,
265 0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0A,
267 0x0A,0xE0,0x00,0x05,0x00,0x03,0x7C,0x06,0x26,0x03,0x30,0x00,0x70,
268 0x00,0x03,0x00,0x06,0x00,0x4D,0xC8,0x48,0x00,0x00,0x00,0x00,0x06,
270 0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x20,
271 0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05,
273 0x0C,0xE0,0x00,0x05,0x20,0x03,0x10,0x06,0x2C,0x03,0x30,0x00,0x70,
274 0x00,0x04,0x00,0x03,0x00,0x49,0xCE,0x1E,0x00,0x00,0x00,0x00,0x09,
276 0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C,
277 0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06,
279 0x0C,0xE0,0x00,0x05,0x20,0x03,0xAA,0x05,0x2E,0x03,0x30,0x00,0x50,
280 0x00,0x04,0x00,0x03,0x00,0x47,0xA9,0x10,0x00,0x00,0x00,0x00,0x07,
282 0x01,0xC0,0x20,0x03,0x58,0x02,0x20,0x04,0x74,0x02,0x2A,0x00,0x80,
283 0x00,0x06,0x00,0x04,0x00,0x28,0x63,0x4B,0x00,0x00,0x00,0x00,0x00,
285 0x08,0xE0,0x00,0x05,0x56,0x03,0x80,0x06,0x5d,0x03,0x10,0x00,0x70,
286 0x00,0x01,0x00,0x03,0x00,0x54,0x75,0x13,0x00,0x00,0x00,0x00,0x08
292 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
293 0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23,
294 0x00,0x00,0x03,0x28,0x03,0x10,0x05,0x08,0x40,0x10,0x00,0x10,0x04,0x23,0x00,0x23,
295 0x03,0x11,0x60,0xBC,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x09,0x04,0x04,0x05,
296 0x04,0x0C,0x09,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5A,0x01,0xBE,0x01,0x00 },
297 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x27,0x00,0x80,0x02,
298 0x20,0x03,0x07,0x00,0x5E,0x01,0x0D,0x02,0x60,0x0C,0x30,0x11,0x00,0x00,0x04,0x23,
299 0x00,0x00,0x03,0x80,0x03,0x28,0x06,0x08,0x40,0x11,0x00,0x11,0x04,0x23,0x00,0x23,
300 0x03,0x11,0x60,0x90,0x01,0xFF,0x0F,0xF4,0x19,0x01,0x00,0x05,0x01,0x00,0x04,0x05,
301 0x04,0x0C,0x02,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEC,0x57,0x01,0xBE,0x01,0x00 },
302 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02,
303 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
304 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
305 0x03,0x11,0x60,0xD9,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
306 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x59,0x01,0xBE,0x01,0x00 },
307 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02,
308 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
309 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
310 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
311 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
312 { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
313 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23,
314 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23,
315 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05,
316 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
317 { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03,
318 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D,
319 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D,
320 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B,
321 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
322 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04,
323 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23,
324 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23,
325 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01,
326 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
328 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
329 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23,
330 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23,
331 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05,
332 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
333 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
334 0x20,0x03,0x15,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x18,0x00,0x00,0x04,0x23,
335 0x00,0x01,0x03,0x44,0x03,0x28,0x06,0x08,0x40,0x18,0x00,0x18,0x04,0x23,0x00,0x23,
336 0x03,0x11,0x60,0xA6,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x13,0x04,0x04,0x05,
337 0x04,0x0C,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
338 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02,
339 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
340 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
341 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
342 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
343 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02,
344 0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
345 0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
346 0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
347 0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
348 { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
349 0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23,
350 0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23,
351 0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05,
352 0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 },
353 { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03,
354 0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D,
355 0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D,
356 0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B,
357 0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 },
358 { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x11,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04,
359 0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23,
360 0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23,
361 0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01,
362 0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEA,0x58,0x01,0xBE,0x01,0x00 }
424 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_UnLockCRT2()
426 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01); in SiS_UnLockCRT2()
436 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE); in SiS_LockCRT2()
438 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE); in SiS_LockCRT2()
449 DataAND &= 0x0f; in SiS_SetRegSR11ANDOR()
450 DataOR &= 0x0f; in SiS_SetRegSR11ANDOR()
452 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR); in SiS_SetRegSR11ANDOR()
465 unsigned short romindex = 0, reg = 0, idx = 0; in GetLCDStructPtr661()
477 if(SiS_Pr->ChipType < SIS_661) reg = 0x3c; in GetLCDStructPtr661()
478 else reg = 0x7d; in GetLCDStructPtr661()
480 idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26; in GetLCDStructPtr661()
485 romindex = SISGETROMW(0x100); in GetLCDStructPtr661()
498 unsigned short romptr = 0; in GetLCDStructPtr661_2()
509 romptr = SISGETROMW(0x102); in GetLCDStructPtr661_2()
510 romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize); in GetLCDStructPtr661_2()
525 unsigned short checkmask=0, modeid, infoflag; in SiS_AdjustCRT2Rate()
550 if(modeid == 0x2e) checkmask |= Support64048060Hz; in SiS_AdjustCRT2Rate()
575 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_AdjustCRT2Rate()
591 if((*i) == 0) break; in SiS_AdjustCRT2Rate()
597 for((*i) = 0; ; (*i)++) { in SiS_AdjustCRT2Rate()
615 0x00, 0x00, 0x01, 0x01, in SiS_GetRatePtr()
616 0x01, 0x01, 0x01, 0x01, in SiS_GetRatePtr()
617 0x01, 0x01, 0x01, 0x01, in SiS_GetRatePtr()
618 0x01, 0x01, 0x01, 0x01, in SiS_GetRatePtr()
619 0x00, 0x00, 0x00, 0x00 in SiS_GetRatePtr()
623 if(ModeNo == 0xfe) return 0; in SiS_GetRatePtr()
625 if(ModeNo <= 0x13) { in SiS_GetRatePtr()
631 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
633 if(modeflag & HalfDCLK) return 0; in SiS_GetRatePtr()
637 if(ModeNo < 0x14) return 0xFFFF; in SiS_GetRatePtr()
639 index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F; in SiS_GetRatePtr()
642 if(index > 0) index--; in SiS_GetRatePtr()
647 if(SiS_Pr->SiS_VBType & VB_NoLCD) index = 0; in SiS_GetRatePtr()
648 else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index = backupindex = 0; in SiS_GetRatePtr()
657 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) index = 0; in SiS_GetRatePtr()
658 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetRatePtr()
659 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) index = 0; in SiS_GetRatePtr()
669 if( (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x105) || in SiS_GetRatePtr()
670 (SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_VESAID == 0x107) ) { in SiS_GetRatePtr()
676 i = 0; in SiS_GetRatePtr()
684 } while(index != 0xFFFF); in SiS_GetRatePtr()
715 SiS_SetReg(SiS_Pr->SiS_P3d4,0x34,ModeNo); in SiS_SaveCRT2Info()
718 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x31,temp2,temp1); in SiS_SaveCRT2Info()
733 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_CR36BIOSWord23b()
734 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23b()
735 temp1 = SISGETROMW(0x23b); in SiS_CR36BIOSWord23b()
749 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_CR36BIOSWord23d()
750 temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) & 0x0f); in SiS_CR36BIOSWord23d()
751 temp1 = SISGETROMW(0x23d); in SiS_CR36BIOSWord23d()
766 while (delaytime-- > 0) in SiS_DDC2Delay()
767 SiS_GetReg(SiS_Pr->SiS_P3c4, 0x05); in SiS_DDC2Delay()
803 unsigned short PanelID, DelayIndex, Delay=0; in SiS_PanelDelay()
810 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
812 if(SiS_Pr->SiS_VBType & VB_SIS301) PanelID &= 0xf7; in SiS_PanelDelay()
813 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x18) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
816 if((DelayTime >= 2) && ((PanelID & 0x0f) == 1)) { in SiS_PanelDelay()
820 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
821 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
826 if(ROMAddr[0x220] & 0x40) { in SiS_PanelDelay()
827 if(!(DelayTime & 0x01)) Delay = (unsigned short)ROMAddr[0x225]; in SiS_PanelDelay()
828 else Delay = (unsigned short)ROMAddr[0x226]; in SiS_PanelDelay()
845 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
846 SiS_DDC2Delay(SiS_Pr, 0x1000); in SiS_PanelDelay()
848 SiS_DDC2Delay(SiS_Pr, 0x4000); in SiS_PanelDelay()
853 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_PanelDelay()
854 PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_PanelDelay()
856 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1b) & 0x10)) PanelID = 0x12; in SiS_PanelDelay()
859 DelayIndex = PanelID & 0x0f; in SiS_PanelDelay()
863 if((DelayTime >= 2) && ((PanelID & 0x0f) == 1)) { in SiS_PanelDelay()
867 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
868 Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[0]; in SiS_PanelDelay()
873 if(ROMAddr[0x13c] & 0x40) { in SiS_PanelDelay()
874 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
875 Delay = (unsigned short)ROMAddr[0x17e]; in SiS_PanelDelay()
877 Delay = (unsigned short)ROMAddr[0x17f]; in SiS_PanelDelay()
887 DelayIndex = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_PanelDelay()
888 if(!(DelayTime & 0x01)) { in SiS_PanelDelay()
889 Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0]; in SiS_PanelDelay()
908 for(i = 0; i < DelayLoop; i++) { in SiS_PanelDelayLoop()
923 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return; in SiS_WaitRetrace1()
924 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return; in SiS_WaitRetrace1()
927 while((SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08) && --watchdog); in SiS_WaitRetrace1()
929 while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog); in SiS_WaitRetrace1()
939 while((SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02) && --watchdog); in SiS_WaitRetrace2()
941 while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog); in SiS_WaitRetrace2()
951 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x20)) return; in SiS_WaitVBRetrace()
953 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x80)) { in SiS_WaitVBRetrace()
956 SiS_WaitRetrace2(SiS_Pr, 0x25); in SiS_WaitVBRetrace()
961 if(!(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x40)) { in SiS_WaitVBRetrace()
964 SiS_WaitRetrace2(SiS_Pr, 0x30); in SiS_WaitVBRetrace()
975 temp = 0; in SiS_VBWait()
976 for(i = 0; i < 3; i++) { in SiS_VBWait()
977 for(j = 0; j < 100; j++) { in SiS_VBWait()
979 if(temp & 0x01) { in SiS_VBWait()
980 if((tempal & 0x08)) continue; in SiS_VBWait()
983 if(!(tempal & 0x08)) continue; in SiS_VBWait()
987 temp ^= 0x01; in SiS_VBWait()
1009 if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return true; in SiS_Is301B()
1018 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x20) return true; in SiS_CRT2IsLCD()
1020 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & 0x20) return true; in SiS_CRT2IsLCD()
1029 if((SiS_Pr->ChipType != SIS_650) || (SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0)) { in SiS_IsDualEdge()
1030 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableDualEdge) return true; in SiS_IsDualEdge()
1044 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsVAMode()
1079 if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return true; in SiS_TVEnabled()
1081 if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return true; in SiS_TVEnabled()
1091 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) return true; in SiS_LCDAEnabled()
1101 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return true; in SiS_WeHaveBacklightCtrl()
1114 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xf0; in SiS_IsNotM650orLater()
1116 if((flag == 0xe0) || (flag == 0xc0) || in SiS_IsNotM650orLater()
1117 (flag == 0xb0) || (flag == 0x90)) return false; in SiS_IsNotM650orLater()
1128 /* YPrPb = 0x08 */ in SiS_IsYPbPr()
1129 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHYPbPr) return true; in SiS_IsYPbPr()
1140 /* Scart = 0x04 */ in SiS_IsChScart()
1141 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & EnableCHScart) return true; in SiS_IsChScart()
1154 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1156 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsTVOrYPbPrOrScart()
1157 if(flag & EnableCHYPbPr) return true; /* = YPrPb = 0x08 */ in SiS_IsTVOrYPbPrOrScart()
1158 if(flag & EnableCHScart) return true; /* = Scart = 0x04 - TW */ in SiS_IsTVOrYPbPrOrScart()
1160 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsTVOrYPbPrOrScart()
1174 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1176 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_IsLCDOrLCDA()
1179 flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_IsLCDOrLCDA()
1194 flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00); in SiS_HaveBridge()
1206 flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_BridgeIsEnabled()
1208 flag &= 0xa0; in SiS_BridgeIsEnabled()
1209 if((flag == 0x80) || (flag == 0x20)) return true; in SiS_BridgeIsEnabled()
1211 flag &= 0x50; in SiS_BridgeIsEnabled()
1212 if((flag == 0x40) || (flag == 0x10)) return true; in SiS_BridgeIsEnabled()
1223 flag1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); in SiS_BridgeInSlavemode()
1242 acpibase = sisfb_read_lpc_pci_dword(SiS_Pr, 0x74); in SiS_SetChrontelGPIO()
1243 acpibase &= 0xFFFF; in SiS_SetChrontelGPIO()
1245 temp = SiS_GetRegShort((acpibase + 0x3c)); /* ACPI register 0x3c: GP Event 1 I/O mode select */ in SiS_SetChrontelGPIO()
1246 temp &= 0xFEFF; in SiS_SetChrontelGPIO()
1247 SiS_SetRegShort((acpibase + 0x3c), temp); in SiS_SetChrontelGPIO()
1248 temp = SiS_GetRegShort((acpibase + 0x3c)); in SiS_SetChrontelGPIO()
1249 temp = SiS_GetRegShort((acpibase + 0x3a)); /* ACPI register 0x3a: GP Pin Level (low/high) */ in SiS_SetChrontelGPIO()
1250 temp &= 0xFEFF; in SiS_SetChrontelGPIO()
1251 if(!(myvbinfo & SetCRT2ToTV)) temp |= 0x0100; in SiS_SetChrontelGPIO()
1252 SiS_SetRegShort((acpibase + 0x3a), temp); in SiS_SetChrontelGPIO()
1253 temp = SiS_GetRegShort((acpibase + 0x3a)); in SiS_SetChrontelGPIO()
1262 unsigned short modeflag, resinfo = 0; in SiS_GetVBInfo()
1264 SiS_Pr->SiS_SetFlag = 0; in SiS_GetVBInfo()
1270 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetVBInfo()
1274 tempbx = 0; in SiS_GetVBInfo()
1278 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_GetVBInfo()
1280 tempax = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) << 8; in SiS_GetVBInfo()
1287 if(ModeNo == 0x03) { in SiS_GetVBInfo()
1288 /* Mode 0x03 is never in driver mode */ in SiS_GetVBInfo()
1289 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf); in SiS_GetVBInfo()
1291 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) { in SiS_GetVBInfo()
1293 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); in SiS_GetVBInfo()
1297 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x5f) & 0xF0) { in SiS_GetVBInfo()
1298 if((ModeNo <= 0x13) || (!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8)))) { in SiS_GetVBInfo()
1299 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x38,(EnableDualEdge | SetToLCDA)); in SiS_GetVBInfo()
1304 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1312 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x38) & 0x04) { in SiS_GetVBInfo()
1313 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35) & 0xe0; in SiS_GetVBInfo()
1314 if(temp == 0x60) tempbx |= SetCRT2ToHiVision; in SiS_GetVBInfo()
1322 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_GetVBInfo()
1326 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1351 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1363 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1373 tempbx = 0; in SiS_GetVBInfo()
1398 tempbx &= (0xFF00|SwitchCRT2|SetSimuScanMode); in SiS_GetVBInfo()
1401 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_GetVBInfo()
1403 tempbx &= (0xFF00|SetCRT2ToTV|SwitchCRT2|SetSimuScanMode); in SiS_GetVBInfo()
1407 tempbx &= (0xFF00|SetCRT2ToLCD|SwitchCRT2|SetSimuScanMode); in SiS_GetVBInfo()
1475 #if 0 in SiS_GetVBInfo()
1476 printk(KERN_DEBUG "sisfb: (init301: VBInfo= 0x%04x, SetFlag=0x%04x)\n", in SiS_GetVBInfo()
1499 SiS_Pr->SiS_YPbPr = 0; in SiS_SetYPbPr()
1510 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetYPbPr()
1511 if(temp & 0x08) { in SiS_SetYPbPr()
1513 case 0x00: SiS_Pr->SiS_YPbPr = YPbPr525i; break; in SiS_SetYPbPr()
1514 case 0x01: SiS_Pr->SiS_YPbPr = YPbPr525p; break; in SiS_SetYPbPr()
1515 case 0x02: SiS_Pr->SiS_YPbPr = YPbPr750p; break; in SiS_SetYPbPr()
1516 case 0x03: SiS_Pr->SiS_YPbPr = YPbPrHiVision; break; in SiS_SetYPbPr()
1532 unsigned short temp, temp1, resinfo = 0, romindex = 0; in SiS_SetTVMode()
1535 SiS_Pr->SiS_TVMode = 0; in SiS_SetTVMode()
1540 if(ModeNo > 0x13) { in SiS_SetTVMode()
1549 temp = 0; in SiS_SetTVMode()
1552 temp = 0x35; in SiS_SetTVMode()
1553 romindex = 0xfe; in SiS_SetTVMode()
1555 temp = 0x38; in SiS_SetTVMode()
1557 romindex = 0xf3; in SiS_SetTVMode()
1558 if(SiS_Pr->ChipType >= SIS_330) romindex = 0x11b; in SiS_SetTVMode()
1565 SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F); in SiS_SetTVMode()
1570 if(temp1 & EnablePALM) { /* 0x40 */ in SiS_SetTVMode()
1573 } else if(temp1 & EnablePALN) { /* 0x80 */ in SiS_SetTVMode()
1577 if(temp1 & EnableNTSCJ) { /* 0x40 */ in SiS_SetTVMode()
1595 } else if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetTVMode()
1598 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1603 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79); in SiS_SetTVMode()
1604 if((temp & 0x80) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1613 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); in SiS_SetTVMode()
1627 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_SetTVMode()
1628 if(temp1 & 0x01) { in SiS_SetTVMode()
1630 if(temp1 & 0x08) { in SiS_SetTVMode()
1632 } else if(temp1 & 0x04) { in SiS_SetTVMode()
1639 if(temp1 & 0x02) { in SiS_SetTVMode()
1645 if((temp1 & 0x10) || (SiS_Pr->SiS_CHOverScan == 1)) { in SiS_SetTVMode()
1652 temp1 &= 0xe0; in SiS_SetTVMode()
1653 if(temp1 == 0x00) SiS_Pr->SiS_TVMode |= TVSetYPbPr525i; in SiS_SetTVMode()
1654 else if(temp1 == 0x20) SiS_Pr->SiS_TVMode |= TVSetYPbPr525p; in SiS_SetTVMode()
1655 else if(temp1 == 0x40) SiS_Pr->SiS_TVMode |= TVSetYPbPr750p; in SiS_SetTVMode()
1663 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39); in SiS_SetTVMode()
1664 if(temp1 & 0x02) { in SiS_SetTVMode()
1777 int i = 0; in SiS_CheckScaling()
1778 while(nonscalingmodes[i] != 0xff) { in SiS_CheckScaling()
1792 unsigned short temp,modeflag,resinfo=0,modexres=0,modeyres=0; in SiS_GetLCDResInfo()
1797 { 0, 1, 2, 3, 7, 4, 5, 8, in SiS_GetLCDResInfo()
1798 0, 0, 10, 0, 0, 0, 0, 15 }; in SiS_GetLCDResInfo()
1804 SiS_Pr->SiS_LCDResInfo = 0; in SiS_GetLCDResInfo()
1805 SiS_Pr->SiS_LCDTypeInfo = 0; in SiS_GetLCDResInfo()
1806 SiS_Pr->SiS_LCDInfo = 0; in SiS_GetLCDResInfo()
1820 if((ModeNo > 0x13) && (!SiS_Pr->UseCustomMode)) { in SiS_GetLCDResInfo()
1826 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_GetLCDResInfo()
1829 if(temp == 0) temp = 0x02; in SiS_GetLCDResInfo()
1832 SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2; in SiS_GetLCDResInfo()
1836 SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1; in SiS_GetLCDResInfo()
1838 temp &= 0x0f; in SiS_GetLCDResInfo()
1843 if(temp < 0x0f) temp &= 0x07; in SiS_GetLCDResInfo()
1894 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_GetLCDResInfo()
1895 SiS_Pr->SiS_LCDInfo = temp & ~0x000e; in SiS_GetLCDResInfo()
1919 if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1923 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1925 if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
1930 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; in SiS_GetLCDResInfo()
1934 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); in SiS_GetLCDResInfo()
1935 if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; in SiS_GetLCDResInfo()
1937 if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; in SiS_GetLCDResInfo()
2209 SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, 0xff in SiS_GetLCDResInfo()
2218 0xff in SiS_GetLCDResInfo()
2227 0xff in SiS_GetLCDResInfo()
2239 SIS_RI_1152x768,0xff in SiS_GetLCDResInfo()
2254 SIS_RI_1152x768,SIS_RI_1280x720,SIS_RI_1280x768,0xff in SiS_GetLCDResInfo()
2263 SIS_RI_1152x768,0xff in SiS_GetLCDResInfo()
2279 SIS_RI_1152x768,0xff in SiS_GetLCDResInfo()
2297 SIS_RI_1280x854,0xff in SiS_GetLCDResInfo()
2307 SIS_RI_1280x854,SIS_RI_1280x960,0xff in SiS_GetLCDResInfo()
2317 SIS_RI_1280x960,0xff in SiS_GetLCDResInfo()
2335 SIS_RI_1280x854,SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,0xff in SiS_GetLCDResInfo()
2345 SIS_RI_1360x1024,0xff in SiS_GetLCDResInfo()
2356 SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ in SiS_GetLCDResInfo()
2363 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_GetLCDResInfo()
2364 if(!(ROMAddr[0x235] & 0x02)) { in SiS_GetLCDResInfo()
2370 if((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10))) { in SiS_GetLCDResInfo()
2419 if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) { in SiS_GetLCDResInfo()
2420 if(ModeNo == 0x12) { in SiS_GetLCDResInfo()
2424 } else if(ModeNo > 0x13) { in SiS_GetLCDResInfo()
2443 } else if(ModeNo > 0x13) { in SiS_GetLCDResInfo()
2463 #if 0 in SiS_GetLCDResInfo()
2464 printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n", in SiS_GetLCDResInfo()
2477 unsigned short CRT2Index, VCLKIndex = 0, VCLKIndexGEN = 0, VCLKIndexGENCRT = 0; in SiS_GetVCLK2Ptr()
2481 if(ModeNo <= 0x13) { in SiS_GetVCLK2Ptr()
2484 VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03; in SiS_GetVCLK2Ptr()
2524 if(ModeNo <= 0x13) { in SiS_GetVCLK2Ptr()
2526 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42; in SiS_GetVCLK2Ptr()
2528 if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x00; in SiS_GetVCLK2Ptr()
2532 if(VCLKIndex == 0) VCLKIndex = 0x41; in SiS_GetVCLK2Ptr()
2533 if(VCLKIndex == 1) VCLKIndex = 0x43; in SiS_GetVCLK2Ptr()
2534 if(VCLKIndex == 4) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2557 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2559 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_GetVCLK2Ptr()
2560 if(VCLKIndex == 0x14) VCLKIndex = 0x34; in SiS_GetVCLK2Ptr()
2563 if(VCLKIndex == 0x17) VCLKIndex = 0x45; in SiS_GetVCLK2Ptr()
2572 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2575 if(VCLKIndex == 0x1b) VCLKIndex = 0x48; in SiS_GetVCLK2Ptr()
2587 if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) { in SiS_GetVCLK2Ptr()
2589 VCLKIndex &= 0x1f; in SiS_GetVCLK2Ptr()
2590 tempbx = 0; in SiS_GetVCLK2Ptr()
2606 case 0: CHTVVCLKPtr = SiS_Pr->SiS_CHTVVCLKUNTSC; break; in SiS_GetVCLK2Ptr()
2629 if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44; in SiS_GetVCLK2Ptr()
2647 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2649 (SiS_Pr->ChipRevision >= 0x30) ) { in SiS_GetVCLK2Ptr()
2650 if(VCLKIndex == 0x14) VCLKIndex = 0x2e; in SiS_GetVCLK2Ptr()
2660 if(ModeNo > 0x13) { in SiS_GetVCLK2Ptr()
2663 if(VCLKIndex == 0x1b) VCLKIndex = 0x48; in SiS_GetVCLK2Ptr()
2665 #if 0 in SiS_GetVCLK2Ptr()
2667 if(VCLKIndex == 0x0b) VCLKIndex = 0x40; /* 1024x768-70 */ in SiS_GetVCLK2Ptr()
2668 if(VCLKIndex == 0x0d) VCLKIndex = 0x41; /* 1024x768-75 */ in SiS_GetVCLK2Ptr()
2688 unsigned short i, j, modeflag, tempah=0; in SiS_SetCRT2ModeRegs()
2702 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xAF,0x40); in SiS_SetCRT2ModeRegs()
2703 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2E,0xF7); in SiS_SetCRT2ModeRegs()
2707 for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0); in SiS_SetCRT2ModeRegs()
2709 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F); in SiS_SetCRT2ModeRegs()
2720 tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32); in SiS_SetCRT2ModeRegs()
2721 tempbl &= 0xef; in SiS_SetCRT2ModeRegs()
2722 tempbl |= 0x02; in SiS_SetCRT2ModeRegs()
2724 tempbl |= 0x10; in SiS_SetCRT2ModeRegs()
2725 tempbl &= 0xfd; in SiS_SetCRT2ModeRegs()
2727 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl); in SiS_SetCRT2ModeRegs()
2730 if(ModeNo > 0x13) { in SiS_SetCRT2ModeRegs()
2732 if(tempcl >= 0) { in SiS_SetCRT2ModeRegs()
2733 tempah = ((0x10 >> tempcl) | 0x80); in SiS_SetCRT2ModeRegs()
2735 } else tempah = 0x80; in SiS_SetCRT2ModeRegs()
2737 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0xA0; in SiS_SetCRT2ModeRegs()
2745 if(ModeNo > 0x13) { in SiS_SetCRT2ModeRegs()
2747 if(tempcl >= 0) { in SiS_SetCRT2ModeRegs()
2748 tempah = (0x08 >> tempcl); in SiS_SetCRT2ModeRegs()
2749 if (tempah == 0) tempah = 1; in SiS_SetCRT2ModeRegs()
2750 tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2752 } else tempah = 0x40; in SiS_SetCRT2ModeRegs()
2754 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) tempah ^= 0x50; in SiS_SetCRT2ModeRegs()
2760 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2763 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2767 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2770 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,tempah); in SiS_SetCRT2ModeRegs()
2772 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x00,0xa0,tempah); in SiS_SetCRT2ModeRegs()
2780 tempah = 0x01; in SiS_SetCRT2ModeRegs()
2782 tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2785 tempah ^= 0x05; in SiS_SetCRT2ModeRegs()
2787 tempah ^= 0x01; in SiS_SetCRT2ModeRegs()
2793 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2795 tempah = (tempah << 5) & 0xFF; in SiS_SetCRT2ModeRegs()
2796 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2797 tempah = (tempah >> 5) & 0xFF; in SiS_SetCRT2ModeRegs()
2801 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x08; in SiS_SetCRT2ModeRegs()
2802 else if(!(SiS_IsDualEdge(SiS_Pr))) tempah |= 0x08; in SiS_SetCRT2ModeRegs()
2803 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2E,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2804 tempah &= ~0x08; in SiS_SetCRT2ModeRegs()
2809 tempah |= 0x10; in SiS_SetCRT2ModeRegs()
2812 tempah |= 0x80; in SiS_SetCRT2ModeRegs()
2814 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah &= ~0x80; in SiS_SetCRT2ModeRegs()
2820 tempah |= 0x20; in SiS_SetCRT2ModeRegs()
2825 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0D,0x40,tempah); in SiS_SetCRT2ModeRegs()
2827 tempah = 0x80; in SiS_SetCRT2ModeRegs()
2829 if(SiS_Pr->PanelXRes < 1280 && SiS_Pr->PanelYRes < 960) tempah = 0; in SiS_SetCRT2ModeRegs()
2832 if(SiS_IsDualLink(SiS_Pr)) tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2836 tempah |= 0x40; in SiS_SetCRT2ModeRegs()
2840 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0C,tempah); in SiS_SetCRT2ModeRegs()
2848 tempah = 0x80; in SiS_SetCRT2ModeRegs()
2851 tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2855 if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2857 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah ^= 0x01; in SiS_SetCRT2ModeRegs()
2861 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2e,0xF0,tempah); in SiS_SetCRT2ModeRegs()
2867 tempah = 0; in SiS_SetCRT2ModeRegs()
2869 tempah |= 0x02; in SiS_SetCRT2ModeRegs()
2873 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0; in SiS_SetCRT2ModeRegs()
2875 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,tempah); in SiS_SetCRT2ModeRegs()
2889 /* unsigned char bridgerev = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01); */ in SiS_SetCRT2ModeRegs()
2903 tempah = 0x04; /* For all bridges */ in SiS_SetCRT2ModeRegs()
2904 tempbl = 0xfb; in SiS_SetCRT2ModeRegs()
2906 tempah = 0x00; in SiS_SetCRT2ModeRegs()
2908 tempbl = 0xff; in SiS_SetCRT2ModeRegs()
2911 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2916 * b0 was found in some 651 machine (Pim; P4_23=0xe5); the b1 version in SiS_SetCRT2ModeRegs()
2924 tempah = 0x30; in SiS_SetCRT2ModeRegs()
2925 tempbl = 0xc0; in SiS_SetCRT2ModeRegs()
2927 ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) { in SiS_SetCRT2ModeRegs()
2928 tempah = 0x00; in SiS_SetCRT2ModeRegs()
2929 tempbl = 0x00; in SiS_SetCRT2ModeRegs()
2931 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,0xcf,tempah); in SiS_SetCRT2ModeRegs()
2932 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0x3f,tempbl); in SiS_SetCRT2ModeRegs()
2935 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2c,0xcf); /* For 301 */ in SiS_SetCRT2ModeRegs()
2936 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2938 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); /* For 30xLV */ in SiS_SetCRT2ModeRegs()
2939 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x21,0xc0); in SiS_SetCRT2ModeRegs()
2941 tempah = 0x30; tempah2 = 0xc0; in SiS_SetCRT2ModeRegs()
2942 tempbl = 0xcf; tempbl2 = 0x3f; in SiS_SetCRT2ModeRegs()
2943 if(SiS_Pr->SiS_TVBlue == 0) { in SiS_SetCRT2ModeRegs()
2944 tempah = tempah2 = 0x00; in SiS_SetCRT2ModeRegs()
2947 if(!(IS_SIS65x)) /* (bridgerev != 0xb0) */ { in SiS_SetCRT2ModeRegs()
2948 tempah = tempah2 = 0x00; in SiS_SetCRT2ModeRegs()
2951 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2952 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2954 tempah = 0x30; tempah2 = 0xc0; /* For 30xB, 301C */ in SiS_SetCRT2ModeRegs()
2955 tempbl = 0xcf; tempbl2 = 0x3f; in SiS_SetCRT2ModeRegs()
2957 tempah = tempah2 = 0x00; in SiS_SetCRT2ModeRegs()
2959 tempbl = tempbl2 = 0xff; in SiS_SetCRT2ModeRegs()
2962 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2c,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2963 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,tempbl2,tempah2); in SiS_SetCRT2ModeRegs()
2967 tempah = 0x80; in SiS_SetCRT2ModeRegs()
2968 if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00; in SiS_SetCRT2ModeRegs()
2969 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah); in SiS_SetCRT2ModeRegs()
2971 tempah = 0x00; in SiS_SetCRT2ModeRegs()
2972 tempbl = 0x7f; in SiS_SetCRT2ModeRegs()
2974 tempbl = 0xff; in SiS_SetCRT2ModeRegs()
2975 if(!(SiS_IsDualEdge(SiS_Pr))) tempah = 0x80; in SiS_SetCRT2ModeRegs()
2977 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah); in SiS_SetCRT2ModeRegs()
2985 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x21,0x3f); in SiS_SetCRT2ModeRegs()
2990 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x23,0x7F); in SiS_SetCRT2ModeRegs()
2992 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x23,0x80); in SiS_SetCRT2ModeRegs()
2999 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x0D,0x80); in SiS_SetCRT2ModeRegs()
3001 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3A,0xC0); in SiS_SetCRT2ModeRegs()
3010 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2ModeRegs()
3012 tempah = 0x04; in SiS_SetCRT2ModeRegs()
3013 tempbl = 0xfb; in SiS_SetCRT2ModeRegs()
3015 tempah = 0x00; in SiS_SetCRT2ModeRegs()
3016 if(SiS_IsDualEdge(SiS_Pr)) tempbl = 0xff; in SiS_SetCRT2ModeRegs()
3018 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah); in SiS_SetCRT2ModeRegs()
3021 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3024 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3028 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_SetCRT2ModeRegs()
3029 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2c,0x30); in SiS_SetCRT2ModeRegs()
3047 if(ModeNo <= 0x13) in SiS_GetResInfo()
3056 unsigned short xres, yres, modeflag=0, resindex; in SiS_GetCRT2ResInfo()
3069 if(ModeNo <= 0x13) { in SiS_GetCRT2ResInfo()
3081 if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) { in SiS_GetCRT2ResInfo()
3084 if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x3a) & 0x01) { in SiS_GetCRT2ResInfo()
3085 if(ModeNo == 0x12) yres = 400; in SiS_GetCRT2ResInfo()
3136 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3138 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480; in SiS_GetCRT2ResInfo()
3157 unsigned short tempbx=0, tempal=0, resinfo=0; in SiS_GetCRT2Ptr()
3159 if(ModeNo <= 0x13) { in SiS_GetCRT2Ptr()
3166 if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_IF_DEF_LVDS == 0)) { in SiS_GetCRT2Ptr()
3188 if(ModeNo >= 0x13) { in SiS_GetCRT2Ptr()
3226 tempal &= 0x3F; in SiS_GetCRT2Ptr()
3228 if(ModeNo > 0x13) { in SiS_GetCRT2Ptr()
3267 tempbx = 0; in SiS_GetCRT2Ptr()
3328 (*ResIndex) = tempal & 0x1F; in SiS_GetCRT2Ptr()
3336 unsigned short tempax=0, tempbx=0, index, dotclock; in SiS_GetRAMDAC2DATA()
3337 unsigned short temp1=0, modeflag=0, tempcx=0; in SiS_GetRAMDAC2DATA()
3342 if(ModeNo <= 0x13) { in SiS_GetRAMDAC2DATA()
3347 tempax = SiS_Pr->SiS_StandTable[index].CRTC[0]; in SiS_GetRAMDAC2DATA()
3358 tempax = SiS_Pr->SiS_CRT1Table[index].CR[0]; in SiS_GetRAMDAC2DATA()
3360 tempax &= 0x03FF; in SiS_GetRAMDAC2DATA()
3363 tempcx &= 0x0100; in SiS_GetRAMDAC2DATA()
3372 if(temp1 & 0x01) tempbx |= 0x0100; in SiS_GetRAMDAC2DATA()
3373 if(temp1 & 0x20) tempbx |= 0x0200; in SiS_GetRAMDAC2DATA()
3399 if(ModeNo < 0x13) { in SiS_CalcPanelLinkTiming()
3404 if(ResIndex == 0x09) { in SiS_CalcPanelLinkTiming()
3405 if(SiS_Pr->Alternate1600x1200) ResIndex = 0x20; /* 1600x1200 LCDA */ in SiS_CalcPanelLinkTiming()
3406 else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) ResIndex = 0x21; /* 1600x1200 LVDS */ in SiS_CalcPanelLinkTiming()
3440 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2DataLVDS()
3442 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2DataLVDS()
3443 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2DataLVDS()
3444 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2DataLVDS()
3445 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2DataLVDS()
3446 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2DataLVDS()
3512 if(ResIndex < 0x08) { in SiS_GetCRT2DataLVDS()
3528 unsigned short tempax, tempbx, modeflag, romptr=0; in SiS_GetCRT2Data301()
3536 if(ModeNo <= 0x13) { in SiS_GetCRT2Data301()
3541 resinfo = 0; in SiS_GetCRT2Data301()
3549 (resinfo661 >= 0) && in SiS_GetCRT2Data301()
3561 SiS_Pr->SiS_NewFlickerMode = 0; in SiS_GetCRT2Data301()
3563 SiS_Pr->SiS_RY1COE = 0; in SiS_GetCRT2Data301()
3564 SiS_Pr->SiS_RY2COE = 0; in SiS_GetCRT2Data301()
3565 SiS_Pr->SiS_RY3COE = 0; in SiS_GetCRT2Data301()
3566 SiS_Pr->SiS_RY4COE = 0; in SiS_GetCRT2Data301()
3567 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3619 SiS_Pr->SiS_RVBHRS2 = (TVPtr+ResIndex)->RVBHRS2 & 0x0fff; in SiS_GetCRT2Data301()
3624 tempax = ((TVPtr+ResIndex)->RVBHRS2 >> 12) & 0x07; in SiS_GetCRT2Data301()
3625 if((TVPtr+ResIndex)->RVBHRS2 & 0x8000) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3639 SiS_Pr->SiS_NewFlickerMode = 0x40; in SiS_GetCRT2Data301()
3676 SiS_Pr->SiS_RY1COE = 0x00; in SiS_GetCRT2Data301()
3677 SiS_Pr->SiS_RY2COE = 0xf4; in SiS_GetCRT2Data301()
3678 SiS_Pr->SiS_RY3COE = 0x10; in SiS_GetCRT2Data301()
3679 SiS_Pr->SiS_RY4COE = 0x38; in SiS_GetCRT2Data301()
3725 SiS_Pr->SiS_VGAHT = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8); in SiS_GetCRT2Data301()
3726 SiS_Pr->SiS_VGAVT = (ROMAddr[romptr+4] << 4) | ((ROMAddr[romptr+3] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3727 SiS_Pr->SiS_HT = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8); in SiS_GetCRT2Data301()
3728 SiS_Pr->SiS_VT = (ROMAddr[romptr+7] << 4) | ((ROMAddr[romptr+6] & 0xf0) >> 4); in SiS_GetCRT2Data301()
3729 SiS_Pr->SiS_RVBHRS2 = ROMAddr[romptr+8] | ((ROMAddr[romptr+9] & 0x0f) << 8); in SiS_GetCRT2Data301()
3732 tempax = (ROMAddr[romptr+9] >> 4) & 0x07; in SiS_GetCRT2Data301()
3733 if(ROMAddr[romptr+9] & 0x80) SiS_Pr->SiS_RVBHRS2 -= tempax; in SiS_GetCRT2Data301()
3746 SiS_Pr->SiS_RVBHRS2 = 0; in SiS_GetCRT2Data301()
3910 SiS_Pr->SiS_LCDHDES = 0; in SiS_GetLVDSDesData()
3911 SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
3947 if(ModeNo <= 0x13) ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC; in SiS_GetLVDSDesData()
3989 if((SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { in SiS_GetLVDSDesData()
4061 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_GetLVDSDesData()
4090 if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) { in SiS_GetLVDSDesData()
4126 int ret = 0; in SiS_HandlePWD()
4130 unsigned char drivermode = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40; in SiS_HandlePWD()
4136 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2b,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 0]); in SiS_HandlePWD()
4137 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2c,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 1]); in SiS_HandlePWD()
4138 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2d,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 2]); in SiS_HandlePWD()
4139 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2e,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 3]); in SiS_HandlePWD()
4140 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2f,ROMAddr[romptr + SiS_Pr->SiS_PWDOffset + 4]); in SiS_HandlePWD()
4141 temp = 0x00; in SiS_HandlePWD()
4142 if((ROMAddr[romptr + 2] & (0x06 << 1)) && !drivermode) { in SiS_HandlePWD()
4143 temp = 0x80; in SiS_HandlePWD()
4146 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); in SiS_HandlePWD()
4161 unsigned short tempah, pushax=0, modenum; in SiS_DisableBridge()
4163 unsigned short temp=0; in SiS_DisableBridge()
4175 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_DisableBridge()
4177 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4182 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f); in SiS_DisableBridge()
4185 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); in SiS_DisableBridge()
4187 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4188 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4191 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4192 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4198 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4200 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4210 int didpwd = 0; in SiS_DisableBridge()
4214 modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f; in SiS_DisableBridge()
4221 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_DisableBridge()
4228 if( (modenum <= 0x13) || in SiS_DisableBridge()
4232 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfe); in SiS_DisableBridge()
4235 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xfc); in SiS_DisableBridge()
4240 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_DisableBridge()
4241 SiS_DDC2Delay(SiS_Pr,0xe000); in SiS_DisableBridge()
4242 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_DisableBridge()
4243 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_DisableBridge()
4245 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_DisableBridge()
4254 tempah = 0xef; in SiS_DisableBridge()
4255 if(SiS_IsVAMode(SiS_Pr)) tempah = 0xf7; in SiS_DisableBridge()
4256 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_DisableBridge()
4261 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10); in SiS_DisableBridge()
4264 tempah = 0x3f; in SiS_DisableBridge()
4266 tempah = 0x7f; in SiS_DisableBridge()
4267 if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0xbf; in SiS_DisableBridge()
4269 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_DisableBridge()
4272 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4278 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4279 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF); in SiS_DisableBridge()
4284 ((SiS_Pr->SiS_VBType & VB_SISLVDS) && (modenum <= 0x13))) { in SiS_DisableBridge()
4287 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf); in SiS_DisableBridge()
4290 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4296 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4297 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4298 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4299 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4300 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4305 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4316 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD); in SiS_DisableBridge()
4322 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_DisableBridge()
4341 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4347 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF); /* disable VB */ in SiS_DisableBridge()
4351 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4354 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); /* disable lock mode */ in SiS_DisableBridge()
4357 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SiS_DisableBridge()
4358 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10); in SiS_DisableBridge()
4359 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_DisableBridge()
4360 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp); in SiS_DisableBridge()
4363 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); /* disable CRT2 */ in SiS_DisableBridge()
4367 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4381 SiS_SetCH700x(SiS_Pr,0x0E,0x09); in SiS_DisableBridge()
4385 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4389 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4393 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x08)) { in SiS_DisableBridge()
4394 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_DisableBridge()
4397 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x1c)) { in SiS_DisableBridge()
4400 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4409 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4411 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4413 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); in SiS_DisableBridge()
4414 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_DisableBridge()
4419 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4430 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18); in SiS_DisableBridge()
4434 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4437 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_DisableBridge()
4439 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_DisableBridge()
4440 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_DisableBridge()
4445 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_DisableBridge()
4458 SiS_SetCH701x(SiS_Pr,0x49,0x01); in SiS_DisableBridge()
4464 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4465 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x08); in SiS_DisableBridge()
4469 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4475 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4478 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_DisableBridge()
4482 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_DisableBridge()
4485 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF); in SiS_DisableBridge()
4487 if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4490 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF); in SiS_DisableBridge()
4493 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4495 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4497 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xbf); in SiS_DisableBridge()
4498 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xef); in SiS_DisableBridge()
4504 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4507 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1e,0xdf); in SiS_DisableBridge()
4511 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_DisableBridge()
4513 /* SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xff); */ in SiS_DisableBridge()
4515 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); in SiS_DisableBridge()
4522 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80); /* DirectDVD PAL?*/ in SiS_DisableBridge()
4523 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); /* VB clock / 4 ? */ in SiS_DisableBridge()
4524 } else if( (SiS_Pr->SiS_IF_DEF_CH70xx == 0) || in SiS_DisableBridge()
4527 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_DisableBridge()
4530 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_DisableBridge()
4534 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x04); in SiS_DisableBridge()
4559 unsigned short temp=0, tempah; in SiS_EnableBridge()
4561 unsigned short temp1, pushax=0; in SiS_EnableBridge()
4575 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4577 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4581 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
4589 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* Enable CRT2 */ in SiS_EnableBridge()
4592 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
4594 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
4596 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
4598 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
4599 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4604 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
4610 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4612 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4613 if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; in SiS_EnableBridge()
4615 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4616 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
4617 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4618 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0); in SiS_EnableBridge()
4622 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
4626 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4641 unsigned char r30=0, r31=0, r32=0, r33=0, cr36=0; in SiS_EnableBridge()
4642 int didpwd = 0; in SiS_EnableBridge()
4643 /* unsigned short emidelay=0; */ in SiS_EnableBridge()
4647 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef); in SiS_EnableBridge()
4650 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4657 tempah = 0x10; in SiS_EnableBridge()
4659 if(SiS_TVEnabled(SiS_Pr)) tempah = 0x18; in SiS_EnableBridge()
4660 else tempah = 0x08; in SiS_EnableBridge()
4662 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah); in SiS_EnableBridge()
4668 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00); in SiS_EnableBridge()
4670 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06); in SiS_EnableBridge()
4672 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3); in SiS_EnableBridge()
4679 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_EnableBridge()
4681 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_EnableBridge()
4695 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) { in SiS_EnableBridge()
4704 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; in SiS_EnableBridge()
4706 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4708 if(!(SiS_LCDAEnabled(SiS_Pr))) temp |= 0x20; in SiS_EnableBridge()
4711 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4713 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4715 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
4716 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4724 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_EnableBridge()
4728 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20); in SiS_EnableBridge()
4729 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4735 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f); in SiS_EnableBridge()
4737 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x7f); in SiS_EnableBridge()
4741 tempah = 0xc0; in SiS_EnableBridge()
4743 tempah = 0x80; in SiS_EnableBridge()
4744 if(!(SiS_IsVAMode(SiS_Pr))) tempah = 0x40; in SiS_EnableBridge()
4746 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah); in SiS_EnableBridge()
4752 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10); in SiS_EnableBridge()
4753 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80); in SiS_EnableBridge()
4758 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_EnableBridge()
4762 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c); in SiS_EnableBridge()
4766 cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); in SiS_EnableBridge()
4772 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4773 SiS_Pr->EMI_30 = 0; in SiS_EnableBridge()
4774 SiS_Pr->EMI_31 = ROMAddr[romptr + SiS_Pr->SiS_EMIOffset + 0]; in SiS_EnableBridge()
4777 if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40; in SiS_EnableBridge()
4778 /* emidelay = SISGETROMW((romptr + 0x22)); */ in SiS_EnableBridge()
4783 /* (P4_30|0x40) */ in SiS_EnableBridge()
4784 /* Compal 1400x1050: 0x05, 0x60, 0x00 YES (1.10.7w; CR36=69) */ in SiS_EnableBridge()
4785 /* Compal 1400x1050: 0x0d, 0x70, 0x40 YES (1.10.7x; CR36=69) */ in SiS_EnableBridge()
4786 /* Acer 1280x1024: 0x12, 0xd0, 0x6b NO (1.10.9k; CR36=73) */ in SiS_EnableBridge()
4787 /* Compaq 1280x1024: 0x0d, 0x70, 0x6b YES (1.12.04b; CR36=03) */ in SiS_EnableBridge()
4788 /* Clevo 1024x768: 0x05, 0x60, 0x33 NO (1.10.8e; CR36=12, DL!) */ in SiS_EnableBridge()
4789 /* Clevo 1024x768: 0x0d, 0x70, 0x40 (if type == 3) YES (1.10.8y; CR36=?2) */ in SiS_EnableBridge()
4790 /* Clevo 1024x768: 0x05, 0x60, 0x33 (if type != 3) YES (1.10.8y; CR36=?2) */ in SiS_EnableBridge()
4792 /* Asus 1024x768: 0x08, 0x10, 0x3c (problematic) YES (1.10.8q; CR36=22) */ in SiS_EnableBridge()
4798 r30 = 0; in SiS_EnableBridge()
4809 switch((cr36 & 0x0f)) { in SiS_EnableBridge()
4811 r30 |= 0x40; in SiS_EnableBridge()
4812 if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40; in SiS_EnableBridge()
4814 r31 = 0x05; r32 = 0x60; r33 = 0x33; in SiS_EnableBridge()
4815 if((cr36 & 0xf0) == 0x30) { in SiS_EnableBridge()
4816 r31 = 0x0d; r32 = 0x70; r33 = 0x40; in SiS_EnableBridge()
4821 if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40; in SiS_EnableBridge()
4823 r31 = 0x12; r32 = 0xd0; r33 = 0x6b; in SiS_EnableBridge()
4825 r31 = 0x0d; r32 = 0x70; r33 = 0x6b; in SiS_EnableBridge()
4830 r30 |= 0x40; in SiS_EnableBridge()
4832 r31 = 0x05; r32 = 0x60; r33 = 0x00; in SiS_EnableBridge()
4834 r31 = 0x0d; r32 = 0x70; r33 = 0x40; /* BIOS values */ in SiS_EnableBridge()
4839 r30 |= 0x40; in SiS_EnableBridge()
4841 r31 = 0x05; r32 = 0x60; r33 = 0x00; in SiS_EnableBridge()
4850 if((cr36 & 0x0f) == 0x09) { in SiS_EnableBridge()
4851 r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x00; in SiS_EnableBridge()
4857 if((cr36 & 0x0f) == 0x03) { in SiS_EnableBridge()
4858 r30 = 0x20; r31 = 0x12; r32 = 0xd0; r33 = 0x6b; in SiS_EnableBridge()
4864 if((cr36 & 0x0f) == 0x02) { in SiS_EnableBridge()
4865 /* r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x33; */ /* rev 2 */ in SiS_EnableBridge()
4866 /* r30 = 0x20; r31 = 0x05; r32 = 0x60; r33 = 0x33; */ /* rev 3 */ in SiS_EnableBridge()
4867 /* r30 = 0x60; r31 = 0x0d; r32 = 0x70; r33 = 0x40; */ /* rev 4 */ in SiS_EnableBridge()
4868 /* r30 = 0x20; r31 = 0x0d; r32 = 0x70; r33 = 0x40; */ /* rev 5 */ in SiS_EnableBridge()
4875 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20); /* Reset */ in SiS_EnableBridge()
4878 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31); in SiS_EnableBridge()
4879 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32); in SiS_EnableBridge()
4880 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33); in SiS_EnableBridge()
4883 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_EnableBridge()
4888 if(r30 & 0x40) { in SiS_EnableBridge()
4889 /*SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x2a,0x80);*/ in SiS_EnableBridge()
4900 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40); /* Enable */ in SiS_EnableBridge()
4901 /*SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x2a,0x7f);*/ in SiS_EnableBridge()
4920 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_EnableBridge()
4922 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x03); in SiS_EnableBridge()
4927 SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax); in SiS_EnableBridge()
4929 SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff); in SiS_EnableBridge()
4934 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4945 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4946 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
4950 temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF; /* lock mode */ in SiS_EnableBridge()
4952 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); in SiS_EnableBridge()
4953 if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20; in SiS_EnableBridge()
4955 SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp); in SiS_EnableBridge()
4957 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); /* enable CRT2 */ in SiS_EnableBridge()
4960 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
4961 if(!(temp & 0x80)) { in SiS_EnableBridge()
4962 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); /* BVBDOENABLE=1 */ in SiS_EnableBridge()
4966 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20); /* enable VB processor */ in SiS_EnableBridge()
4971 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
4978 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
4996 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
4998 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
5002 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5005 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF); in SiS_EnableBridge()
5007 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F); in SiS_EnableBridge()
5009 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40); in SiS_EnableBridge()
5015 SiS_SetCH700x(SiS_Pr,0x0E,0x0B); in SiS_EnableBridge()
5020 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) { in SiS_EnableBridge()
5021 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) { in SiS_EnableBridge()
5027 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
5040 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18); in SiS_EnableBridge()
5044 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5046 SiS_SetRegSR11ANDOR(SiS_Pr,0xFB,0x00); in SiS_EnableBridge()
5047 SiS_PanelDelay(SiS_Pr, 0); in SiS_EnableBridge()
5051 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_EnableBridge()
5054 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7); in SiS_EnableBridge()
5057 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_EnableBridge()
5058 temp &= 0x20; in SiS_EnableBridge()
5063 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f); in SiS_EnableBridge()
5069 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5074 temp1 = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E); in SiS_EnableBridge()
5075 if(!(temp1 & 0x80)) { in SiS_EnableBridge()
5076 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80); in SiS_EnableBridge()
5085 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5087 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5089 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x40); in SiS_EnableBridge()
5090 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x10); in SiS_EnableBridge()
5095 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x20); in SiS_EnableBridge()
5100 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f); in SiS_EnableBridge()
5121 } else if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { in SiS_EnableBridge()
5125 SiS_SetRegSR11ANDOR(SiS_Pr,0xF7,0x00); in SiS_EnableBridge()
5154 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF)); in SiS_SetCRT2Offset()
5155 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8)); in SiS_SetCRT2Offset()
5157 temp = (unsigned char)(((offset >> 3) & 0xFF) + 1); in SiS_SetCRT2Offset()
5158 if(offset & 0x07) temp++; in SiS_SetCRT2Offset()
5159 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp); in SiS_SetCRT2Offset()
5166 unsigned short tempah=0, tempbl, infoflag; in SiS_SetCRT2Sync()
5168 tempbl = 0xC0; in SiS_SetCRT2Sync()
5179 tempah = 0; in SiS_SetCRT2Sync()
5183 tempah &= 0xC0; in SiS_SetCRT2Sync()
5184 tempah |= 0x20; in SiS_SetCRT2Sync()
5185 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5189 tempah |= 0xf0; in SiS_SetCRT2Sync()
5196 tempah |= 0x30; in SiS_SetCRT2Sync()
5200 tempah &= ~0xc0; in SiS_SetCRT2Sync()
5206 tempah &= 0x18; in SiS_SetCRT2Sync()
5207 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah); in SiS_SetCRT2Sync()
5210 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0); in SiS_SetCRT2Sync()
5213 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5225 tempbl = 0; in SiS_SetCRT2Sync()
5229 tempbl = (tempah >> 6) & 0x03; in SiS_SetCRT2Sync()
5232 tempah &= 0xC0; in SiS_SetCRT2Sync()
5233 tempah |= 0x20; in SiS_SetCRT2Sync()
5234 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5235 tempah |= 0xc0; in SiS_SetCRT2Sync()
5236 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5238 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5243 tempah = ((infoflag >> 8) & 0xc0) | 0x20; in SiS_SetCRT2Sync()
5244 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5245 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5257 tempbl = 0; in SiS_SetCRT2Sync()
5262 tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6); in SiS_SetCRT2Sync()
5267 tempbl = 0x03; in SiS_SetCRT2Sync()
5269 tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); in SiS_SetCRT2Sync()
5270 tempbl = (tempah >> 6) & 0x03; in SiS_SetCRT2Sync()
5271 tempbl |= 0x08; in SiS_SetCRT2Sync()
5272 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04; in SiS_SetCRT2Sync()
5274 tempah &= 0xC0; in SiS_SetCRT2Sync()
5275 tempah |= 0x20; in SiS_SetCRT2Sync()
5276 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5277 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) tempah |= 0xc0; in SiS_SetCRT2Sync()
5278 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5281 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5289 tempbl = 0; in SiS_SetCRT2Sync()
5291 if(ModeNo <= 0x13) { in SiS_SetCRT2Sync()
5292 tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetCRT2Sync()
5299 tempbl = (tempah >> 6) & 0x03; in SiS_SetCRT2Sync()
5304 tempah &= 0xC0; in SiS_SetCRT2Sync()
5305 tempah |= 0x20; in SiS_SetCRT2Sync()
5306 if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10; in SiS_SetCRT2Sync()
5309 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempah |= 0xc0; in SiS_SetCRT2Sync()
5313 tempah &= 0x18; in SiS_SetCRT2Sync()
5314 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah); in SiS_SetCRT2Sync()
5316 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah); in SiS_SetCRT2Sync()
5319 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl); in SiS_SetCRT2Sync()
5337 unsigned short VCLK = 0, MCLK, colorth = 0, data2 = 0; in SiS_SetCRT2FIFO_300()
5351 SiS_Pr->SiS_SelectCRT2Rate = 0; in SiS_SetCRT2FIFO_300()
5354 if(CRT1ModeNo >= 0x13) { in SiS_SetCRT2FIFO_300()
5366 CRT1ModeNo = 0xfe; in SiS_SetCRT2FIFO_300()
5376 if(CRT1ModeNo >= 0x13) { in SiS_SetCRT2FIFO_300()
5379 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x3A); in SiS_SetCRT2FIFO_300()
5381 index = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1A); in SiS_SetCRT2FIFO_300()
5383 index &= 0x07; in SiS_SetCRT2FIFO_300()
5386 temp = ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) >> 6) & 0x03) << 1; in SiS_SetCRT2FIFO_300()
5403 pci50 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0x50); in SiS_SetCRT2FIFO_300()
5404 pciA0 = sisfb_read_nbridge_pci_dword(SiS_Pr, 0xa0); in SiS_SetCRT2FIFO_300()
5408 index = (unsigned short)(((pciA0 >> 28) & 0x0f) * 3); in SiS_SetCRT2FIFO_300()
5409 index += (unsigned short)(((pci50 >> 9)) & 0x03); in SiS_SetCRT2FIFO_300()
5412 index = 0; /* -- do it like the BIOS anyway... */ in SiS_SetCRT2FIFO_300()
5419 index = (pci50 >> 1) & 0x07; in SiS_SetCRT2FIFO_300()
5421 if(pci50 & 0x01) index += 6; in SiS_SetCRT2FIFO_300()
5422 if(!(pciA0 & 0x01)) index += 24; in SiS_SetCRT2FIFO_300()
5424 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80) index += 12; in SiS_SetCRT2FIFO_300()
5429 if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x80)) data += 5; in SiS_SetCRT2FIFO_300()
5451 if(ROMAddr[0x220] & 0x01) { in SiS_SetCRT2FIFO_300()
5452 VCLK = ROMAddr[0x229] | (ROMAddr[0x22a] << 8); in SiS_SetCRT2FIFO_300()
5460 CRT2ModeNo = 0xfe; in SiS_SetCRT2FIFO_300()
5475 else if(data > 0x14) data = 0x14; in SiS_SetCRT2FIFO_300()
5478 temp = 0x16; in SiS_SetCRT2FIFO_300()
5479 if((data <= 0x0f) || (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) in SiS_SetCRT2FIFO_300()
5480 temp = 0x13; in SiS_SetCRT2FIFO_300()
5482 temp = 0x16; in SiS_SetCRT2FIFO_300()
5485 (SiS_Pr->ChipRevision >= 0x30)) in SiS_SetCRT2FIFO_300()
5486 temp = 0x1b; in SiS_SetCRT2FIFO_300()
5488 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0xe0,temp); in SiS_SetCRT2FIFO_300()
5491 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetCRT2FIFO_300()
5492 if(data > 0x13) data = 0x13; in SiS_SetCRT2FIFO_300()
5494 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,0xe0,data); in SiS_SetCRT2FIFO_300()
5496 } else { /* If mode <= 0x13, we just restore everything */ in SiS_SetCRT2FIFO_300()
5510 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B); in SiS_SetCRT2FIFO_310()
5516 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03); in SiS_SetCRT2FIFO_310()
5517 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b); in SiS_SetCRT2FIFO_310()
5518 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5519 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01); in SiS_SetCRT2FIFO_310()
5520 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0); in SiS_SetCRT2FIFO_310()
5521 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e); in SiS_SetCRT2FIFO_310()
5523 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04); in SiS_SetCRT2FIFO_310()
5545 unsigned short temp, modeflag, i, j, xres=0, VGAVDE; in SiS_SetGroup1_301()
5548 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, in SiS_SetGroup1_301()
5550 0x00, 0x0b, 0x17, 0x18, 0x19, 0x00, 0x1a, 0x00, in SiS_SetGroup1_301()
5552 0x0c, 0x0d, 0x0e, 0x00, 0x0f, 0x10, 0x11, 0x00 in SiS_SetGroup1_301()
5555 if(ModeNo <= 0x13) { in SiS_SetGroup1_301()
5569 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04); in SiS_SetGroup1_301()
5573 SiS_Pr->CHTotal = 8224; /* Max HT, 0x2020, results in 0x3ff in registers */ in SiS_SetGroup1_301()
5591 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x04); in SiS_SetGroup1_301()
5592 temp |= ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x0b) & 0xc0) << 2); in SiS_SetGroup1_301()
5600 SiS_Pr->CHSyncEnd = 0xffe8; /* results in 0x2000 in registers */ in SiS_SetGroup1_301()
5602 SiS_Pr->CVTotal = 2049; /* Max VT, 0x0801, results in 0x7ff in registers */ in SiS_SetGroup1_301()
5617 if(ModeNo == 0x3c) SiS_Pr->CVBlankEnd = 226; in SiS_SetGroup1_301()
5625 SiS_CalcCRRegisters(SiS_Pr, 0); in SiS_SetGroup1_301()
5626 SiS_Pr->CCRT1CRTC[16] &= ~0xE0; in SiS_SetGroup1_301()
5628 for(i = 0; i <= 7; i++) { in SiS_SetGroup1_301()
5631 for(i = 0x10, j = 8; i <= 0x12; i++, j++) { in SiS_SetGroup1_301()
5634 for(i = 0x15, j = 11; i <= 0x16; i++, j++) { in SiS_SetGroup1_301()
5637 for(i = 0x0a, j = 13; i <= 0x0c; i++, j++) { in SiS_SetGroup1_301()
5641 temp = SiS_Pr->CCRT1CRTC[16] & 0xE0; in SiS_SetGroup1_301()
5642 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x0E],0x1F,temp); in SiS_SetGroup1_301()
5644 temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5; in SiS_SetGroup1_301()
5645 if(modeflag & DoubleScanMode) temp |= 0x80; in SiS_SetGroup1_301()
5646 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,CRTranslation[0x09],0x5F,temp); in SiS_SetGroup1_301()
5648 temp = 0; in SiS_SetGroup1_301()
5649 temp |= (SiS_GetReg(SiS_Pr->SiS_P3c4,0x01) & 0x01); in SiS_SetGroup1_301()
5650 if(modeflag & HalfDCLK) temp |= 0x08; in SiS_SetGroup1_301()
5651 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* SR01: HalfDCLK[3], 8/9 div dotclock[ in SiS_SetGroup1_301()
5653 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,0x00); /* CR14: (text mode: underline location… in SiS_SetGroup1_301()
5654 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,0x00); /* CR17: n/a */ in SiS_SetGroup1_301()
5656 temp = 0; in SiS_SetGroup1_301()
5658 temp = (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) << 7; in SiS_SetGroup1_301()
5660 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* SR0E, dither[7] */ in SiS_SetGroup1_301()
5662 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); in SiS_SetGroup1_301()
5663 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ in SiS_SetGroup1_301()
5674 unsigned short modeflag, resinfo = 0; in SiS_SetGroup1_LVDS()
5676 unsigned int tempeax = 0, tempebx, tempecx, tempvcfact = 0; in SiS_SetGroup1_LVDS()
5679 unsigned short crt2crtc = 0; in SiS_SetGroup1_LVDS()
5685 if(ModeNo <= 0x13) { in SiS_SetGroup1_LVDS()
5720 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5723 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5724 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03); in SiS_SetGroup1_LVDS()
5726 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10); in SiS_SetGroup1_LVDS()
5730 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04); in SiS_SetGroup1_LVDS()
5731 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00); in SiS_SetGroup1_LVDS()
5733 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f); in SiS_SetGroup1_LVDS()
5737 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20); in SiS_SetGroup1_LVDS()
5759 temp = (tempax & 0x0007); in SiS_SetGroup1_LVDS()
5760 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp); /* BPLHDESKEW[2:0] */ in SiS_SetGroup1_LVDS()
5761 temp = (tempax >> 3) & 0x00FF; in SiS_SetGroup1_LVDS()
5762 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp); /* BPLHDESKEW[10:3] */ in SiS_SetGroup1_LVDS()
5780 if(temp & 0x07) temp += 8; in SiS_SetGroup1_LVDS()
5782 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp); /* BPLHDEE */ in SiS_SetGroup1_LVDS()
5795 temp = (tempcx >> 3) & 0x00FF; in SiS_SetGroup1_LVDS()
5800 case 0x04: in SiS_SetGroup1_LVDS()
5801 case 0x05: in SiS_SetGroup1_LVDS()
5802 case 0x0d: temp = 0x56; break; in SiS_SetGroup1_LVDS()
5803 case 0x10: temp = 0x60; break; in SiS_SetGroup1_LVDS()
5804 case 0x13: temp = 0x5f; break; in SiS_SetGroup1_LVDS()
5805 case 0x40: in SiS_SetGroup1_LVDS()
5806 case 0x41: in SiS_SetGroup1_LVDS()
5807 case 0x4f: in SiS_SetGroup1_LVDS()
5808 case 0x43: in SiS_SetGroup1_LVDS()
5809 case 0x44: in SiS_SetGroup1_LVDS()
5810 case 0x62: in SiS_SetGroup1_LVDS()
5811 case 0x56: in SiS_SetGroup1_LVDS()
5812 case 0x53: in SiS_SetGroup1_LVDS()
5813 case 0x5d: in SiS_SetGroup1_LVDS()
5814 case 0x5e: temp = 0x54; break; in SiS_SetGroup1_LVDS()
5819 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp); /* BPLHRS */ in SiS_SetGroup1_LVDS()
5835 temp &= 0x1F; in SiS_SetGroup1_LVDS()
5836 temp |= ((tempcx & 0x07) << 5); in SiS_SetGroup1_LVDS()
5837 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp); /* BPLHRE */ in SiS_SetGroup1_LVDS()
5878 temp = tempbx & 0x00FF; in SiS_SetGroup1_LVDS()
5881 if(ModeNo == 0x10) temp = 0xa9; in SiS_SetGroup1_LVDS()
5884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); /* BPLVRS */ in SiS_SetGroup1_LVDS()
5896 temp = tempcx & 0x000F; in SiS_SetGroup1_LVDS()
5897 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); /* BPLVRE */ in SiS_SetGroup1_LVDS()
5899 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
5902 if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5904 } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40; in SiS_SetGroup1_LVDS()
5905 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) temp |= 0x40; in SiS_SetGroup1_LVDS()
5906 tempbx = 0x87; in SiS_SetGroup1_LVDS()
5908 (SiS_Pr->ChipRevision >= 0x30)) { in SiS_SetGroup1_LVDS()
5909 tempbx = 0x07; in SiS_SetGroup1_LVDS()
5911 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03) temp |= 0x80; in SiS_SetGroup1_LVDS()
5916 if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80; in SiS_SetGroup1_LVDS()
5918 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80; in SiS_SetGroup1_LVDS()
5922 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp); in SiS_SetGroup1_LVDS()
5957 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
5958 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup1_LVDS()
5959 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp); in SiS_SetGroup1_LVDS()
5960 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx); in SiS_SetGroup1_LVDS()
5961 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx); in SiS_SetGroup1_LVDS()
5973 if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F; in SiS_SetGroup1_LVDS()
5975 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5976 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp); /* BPLVCFACT */ in SiS_SetGroup1_LVDS()
5990 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
5991 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp); in SiS_SetGroup1_LVDS()
5992 temp = (unsigned short)((tempeax & 0x00FF00) >> 8); in SiS_SetGroup1_LVDS()
5993 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp); in SiS_SetGroup1_LVDS()
5994 temp = (unsigned short)((tempeax & 0x00030000) >> 16); in SiS_SetGroup1_LVDS()
5995 if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04; in SiS_SetGroup1_LVDS()
5996 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp); in SiS_SetGroup1_LVDS()
5999 temp = (unsigned short)(tempeax & 0x00FF); in SiS_SetGroup1_LVDS()
6000 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp); in SiS_SetGroup1_LVDS()
6001 temp = (unsigned short)((tempeax & 0x00FF00) >> 8); in SiS_SetGroup1_LVDS()
6002 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp); in SiS_SetGroup1_LVDS()
6003 temp = (unsigned short)(((tempeax & 0x00030000) >> 16) << 6); in SiS_SetGroup1_LVDS()
6004 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp); in SiS_SetGroup1_LVDS()
6005 temp = 0; in SiS_SetGroup1_LVDS()
6006 if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08; in SiS_SetGroup1_LVDS()
6007 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp); in SiS_SetGroup1_LVDS()
6021 tempecx = 0xFFFF; in SiS_SetGroup1_LVDS()
6034 tempecx = (tempecx << 16) | (tempeax & 0xFFFF); in SiS_SetGroup1_LVDS()
6035 temp = (unsigned short)(tempecx & 0x00FF); in SiS_SetGroup1_LVDS()
6036 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp); in SiS_SetGroup1_LVDS()
6040 tempbx = (unsigned short)(tempeax & 0xFFFF); in SiS_SetGroup1_LVDS()
6043 tempbx = tempvcfact & 0x3f; in SiS_SetGroup1_LVDS()
6044 if(tempbx == 0) tempbx = 64; in SiS_SetGroup1_LVDS()
6046 tempbx = (unsigned short)(tempeax & 0xFFFF); in SiS_SetGroup1_LVDS()
6054 temp = ((tempbx >> 8) & 0x07) << 3; in SiS_SetGroup1_LVDS()
6055 temp = temp | ((tempecx >> 8) & 0x07); in SiS_SetGroup1_LVDS()
6056 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp); in SiS_SetGroup1_LVDS()
6057 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx); in SiS_SetGroup1_LVDS()
6063 temp = (unsigned short)((tempecx & 0xFF00) >> 8); in SiS_SetGroup1_LVDS()
6064 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp); in SiS_SetGroup1_LVDS()
6065 temp = (unsigned short)(tempecx & 0x00FF); in SiS_SetGroup1_LVDS()
6066 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp); in SiS_SetGroup1_LVDS()
6072 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20); in SiS_SetGroup1_LVDS()
6077 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_SetGroup1_LVDS()
6079 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23); in SiS_SetGroup1_LVDS()
6091 unsigned char TrumpMode13[4] = { 0x01, 0x10, 0x2c, 0x00 }; in SiS_SetGroup1_LVDS()
6092 unsigned char TrumpMode10_1[4] = { 0x01, 0x10, 0x27, 0x00 }; in SiS_SetGroup1_LVDS()
6093 unsigned char TrumpMode10_2[4] = { 0x01, 0x16, 0x10, 0x00 }; in SiS_SetGroup1_LVDS()
6096 trumpdata = &ROMAddr[0x8001 + (j * 80)]; in SiS_SetGroup1_LVDS()
6098 if(SiS_Pr->SiS_LCDTypeInfo == 0x0e) j += 7; in SiS_SetGroup1_LVDS()
6099 trumpdata = &SiS300_TrumpionData[j][0]; in SiS_SetGroup1_LVDS()
6102 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf); in SiS_SetGroup1_LVDS()
6103 for(i=0; i<5; i++) { in SiS_SetGroup1_LVDS()
6107 if(ModeNo == 0x13) { in SiS_SetGroup1_LVDS()
6108 for(i=0; i<4; i++) { in SiS_SetGroup1_LVDS()
6109 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode13[0]); in SiS_SetGroup1_LVDS()
6111 } else if(ModeNo == 0x10) { in SiS_SetGroup1_LVDS()
6112 for(i=0; i<4; i++) { in SiS_SetGroup1_LVDS()
6113 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_1[0]); in SiS_SetGroup1_LVDS()
6114 SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_2[0]); in SiS_SetGroup1_LVDS()
6118 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40); in SiS_SetGroup1_LVDS()
6124 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x25,0x00); in SiS_SetGroup1_LVDS()
6125 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x26,0x00); in SiS_SetGroup1_LVDS()
6126 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x27,0x00); in SiS_SetGroup1_LVDS()
6127 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87); in SiS_SetGroup1_LVDS()
6128 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A); in SiS_SetGroup1_LVDS()
6129 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B); in SiS_SetGroup1_LVDS()
6130 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03); in SiS_SetGroup1_LVDS()
6136 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,tempax & 0xff); in SiS_SetGroup1_LVDS()
6138 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,~0x078,temp); in SiS_SetGroup1_LVDS()
6140 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,tempax & 0xff); in SiS_SetGroup1_LVDS()
6141 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3A,0x00); /* Bflml = 0 */ in SiS_SetGroup1_LVDS()
6142 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x007); in SiS_SetGroup1_LVDS()
6149 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,tempax & 0xff); in SiS_SetGroup1_LVDS()
6151 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp); in SiS_SetGroup1_LVDS()
6158 temp = tempeax & 0x7f; in SiS_SetGroup1_LVDS()
6161 temp = tempeax & 0x3f; in SiS_SetGroup1_LVDS()
6162 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,temp); in SiS_SetGroup1_LVDS()
6163 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3F,0x00); /* BDxWadrst0 */ in SiS_SetGroup1_LVDS()
6164 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3E,0x00); in SiS_SetGroup1_LVDS()
6165 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3D,0x10); in SiS_SetGroup1_LVDS()
6166 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x3C,~0x040); in SiS_SetGroup1_LVDS()
6174 temp = tempax & 0x00FF; in SiS_SetGroup1_LVDS()
6175 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,temp); in SiS_SetGroup1_LVDS()
6176 temp = ((tempax & 0xFF00) >> 8) << 3; in SiS_SetGroup1_LVDS()
6177 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x44, 0x07, temp); in SiS_SetGroup1_LVDS()
6184 temp = tempeax & 0xFF; in SiS_SetGroup1_LVDS()
6185 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,temp); in SiS_SetGroup1_LVDS()
6186 temp = (tempeax & 0xFF00) >> 8; in SiS_SetGroup1_LVDS()
6187 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,temp); in SiS_SetGroup1_LVDS()
6188 temp = ((tempeax & 0xFF0000) >> 16) | 0x10; in SiS_SetGroup1_LVDS()
6189 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,temp); in SiS_SetGroup1_LVDS()
6190 temp = ((tempeax & 0x01000000) >> 24) << 7; in SiS_SetGroup1_LVDS()
6191 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port, 0x3C, 0x7F, temp); in SiS_SetGroup1_LVDS()
6193 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x03); in SiS_SetGroup1_LVDS()
6194 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0x50); in SiS_SetGroup1_LVDS()
6195 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,0x00); in SiS_SetGroup1_LVDS()
6196 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2F,0x01); in SiS_SetGroup1_LVDS()
6197 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0x38); in SiS_SetGroup1_LVDS()
6200 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2b,0x02); in SiS_SetGroup1_LVDS()
6201 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2c,0x00); in SiS_SetGroup1_LVDS()
6202 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x00); in SiS_SetGroup1_LVDS()
6203 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,0x0c); in SiS_SetGroup1_LVDS()
6204 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,0x00); in SiS_SetGroup1_LVDS()
6205 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,0x00); in SiS_SetGroup1_LVDS()
6206 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,0x80); in SiS_SetGroup1_LVDS()
6207 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x39,0xA0); in SiS_SetGroup1_LVDS()
6208 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3a,0x00); in SiS_SetGroup1_LVDS()
6209 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3b,0xf0); in SiS_SetGroup1_LVDS()
6210 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3c,0x00); in SiS_SetGroup1_LVDS()
6211 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3d,0x10); in SiS_SetGroup1_LVDS()
6212 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3e,0x00); in SiS_SetGroup1_LVDS()
6213 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3f,0x00); in SiS_SetGroup1_LVDS()
6214 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x40,0x10); in SiS_SetGroup1_LVDS()
6215 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x41,0x25); in SiS_SetGroup1_LVDS()
6216 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x42,0x80); in SiS_SetGroup1_LVDS()
6217 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x43,0x14); in SiS_SetGroup1_LVDS()
6218 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x44,0x03); in SiS_SetGroup1_LVDS()
6219 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x45,0x0a); in SiS_SetGroup1_LVDS()
6233 unsigned short temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0; in SiS_SetGroup1()
6234 unsigned short pushbx=0, CRT1Index=0, modeflag, resinfo=0; in SiS_SetGroup1()
6236 unsigned short tempbl=0; in SiS_SetGroup1()
6244 if(ModeNo <= 0x13) { in SiS_SetGroup1()
6276 temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6277 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6279 temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4; in SiS_SetGroup1()
6280 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6282 temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6283 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6285 pushbx = SiS_Pr->SiS_VGAHDE + 12; /* bx BTVGA2HRS 0x0B,0x0C */ in SiS_SetGroup1()
6299 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HT 0x08,0x09 */ in SiS_SetGroup1()
6312 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx); /* CRT2 Horizontal Total */ in SiS_SetGroup1()
6313 temp = (tempcx >> 4) & 0xF0; in SiS_SetGroup1()
6314 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp); /* CRT2 Horizontal Total Overflow [7:4] … in SiS_SetGroup1()
6316 tempcx = SiS_Pr->SiS_VGAHT; /* BTVGA2HDEE 0x0A,0x0C */ in SiS_SetGroup1()
6326 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx); /* CRT2 Horizontal Display Enable End */ in SiS_SetGroup1()
6340 tempcx = (tempcx & 0xff00) | 0x30; in SiS_SetGroup1()
6342 tempcx = (tempcx & 0xff00) | 0xff; in SiS_SetGroup1()
6376 tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; /* (VGAHRS-3)*8 */ in SiS_SetGroup1()
6377 tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3; /* (VGAHRE-3)*8 */ in SiS_SetGroup1()
6378 tempcx &= 0x00FF; in SiS_SetGroup1()
6379 tempcx |= (tempbx & 0xFF00); in SiS_SetGroup1()
6395 … SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx); /* CRT2 Horizontal Retrace Start */ in SiS_SetGroup1()
6397 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx); /* CRT2 Horizontal Retrace End */ in SiS_SetGroup1()
6399 temp = ((tempbx >> 8) & 0x0F) | ((pushbx >> 4) & 0xF0); in SiS_SetGroup1()
6400 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp); /* Overflow */ in SiS_SetGroup1()
6405 temp = tempcx & 0x00FF; in SiS_SetGroup1()
6410 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6422 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp); /* CRT2 Vertical Total */ in SiS_SetGroup1()
6425 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx); /* CRT2 Vertical Display Enable End */ in SiS_SetGroup1()
6427 temp = ((tempbx >> 5) & 0x38) | ((tempcx >> 8) & 0x07); in SiS_SetGroup1()
6428 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp); /* Overflow */ in SiS_SetGroup1()
6442 …tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x1… in SiS_SetGroup1()
6443 …tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 … in SiS_SetGroup1()
6465 if(cr7 & 0x04) tempbx |= 0x0100; in SiS_SetGroup1()
6466 if(cr7 & 0x80) tempbx |= 0x0200; in SiS_SetGroup1()
6467 if(cr13 & 0x08) tempbx |= 0x0400; in SiS_SetGroup1()
6470 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx); /* CRT2 Vertical Retrace Start */ in SiS_SetGroup1()
6472 temp = ((tempbx >> 4) & 0x70) | (tempcx & 0x0F); in SiS_SetGroup1()
6473 …SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp); /* CRT2 Vert. Retrace End; Overflow */ in SiS_SetGroup1()
6482 temp = 0x20; in SiS_SetGroup1()
6484 temp = 0x10; in SiS_SetGroup1()
6485 if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) temp = 0x2c; in SiS_SetGroup1()
6486 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6489 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20; in SiS_SetGroup1()
6491 if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) temp = 0x24; in SiS_SetGroup1()
6492 if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) temp = 0x2c; in SiS_SetGroup1()
6493 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x08; in SiS_SetGroup1()
6495 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) temp = 0x2c; in SiS_SetGroup1()
6496 else temp = 0x20; in SiS_SetGroup1()
6499 if(ROMAddr[0x220] & 0x80) { in SiS_SetGroup1()
6501 temp = ROMAddr[0x221]; in SiS_SetGroup1()
6503 temp = ROMAddr[0x222]; in SiS_SetGroup1()
6505 temp = ROMAddr[0x223]; in SiS_SetGroup1()
6507 temp = ROMAddr[0x224]; in SiS_SetGroup1()
6515 temp = 0x20; in SiS_SetGroup1()
6517 if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04; in SiS_SetGroup1()
6520 if(ROMAddr[0x220] & 0x80) { in SiS_SetGroup1()
6521 temp = ROMAddr[0x220]; in SiS_SetGroup1()
6529 temp &= 0x3c; in SiS_SetGroup1()
6531 …SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* Panel Link Delay Compensation; (Softw… in SiS_SetGroup1()
6543 if(SiS_Pr->ChipType == SIS_740) temp = 0x03; in SiS_SetGroup1()
6544 else temp = 0x00; in SiS_SetGroup1()
6546 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a; in SiS_SetGroup1()
6547 tempbl = 0xF0; in SiS_SetGroup1()
6549 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6550 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F; in SiS_SetGroup1()
6555 temp = 0x08; in SiS_SetGroup1()
6556 tempbl = 0; in SiS_SetGroup1()
6558 if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0; in SiS_SetGroup1()
6562 … SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp); /* Panel Link Delay Compensation */ in SiS_SetGroup1()
6567 tempax = 0; in SiS_SetGroup1()
6568 if(modeflag & DoubleScanMode) tempax |= 0x80; in SiS_SetGroup1()
6569 if(modeflag & HalfDCLK) tempax |= 0x40; in SiS_SetGroup1()
6570 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax); in SiS_SetGroup1()
6589 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetGroup1()
6609 unsigned short a, b, p = 0; in SiS_GetGroup2CLVXPtr()
6637 p += 0x42; in SiS_GetGroup2CLVXPtr()
6638 } while((tableptr[p] | tableptr[p+1] << 8) != 0xffff); in SiS_GetGroup2CLVXPtr()
6639 if((tableptr[p] | tableptr[p+1] << 8) == 0xffff) p -= 0x42; in SiS_GetGroup2CLVXPtr()
6655 tableptr = SiS_GetGroup2CLVXPtr(SiS_Pr, 0); in SiS_SetGroup2_C_ELV()
6656 for(i = 0x80, j = 0; i <= 0xbf; i++, j++) { in SiS_SetGroup2_C_ELV()
6661 for(i = 0xc0, j = 0; i <= 0xff; i++, j++) { in SiS_SetGroup2_C_ELV()
6665 temp = 0x10; in SiS_SetGroup2_C_ELV()
6666 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp |= 0x04; in SiS_SetGroup2_C_ELV()
6667 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp); in SiS_SetGroup2_C_ELV()
6678 if(ModeNo <= 0x13) in SiS_GetCRT2Part2Ptr()
6683 (*ResIndex) &= 0x3f; in SiS_GetCRT2Part2Ptr()
6684 (*CRT2Index) = 0; in SiS_GetCRT2Part2Ptr()
6697 return (((*CRT2Index) != 0)); in SiS_GetCRT2Part2Ptr()
6707 0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02, in SiS_Group2LCDSpecial()
6708 0xab,0x87,0xab,0x9e,0xe7,0x02,0x02 in SiS_Group2LCDSpecial()
6718 if(ModeNo == 0x13) { in SiS_Group2LCDSpecial()
6719 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9); in SiS_Group2LCDSpecial()
6720 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC); in SiS_Group2LCDSpecial()
6721 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6); in SiS_Group2LCDSpecial()
6722 } else if((crt2crtc & 0x3F) == 4) { in SiS_Group2LCDSpecial()
6723 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B); in SiS_Group2LCDSpecial()
6724 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13); in SiS_Group2LCDSpecial()
6725 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5); in SiS_Group2LCDSpecial()
6726 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08); in SiS_Group2LCDSpecial()
6727 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2); in SiS_Group2LCDSpecial()
6732 if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) { in SiS_Group2LCDSpecial()
6733 crt2crtc &= 0x1f; in SiS_Group2LCDSpecial()
6734 tempcx = 0; in SiS_Group2LCDSpecial()
6742 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff); in SiS_Group2LCDSpecial()
6748 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28); in SiS_Group2LCDSpecial()
6752 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18); in SiS_Group2LCDSpecial()
6753 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]); in SiS_Group2LCDSpecial()
6772 if(ModeNo <= 0x13) { in SiS_Set300Part2Regs()
6778 resindex = crt2crtc & 0x3F; in SiS_Set300Part2Regs()
6783 if(ModeNo > 0x13) { in SiS_Set300Part2Regs()
6788 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_Set300Part2Regs()
6789 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_Set300Part2Regs()
6790 for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) { in SiS_Set300Part2Regs()
6793 for(j = 0x1c; j <= 0x1d; i++, j++ ) { in SiS_Set300Part2Regs()
6796 for(j = 0x1f; j <= 0x21; i++, j++ ) { in SiS_Set300Part2Regs()
6799 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_Set300Part2Regs()
6800 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_Set300Part2Regs()
6814 0xa7,0x07,0xf2,0x6e,0x17,0x8b,0x73,0x53, in SiS_SetTVSpecial()
6815 0x13,0x40,0x34,0xf4,0x63,0xbb,0xcc,0x7a, in SiS_SetTVSpecial()
6816 0x58,0xe4,0x73,0xda,0x13 in SiS_SetTVSpecial()
6819 for(i = 0x1c, j = 0; i <= 0x30; i++, j++) { in SiS_SetTVSpecial()
6822 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,0x72); in SiS_SetTVSpecial()
6825 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); in SiS_SetTVSpecial()
6826 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b); in SiS_SetTVSpecial()
6828 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14); /* 15 */ in SiS_SetTVSpecial()
6829 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a); /* 1b */ in SiS_SetTVSpecial()
6834 if((ModeNo == 0x38) || (ModeNo == 0x4a) || (ModeNo == 0x64) || in SiS_SetTVSpecial()
6835 (ModeNo == 0x52) || (ModeNo == 0x58) || (ModeNo == 0x5c)) { in SiS_SetTVSpecial()
6836 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); /* 21 */ in SiS_SetTVSpecial()
6837 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); /* 5a */ in SiS_SetTVSpecial()
6839 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a); /* 21 */ in SiS_SetTVSpecial()
6840 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53); /* 5a */ in SiS_SetTVSpecial()
6852 temp = 0xc3; in SiS_SetGroup2_Tail()
6857 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6858 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3); in SiS_SetGroup2_Tail()
6860 temp = 0x4d; in SiS_SetGroup2_Tail()
6865 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp); in SiS_SetGroup2_Tail()
6872 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03); in SiS_SetGroup2_Tail()
6876 if(ModeNo <= 0x13) temp = 3; in SiS_SetGroup2_Tail()
6877 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp); in SiS_SetGroup2_Tail()
6879 #if 0 in SiS_SetGroup2_Tail()
6885 SiS_SetReg(SiS_Part2Port,0x01,0x2b); in SiS_SetGroup2_Tail()
6886 SiS_SetReg(SiS_Part2Port,0x02,0x13); in SiS_SetGroup2_Tail()
6887 SiS_SetReg(SiS_Part2Port,0x04,0xe5); in SiS_SetGroup2_Tail()
6888 SiS_SetReg(SiS_Part2Port,0x05,0x08); in SiS_SetGroup2_Tail()
6889 SiS_SetReg(SiS_Part2Port,0x06,0xe2); in SiS_SetGroup2_Tail()
6890 SiS_SetReg(SiS_Part2Port,0x1c,0x21); in SiS_SetGroup2_Tail()
6891 SiS_SetReg(SiS_Part2Port,0x1d,0x45); in SiS_SetGroup2_Tail()
6892 SiS_SetReg(SiS_Part2Port,0x1f,0x0b); in SiS_SetGroup2_Tail()
6893 SiS_SetReg(SiS_Part2Port,0x20,0x00); in SiS_SetGroup2_Tail()
6894 SiS_SetReg(SiS_Part2Port,0x21,0xa9); in SiS_SetGroup2_Tail()
6895 SiS_SetReg(SiS_Part2Port,0x23,0x0b); in SiS_SetGroup2_Tail()
6896 SiS_SetReg(SiS_Part2Port,0x25,0x04); in SiS_SetGroup2_Tail()
6920 if(ModeNo <= 0x13) { in SiS_SetGroup2()
6925 crt2crtc = 0; in SiS_SetGroup2()
6931 temp = 0; in SiS_SetGroup2()
6932 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO)) temp |= 0x08; in SiS_SetGroup2()
6933 if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x04; in SiS_SetGroup2()
6934 if(SiS_Pr->SiS_VBInfo & SetCRT2ToSCART) temp |= 0x02; in SiS_SetGroup2()
6935 if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) temp |= 0x01; in SiS_SetGroup2()
6937 if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) temp |= 0x10; in SiS_SetGroup2()
6939 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x00,temp); in SiS_SetGroup2()
6941 PhaseIndex = 0x01; /* SiS_PALPhase */ in SiS_SetGroup2()
6963 i = 0; in SiS_SetGroup2()
6967 TimingPoint = &SiS_YPbPrTable[i][0]; in SiS_SetGroup2()
6969 PhaseIndex = 0x00; /* SiS_NTSCPhase */ in SiS_SetGroup2()
6973 if(newtvphase) PhaseIndex = 0x09; /* SiS_PALPhase2 */ in SiS_SetGroup2()
6978 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetNTSCJ) ? 0x01 : 0x00; /* SiS_PALPhase : SiS_NTSCPhase */ in SiS_SetGroup2()
6984 … PhaseIndex = (SiS_Pr->SiS_TVMode & TVSetPALM) ? 0x02 : 0x03; /* SiS_PALMPhase : SiS_PALNPhase */ in SiS_SetGroup2()
6990 PhaseIndex = 0x05; /* SiS_SpecialPhaseM */ in SiS_SetGroup2()
6992 PhaseIndex = 0x11; /* SiS_SpecialPhaseJ */ in SiS_SetGroup2()
6994 PhaseIndex = 0x10; /* SiS_SpecialPhase */ in SiS_SetGroup2()
6998 for(i = 0x31, j = 0; i <= 0x34; i++, j++) { in SiS_SetGroup2()
7002 for(i = 0x01, j = 0; i <= 0x2D; i++, j++) { in SiS_SetGroup2()
7005 for(i = 0x39; i <= 0x45; i++, j++) { in SiS_SetGroup2()
7011 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x3A,0x1F); in SiS_SetGroup2()
7015 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x0A,SiS_Pr->SiS_NewFlickerMode); in SiS_SetGroup2()
7017 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,SiS_Pr->SiS_RY1COE); in SiS_SetGroup2()
7018 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,SiS_Pr->SiS_RY2COE); in SiS_SetGroup2()
7019 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,SiS_Pr->SiS_RY3COE); in SiS_SetGroup2()
7020 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,SiS_Pr->SiS_RY4COE); in SiS_SetGroup2()
7036 tempax &= 0x00ff; in SiS_SetGroup2()
7038 temp = tempax + (unsigned short)TimingPoint[0]; in SiS_SetGroup2()
7039 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7042 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7046 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b); in SiS_SetGroup2()
7047 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54); in SiS_SetGroup2()
7049 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17); in SiS_SetGroup2()
7050 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d); in SiS_SetGroup2()
7060 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx); in SiS_SetGroup2()
7061 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f)); in SiS_SetGroup2()
7067 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7071 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx); in SiS_SetGroup2()
7072 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7079 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0)); in SiS_SetGroup2()
7083 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx); in SiS_SetGroup2()
7084 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0)); in SiS_SetGroup2()
7088 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7094 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0)); in SiS_SetGroup2()
7100 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx); in SiS_SetGroup2()
7112 if((ModeNo <= 0x13) && (crt2crtc == 1)) tempbx++; in SiS_SetGroup2()
7121 if((ModeNo == 0x2f) || (ModeNo == 0x5d) || (ModeNo == 0x5e)) tempbx++; in SiS_SetGroup2()
7124 if(ModeNo == 0x03) tempbx++; /* From 1.10.7w - doesn't make sense */ in SiS_SetGroup2()
7129 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx); in SiS_SetGroup2()
7131 temp = (tempcx >> 8) & 0x0F; in SiS_SetGroup2()
7132 temp |= ((tempbx >> 2) & 0xC0); in SiS_SetGroup2()
7134 temp |= 0x10; in SiS_SetGroup2()
7135 if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20; in SiS_SetGroup2()
7137 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp); in SiS_SetGroup2()
7140 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5)); in SiS_SetGroup2()
7150 temp = ((tempbx >> 3) & 0x60) | 0x18; in SiS_SetGroup2()
7151 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp); in SiS_SetGroup2()
7152 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx); in SiS_SetGroup2()
7155 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4)); in SiS_SetGroup2()
7159 tempbx = 0; in SiS_SetGroup2()
7162 tempax = 0; in SiS_SetGroup2()
7163 tempbx |= 0x20; in SiS_SetGroup2()
7167 tempch = tempcl = 0x01; in SiS_SetGroup2()
7171 tempcl = 0x20; in SiS_SetGroup2()
7174 tempbx &= ~0x20; in SiS_SetGroup2()
7182 if(!(tempbx & 0x20)) { in SiS_SetGroup2()
7188 tempbx |= ((tempax >> 8) & 0x1F); in SiS_SetGroup2()
7192 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax); in SiS_SetGroup2()
7193 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx); in SiS_SetGroup2()
7197 tempcx &= 0x07; in SiS_SetGroup2()
7198 if(tempbx & 0x20) tempcx = 0; in SiS_SetGroup2()
7199 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,tempcx); in SiS_SetGroup2()
7202 tempbx = 0x0382; in SiS_SetGroup2()
7203 tempcx = 0x007e; in SiS_SetGroup2()
7205 tempbx = 0x0369; in SiS_SetGroup2()
7206 tempcx = 0x0061; in SiS_SetGroup2()
7208 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx); in SiS_SetGroup2()
7209 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx); in SiS_SetGroup2()
7210 temp = (tempcx & 0x0300) >> 6; in SiS_SetGroup2()
7211 temp |= ((tempbx >> 8) & 0x03); in SiS_SetGroup2()
7213 temp |= 0x10; in SiS_SetGroup2()
7214 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp |= 0x20; in SiS_SetGroup2()
7215 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp |= 0x40; in SiS_SetGroup2()
7217 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp); in SiS_SetGroup2()
7219 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43); in SiS_SetGroup2()
7220 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3)); in SiS_SetGroup2()
7225 temp = 0; in SiS_SetGroup2()
7227 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xf7,temp); in SiS_SetGroup2()
7234 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_SetGroup2()
7235 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1)); in SiS_SetGroup2()
7237 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF); in SiS_SetGroup2()
7242 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,0x00); in SiS_SetGroup2()
7253 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx); in SiS_SetGroup2()
7254 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7256 temp = 0x01; in SiS_SetGroup2()
7260 temp = 0x02; in SiS_SetGroup2()
7262 temp = 0x01; in SiS_SetGroup2()
7267 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp); in SiS_SetGroup2()
7270 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx); in SiS_SetGroup2()
7271 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07)); in SiS_SetGroup2()
7274 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx); in SiS_SetGroup2()
7275 temp = (tempcx >> 3) & 0xE0; in SiS_SetGroup2()
7278 if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) { in SiS_SetGroup2()
7279 temp |= 0x10; in SiS_SetGroup2()
7282 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp); in SiS_SetGroup2()
7284 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0); in SiS_SetGroup2()
7285 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0); in SiS_SetGroup2()
7287 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB); in SiS_SetGroup2()
7288 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF); in SiS_SetGroup2()
7299 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]); in SiS_SetGroup2()
7300 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x02,0x80,(CRT2Part2Ptr+resindex)->CR[1]); in SiS_SetGroup2()
7301 for(i = 2, j = 0x04; j <= 0x06; i++, j++ ) { in SiS_SetGroup2()
7304 for(j = 0x1c; j <= 0x1d; i++, j++ ) { in SiS_SetGroup2()
7307 for(j = 0x1f; j <= 0x21; i++, j++ ) { in SiS_SetGroup2()
7310 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]); in SiS_SetGroup2()
7311 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]); in SiS_SetGroup2()
7337 /* if(SiS_Pr->SiS_VGAVDE == 525) tempax += 0x3c; */ /* 651+301C */ in SiS_SetGroup2()
7339 tempax = tempcx = 0; in SiS_SetGroup2()
7351 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ in SiS_SetGroup2()
7352 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ in SiS_SetGroup2()
7354 temp = (tempbx >> 5) & 0x38; in SiS_SetGroup2()
7355 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup2()
7356 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp); in SiS_SetGroup2()
7399 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ in SiS_SetGroup2()
7401 temp = (tempbx >> 4) & 0xF0; in SiS_SetGroup2()
7403 temp |= (tempbx & 0x0F); in SiS_SetGroup2()
7406 temp &= 0xf0; in SiS_SetGroup2()
7407 temp |= (SiS_Pr->CVSyncEnd & 0x0f); in SiS_SetGroup2()
7410 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); in SiS_SetGroup2()
7423 temp = 0; in SiS_SetGroup2()
7431 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp); /* lcdhdes */ in SiS_SetGroup2()
7432 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0)); in SiS_SetGroup2()
7450 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ in SiS_SetGroup2()
7451 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f)); in SiS_SetGroup2()
7461 if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47; in SiS_SetGroup2()
7473 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ in SiS_SetGroup2()
7474 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); in SiS_SetGroup2()
7491 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ in SiS_SetGroup2()
7516 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00); in SiS_SetGroup3()
7522 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7523 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7525 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xF5); in SiS_SetGroup3()
7526 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xB7); in SiS_SetGroup3()
7530 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x13,0xFA); in SiS_SetGroup3()
7531 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x14,0xC8); in SiS_SetGroup3()
7532 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x3D,0xA8); in SiS_SetGroup3()
7548 for(i=0; i<=0x3E; i++) { in SiS_SetGroup3()
7553 SiS_SetReg(SiS_Pr->SiS_Part3Port,0x28,0x3f); in SiS_SetGroup3()
7568 #if 0
7574 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f);
7575 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20);
7576 temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
7577 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp);
7578 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0));
7579 temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f;
7581 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f));
7582 temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
7583 temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42);
7584 temp = (unsigned short)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
7585 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp);
7586 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0));
7602 if(!(ROMAddr[0x61] & 0x04)) return; in SiS_SetGroup4_C_ELV()
7605 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08); in SiS_SetGroup4_C_ELV()
7606 temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a); in SiS_SetGroup4_C_ELV()
7607 if(!(temp & 0x01)) { in SiS_SetGroup4_C_ELV()
7608 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3a,0xdf); in SiS_SetGroup4_C_ELV()
7609 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xfc); in SiS_SetGroup4_C_ELV()
7611 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8); in SiS_SetGroup4_C_ELV()
7613 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb); in SiS_SetGroup4_C_ELV()
7614 if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) temp = 0x0000; in SiS_SetGroup4_C_ELV()
7615 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp = 0x0002; in SiS_SetGroup4_C_ELV()
7616 else if(SiS_Pr->SiS_TVMode & TVSetHiVision) temp = 0x0400; in SiS_SetGroup4_C_ELV()
7617 else temp = 0x0402; in SiS_SetGroup4_C_ELV()
7619 temp1 = 0; in SiS_SetGroup4_C_ELV()
7621 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1); in SiS_SetGroup4_C_ELV()
7622 if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7623 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7624 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7625 if(ModeNo > 0x13) { in SiS_SetGroup4_C_ELV()
7626 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x39,0xfd); in SiS_SetGroup4_C_ELV()
7629 temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03; in SiS_SetGroup4_C_ELV()
7630 if(temp1 == 0x01) temp |= 0x01; in SiS_SetGroup4_C_ELV()
7631 if(temp1 == 0x03) temp |= 0x04; /* ? why not 0x10? */ in SiS_SetGroup4_C_ELV()
7632 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff)); in SiS_SetGroup4_C_ELV()
7633 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8)); in SiS_SetGroup4_C_ELV()
7634 if(ModeNo > 0x13) { in SiS_SetGroup4_C_ELV()
7635 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x3b,0xfd); in SiS_SetGroup4_C_ELV()
7639 #if 0 in SiS_SetGroup4_C_ELV()
7677 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x57); in SiS_SetCRT2VCLK()
7678 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,0x46); in SiS_SetCRT2VCLK()
7679 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1f,0xf6); in SiS_SetCRT2VCLK()
7681 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7682 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7685 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,0x01); in SiS_SetCRT2VCLK()
7686 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0b,reg2); in SiS_SetCRT2VCLK()
7687 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x0a,reg1); in SiS_SetCRT2VCLK()
7689 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x12,0x00); in SiS_SetCRT2VCLK()
7690 temp = 0x08; in SiS_SetCRT2VCLK()
7691 if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) temp |= 0x20; in SiS_SetCRT2VCLK()
7692 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp); in SiS_SetCRT2VCLK()
7703 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); in SiS_SetDualLinkEtc()
7705 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20); in SiS_SetDualLinkEtc()
7711 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_SetDualLinkEtc()
7713 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_SetDualLinkEtc()
7715 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_SetDualLinkEtc()
7726 if(ModeNo <= 0x13) { in SiS_SetGroup4()
7731 resinfo = 0; in SiS_SetGroup4()
7740 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7747 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f); in SiS_SetGroup4()
7758 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT); in SiS_SetGroup4()
7761 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx); in SiS_SetGroup4()
7763 temp = (tempbx >> 1) & 0x80; in SiS_SetGroup4()
7766 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx); in SiS_SetGroup4()
7768 temp |= ((tempcx >> 5) & 0x78); in SiS_SetGroup4()
7772 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx); in SiS_SetGroup4()
7774 temp |= ((tempcx >> 8) & 0x07); in SiS_SetGroup4()
7775 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp); in SiS_SetGroup4()
7782 temp = 0; in SiS_SetGroup4()
7783 if(tempbx > 800) temp = 0x60; in SiS_SetGroup4()
7785 temp = 0; in SiS_SetGroup4()
7786 if(tempbx > 1024) temp = 0xC0; in SiS_SetGroup4()
7787 else if(tempbx >= 960) temp = 0xA0; in SiS_SetGroup4()
7789 temp = 0; in SiS_SetGroup4()
7790 if(tempbx >= 1280) temp = 0x40; in SiS_SetGroup4()
7791 else if(tempbx >= 1024) temp = 0x20; in SiS_SetGroup4()
7793 temp = 0x80; in SiS_SetGroup4()
7794 if(tempbx >= 1024) temp = 0xA0; in SiS_SetGroup4()
7801 temp &= 0xf0; in SiS_SetGroup4()
7802 temp |= 0x0A; in SiS_SetGroup4()
7806 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp); in SiS_SetGroup4()
7811 if(!(temp & 0xE0)) tempebx >>=1; in SiS_SetGroup4()
7815 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx); in SiS_SetGroup4()
7817 tempcx |= 0x40; in SiS_SetGroup4()
7820 tempcx ^= 0x40; in SiS_SetGroup4()
7830 temp = (unsigned short)(tempeax & 0x000000FF); in SiS_SetGroup4()
7831 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp); in SiS_SetGroup4()
7832 temp = (unsigned short)((tempeax & 0x0000FF00) >> 8); in SiS_SetGroup4()
7833 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp); in SiS_SetGroup4()
7834 temp = (unsigned short)((tempeax >> 12) & 0x70); /* sic! */ in SiS_SetGroup4()
7835 temp |= (tempcx & 0x4F); in SiS_SetGroup4()
7836 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp); in SiS_SetGroup4()
7840 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28); in SiS_SetGroup4()
7843 tempbx = 0; in SiS_SetGroup4()
7844 if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08; in SiS_SetGroup4()
7852 tempbx = 0x08; in SiS_SetGroup4()
7866 tempax = (tempax & 0xff00) | 0x20; in SiS_SetGroup4()
7872 temp = ((tempax >> 4) & 0x30) | tempbx; in SiS_SetGroup4()
7873 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax); in SiS_SetGroup4()
7874 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp); in SiS_SetGroup4()
7876 temp = 0x0036; tempbx = 0xD0; in SiS_SetGroup4()
7878 temp = 0x0026; tempbx = 0xC0; /* See En/DisableBridge() */ in SiS_SetGroup4()
7882 temp |= 0x01; in SiS_SetGroup4()
7885 temp &= ~0x01; in SiS_SetGroup4()
7890 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp); in SiS_SetGroup4()
7895 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx); in SiS_SetGroup4()
7896 temp = (tempbx >> 5) & 0x38; in SiS_SetGroup4()
7897 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp); in SiS_SetGroup4()
7901 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e); in SiS_SetGroup4()
7925 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20); in SiS_SetGroup5()
7940 unsigned short modeflag = 0; in SiS_GetLVDSCRT1Ptr()
7945 if(ModeNo <= 0x13) { in SiS_GetLVDSCRT1Ptr()
7953 (*ResIndex) &= 0x3F; in SiS_GetLVDSCRT1Ptr()
7970 (*DisplayType = 0); in SiS_GetLVDSCRT1Ptr()
8006 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, in SiS_ModCRT1CRTC()
8007 0x07, 0x10, 0x11, 0x15, 0x16 in SiS_ModCRT1CRTC()
8043 #if 0 /* Works better with calculated numbers */ in SiS_ModCRT1CRTC()
8058 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f); in SiS_ModCRT1CRTC()
8060 for(i = 0; i <= 10; i++) { in SiS_ModCRT1CRTC()
8065 for(i = 0x0A, j = 11; i <= 0x0C; i++, j++) { in SiS_ModCRT1CRTC()
8070 tempah = (LVDSCRT1Ptr + ResIndex)->CR[14] & 0xE0; in SiS_ModCRT1CRTC()
8071 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1f,tempah); in SiS_ModCRT1CRTC()
8073 if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag; in SiS_ModCRT1CRTC()
8076 tempah = ((LVDSCRT1Ptr + ResIndex)->CR[14] & 0x01) << 5; in SiS_ModCRT1CRTC()
8077 if(modeflag & DoubleScanMode) tempah |= 0x80; in SiS_ModCRT1CRTC()
8078 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah); in SiS_ModCRT1CRTC()
8096 unsigned short clkbase, vclkindex = 0; in SiS_SetCRT2ECLK()
8117 if(ROMAddr[0x220] & 0x01) { in SiS_SetCRT2ECLK()
8118 sr2b = ROMAddr[0x227]; in SiS_SetCRT2ECLK()
8119 sr2c = ROMAddr[0x228]; in SiS_SetCRT2ECLK()
8124 clkbase = 0x02B; in SiS_SetCRT2ECLK()
8131 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20); in SiS_SetCRT2ECLK()
8134 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x10); in SiS_SetCRT2ECLK()
8137 SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x00); in SiS_SetCRT2ECLK()
8153 if(ModeNo <= 0x13) in SiS_SetCHTVReg()
8158 resindex &= 0x3F; in SiS_SetCHTVReg()
8160 TVType = 0; in SiS_SetCHTVReg()
8177 case 0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break; in SiS_SetCHTVReg()
8200 SiS_SetCH700x(SiS_Pr,0x04,0x43); /* 0x40=76uA (PAL); 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8201 SiS_SetCH700x(SiS_Pr,0x09,0x69); /* Black level for PAL (105)*/ in SiS_SetCHTVReg()
8203 SiS_SetCH700x(SiS_Pr,0x04,0x03); /* upper nibble=71uA (NTSC), 0x03=15bit non-multi RGB*/ in SiS_SetCHTVReg()
8204 SiS_SetCH700x(SiS_Pr,0x09,0x71); /* Black level for NTSC (113)*/ in SiS_SetCHTVReg()
8207 SiS_SetCH700x(SiS_Pr,0x00,CHTVRegData[resindex].Reg[0]); /* Mode register */ in SiS_SetCHTVReg()
8208 SiS_SetCH700x(SiS_Pr,0x07,CHTVRegData[resindex].Reg[1]); /* Start active video register */ in SiS_SetCHTVReg()
8209 SiS_SetCH700x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[2]); /* Position overflow register */ in SiS_SetCHTVReg()
8210 SiS_SetCH700x(SiS_Pr,0x0a,CHTVRegData[resindex].Reg[3]); /* Horiz Position register */ in SiS_SetCHTVReg()
8211 SiS_SetCH700x(SiS_Pr,0x0b,CHTVRegData[resindex].Reg[4]); /* Vertical Position register */ in SiS_SetCHTVReg()
8213 /* Set minimum flicker filter for Luma channel (SR1-0=00), in SiS_SetCHTVReg()
8216 =00101000=0x28 (When reading, S1-0->S3-2, and S3-2->S1-0!) in SiS_SetCHTVReg()
8218 SiS_SetCH700x(SiS_Pr,0x01,0x28); in SiS_SetCHTVReg()
8223 disable peak filter in S-video channel (S3=0) in SiS_SetCHTVReg()
8225 =00110001=0x31 in SiS_SetCHTVReg()
8227 SiS_SetCH700x(SiS_Pr,0x03,0xb1); /* old: 3103 */ in SiS_SetCHTVReg()
8229 /* Register 0x3D does not exist in non-macrovision register map in SiS_SetCHTVReg()
8233 SiS_SetCH70xx(SiS_Pr,0x3d,0x00); in SiS_SetCHTVReg()
8236 /* Register 0x10 only contains 1 writable bit (S0) for sensing, in SiS_SetCHTVReg()
8239 SiS_SetCH70xxANDOR(SiS_Pr,0x10,0x00,0x1F); in SiS_SetCHTVReg()
8241 /* Register 0x11 only contains 3 writable bits (S0-S2) for in SiS_SetCHTVReg()
8244 SiS_SetCH70xxANDOR(SiS_Pr,0x11,0x02,0xF8); in SiS_SetCHTVReg()
8248 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xEF); in SiS_SetCHTVReg()
8252 if(resindex == 0x04) { /* 640x480 overscan: Mode 16 */ in SiS_SetCHTVReg()
8253 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8254 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); /* ACIV on, no need to set FSCI */ in SiS_SetCHTVReg()
8255 } else if(resindex == 0x05) { /* 800x600 overscan: Mode 23 */ in SiS_SetCHTVReg()
8256 SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* 0x18-0x1f: FSCI 469,762,048 */ in SiS_SetCHTVReg()
8257 SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x0C,0xF0); in SiS_SetCHTVReg()
8258 SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x00,0xF0); in SiS_SetCHTVReg()
8259 SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x00,0xF0); in SiS_SetCHTVReg()
8260 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x00,0xF0); in SiS_SetCHTVReg()
8261 SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x00,0xF0); in SiS_SetCHTVReg()
8262 SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x00,0xF0); in SiS_SetCHTVReg()
8263 SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x00,0xF0); in SiS_SetCHTVReg()
8264 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x01,0xEF); /* Loop filter on for mode 23 */ in SiS_SetCHTVReg()
8265 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); /* ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8268 if(resindex == 0x04) { /* ----- 640x480 underscan; Mode 17 */ in SiS_SetCHTVReg()
8269 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8270 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); in SiS_SetCHTVReg()
8271 } else if(resindex == 0x05) { /* ----- 800x600 underscan: Mode 24 */ in SiS_SetCHTVReg()
8272 #if 0 in SiS_SetCHTVReg()
8273 … SiS_SetCH70xxANDOR(SiS_Pr,0x18,0x01,0xF0); /* (FSCI was 0x1f1c71c7 - this is for mode 22) */ in SiS_SetCHTVReg()
8274 SiS_SetCH70xxANDOR(SiS_Pr,0x19,0x09,0xF0); /* FSCI for mode 24 is 428,554,851 */ in SiS_SetCHTVReg()
8275 SiS_SetCH70xxANDOR(SiS_Pr,0x1a,0x08,0xF0); /* 198b3a63 */ in SiS_SetCHTVReg()
8276 SiS_SetCH70xxANDOR(SiS_Pr,0x1b,0x0b,0xF0); in SiS_SetCHTVReg()
8277 SiS_SetCH70xxANDOR(SiS_Pr,0x1c,0x04,0xF0); in SiS_SetCHTVReg()
8278 SiS_SetCH70xxANDOR(SiS_Pr,0x1d,0x01,0xF0); in SiS_SetCHTVReg()
8279 SiS_SetCH70xxANDOR(SiS_Pr,0x1e,0x06,0xF0); in SiS_SetCHTVReg()
8280 SiS_SetCH70xxANDOR(SiS_Pr,0x1f,0x05,0xF0); in SiS_SetCHTVReg()
8281 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off for mode 24 */ in SiS_SetCHTVReg()
8282 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x00,0xFE); * ACIV off, need to set FSCI */ in SiS_SetCHTVReg()
8284 SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8285 SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE); in SiS_SetCHTVReg()
8290 SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF); /* loop filter off */ in SiS_SetCHTVReg()
8291 SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE); /* ACIV on */ in SiS_SetCHTVReg()
8307 temp = CHTVRegData[resindex].Reg[0]; in SiS_SetCHTVReg()
8308 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp |= 0x10; in SiS_SetCHTVReg()
8309 SiS_SetCH701x(SiS_Pr,0x00,temp); in SiS_SetCHTVReg()
8311 SiS_SetCH701x(SiS_Pr,0x01,CHTVRegData[resindex].Reg[1]); in SiS_SetCHTVReg()
8312 SiS_SetCH701x(SiS_Pr,0x02,CHTVRegData[resindex].Reg[2]); in SiS_SetCHTVReg()
8313 SiS_SetCH701x(SiS_Pr,0x04,CHTVRegData[resindex].Reg[3]); in SiS_SetCHTVReg()
8314 SiS_SetCH701x(SiS_Pr,0x03,CHTVRegData[resindex].Reg[4]); in SiS_SetCHTVReg()
8315 SiS_SetCH701x(SiS_Pr,0x05,CHTVRegData[resindex].Reg[5]); in SiS_SetCHTVReg()
8316 SiS_SetCH701x(SiS_Pr,0x06,CHTVRegData[resindex].Reg[6]); in SiS_SetCHTVReg()
8319 if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) temp = 0x66; in SiS_SetCHTVReg()
8320 SiS_SetCH701x(SiS_Pr,0x07,temp); in SiS_SetCHTVReg()
8322 SiS_SetCH701x(SiS_Pr,0x08,CHTVRegData[resindex].Reg[8]); in SiS_SetCHTVReg()
8323 SiS_SetCH701x(SiS_Pr,0x15,CHTVRegData[resindex].Reg[9]); in SiS_SetCHTVReg()
8324 SiS_SetCH701x(SiS_Pr,0x1f,CHTVRegData[resindex].Reg[10]); in SiS_SetCHTVReg()
8325 SiS_SetCH701x(SiS_Pr,0x0c,CHTVRegData[resindex].Reg[11]); in SiS_SetCHTVReg()
8326 SiS_SetCH701x(SiS_Pr,0x0d,CHTVRegData[resindex].Reg[12]); in SiS_SetCHTVReg()
8327 SiS_SetCH701x(SiS_Pr,0x0e,CHTVRegData[resindex].Reg[13]); in SiS_SetCHTVReg()
8328 SiS_SetCH701x(SiS_Pr,0x0f,CHTVRegData[resindex].Reg[14]); in SiS_SetCHTVReg()
8329 SiS_SetCH701x(SiS_Pr,0x10,CHTVRegData[resindex].Reg[15]); in SiS_SetCHTVReg()
8331 temp = SiS_GetCH701x(SiS_Pr,0x21) & ~0x02; in SiS_SetCHTVReg()
8338 if(SiS_Pr->SiS_TVMode & (TVSetPALN | TVSetNTSCJ)) temp |= 0x02; in SiS_SetCHTVReg()
8339 SiS_SetCH701x(SiS_Pr,0x21,temp); in SiS_SetCHTVReg()
8361 SiS_SetCH701x(SiS_Pr,0x66,0x65); in SiS_Chrontel701xBLOn()
8363 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOn()
8364 temp |= 0x20; in SiS_Chrontel701xBLOn()
8365 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOn()
8377 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_Chrontel701xBLOff()
8378 temp &= 0xDF; in SiS_Chrontel701xBLOff()
8379 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_Chrontel701xBLOff()
8386 static const unsigned char regtable[] = { 0x67, 0x68, 0x69, 0x6a, 0x6b }; in SiS_ChrontelPowerSequencing()
8387 static const unsigned char table1024_740[] = { 0x01, 0x02, 0x01, 0x01, 0x01 }; in SiS_ChrontelPowerSequencing()
8388 static const unsigned char table1400_740[] = { 0x01, 0x6e, 0x01, 0x01, 0x01 }; in SiS_ChrontelPowerSequencing()
8389 static const unsigned char asus1024_740[] = { 0x19, 0x6e, 0x01, 0x19, 0x09 }; in SiS_ChrontelPowerSequencing()
8390 static const unsigned char asus1400_740[] = { 0x19, 0x6e, 0x01, 0x19, 0x09 }; in SiS_ChrontelPowerSequencing()
8391 static const unsigned char table1024_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 }; in SiS_ChrontelPowerSequencing()
8392 static const unsigned char table1400_650[] = { 0x01, 0x02, 0x01, 0x01, 0x02 }; in SiS_ChrontelPowerSequencing()
8418 for(i=0; i<5; i++) { in SiS_ChrontelPowerSequencing()
8430 0x1c, 0x5f, 0x64, 0x6f, 0x70, 0x71, in SiS_SetCH701xForLCD()
8431 0x72, 0x73, 0x74, 0x76, 0x78, 0x7d, 0x66 in SiS_SetCH701xForLCD()
8434 0x60, 0x02, 0x00, 0x07, 0x40, 0xed, in SiS_SetCH701xForLCD()
8435 0xa3, 0xc8, 0xc7, 0xac, 0xe0, 0x02, 0x44 in SiS_SetCH701xForLCD()
8438 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8439 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 in SiS_SetCH701xForLCD()
8442 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8443 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02, 0x44 in SiS_SetCH701xForLCD()
8446 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8447 0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a, 0x44 in SiS_SetCH701xForLCD()
8450 0x60, 0x02, 0x00, 0x07, 0x40, 0xed, in SiS_SetCH701xForLCD()
8451 0xa3, 0xc8, 0xc7, 0xac, 0x60, 0x02 in SiS_SetCH701xForLCD()
8454 0x60, 0x03, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8455 0xad, 0xdb, 0xf6, 0xac, 0xe0, 0x02 in SiS_SetCH701xForLCD()
8458 0x60, 0x03, 0x11, 0x00, 0x40, 0xef, in SiS_SetCH701xForLCD()
8459 0xad, 0xdb, 0xf6, 0xac, 0x60, 0x02 in SiS_SetCH701xForLCD()
8462 0x60, 0x04, 0x11, 0x00, 0x40, 0xe3, in SiS_SetCH701xForLCD()
8463 0xad, 0xde, 0xf6, 0xac, 0x60, 0x1a in SiS_SetCH701xForLCD()
8480 tempbh = SiS_GetCH701x(SiS_Pr,0x74); in SiS_SetCH701xForLCD()
8481 if((tempbh == 0xf6) || (tempbh == 0xc7)) { in SiS_SetCH701xForLCD()
8482 tempbh = SiS_GetCH701x(SiS_Pr,0x73); in SiS_SetCH701xForLCD()
8483 if(tempbh == 0xc8) { in SiS_SetCH701xForLCD()
8485 } else if(tempbh == 0xdb) { in SiS_SetCH701xForLCD()
8488 } else if(tempbh == 0xde) { in SiS_SetCH701xForLCD()
8493 if(SiS_Pr->ChipType == SIS_740) tempbh = 0x0d; in SiS_SetCH701xForLCD()
8494 else tempbh = 0x0c; in SiS_SetCH701xForLCD()
8496 for(i = 0; i < tempbh; i++) { in SiS_SetCH701xForLCD()
8500 tempbh = SiS_GetCH701x(SiS_Pr,0x1e); in SiS_SetCH701xForLCD()
8501 tempbh |= 0xc0; in SiS_SetCH701xForLCD()
8502 SiS_SetCH701x(SiS_Pr,0x1e,tempbh); in SiS_SetCH701xForLCD()
8505 tempbh = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_SetCH701xForLCD()
8506 tempbh &= 0xfb; in SiS_SetCH701xForLCD()
8507 SiS_SetCH701x(SiS_Pr,0x1c,tempbh); in SiS_SetCH701xForLCD()
8508 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_SetCH701xForLCD()
8509 tempbh = SiS_GetCH701x(SiS_Pr,0x64); in SiS_SetCH701xForLCD()
8510 tempbh |= 0x40; in SiS_SetCH701xForLCD()
8511 SiS_SetCH701x(SiS_Pr,0x64,tempbh); in SiS_SetCH701xForLCD()
8512 tempbh = SiS_GetCH701x(SiS_Pr,0x03); in SiS_SetCH701xForLCD()
8513 tempbh &= 0x3f; in SiS_SetCH701xForLCD()
8514 SiS_SetCH701x(SiS_Pr,0x03,tempbh); in SiS_SetCH701xForLCD()
8523 temp1 = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetVSync()
8524 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_ChrontelResetVSync()
8525 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8526 temp &= 0x7f; /* Use external VSYNC */ in SiS_ChrontelResetVSync()
8527 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8529 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelResetVSync()
8530 temp |= 0x80; /* Use internal VSYNC */ in SiS_ChrontelResetVSync()
8531 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_ChrontelResetVSync()
8532 SiS_SetCH701x(SiS_Pr,0x49,temp1); in SiS_ChrontelResetVSync()
8542 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_Chrontel701xOn()
8543 temp |= 0x04; /* Invert XCLK phase */ in SiS_Chrontel701xOn()
8544 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_Chrontel701xOn()
8547 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8548 temp &= 0x3f; in SiS_Chrontel701xOn()
8549 temp |= 0x80; /* Enable YPrPb (HDTV) */ in SiS_Chrontel701xOn()
8550 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8553 temp = SiS_GetCH701x(SiS_Pr,0x01); in SiS_Chrontel701xOn()
8554 temp &= 0x3f; in SiS_Chrontel701xOn()
8555 temp |= 0xc0; /* Enable SCART + CVBS */ in SiS_Chrontel701xOn()
8556 SiS_SetCH701x(SiS_Pr,0x01,temp); in SiS_Chrontel701xOn()
8560 SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ in SiS_Chrontel701xOn()
8562 SiS_SetCH701x(SiS_Pr,0x49,0x20); /* Enable TV path */ in SiS_Chrontel701xOn()
8563 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_Chrontel701xOn()
8565 temp = SiS_GetCH701x(SiS_Pr,0x73); in SiS_Chrontel701xOn()
8566 temp |= 0x60; in SiS_Chrontel701xOn()
8567 SiS_SetCH701x(SiS_Pr,0x73,temp); in SiS_Chrontel701xOn()
8569 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8570 temp &= 0x7f; in SiS_Chrontel701xOn()
8571 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8573 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_Chrontel701xOn()
8574 temp |= 0x80; in SiS_Chrontel701xOn()
8575 SiS_SetCH701x(SiS_Pr,0x47,temp); in SiS_Chrontel701xOn()
8590 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_Chrontel701xOff()
8591 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_Chrontel701xOff()
8594 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_Chrontel701xOff()
8595 temp &= 0xfc; in SiS_Chrontel701xOff()
8596 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_Chrontel701xOff()
8597 SiS_SetCH701x(SiS_Pr,0x66,0x00); in SiS_Chrontel701xOff()
8609 temp = SiS_GetCH701x(SiS_Pr,0x4a); /* Version ID */ in SiS_ChrontelResetDB()
8610 temp &= 0x01; in SiS_ChrontelResetDB()
8614 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelResetDB()
8615 SiS_SetCH701x(SiS_Pr,0x49,0x3e); in SiS_ChrontelResetDB()
8619 SiS_SetCH701x(SiS_Pr,0x48,0x10); in SiS_ChrontelResetDB()
8621 SiS_SetCH701x(SiS_Pr,0x48,0x18); in SiS_ChrontelResetDB()
8625 SiS_SetCH701x(SiS_Pr,0x49,temp); in SiS_ChrontelResetDB()
8631 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8632 temp &= 0xef; in SiS_ChrontelResetDB()
8633 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8634 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8635 temp |= 0x10; in SiS_ChrontelResetDB()
8636 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8637 temp = SiS_GetCH701x(SiS_Pr,0x5c); in SiS_ChrontelResetDB()
8638 temp &= 0xef; in SiS_ChrontelResetDB()
8639 SiS_SetCH701x(SiS_Pr,0x5c,temp); in SiS_ChrontelResetDB()
8640 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelResetDB()
8648 SiS_SetCH701x(SiS_Pr,0x48,0x10); in SiS_ChrontelResetDB()
8650 SiS_SetCH701x(SiS_Pr,0x48,0x18); in SiS_ChrontelResetDB()
8667 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* Power up LVDS block */ in SiS_ChrontelInitTVVSync()
8668 temp = SiS_GetCH701x(SiS_Pr,0x49); in SiS_ChrontelInitTVVSync()
8670 if(temp != 1) { /* TV block powered? (0 = yes, 1 = no) */ in SiS_ChrontelInitTVVSync()
8671 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8672 temp &= 0x70; in SiS_ChrontelInitTVVSync()
8673 SiS_SetCH701x(SiS_Pr,0x47,temp); /* enable VSYNC */ in SiS_ChrontelInitTVVSync()
8675 temp = SiS_GetCH701x(SiS_Pr,0x47); in SiS_ChrontelInitTVVSync()
8676 temp |= 0x80; in SiS_ChrontelInitTVVSync()
8677 SiS_SetCH701x(SiS_Pr,0x47,temp); /* disable VSYNC */ in SiS_ChrontelInitTVVSync()
8690 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8693 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8695 SiS_SetCH701x(SiS_Pr,0x66,0x45); /* Panel power on */ in SiS_ChrontelDoSomething3()
8696 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on */ in SiS_ChrontelDoSomething3()
8702 temp1 = 0; in SiS_ChrontelDoSomething3()
8703 temp = SiS_GetCH701x(SiS_Pr,0x61); in SiS_ChrontelDoSomething3()
8706 SiS_SetCH701x(SiS_Pr,0x61,temp); in SiS_ChrontelDoSomething3()
8709 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_ChrontelDoSomething3()
8710 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8711 temp |= 0x5f; in SiS_ChrontelDoSomething3()
8712 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8713 if(ModeNo > 0x13) { in SiS_ChrontelDoSomething3()
8723 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething3()
8724 temp |= 0x03; in SiS_ChrontelDoSomething3()
8725 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething3()
8726 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething3()
8727 temp &= 0x7f; in SiS_ChrontelDoSomething3()
8728 SiS_SetCH701x(SiS_Pr,0x66,temp); in SiS_ChrontelDoSomething3()
8742 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething2()
8743 temp &= 0x04; /* PLL stable? -> bail out */ in SiS_ChrontelDoSomething2()
8744 if(temp == 0x04) break; in SiS_ChrontelDoSomething2()
8748 SiS_SetCH701x(SiS_Pr,0x76,0xac); in SiS_ChrontelDoSomething2()
8753 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8754 temp &= 0xfb; /* Reset PLL */ in SiS_ChrontelDoSomething2()
8755 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8757 temp = SiS_GetCH701x(SiS_Pr,0x76); in SiS_ChrontelDoSomething2()
8758 temp |= 0x04; /* PLL normal operation */ in SiS_ChrontelDoSomething2()
8759 SiS_SetCH701x(SiS_Pr,0x76,temp); in SiS_ChrontelDoSomething2()
8761 SiS_SetCH701x(SiS_Pr,0x78,0xe0); /* PLL loop filter */ in SiS_ChrontelDoSomething2()
8763 SiS_SetCH701x(SiS_Pr,0x78,0x60); in SiS_ChrontelDoSomething2()
8766 } while(0); in SiS_ChrontelDoSomething2()
8768 SiS_SetCH701x(SiS_Pr,0x77,0x00); /* MV? */ in SiS_ChrontelDoSomething2()
8776 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8777 temp |= 0x80; /* Set datapath 1 to TV */ in SiS_ChrontelDoSomething1()
8778 temp &= 0xbf; /* Set datapath 2 to LVDS */ in SiS_ChrontelDoSomething1()
8779 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8783 temp = SiS_GetCH701x(SiS_Pr,0x1c); in SiS_ChrontelDoSomething1()
8784 temp &= 0xfb; /* Normal XCLK phase */ in SiS_ChrontelDoSomething1()
8785 SiS_SetCH701x(SiS_Pr,0x1c,temp); in SiS_ChrontelDoSomething1()
8787 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,0x03); in SiS_ChrontelDoSomething1()
8789 temp = SiS_GetCH701x(SiS_Pr,0x64); in SiS_ChrontelDoSomething1()
8790 temp |= 0x40; /* ? Bit not defined */ in SiS_ChrontelDoSomething1()
8791 SiS_SetCH701x(SiS_Pr,0x64,temp); in SiS_ChrontelDoSomething1()
8793 temp = SiS_GetCH701x(SiS_Pr,0x03); in SiS_ChrontelDoSomething1()
8794 temp &= 0x3f; /* D1 input to both LVDS and TV */ in SiS_ChrontelDoSomething1()
8795 SiS_SetCH701x(SiS_Pr,0x03,temp); in SiS_ChrontelDoSomething1()
8798 SiS_SetCH701x(SiS_Pr,0x63,0x40); /* LVDS off */ in SiS_ChrontelDoSomething1()
8800 SiS_SetCH701x(SiS_Pr,0x63,0x00); /* LVDS on */ in SiS_ChrontelDoSomething1()
8803 SiS_ChrontelDoSomething3(SiS_Pr, 0); in SiS_ChrontelDoSomething1()
8805 temp = SiS_GetCH701x(SiS_Pr,0x66); in SiS_ChrontelDoSomething1()
8806 if(temp != 0x45) { in SiS_ChrontelDoSomething1()
8809 SiS_ChrontelDoSomething3(SiS_Pr, 0); in SiS_ChrontelDoSomething1()
8817 temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34); in SiS_ChrontelDoSomething1()
8819 SiS_SetCH701x(SiS_Pr,0x76,0xaf); /* All power on, LVDS normal operation */ in SiS_ChrontelDoSomething1()
8843 ModeIdIndex = 0; in SiS_SetCRT2Group()
8858 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,0x80); in SiS_SetCRT2Group()
8872 SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0; in SiS_SetCRT2Group()
8903 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) { in SiS_SetCRT2Group()
8921 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) { in SiS_SetCRT2Group()
8942 if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) { in SiS_SetCRT2Group()
8969 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40); in SiS_SetCRT2Group()
8983 SiS_SetRegSR11ANDOR(SiS_Pr,0xFF,0x0C); in SiS_SetCRT2Group()
8986 SiS_SetCH70xxANDOR(SiS_Pr,0x0e,0x01,0xf8); in SiS_SetCRT2Group()
9006 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOn()
9007 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) { in SiS_SiS30xBLOn()
9008 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02); in SiS_SiS30xBLOn()
9011 if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x01)) { in SiS_SiS30xBLOn()
9012 SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01); in SiS_SiS30xBLOn()
9020 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE); in SiS_SiS30xBLOff()
9021 SiS_DDC2Delay(SiS_Pr,0xff00); in SiS_SiS30xBLOff()
9033 if((SiS_Pr->SiS_DDC_Index == 0x11) && (SiS_Pr->SiS_SensibleSR11)) { in SiS_SetupDDCN()
9034 SiS_Pr->SiS_DDC_NData &= 0x0f; in SiS_SetupDDCN()
9035 SiS_Pr->SiS_DDC_NClk &= 0x0f; in SiS_SetupDDCN()
9047 for(i=0; i<20; i++) { /* Do 20 attempts to write */ in SiS_SetTrumpBlockLoop()
9057 temp = SiS_WriteDDC2Data(SiS_Pr,tempah); /* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9062 for(j=0; j<num; j++) { in SiS_SetTrumpBlockLoop()
9064 temp = SiS_WriteDDC2Data(SiS_Pr,tempah);/* Write DAB (S0=0=write) */ in SiS_SetTrumpBlockLoop()
9077 SiS_Pr->SiS_DDC_DeviceAddr = 0xF0; /* DAB (Device Address Byte) */ in SiS_SetTrumpionBlock()
9078 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetTrumpionBlock()
9079 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetTrumpionBlock()
9080 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetTrumpionBlock()
9096 * On 630(S)T chipset, the index changed from 0x11 to
9097 * 0x0a, possibly for working around the DDC problems
9105 for(i=0; i<20; i++) { /* Do 20 attempts to write */ in SiS_SetChReg()
9111 temp = SiS_WriteDDC2Data(SiS_Pr, SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_SetChReg()
9128 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH700x()
9133 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH700x()
9134 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_SetCH700x()
9135 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_SetCH700x()
9139 if( (!(SiS_SetChReg(SiS_Pr, reg, val, 0x80))) && in SiS_SetCH700x()
9141 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_SetCH700x()
9142 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_SetCH700x()
9143 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_SetCH700x()
9146 SiS_SetChReg(SiS_Pr, reg, val, 0x80); in SiS_SetCH700x()
9155 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_SetCH701x()
9156 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_SetCH701x()
9157 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_SetCH701x()
9159 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB (Device Address Byte) */ in SiS_SetCH701x()
9160 SiS_SetChReg(SiS_Pr, reg, val, 0); in SiS_SetCH701x()
9178 for(i=0; i<20; i++) { /* Do 20 attempts to read */ in SiS_GetChReg()
9184 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr); /* Write DAB (S0=0=write) */ in SiS_GetChReg()
9186 … temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_ReadAddr | myor); /* Write RAB (700x: | 0x80) */ in SiS_GetChReg()
9189 temp = SiS_WriteDDC2Data(SiS_Pr,SiS_Pr->SiS_DDC_DeviceAddr | 0x01);/* DAB (S0=1=read) */ in SiS_GetChReg()
9196 return 0xFFFF; in SiS_GetChReg()
9206 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH700x()
9211 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH700x()
9212 SiS_Pr->SiS_DDC_Data = 0x02; /* Bitmask in IndexReg for Data */ in SiS_GetCH700x()
9213 SiS_Pr->SiS_DDC_Clk = 0x01; /* Bitmask in IndexReg for Clk */ in SiS_GetCH700x()
9219 if( ((result = SiS_GetChReg(SiS_Pr,0x80)) == 0xFFFF) && in SiS_GetCH700x()
9222 SiS_Pr->SiS_DDC_Index = 0x0a; in SiS_GetCH700x()
9223 SiS_Pr->SiS_DDC_Data = 0x80; in SiS_GetCH700x()
9224 SiS_Pr->SiS_DDC_Clk = 0x40; in SiS_GetCH700x()
9227 result = SiS_GetChReg(SiS_Pr,0x80); in SiS_GetCH700x()
9237 SiS_Pr->SiS_DDC_Index = 0x11; /* Bit 0 = SC; Bit 1 = SD */ in SiS_GetCH701x()
9238 SiS_Pr->SiS_DDC_Data = 0x08; /* Bitmask in IndexReg for Data */ in SiS_GetCH701x()
9239 SiS_Pr->SiS_DDC_Clk = 0x04; /* Bitmask in IndexReg for Clk */ in SiS_GetCH701x()
9241 SiS_Pr->SiS_DDC_DeviceAddr = 0xEA; /* DAB */ in SiS_GetCH701x()
9245 return SiS_GetChReg(SiS_Pr,0); in SiS_GetCH701x()
9266 tempbl = (SiS_GetCH70xx(SiS_Pr, (reg & 0xFF)) & myand) | myor; in SiS_SetCH70xxANDOR()
9277 unsigned char ddcdtype[] = { 0xa0, 0xa0, 0xa0, 0xa2, 0xa6 }; in SiS_InitDDCRegs()
9279 unsigned short temp = 0, myadaptnum = adaptnum; in SiS_InitDDCRegs()
9281 if(adaptnum != 0) { in SiS_InitDDCRegs()
9282 if(!(VBFlags2 & VB2_SISTMDSBRIDGE)) return 0xFFFF; in SiS_InitDDCRegs()
9283 if((VBFlags2 & VB2_30xBDH) && (adaptnum == 1)) return 0xFFFF; in SiS_InitDDCRegs()
9286 /* adapternum for SiS bridges: 0 = CRT1, 1 = LCD, 2 = VGA2 */ in SiS_InitDDCRegs()
9288 SiS_Pr->SiS_ChrontelInit = 0; /* force re-detection! */ in SiS_InitDDCRegs()
9290 SiS_Pr->SiS_DDC_SecAddr = 0; in SiS_InitDDCRegs()
9293 SiS_Pr->SiS_DDC_Index = 0x11; in SiS_InitDDCRegs()
9294 flag = 0xff; in SiS_InitDDCRegs()
9296 cr32 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x32); in SiS_InitDDCRegs()
9298 #if 0 in SiS_InitDDCRegs()
9300 if(myadaptnum == 0) { in SiS_InitDDCRegs()
9301 if(!(cr32 & 0x20)) { in SiS_InitDDCRegs()
9303 if(!(cr32 & 0x10)) { in SiS_InitDDCRegs()
9305 if(!(cr32 & 0x08)) { in SiS_InitDDCRegs()
9306 myadaptnum = 0; in SiS_InitDDCRegs()
9316 if(myadaptnum != 0) { in SiS_InitDDCRegs()
9317 flag = 0; in SiS_InitDDCRegs()
9320 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9325 if((cr32 & 0x80) && (checkcr32)) { in SiS_InitDDCRegs()
9327 if(!(cr32 & 0x08)) { in SiS_InitDDCRegs()
9329 if(!(cr32 & 0x10)) return 0xFFFF; in SiS_InitDDCRegs()
9336 if(flag) temp = 0; in SiS_InitDDCRegs()
9340 /* here we simplify: 0 = CRT1, 1 = CRT2 (VGA, LCD) */ in SiS_InitDDCRegs()
9349 flag = 0; in SiS_InitDDCRegs()
9352 SiS_Pr->SiS_DDC_Index = 0x0f; in SiS_InitDDCRegs()
9356 if((cr32 & 0x80) && (checkcr32)) { in SiS_InitDDCRegs()
9358 if(!(cr32 & 0x08)) { in SiS_InitDDCRegs()
9360 if(!(cr32 & 0x10)) return 0xFFFF; in SiS_InitDDCRegs()
9367 temp = 0; in SiS_InitDDCRegs()
9368 if(VBFlags2 & VB2_LVDS) flag = 0xff; in SiS_InitDDCRegs()
9371 if(flag) temp = 0; in SiS_InitDDCRegs()
9374 SiS_Pr->SiS_DDC_Data = 0x02 << temp; in SiS_InitDDCRegs()
9375 SiS_Pr->SiS_DDC_Clk = 0x01 << temp; in SiS_InitDDCRegs()
9379 return 0; in SiS_InitDDCRegs()
9385 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_WriteDABDDC()
9387 return 0xFFFF; in SiS_WriteDABDDC()
9390 return 0xFFFF; in SiS_WriteDABDDC()
9392 return 0; in SiS_WriteDABDDC()
9398 if(SiS_SetStart(SiS_Pr)) return 0xFFFF; in SiS_PrepareReadDDC()
9399 if(SiS_WriteDDC2Data(SiS_Pr, (SiS_Pr->SiS_DDC_DeviceAddr | 0x01))) { in SiS_PrepareReadDDC()
9400 return 0xFFFF; in SiS_PrepareReadDDC()
9402 return 0; in SiS_PrepareReadDDC()
9410 return 0; in SiS_PrepareDDC()
9426 0); in SiS_SendACK()
9435 unsigned short temp, ret=0; in SiS_DoProbeDDC()
9441 return 0xFFFF; in SiS_DoProbeDDC()
9443 mask = 0xf0; in SiS_DoProbeDDC()
9444 value = 0x20; in SiS_DoProbeDDC()
9445 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9447 SiS_SendACK(SiS_Pr, 0); in SiS_DoProbeDDC()
9448 if(temp == 0) { in SiS_DoProbeDDC()
9449 mask = 0xff; in SiS_DoProbeDDC()
9450 value = 0xff; in SiS_DoProbeDDC()
9453 ret = 0xFFFF; in SiS_DoProbeDDC()
9460 if(temp == value) ret = 0; in SiS_DoProbeDDC()
9462 ret = 0xFFFF; in SiS_DoProbeDDC()
9463 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { in SiS_DoProbeDDC()
9464 if(temp == 0x30) ret = 0; in SiS_DoProbeDDC()
9478 flag = 0x180; in SiS_ProbeDDC()
9479 SiS_Pr->SiS_DDC_DeviceAddr = 0xa0; in SiS_ProbeDDC()
9480 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x02; in SiS_ProbeDDC()
9481 SiS_Pr->SiS_DDC_DeviceAddr = 0xa2; in SiS_ProbeDDC()
9482 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x08; in SiS_ProbeDDC()
9483 SiS_Pr->SiS_DDC_DeviceAddr = 0xa6; in SiS_ProbeDDC()
9484 if(!(SiS_DoProbeDDC(SiS_Pr))) flag |= 0x10; in SiS_ProbeDDC()
9485 if(!(flag & 0x1a)) flag = 0; in SiS_ProbeDDC()
9496 if(DDCdatatype > 4) return 0xFFFF; in SiS_ReadDDC()
9498 flag = 0; in SiS_ReadDDC()
9503 chksum = 0; in SiS_ReadDDC()
9504 gotcha = 0; in SiS_ReadDDC()
9505 for(i=0; i<length; i++) { in SiS_ReadDDC()
9509 SiS_SendACK(SiS_Pr, 0); in SiS_ReadDDC()
9515 else flag = 0xFFFF; in SiS_ReadDDC()
9517 flag = 0xFFFF; in SiS_ReadDDC()
9533 adaptnum: 0=CRT1(analog), 1=CRT2/LCD(digital), 2=CRT2/VGA2(analog)
9536 DDCdatatype: 0=Probe, 1=EDID, 2=EDID+VDIF, 3=EDID V2 (P&D), 4=EDID V2 (FPDI-2)
9539 Returns 0xFFFF if error, otherwise
9540 if DDCdatatype > 0: Returns 0 if reading OK (included a correct checksum)
9541 if DDCdatatype = 0: Returns supported DDC modes
9553 return 0xFFFF; in SiS_HandleDDC()
9556 return 0xFFFF; in SiS_HandleDDC()
9558 if((!(VBFlags2 & VB2_VIDEOBRIDGE)) && (adaptnum > 0)) in SiS_HandleDDC()
9559 return 0xFFFF; in SiS_HandleDDC()
9561 if(SiS_InitDDCRegs(SiS_Pr, VBFlags, VGAEngine, adaptnum, DDCdatatype, false, VBFlags2) == 0xFFFF) in SiS_HandleDDC()
9562 return 0xFFFF; in SiS_HandleDDC()
9564 sr1f = SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f); in SiS_HandleDDC()
9565 SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x1f,0x3f,0x04); in SiS_HandleDDC()
9567 cr17 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80; in SiS_HandleDDC()
9569 SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x17,0x80); in SiS_HandleDDC()
9570 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x01); in SiS_HandleDDC()
9571 SiS_SetReg(SiS_Pr->SiS_P3c4,0x00,0x03); in SiS_HandleDDC()
9581 if(DDCdatatype == 0) { in SiS_HandleDDC()
9586 if((buffer[0] == 0x00) && (buffer[1] == 0xff) && in SiS_HandleDDC()
9587 (buffer[2] == 0xff) && (buffer[3] == 0xff) && in SiS_HandleDDC()
9588 (buffer[4] == 0xff) && (buffer[5] == 0xff) && in SiS_HandleDDC()
9589 (buffer[6] == 0xff) && (buffer[7] == 0x00) && in SiS_HandleDDC()
9590 (buffer[0x12] == 1)) { in SiS_HandleDDC()
9593 if(!(buffer[0x14] & 0x80)) result = 0xFFFE; in SiS_HandleDDC()
9595 if(buffer[0x14] & 0x80) result = 0xFFFE; in SiS_HandleDDC()
9601 SiS_SetReg(SiS_Pr->SiS_P3c4,0x1f,sr1f); in SiS_HandleDDC()
9603 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x17,0x7f,cr17); in SiS_HandleDDC()
9624 return ((SiS_GetReg(SiS_Pr->SiS_P3c4,0x11) & 0x02) >> 1); in SiS_ReadDDC1Bit()
9632 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9637 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStart()
9641 0x00); /* SD->low = start condition */ in SiS_SetStart()
9642 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStart()
9643 return 0; in SiS_SetStart()
9651 if(SiS_SetSCLKLow(SiS_Pr)) return 0xFFFF; /* (SC->low) */ in SiS_SetStop()
9655 0x00); /* SD->low */ in SiS_SetStop()
9656 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* SC->high */ in SiS_SetStop()
9661 if(SiS_SetSCLKHigh(SiS_Pr)) return 0xFFFF; /* (SC->high) */ in SiS_SetStop()
9662 return 0; in SiS_SetStop()
9671 flag = 0x80; in SiS_WriteDDC2Data()
9672 for(i = 0; i < 8; i++) { in SiS_WriteDDC2Data()
9683 0x00); /* Write bit (0) to SD */ in SiS_WriteDDC2Data()
9697 getdata = 0; in SiS_ReadDDC2Data()
9698 for(i = 0; i < 8; i++) { in SiS_ReadDDC2Data()
9707 if(temp & SiS_Pr->SiS_DDC_Data) getdata |= 0x01; in SiS_ReadDDC2Data()
9718 0x00); /* SetSCLKLow() */ in SiS_SetSCLKLow()
9720 return 0; in SiS_SetSCLKLow()
9736 return 0xFFFF; in SiS_SetSCLKHigh()
9739 return 0; in SiS_SetSCLKHigh()
9743 /* Returns 0 if ack ok, non-0 if ack not ok */
9757 if(tempah & SiS_Pr->SiS_DDC_Data) return 1; /* Ack OK if bit = 0 */ in SiS_CheckACK()
9758 return 0; in SiS_CheckACK()
9775 romptr = SISGETROMW(0x128); in GetRAMDACromptr()
9777 romptr = SISGETROMW(0x12a); in GetRAMDACromptr()
9779 romptr = SISGETROMW(0x1a8); in GetRAMDACromptr()
9781 romptr = SISGETROMW(0x1aa); in GetRAMDACromptr()
9793 romptr = SISGETROMW(0x120); in GetLCDromptr()
9795 romptr = SISGETROMW(0x122); in GetLCDromptr()
9797 romptr = SISGETROMW(0x1a0); in GetLCDromptr()
9799 romptr = SISGETROMW(0x1a2); in GetLCDromptr()
9811 romptr = SISGETROMW(0x114); in GetTVromptr()
9813 romptr = SISGETROMW(0x11a); in GetTVromptr()
9815 romptr = SISGETROMW(0x194); in GetTVromptr()
9817 romptr = SISGETROMW(0x19a); in GetTVromptr()
9829 if((index = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0)) { in GetLCDPtrIndexBIOS()
9839 index = SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F; in GetLCDPtrIndexBIOS()
9859 index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3; in GetLCDPtrIndex()
9870 index = 0; in GetTVPtrIndex()
9874 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) index = 0; in GetTVPtrIndex()
9889 unsigned short index = 0, temp = 0; in GetOEMTVPtr661_2_GEN()
9907 temp += 0x0100; in GetOEMTVPtr661_2_GEN()
9918 #if 0
9929 int index = 0; in GetOEMTVPtr661()
9953 unsigned short delay=0,index,myindex,temp,romptr=0; in SetDelayComp()
9957 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf); in SetDelayComp()
9959 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f); in SetDelayComp()
9971 delay = 0x04; in SetDelayComp()
9974 delay = 0x0a; in SetDelayComp()
9976 delay = 0x00; in SetDelayComp()
9978 delay = 0x0c; in SetDelayComp()
9981 delay = 0x00; in SetDelayComp()
9993 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f)); in SetDelayComp()
9994 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7)); in SetDelayComp()
9999 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0)); in SetDelayComp()
10000 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6)); in SetDelayComp()
10009 delay = 0x00; in SetDelayComp()
10011 delay = 0x20; in SetDelayComp()
10013 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay); in SetDelayComp()
10015 delay = 0x0c; in SetDelayComp()
10017 delay = 0x03; in SetDelayComp()
10019 delay = 0x00; in SetDelayComp()
10022 if(IS_SIS740) delay = 0x01; in SetDelayComp()
10023 else delay = 0x03; in SetDelayComp()
10025 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay); in SetDelayComp()
10041 delay = 0x03; in SetDelayComp()
10048 delay = 0x02; in SetDelayComp()
10055 delay = 0x33; in SetDelayComp()
10056 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10057 delay &= 0x0f; in SetDelayComp()
10076 /* romptr = SISGETROMW(0x120); */ in SetDelayComp()
10078 romptr = SISGETROMW(0x122); in SetDelayComp()
10107 if(IS_SIS740) delay = 0x03; in SetDelayComp()
10108 else delay = 0x00; in SetDelayComp()
10114 if(IS_SIS740) delay = 0x01; in SetDelayComp()
10118 if(IS_SIS740) delay = 0x01; /* ? */ in SetDelayComp()
10119 else delay = 0x03; in SetDelayComp()
10120 if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) delay = 0x00; /* experience */ in SetDelayComp()
10122 if(IS_SIS740) delay = 0x01; in SetDelayComp()
10131 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,((delay << 4) & 0xf0)); in SetDelayComp()
10146 /* romptr = SISGETROMW(0x114); */ in SetDelayComp()
10148 romptr = SISGETROMW(0x11a); in SetDelayComp()
10165 delay = 0x02; in SetDelayComp()
10170 delay = 0x03; in SetDelayComp()
10200 if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02; in SetDelayComp()
10207 delay &= 0x0f; in SetDelayComp()
10219 temp = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xf0) >> 4; in SetDelayComp()
10221 delay &= 0x0f; in SetDelayComp()
10222 delay |= 0xb0; in SetDelayComp()
10224 delay &= 0x0f; in SetDelayComp()
10225 delay |= 0xc0; in SetDelayComp()
10227 delay = 0x35; in SetDelayComp()
10229 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2D,delay); in SetDelayComp()
10233 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10240 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10242 if(IS_SIS650 && (SiS_Pr->SiS_IF_DEF_CH70xx != 0)) { in SetDelayComp()
10244 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0x0F,delay); in SetDelayComp()
10246 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,0xF0,delay); in SetDelayComp()
10258 unsigned short index,temp,temp1,romptr=0; in SetAntiFlicker()
10262 if(ModeNo<=0x13) in SetAntiFlicker()
10268 temp >>= 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetAntiFlicker()
10275 romptr = SISGETROMW(0x260); in SetAntiFlicker()
10277 romptr = SISGETROMW(0x360); in SetAntiFlicker()
10280 romptr = SISGETROMW(0x192); in SetAntiFlicker()
10282 romptr = SISGETROMW(0x112); in SetAntiFlicker()
10294 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8f,temp); /* index 0A D[6:4] */ in SetAntiFlicker()
10301 unsigned short index,temp,temp1,romptr=0; in SetEdgeEnhance()
10303 temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetEdgeEnhance()
10305 if(ModeNo <= 0x13) in SetEdgeEnhance()
10312 romptr = SISGETROMW(0x26c); in SetEdgeEnhance()
10314 romptr = SISGETROMW(0x36c); in SetEdgeEnhance()
10319 romptr = SISGETROMW(0x1a4); in SetEdgeEnhance()
10321 romptr = SISGETROMW(0x124); in SetEdgeEnhance()
10332 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x3A,0x1F,temp); /* index 0A D[7:5] */ in SetEdgeEnhance()
10340 if(ModeNo <= 0x13) { in SetYFilter()
10346 temp = GetTVPtrIndex(SiS_Pr) >> 1; /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */ in SetYFilter()
10354 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetYFilter()
10357 for(i=0x48; i<=0x4A; i++, j++) { in SetYFilter()
10361 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetYFilter()
10371 unsigned short index,temp,i,j,resinfo,romptr=0; in SetPhaseIncr()
10380 lindex = GetOEMTVPtr661_2_OLD(SiS_Pr) & 0xffff; in SetPhaseIncr()
10382 for(j=0, i=0x31; i<=0x34; i++, j++) { in SetPhaseIncr()
10391 if(ModeNo<=0x13) { in SetPhaseIncr()
10398 /* 0: NTSC Graphics, 1: NTSC Text, 2: PAL Graphics, in SetPhaseIncr()
10402 romptr = SISGETROMW(0x116); in SetPhaseIncr()
10404 romptr = SISGETROMW(0x196); in SetPhaseIncr()
10407 romptr = SISGETROMW(0x11c); in SetPhaseIncr()
10409 romptr = SISGETROMW(0x19c); in SetPhaseIncr()
10412 romptr = SISGETROMW(0x116); in SetPhaseIncr()
10414 romptr = SISGETROMW(0x196); in SetPhaseIncr()
10421 for(j=0, i=0x31; i<=0x34; i++, j++) { in SetPhaseIncr()
10426 temp >>= 1; /* 0:NTSC, 1:PAL, 2:HiTV */ in SetPhaseIncr()
10427 for(j=0, i=0x31; i<=0x34; i++, j++) { in SetPhaseIncr()
10438 if((!(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetYPbPr525p | TVSetYPbPr750p))) && (ModeNo > 0x13)) { in SetPhaseIncr()
10441 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x21); in SetPhaseIncr()
10442 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0xf0); in SetPhaseIncr()
10443 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xf5); in SetPhaseIncr()
10444 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7f); in SetPhaseIncr()
10446 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x31,0x1e); in SetPhaseIncr()
10447 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x32,0x8b); in SetPhaseIncr()
10448 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x33,0xfb); in SetPhaseIncr()
10449 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x34,0x7b); in SetPhaseIncr()
10459 unsigned short delay = 0, romptr = 0, index, lcdpdcindex; in SetDelayComp661()
10475 } else if(ModeNo > 0x13) { in SetDelayComp661()
10481 if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) { in SetDelayComp661()
10484 romptr = SISGETROMW(0x104); in SetDelayComp661()
10487 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10488 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10490 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10491 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10499 if(SiS_Pr->UseCustomMode) delay = 0x04; in SetDelayComp661()
10500 else if(ModeNo <= 0x13) delay = 0x04; in SetDelayComp661()
10506 delay = 0x0606; in SetDelayComp661()
10509 delay = 0x0404; in SetDelayComp661()
10512 if((romptr = SISGETROMW(0x35e))) { in SetDelayComp661()
10513 delay = (ROMAddr[romptr + index] & 0x0f) << 1; in SetDelayComp661()
10519 if(SiS_Pr->ChipType == XGI_40 && SiS_Pr->ChipRevision == 0x02) { in SetDelayComp661()
10520 delay -= 0x0404; in SetDelayComp661()
10527 delay = 0x0606; in SetDelayComp661()
10529 delay = 0x0404; in SetDelayComp661()
10539 romptr = SISGETROMW(0x106); in SetDelayComp661()
10543 delay = 0x04; in SetDelayComp661()
10544 if(index > 3) delay = 0; in SetDelayComp661()
10566 case Panel_1024x768: delay = 0x0008; break; in SetDelayComp661()
10567 case Panel_1280x720: delay = 0x0004; break; in SetDelayComp661()
10569 case Panel_1280x768_2:delay = 0x0004; break; in SetDelayComp661()
10571 case Panel_1280x800_2:delay = 0x0004; break; /* Verified for 1280x800 */ in SetDelayComp661()
10572 case Panel_1280x854: delay = 0x0004; break; /* FIXME */ in SetDelayComp661()
10573 case Panel_1280x1024: delay = 0x1e04; break; in SetDelayComp661()
10574 case Panel_1400x1050: delay = 0x0004; break; in SetDelayComp661()
10575 case Panel_1600x1200: delay = 0x0400; break; in SetDelayComp661()
10576 case Panel_1680x1050: delay = 0x0e04; break; in SetDelayComp661()
10579 delay = 0x0008; in SetDelayComp661()
10581 delay = 0x1e04; in SetDelayComp661()
10583 delay = 0x0004; in SetDelayComp661()
10585 delay = 0x0400; in SetDelayComp661()
10587 delay = 0x0e04; in SetDelayComp661()
10595 delay = SiS_Pr->PDC & 0x1f; in SetDelayComp661()
10598 delay = (SiS_Pr->PDCA & 0x1f) << 8; in SetDelayComp661()
10607 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0)); in SetDelayComp661()
10608 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6)); in SetDelayComp661()
10610 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f)); in SetDelayComp661()
10611 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7)); in SetDelayComp661()
10623 if(ModeNo <= 0x13) { in SetCRT2SyncDither661()
10632 infoflag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); /* No longer check D5 */ in SetCRT2SyncDither661()
10635 infoflag &= 0xc0; in SetCRT2SyncDither661()
10638 temp = (infoflag >> 6) | 0x0c; in SetCRT2SyncDither661()
10640 temp ^= 0x04; in SetCRT2SyncDither661()
10641 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x10; in SetCRT2SyncDither661()
10643 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp); in SetCRT2SyncDither661()
10645 temp = 0x30; in SetCRT2SyncDither661()
10646 if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) temp = 0x20; in SetCRT2SyncDither661()
10648 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp); in SetCRT2SyncDither661()
10649 temp = 0; in SetCRT2SyncDither661()
10651 if(SiS_Pr->SiS_ModeType >= Mode24Bpp) temp |= 0x80; in SetCRT2SyncDither661()
10653 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp); in SetCRT2SyncDither661()
10666 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x24,0x0f); in SetPanelParms661()
10671 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SetPanelParms661()
10679 temp1 = (ROMAddr[romptr] & 0x03) | 0x0c; in SetPanelParms661()
10680 temp2 = 0xfc; in SetPanelParms661()
10682 temp1 &= 0xfc; in SetPanelParms661()
10683 temp2 = 0xf3; in SetPanelParms661()
10685 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1); in SetPanelParms661()
10688 temp1 = (ROMAddr[romptr + 1] & 0x80) >> 1; in SetPanelParms661()
10689 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1); in SetPanelParms661()
10761 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,SiS_Pr->LVDSHL); in SiS_FinalizeLCD()
10776 if(ModeNo <= 0x13) { in SiS_FinalizeLCD()
10785 if(!(SiS_GetReg(SiS_Pr->SiS_P3d4, 0x5f) & 0xf0)) { in SiS_FinalizeLCD()
10787 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x02); in SiS_FinalizeLCD()
10789 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03); in SiS_FinalizeLCD()
10798 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10809 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10812 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10814 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10815 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10816 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10817 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10828 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); in SiS_FinalizeLCD()
10830 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); in SiS_FinalizeLCD()
10832 SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); in SiS_FinalizeLCD()
10837 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01); in SiS_FinalizeLCD()
10840 tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4; in SiS_FinalizeLCD()
10843 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76); in SiS_FinalizeLCD()
10845 if(tempch == 0x03) { in SiS_FinalizeLCD()
10846 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10847 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25); in SiS_FinalizeLCD()
10848 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x00); in SiS_FinalizeLCD()
10849 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x1b); in SiS_FinalizeLCD()
10852 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,SiS_Pr->Backup_14); in SiS_FinalizeLCD()
10853 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,SiS_Pr->Backup_15); in SiS_FinalizeLCD()
10854 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,SiS_Pr->Backup_16); in SiS_FinalizeLCD()
10855 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,SiS_Pr->Backup_17); in SiS_FinalizeLCD()
10856 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,SiS_Pr->Backup_18); in SiS_FinalizeLCD()
10857 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,SiS_Pr->Backup_19); in SiS_FinalizeLCD()
10858 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,SiS_Pr->Backup_1a); in SiS_FinalizeLCD()
10859 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,SiS_Pr->Backup_1b); in SiS_FinalizeLCD()
10860 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,SiS_Pr->Backup_1c); in SiS_FinalizeLCD()
10861 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,SiS_Pr->Backup_1d); in SiS_FinalizeLCD()
10863 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x90); in SiS_FinalizeLCD()
10864 if(ModeNo <= 0x13) { in SiS_FinalizeLCD()
10865 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x11); in SiS_FinalizeLCD()
10866 if((resinfo == 0) || (resinfo == 2)) return; in SiS_FinalizeLCD()
10867 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x18); in SiS_FinalizeLCD()
10870 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); in SiS_FinalizeLCD()
10871 if((ModeNo > 0x13) && (resinfo == SIS_RI_1024x768)) { in SiS_FinalizeLCD()
10872 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02); /* 1.10.7u */ in SiS_FinalizeLCD()
10873 #if 0 in SiS_FinalizeLCD()
10874 tempbx = 806; /* 0x326 */ /* other older BIOSes */ in SiS_FinalizeLCD()
10876 temp = tempbx & 0xff; in SiS_FinalizeLCD()
10877 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); in SiS_FinalizeLCD()
10878 temp = (tempbx >> 8) & 0x03; in SiS_FinalizeLCD()
10879 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1d,0xf8,temp); in SiS_FinalizeLCD()
10882 } else if(ModeNo <= 0x13) { in SiS_FinalizeLCD()
10884 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x70); in SiS_FinalizeLCD()
10885 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xff); in SiS_FinalizeLCD()
10886 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10887 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10890 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,0x20); in SiS_FinalizeLCD()
10891 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,0x1a); in SiS_FinalizeLCD()
10892 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,0x28); in SiS_FinalizeLCD()
10893 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,0x00); in SiS_FinalizeLCD()
10894 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x4c); in SiS_FinalizeLCD()
10895 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10896 if(ModeNo == 0x12) { in SiS_FinalizeLCD()
10898 case 0: in SiS_FinalizeLCD()
10899 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10900 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x19,0xdc); in SiS_FinalizeLCD()
10901 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1a,0x10); in SiS_FinalizeLCD()
10902 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10903 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1c,0x48); in SiS_FinalizeLCD()
10904 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1d,0x12); in SiS_FinalizeLCD()
10907 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x95); in SiS_FinalizeLCD()
10908 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x48); in SiS_FinalizeLCD()
10911 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x95); in SiS_FinalizeLCD()
10919 tempcl = tempbh = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01); in SiS_FinalizeLCD()
10920 tempcl &= 0x0f; in SiS_FinalizeLCD()
10921 tempbh &= 0x70; in SiS_FinalizeLCD()
10923 tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04); in SiS_FinalizeLCD()
10940 temp = tempbx & 0xff; in SiS_FinalizeLCD()
10941 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp); in SiS_FinalizeLCD()
10942 temp = ((tempbx & 0xff00) >> 4) | tempcl; in SiS_FinalizeLCD()
10943 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,temp); in SiS_FinalizeLCD()
10958 unsigned short crt2crtc=0, modeflag, myindex=0; in SetOEMLCDData2()
10962 if(ModeNo <= 0x13) { in SetOEMLCDData2()
10970 crt2crtc &= 0x3f; in SetOEMLCDData2()
10973 SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xdf); in SetOEMLCDData2()
10980 for(i=0; i<7; i++) { in SetOEMLCDData2()
10981 if(barco_p1[myindex][crt2crtc][i][0]) { in SetOEMLCDData2()
10983 barco_p1[myindex][crt2crtc][i][0], in SetOEMLCDData2()
10989 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00); in SetOEMLCDData2()
10990 if(temp & 0x80) { in SetOEMLCDData2()
10991 temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x18); in SetOEMLCDData2()
10993 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp); in SetOEMLCDData2()
11002 unsigned short tempbx=0,romptr=0; in GetOEMLCDPtr()
11004 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, in GetOEMLCDPtr()
11005 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff in GetOEMLCDPtr()
11008 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, in GetOEMLCDPtr()
11009 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff in GetOEMLCDPtr()
11014 tempbx = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f; in GetOEMLCDPtr()
11015 if(SiS_Pr->SiS_VBType & VB_SIS301) tempbx &= 0x07; in GetOEMLCDPtr()
11022 if(ROMAddr[0x235] & 0x80) { in GetOEMLCDPtr()
11025 romptr = SISGETROMW(0x255); in GetOEMLCDPtr()
11028 if(tempbx == 0xFF) return 0xFFFF; in GetOEMLCDPtr()
11039 romptr = SISGETROMW(0x255); in GetOEMLCDPtr()
11041 else tempbx = 0xff; in GetOEMLCDPtr()
11045 if(tempbx == 0xFF) return 0xFFFF; in GetOEMLCDPtr()
11064 unsigned short index,temp,romptr=0; in SetOEMLCDDelay()
11069 if(!(ROMAddr[0x237] & 0x01)) return; in SetOEMLCDDelay()
11070 if(!(ROMAddr[0x237] & 0x02)) return; in SetOEMLCDDelay()
11071 romptr = SISGETROMW(0x24b); in SetOEMLCDDelay()
11076 * a uniform way using eg. ROM byte 0x220, but use different in SetOEMLCDDelay()
11077 * hard coded delays (0x04, 0x20, 0x18) in SetGroup1(). in SetOEMLCDDelay()
11083 temp = GetOEMLCDPtr(SiS_Pr, 0); in SetOEMLCDDelay()
11086 index = 0; in SetOEMLCDDelay()
11104 if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) { in SetOEMLCDDelay()
11115 romptr = ROMAddr[0x249] | (ROMAddr[0x24a] << 8); in SetOEMLCDDelay()
11129 temp &= 0x3c; in SetOEMLCDDelay()
11130 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); /* index 0A D[6:4] */ in SetOEMLCDDelay()
11136 #if 0 /* Unfinished; Data table missing */ in SetOEMLCDData()
11141 if(!(ROMAddr[0x237] & 0x01)) return; in SetOEMLCDData()
11142 if(!(ROMAddr[0x237] & 0x04)) return; in SetOEMLCDData()
11147 if(temp == 0xFFFF) return; in SetOEMLCDData()
11150 for(i=0x14, j=0; i<=0x17; i++, j++) { in SetOEMLCDData()
11153 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1a, 0xf8, (SiS300_LCDHData[temp][index][j] & 0x07)); in SetOEMLCDData()
11156 SiS_SetReg(SiS_SiS_Part1Port,0x18, SiS300_LCDVData[temp][index][0]); in SetOEMLCDData()
11157 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x19, 0xF0, SiS300_LCDVData[temp][index][1]); in SetOEMLCDData()
11158 SiS_SetRegANDOR(SiS_SiS_Part1Port,0x1A, 0xC7, (SiS300_LCDVData[temp][index][2] & 0x38)); in SetOEMLCDData()
11159 for(i=0x1b, j=3; i<=0x1d; i++, j++) { in SetOEMLCDData()
11170 index = 0; in GetOEMTVPtr()
11187 unsigned short index,temp,romptr=0; in SetOEMTVDelay()
11190 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMTVDelay()
11191 if(!(ROMAddr[0x238] & 0x02)) return; in SetOEMTVDelay()
11192 romptr = SISGETROMW(0x241); in SetOEMTVDelay()
11211 temp &= 0x3c; in SetOEMTVDelay()
11212 SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp); in SetOEMTVDelay()
11219 unsigned short index,temp,romptr=0; in SetOEMAntiFlicker()
11222 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMAntiFlicker()
11223 if(!(ROMAddr[0x238] & 0x04)) return; in SetOEMAntiFlicker()
11224 romptr = SISGETROMW(0x243); in SetOEMAntiFlicker()
11239 temp &= 0x70; in SetOEMAntiFlicker()
11240 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp); in SetOEMAntiFlicker()
11247 unsigned short index,i,j,temp,romptr=0; in SetOEMPhaseIncr()
11254 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMPhaseIncr()
11255 if(!(ROMAddr[0x238] & 0x08)) return; in SetOEMPhaseIncr()
11256 romptr = SISGETROMW(0x245); in SetOEMPhaseIncr()
11264 for(i=0x31, j=0; i<=0x34; i++, j++) { in SetOEMPhaseIncr()
11272 for(i=0x31, j=0; i<=0x34; i++, j++) { in SetOEMPhaseIncr()
11276 for(i=0x31, j=0; i<=0x34; i++, j++) { in SetOEMPhaseIncr()
11287 unsigned short index,temp,i,j,romptr=0; in SetOEMYFilter()
11292 if(!(ROMAddr[0x238] & 0x01)) return; in SetOEMYFilter()
11293 if(!(ROMAddr[0x238] & 0x10)) return; in SetOEMYFilter()
11294 romptr = SISGETROMW(0x247); in SetOEMYFilter()
11306 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetOEMYFilter()
11309 for(i=0x48; i<=0x4A; i++, j++) { in SetOEMYFilter()
11317 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetOEMYFilter()
11321 for(i=0x35, j=0; i<=0x38; i++, j++) { in SetOEMYFilter()
11336 for(ModeIdIndex=0; ; ModeIdIndex++) { in SiS_SearchVBModeID()
11338 if(SiS_Pr->SiS_VBModeIDTable[ModeIdIndex].ModeID == 0xFF) return 0; in SiS_SearchVBModeID()
11341 if(*ModeNo != 0x07) { in SiS_SearchVBModeID()
11342 if(*ModeNo > 0x03) return ModeIdIndex; in SiS_SearchVBModeID()
11343 if(VGAINFO & 0x80) return ModeIdIndex; in SiS_SearchVBModeID()
11347 if(VGAINFO & 0x10) ModeIdIndex++; /* 400 lines */ in SiS_SearchVBModeID()
11356 unsigned short OEMModeIdIndex = 0; in SiS_OEM300Setting()