1
2
3/* Register settings for SiS 300 series */
4
5
6typedef struct _SiS300_StStruct
7{
8	UCHAR St_ModeID;
9	USHORT St_ModeFlag;
10	UCHAR St_StTableIndex;
11	UCHAR St_CRT2CRTC;
12	UCHAR St_ResInfo;
13	UCHAR VB_StTVFlickerIndex;
14	UCHAR VB_StTVEdgeIndex;
15	UCHAR VB_StTVYFilterIndex;
16} SiS300_StStruct;
17
18static const SiS300_StStruct  SiS300_SModeIDTable[]=
19{
20	{0x01,0x9208,0x01,0x00,0x00,0x00,0x00,0x00},
21	{0x01,0x1210,0x14,0x01,0x01,0x00,0x00,0x00},
22	{0x01,0x1010,0x17,0x02,0x02,0x00,0x00,0x00},
23	{0x03,0x8208,0x03,0x00,0x00,0x00,0x00,0x00},
24	{0x03,0x0210,0x16,0x01,0x01,0x00,0x00,0x00},
25	{0x03,0x0010,0x18,0x02,0x02,0x00,0x00,0x00},
26	{0x05,0x9209,0x05,0x00,0x00,0x00,0x00,0x00},
27	{0x06,0x8209,0x06,0x00,0x00,0x00,0x00,0x00},
28	{0x07,0x0000,0x07,0x03,0x03,0x00,0x00,0x00},
29	{0x07,0x0000,0x19,0x02,0x02,0x00,0x00,0x00},
30	{0x0d,0x920a,0x0d,0x00,0x00,0x00,0x00,0x00},
31	{0x0e,0x820a,0x0e,0x00,0x00,0x00,0x00,0x00},
32	{0x0f,0x0202,0x11,0x01,0x01,0x00,0x00,0x00},
33	{0x10,0x0212,0x12,0x01,0x01,0x00,0x00,0x00},
34	{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x00},
35	{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x00},
36	{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x00},
37	/* {0x12,0x0210,0x18,0x00,0x00,0x00,0x00,0x00}, */  /* <--- Different in BIOS */
38	{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x00},
39	{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x00},
40	{0xff,0,0,0,0,0,0,0}
41};
42
43typedef struct _SiS300_StandTableStruct
44{
45	UCHAR CRT_COLS;
46	UCHAR ROWS;
47	UCHAR CHAR_HEIGHT;
48	USHORT CRT_LEN;
49	UCHAR SR[4];
50	UCHAR MISC;
51	UCHAR CRTC[0x19];
52	UCHAR ATTR[0x14];
53	UCHAR GRC[9];
54} SiS300_StandTableStruct;
55
56static const SiS300_StandTableStruct  SiS300_StandTable[]=
57{ /* TW: @ 0x38d4 in BIOS */
58 {0x28,0x18,0x08,0x0800,
59  {0x09,0x03,0x00,0x02},
60  0x63,
61  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
62   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
63   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
64   0xff},
65  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
66   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
67   0x08,0x00,0x0f,0x00},
68  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
69   0xff} },
70 {0x28,0x18,0x08,0x0800,
71  {0x09,0x03,0x00,0x02},
72  0x63,
73  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
74   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
75   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
76   0xff},
77  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
78   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
79   0x08,0x00,0x0f,0x00},
80  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
81   0xff} },
82 {0x50,0x18,0x08,0x1000,
83  {0x01,0x03,0x00,0x02},
84  0x63,
85  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
86   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
87   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
88   0xff},
89  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
90   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
91   0x08,0x00,0x0f,0x00},
92  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
93   0xff} },
94 {0x50,0x18,0x08,0x1000,
95  {0x01,0x03,0x00,0x02},
96  0x63,
97  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
98   0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
99   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
100   0xff},
101  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
102   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
103   0x08,0x00,0x0f,0x00},
104  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
105   0xff} },
106 {0x28,0x18,0x08,0x4000,
107  {0x09,0x03,0x00,0x02},
108  0x63,
109  {0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
110   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
111   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
112   0xff},
113  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
114   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
115   0x01,0x00,0x03,0x00},
116  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
117   0xff} },
118 {0x28,0x18,0x08,0x4000,
119  {0x09,0x03,0x00,0x02},
120  0x63,
121  {0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
122   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
123   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
124   0xff},
125  {0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
126   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
127   0x01,0x00,0x03,0x00},
128  {0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
129   0xff} },
130 {0x50,0x18,0x08,0x4000,
131  {0x01,0x01,0x00,0x06},
132  0x63,
133  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
134   0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
135   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xc2,
136   0xff},
137  {0x00,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
138   0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
139   0x01,0x00,0x01,0x00},
140  {0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
141   0xff} },
142 {0x50,0x18,0x0e,0x1000,
143  {0x00,0x03,0x00,0x03},
144  0xa6,
145  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
146   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
147   0x83,0x85,0x5d,0x28,0x0d,0x63,0xba,0xa3,
148   0xff},
149  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
150   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
151   0x0e,0x00,0x0f,0x08},
152  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
153   0xff} },
154/* MDA_DAC*/
155 {0x00,0x00,0x00,0x0000,
156  {0x00,0x00,0x00,0x15},
157  0x15,
158  {0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
159   0x15,0x15,0x15,0x15,0x15,0x15,0x3f,0x3f,
160   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0x00,
161   0x00},
162  {0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x15,
163   0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
164   0x15,0x15,0x15,0x15},
165  {0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
166   0x3f} },
167/* CGA_DAC*/
168 {0x00,0x10,0x04,0x0114,
169  {0x11,0x09,0x15,0x00},
170  0x10,
171  {0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
172   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x2a,0x3a,
173   0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x10,
174   0x04},
175  {0x14,0x01,0x11,0x09,0x15,0x00,0x10,0x04,
176   0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,0x2e,
177   0x3e,0x2b,0x3b,0x2f},
178  {0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
179   0x3f} },
180/* EGA_DAC*/
181 {0x00,0x10,0x04,0x0114,
182  {0x11,0x05,0x15,0x20},
183  0x30,
184  {0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
185   0x0c,0x1c,0x09,0x19,0x0d,0x1d,0x28,0x38,
186   0x2c,0x3c,0x29,0x39,0x2d,0x3d,0x02,0x12,
187   0x06},
188  {0x16,0x03,0x13,0x07,0x17,0x22,0x32,0x26,
189   0x36,0x23,0x33,0x27,0x37,0x0a,0x1a,0x0e,
190   0x1e,0x0b,0x1b,0x0f},
191  {0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
192   0x3f} },
193/* VGA_DAC*/
194 {0x00,0x10,0x04,0x0114,
195  {0x11,0x09,0x15,0x2a},
196  0x3a,
197  {0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
198   0x08,0x0b,0x0e,0x11,0x14,0x18,0x1c,0x20,
199   0x24,0x28,0x2d,0x32,0x38,0x3f,0x00,0x10,
200   0x1f},
201  {0x2f,0x3f,0x1f,0x27,0x2f,0x37,0x3f,0x2d,
202   0x31,0x36,0x3a,0x3f,0x00,0x07,0x0e,0x15,
203   0x1c,0x0e,0x11,0x15},
204  {0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
205   0x04} },
206 {0x08,0x0c,0x10,0x0a08,
207  {0x0c,0x0e,0x10,0x0b},
208  0x0c,
209  {0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
210   0x00,0x00,0x01,0x00,0x02,0x02,0x01,0x00,
211   0x04,0x04,0x01,0x00,0x05,0x02,0x05,0x00,
212   0x06},
213  {0x01,0x06,0x05,0x06,0x00,0x08,0x01,0x08,
214   0x00,0x07,0x02,0x07,0x06,0x07,0x00,0x00,
215   0x00,0x00,0x00,0x00},
216  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
217   0x00} },
218 {0x28,0x18,0x08,0x2000,
219  {0x09,0x0f,0x00,0x06},
220  0x63,
221  {0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
222   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
223   0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xe3,
224   0xff},
225  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
226   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
227   0x01,0x00,0x0f,0x00},
228  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
229   0xff} },
230 {0x50,0x18,0x08,0x4000,
231  {0x01,0x0f,0x00,0x06},
232  0x63,
233  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
234   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
235   0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xe3,
236   0xff},
237  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
238   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
239   0x01,0x00,0x0f,0x00},
240  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
241   0xff} },
242 {0x00,0x00,0x00,0x0000,	/* TW: Standtable for VGA modes */
243  {0x01,0x0f,0x00,0x0e},	/*    (identical to BIOS) */
244  0x23,
245  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
246   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
247   0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
248   0xff},
249  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
250   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
251   0x01,0x00,0x00,0x00},
252  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
253   0xff} },
254 {0x4a,0x36,0x00,0x00c0,
255  {0x00,0x00,0x00,0x00},
256  0x00,
257  {0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x3a,
258   0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
259   0x00,0x00,0x1a,0x00,0x57,0x39,0x00,0xc0,
260   0x00},
261  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
262   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
263   0x00,0x00,0x00,0x00},
264  {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
265   0x00} },
266 {0x50,0x18,0x0e,0x8000,
267  {0x01,0x0f,0x00,0x06},
268  0xa2,
269  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
270   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
271   0x83,0x85,0x5d,0x28,0x0f,0x63,0xba,0xe3,
272   0xff},
273  {0x00,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
274   0x00,0x08,0x00,0x00,0x00,0x18,0x00,0x00,
275   0x0b,0x00,0x05,0x00},
276  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
277   0xff} },
278 {0x50,0x18,0x0e,0x8000,
279  {0x01,0x0f,0x00,0x06},
280  0xa3,
281  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
282   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
283   0x83,0x85,0x5d,0x28,0x0f,0x63,0xba,0xe3,
284   0xff},
285  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
286   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
287   0x01,0x00,0x0f,0x00},
288  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
289   0xff} },
290 {0x28,0x18,0x0e,0x0800,
291  {0x09,0x03,0x00,0x02},
292  0xa3,
293  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
294   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
295   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
296   0xff},
297  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
298   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
299   0x08,0x00,0x0f,0x00},
300  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
301   0xff} },
302 {0x28,0x18,0x0e,0x0800,
303  {0x09,0x03,0x00,0x02},
304  0xa3,
305  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
306   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
307   0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
308   0xff},
309  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
310   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
311   0x08,0x00,0x0f,0x00},
312  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
313   0xff} },
314 {0x50,0x18,0x0e,0x1000,
315  {0x01,0x03,0x00,0x02},
316  0xa3,
317  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
318   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
319   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
320   0xff},
321  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
322   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
323   0x08,0x00,0x0f,0x00},
324  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
325   0xff} },
326 {0x50,0x18,0x0e,0x1000,
327  {0x01,0x03,0x00,0x02},
328  0xa3,
329  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
330   0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
331   0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
332   0xff},
333  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
334   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
335   0x08,0x00,0x0f,0x00},
336  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
337   0xff} },
338 {0x28,0x18,0x10,0x0800,
339  {0x08,0x03,0x00,0x02},
340  0x67,
341  {0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
342   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
343   0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
344   0xff},
345  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
346   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
347   0x0c,0x00,0x0f,0x08},
348  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
349   0xff} },
350 {0x50,0x18,0x10,0x1000,
351  {0x00,0x03,0x00,0x02},
352  0x67,
353  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
354   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
355   0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
356   0xff},
357  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
358   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
359   0x0c,0x00,0x0f,0x08},
360  {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
361   0xff} },
362 {0x50,0x18,0x10,0x1000,
363  {0x00,0x03,0x00,0x02},
364  0x66,
365  {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
366   0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
367   0x9c,0x8e,0x8f,0x28,0x0f,0x96,0xb9,0xa3,
368   0xff},
369  {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
370   0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
371   0x0e,0x00,0x0f,0x08},
372  {0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
373   0xff} },
374 {0x50,0x1d,0x10,0xa000,
375  {0x01,0x0f,0x00,0x06},
376  0xe3,
377  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
378   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
379   0xea,0x8c,0xdf,0x28,0x00,0xe7,0x04,0xc3,
380   0xff},
381  {0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
382   0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
383   0x01,0x00,0x0f,0x00},
384  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
385   0xff} },
386 {0x50,0x1d,0x10,0xa000,
387  {0x01,0x0f,0x00,0x06},
388  0xe3,
389  {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
390   0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
391   0xea,0x8c,0xdf,0x28,0x00,0xe7,0x04,0xe3,
392   0xff},
393  {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
394   0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
395   0x01,0x00,0x0f,0x00},
396  {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
397   0xff} },
398 {0x28,0x18,0x08,0x2000,
399  {0x01,0x0f,0x00,0x0e},
400  0x63,
401  {0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
402   0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
403   0x9c,0x8e,0x8f,0x28,0x40,0x96,0xb9,0xa3,
404   0xff},
405  {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
406   0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
407   0x41,0x00,0x0f,0x00},
408  {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
409   0xff} }
410};
411
412typedef struct _SiS300_ExtStruct
413{
414	UCHAR Ext_ModeID;
415	USHORT Ext_ModeFlag;
416	USHORT Ext_ModeInfo;
417	USHORT Ext_Point;
418	USHORT Ext_VESAID;
419	UCHAR Ext_VESAMEMSize;
420	UCHAR Ext_RESINFO;
421	UCHAR VB_ExtTVFlickerIndex;
422	UCHAR VB_ExtTVEdgeIndex;
423	UCHAR VB_ExtTVYFilterIndex;
424	UCHAR REFindex;
425} SiS300_ExtStruct;
426
427static const SiS300_ExtStruct  SiS300_EModeIDTable[]=
428{
429	{0x6a,0x2212,0x47,0x3563,0x0102,0x08,0x07,0x00,0x00,0x00,0x00},  /* 37ed */  /* 800x600x? */
430	{0x2e,0x0a1b,0x36,0x3539,0x0101,0x08,0x06,0x00,0x00,0x00,0x08},  /* 37c3 */
431	{0x2f,0x021b,0x35,0x3532,0x0100,0x08,0x05,0x00,0x00,0x00,0x10},  /* 37bc */
432	{0x30,0x2a1b,0x47,0x3563,0x0103,0x08,0x07,0x00,0x00,0x00,0x00},  /* 37ed */
433	{0x31,0x0a1b,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11},  /* 38ba */ /* 720x480x8 */
434	{0x32,0x2a1b,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12},  /* 38c1 */ /* 720x576x8 */
435	{0x33,0x0a1d,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11},  /* 38ba */ /* 720x480x16 */
436	{0x34,0x2a1d,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12},  /* 38c1 */ /* 720x576x16 */
437	{0x35,0x0a1f,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11},  /* 38ba */ /* 720x480x32 */
438	{0x36,0x2a1f,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12},  /* 38c1 */ /* 720x576x32 */
439	{0x37,0x0212,0x58,0x358d,0x0104,0x08,0x08,0x00,0x00,0x00,0x13},  /* 3817 */ /* 1024x768x? */
440	{0x38,0x0a1b,0x58,0x358d,0x0105,0x08,0x08,0x00,0x00,0x00,0x13},  /* 3817 */ /* 1024x768x8 */
441	{0x3a,0x0e3b,0x69,0x35be,0x0107,0x08,0x09,0x00,0x00,0x00,0x1a},  /* 3848 */ /* 1280x1024x8 */
442	{0x3c,0x063b,0x7a,0x35d4,0x0130,0x08,0x0a,0x00,0x00,0x00,0x1e},  /* 385e */
443	{0x3d,0x067d,0x7a,0x35d4,0x0131,0x08,0x0a,0x00,0x00,0x00,0x1e},  /* 385e */
444	{0x40,0x921c,0x00,0x3516,0x010d,0x08,0x00,0x00,0x00,0x00,0x23},  /* 37a0 */
445	{0x41,0x921d,0x00,0x3516,0x010e,0x08,0x00,0x00,0x00,0x00,0x23},  /* 37a0 */
446	{0x43,0x0a1c,0x36,0x3539,0x0110,0x08,0x06,0x00,0x00,0x00,0x08},  /* 37c3 */
447	{0x44,0x0a1d,0x36,0x3539,0x0111,0x08,0x06,0x00,0x00,0x00,0x08},  /* 37c3 */
448	{0x46,0x2a1c,0x47,0x3563,0x0113,0x08,0x07,0x00,0x00,0x00,0x00},  /* 37ed */ /* 800x600 */
449	{0x47,0x2a1d,0x47,0x3563,0x0114,0x08,0x07,0x00,0x00,0x00,0x00},  /* 37ed */ /* 800x600 */
450	{0x49,0x0a3c,0x58,0x358d,0x0116,0x08,0x08,0x00,0x00,0x00,0x13},  /* 3817 */
451	{0x4a,0x0a3d,0x58,0x358d,0x0117,0x08,0x08,0x00,0x00,0x00,0x13},  /* 3817 */
452	{0x4c,0x0e7c,0x69,0x35be,0x0119,0x08,0x09,0x00,0x00,0x00,0x1a},  /* 3848 */
453	{0x4d,0x0e7d,0x69,0x35be,0x011a,0x08,0x09,0x00,0x00,0x00,0x1a},  /* 3848 */
454	{0x50,0x921b,0x01,0x351d,0x0132,0x08,0x01,0x00,0x00,0x00,0x24},  /* 37a7 */
455	{0x51,0xb21b,0x13,0x3524,0x0133,0x08,0x03,0x00,0x00,0x00,0x25},  /* 37ae */ /* 400x300 */
456	{0x52,0x921b,0x24,0x352b,0x0134,0x08,0x04,0x00,0x00,0x00,0x26},  /* 37b5 */
457	{0x56,0x921d,0x01,0x351d,0x0135,0x08,0x01,0x00,0x00,0x00,0x24},  /* 37a7 */
458	{0x57,0xb21d,0x13,0x3524,0x0136,0x08,0x03,0x00,0x00,0x00,0x25},  /* 37ae */ /* 400x300 */
459	{0x58,0x921d,0x24,0x352b,0x0137,0x08,0x04,0x00,0x00,0x00,0x26},  /* 37b5 */
460	{0x59,0x921b,0x00,0x3516,0x0138,0x08,0x00,0x00,0x00,0x00,0x23},  /* 37a0 */
461	{0x5c,0x921f,0x24,0x352b,0x0000,0x08,0x04,0x00,0x00,0x00,0x26},  /* TW: inserted 512x384x32 */
462	{0x5d,0x021d,0x35,0x3532,0x0139,0x08,0x05,0x00,0x00,0x00,0x10},  /* 37bc */
463	{0x62,0x0a3f,0x36,0x3539,0x013a,0x08,0x06,0x00,0x00,0x00,0x08},  /* 37c3 */
464	{0x63,0x2a3f,0x47,0x3563,0x013b,0x08,0x07,0x00,0x00,0x00,0x00},  /* 37ed */  /* 800x600 */
465	{0x64,0x0a7f,0x58,0x358d,0x013c,0x08,0x08,0x00,0x00,0x00,0x13},  /* 3817 */
466	{0x65,0x0eff,0x69,0x35be,0x013d,0x08,0x09,0x00,0x00,0x00,0x1a},  /* 3848 */
467	{0x66,0x06ff,0x7a,0x35d4,0x013e,0x08,0x0a,0x00,0x00,0x00,0x1e},  /* 385e */
468	{0x68,0x067b,0x8b,0x35ef,0x013f,0x08,0x0b,0x00,0x00,0x00,0x27},  /* 3879 */
469	{0x69,0x06fd,0x8b,0x35ef,0x0140,0x08,0x0b,0x00,0x00,0x00,0x27},  /* 3879 */
470	{0x6b,0x07ff,0x8b,0x35ef,0x0000,0x10,0x0b,0x00,0x00,0x00,0x27},  /* 3879 */
471	{0x6c,0x067b,0x9c,0x35f6,0x0000,0x08,0x0c,0x00,0x00,0x00,0x28},  /* 3880 */
472	{0x6d,0x06fd,0x9c,0x35f6,0x0000,0x10,0x0c,0x00,0x00,0x00,0x28},  /* 3880 */
473	{0x6e,0x0e3b,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29},  /* 383c */  /* 1280x960x8 */
474	{0x6f,0x0e7d,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29},  /* 383c */  /* 1280x960x16 */
475	{0x7b,0x0eff,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29},  /* 383c */  /* 1280x960x32 */
476	{0x20,0x0a1b,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},              /* 1024x600 */
477	{0x21,0x0a3d,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},
478	{0x22,0x0a7f,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},
479	{0x23,0x0a1b,0xc5,0x0000,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},              /* 1152x768 */
480	{0x24,0x0a3d,0xc5,0x431d,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},
481	{0x25,0x0a7f,0xc5,0x431d,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},
482	{0xff,0x0000,0x00,0x0000,0xffff,0x00,0x00,0x00,0x00,0x00,0x00}
483};
484
485typedef struct _SiS300_Ext2Struct
486{
487	USHORT Ext_InfoFlag;
488	UCHAR Ext_CRT1CRTC;  /* TW: Index in SiS300_CRT1Table */
489	UCHAR Ext_CRTVCLK;
490	UCHAR Ext_CRT2CRTC;  /* TW: Index in LCD Paneltype arrays (&3f) */
491	UCHAR  ModeID;
492	USHORT XRes;
493	USHORT YRes;
494	USHORT ROM_OFFSET;
495} SiS300_Ext2Struct;
496
497static const SiS300_Ext2Struct  SiS300_RefIndex[]=
498{ /* TW: Don't ever insert anything here, table is indexed */
499	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600,0x3563}, /* 00 */
500	{0x0467,0x0e,0x44,0x05,0x6a, 800, 600,0x3568}, /* 01 */
501	{0x0067,0x4f,0x07,0x48,0x6a, 800, 600,0x356d}, /* 02 */
502	{0x0067,0x10,0x06,0x8b,0x6a, 800, 600,0x3572}, /* 03 */
503	{0x0147,0x11,0x08,0x00,0x6a, 800, 600,0x3577}, /* 04 */
504	{0x0147,0x12,0x0c,0x00,0x6a, 800, 600,0x357c}, /* 05 */
505	{0x0047,0x51,0x4e,0x00,0x6a, 800, 600,0x3581}, /* 06 */
506	{0x0047,0x11,0x13,0x00,0x6a, 800, 600,0x3586}, /* 07 */
507	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480,0x3539}, /* 08 */
508	{0xc067,0x06,0x02,0x04,0x2e, 640, 480,0x353e}, /* 09 */
509	{0xc067,0x07,0x02,0x47,0x2e, 640, 480,0x3543}, /* 0a */
510	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480,0x3548}, /* 0b */
511	{0xc047,0x09,0x05,0x00,0x2e, 640, 480,0x354d}, /* 0c */
512	{0xc047,0x0a,0x08,0x00,0x2e, 640, 480,0x3552}, /* 0d */
513	{0xc047,0x0b,0x0a,0x00,0x2e, 640, 480,0x3557}, /* 0e */
514	{0xc047,0x0c,0x10,0x00,0x2e, 640, 480,0x355c}, /* 0f */
515	{0x487f,0x04,0x00,0x00,0x2f, 640, 400,0x3532}, /* 10 */
516	{0xc00f,0x31,0x01,0x06,0x31, 720, 480,0x3630}, /* 11 */
517	{0x000f,0x32,0x03,0x06,0x32, 720, 576,0x3637}, /* 12 */
518	{0x0187,0x15,0x05,0x00,0x37,1024, 768,0x358d}, /* 13 */
519        {0xc877,0x16,0x09,0x06,0x37,1024, 768,0x3592}, /* 14 */
520	{0xc067,0x97,0x0b,0x49,0x37,1024, 768,0x3597}, /* 15 */
521	{0x0267,0x18,0x0d,0x00,0x37,1024, 768,0x359c}, /* 16 */
522	{0x0047,0x59,0x11,0x8c,0x37,1024, 768,0x35a1}, /* 17 */
523	{0x0047,0x1a,0x52,0x00,0x37,1024, 768,0x35a6}, /* 18 */
524	{0x0047,0x5b,0x16,0x00,0x37,1024, 768,0x35ab}, /* 19 */
525	{0x0387,0x5c,0x4d,0x00,0x3a,1280,1024,0x35be}, /* 1a */
526	{0x0077,0x1d,0x14,0x07,0x3a,1280,1024,0x35c3}, /* 1b */
527	{0x0047,0x1e,0x17,0x00,0x3a,1280,1024,0x35c8}, /* 1c */
528	{0x0007,0x1f,0x98,0x00,0x3a,1280,1024,0x35cd}, /* 1d */
529	{0x0007,0x60,0x59,0x00,0x3c,1600,1200,0x35d4}, /* 1e */
530	{0x0007,0x21,0x5a,0x00,0x3c,1600,1200,0x35d9}, /* 1f */
531	{0x0007,0x22,0x1b,0x00,0x3c,1600,1200,0x35de}, /* 20 */
532	{0x0007,0x63,0x1d,0x00,0x3c,1600,1200,0x35e3}, /* 21 */
533	{0x0007,0x24,0x1e,0x00,0x3c,1600,1200,0x35e8}, /* 22 */
534	{0x407f,0x00,0x00,0x00,0x40, 320, 200,0x3516}, /* 23 */
535	{0xc07f,0x01,0x00,0x04,0x50, 320, 240,0x351d}, /* 24 */
536	{0x0077,0x02,0x04,0x05,0x51, 400, 300,0x3524}, /* 25 */
537	{0xc877,0x03,0x09,0x06,0x52, 512, 384,0x352b}, /* 26 */  /* was c077 */
538	{0x8207,0x25,0x1f,0x00,0x68,1920,1440,0x35ef}, /* 27 */
539	{0x0007,0x26,0x20,0x00,0x6c, 720, 480,0x35f6}, /* 28 */
540	{0x0027,0x27,0x14,0x08,0x6e,1280, 960,0x35b2}, /* 29 */
541	{0x0027,0x27,0x14,0x08,0x6e,1280, 960,0x35b7}, /* 2a */
542	{0xc077,0x33,0x09,0x06,0x20,1024, 600,0x0000}, /* 2b */
543	{0xc077,0x34,0x09,0x06,0x23,1152, 768,0x0000}, /* 2c */
544	{0xffff,0,0,0,0,0,0,0}
545};
546
547/*add for 300 oem util*/
548typedef struct _SiS_VBModeIDTableStruct
549{
550	UCHAR  ModeID;
551	UCHAR  VB_TVDelayIndex;
552	UCHAR  VB_TVFlickerIndex;
553	UCHAR  VB_TVPhaseIndex;
554	UCHAR  VB_TVYFilterIndex;
555	UCHAR  VB_LCDDelayIndex;
556	UCHAR  _VB_LCDHIndex;
557	UCHAR  _VB_LCDVIndex;
558}SiS_VBModeIDTableStruct;
559
560static const SiS_VBModeIDTableStruct  SiS300_VBModeIDTable[]=
561{
562	{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* TW: Identical to 630/301B 2.04.50 BIOS */
563	{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01},
564	{0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x02},
565	{0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00},
566	{0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x01},
567	{0x03,0x00,0x00,0x00,0x03,0x00,0x03,0x02},
568	{0x05,0x00,0x00,0x01,0x04,0x00,0x00,0x00},
569	{0x06,0x00,0x00,0x01,0x05,0x00,0x02,0x00},
570	{0x07,0x00,0x00,0x00,0x03,0x00,0x03,0x01},
571	{0x07,0x00,0x00,0x00,0x03,0x00,0x03,0x02},
572	{0x0d,0x00,0x00,0x01,0x04,0x00,0x00,0x00},
573	{0x0e,0x00,0x00,0x01,0x05,0x00,0x02,0x00},
574	{0x0f,0x00,0x00,0x01,0x05,0x00,0x02,0x01},
575	{0x10,0x00,0x00,0x01,0x05,0x00,0x02,0x01},
576	{0x11,0x00,0x00,0x01,0x05,0x00,0x02,0x03},
577	{0x12,0x00,0x00,0x01,0x05,0x00,0x02,0x03},
578	{0x13,0x00,0x00,0x01,0x04,0x00,0x04,0x00},
579	{0x6a,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
580	{0x2e,0x00,0x00,0x01,0x05,0x00,0x06,0x08},
581	{0x2f,0x00,0x00,0x01,0x05,0x00,0x06,0x06},
582	{0x30,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
583	{0x31,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
584	{0x32,0x00,0x00,0x01,0x06,0x00,0x00,0x00},
585	{0x37,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
586	{0x38,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
587	{0x3a,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
588	{0x40,0x00,0x00,0x01,0x04,0x00,0x05,0x05},
589	{0x41,0x00,0x00,0x01,0x04,0x00,0x05,0x05},
590	{0x43,0x00,0x00,0x01,0x05,0x00,0x06,0x08},
591	{0x44,0x00,0x00,0x01,0x05,0x00,0x06,0x08},
592	{0x46,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
593	{0x47,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
594	{0x49,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
595	{0x4a,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
596	{0x4c,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
597	{0x4d,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
598	{0x50,0x00,0x00,0x01,0x04,0x00,0x05,0x07},
599	{0x51,0x00,0x00,0x01,0x07,0x00,0x07,0x09},
600	{0x52,0x00,0x00,0x01,0x00,0x00,0x09,0x0b},
601	{0x56,0x00,0x00,0x01,0x04,0x00,0x05,0x07},
602	{0x57,0x00,0x00,0x01,0x07,0x00,0x07,0x09},
603	{0x58,0x00,0x00,0x01,0x00,0x00,0x09,0x0b},
604	{0x59,0x00,0x00,0x01,0x04,0x00,0x05,0x05},
605	{0x5d,0x00,0x00,0x01,0x07,0x00,0x06,0x06},
606	{0x62,0x00,0x00,0x01,0x05,0x00,0x06,0x08},
607	{0x63,0x00,0x00,0x01,0x07,0x00,0x08,0x0a},
608	{0x64,0x00,0x00,0x01,0x00,0x00,0x0a,0x0c},
609	{0x65,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
610	{0x6e,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
611	{0x6f,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
612	{0x7b,0x00,0x00,0x01,0x00,0x00,0x0b,0x0d},
613	{0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}  /* TW: added! */
614};
615/*end*/
616
617typedef struct _SiS300_CRT1TableStruct
618{
619	UCHAR CR[17];
620} SiS300_CRT1TableStruct;
621
622static const SiS300_CRT1TableStruct  SiS300_CRT1Table[]=
623{
624 {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,    /* 0x00 */
625  0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,
626  0x00}},
627 {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e,
628  0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
629  0x00}},
630 {{0x3d,0x31,0x31,0x81,0x37,0x1f,0x72,0xf0,
631  0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x05,
632  0x01}},
633 {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
634  0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
635  0x01}},
636 {{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
637  0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x05,
638  0x00}},
639 {{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
640  0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
641  0x00}},
642 {{0x63,0x4f,0x50,0x86,0x56,0x9b,0x06,0x3e,
643  0xe8,0x8b,0xdf,0xe7,0xff,0x10,0x00,0x01,
644  0x00}},
645 {{0x64,0x4f,0x4f,0x88,0x55,0x9d,0xf2,0x1f,
646  0xe0,0x83,0xdf,0xdf,0xf3,0x10,0x00,0x01,
647  0x00}},
648 {{0x63,0x4f,0x4f,0x87,0x5a,0x81,0xfb,0x1f,
649  0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,
650  0x00}},
651 {{0x66,0x4f,0x4f,0x86,0x56,0x9e,0x03,0x3e,
652  0xe4,0x87,0xdf,0xdf,0x04,0x00,0x00,0x01,
653  0x00}},
654 {{0x6c,0x4f,0x4f,0x83,0x59,0x9e,0x00,0x3e,    /* 0x0a */
655  0xe5,0x8d,0xdf,0xdf,0x01,0x00,0x00,0x01,
656  0x00}},
657 {{0x63,0x4f,0x4f,0x87,0x56,0x9d,0xfb,0x1f,
658  0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x01,
659  0x00}},
660 {{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f,
661  0xe6,0x8a,0xe5,0xe5,0xfc,0x00,0x00,0x01,
662  0x00}},
663 {{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0,
664  0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05,
665  0x01}},
666 {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xf0,
667  0x58,0x8c,0x57,0x57,0x73,0x20,0x00,0x06,
668  0x01}},
669 {{0x7d,0x63,0x63,0x81,0x6e,0x1d,0x98,0xf0,
670  0x7c,0x82,0x57,0x57,0x99,0x00,0x00,0x06,
671  0x01}},
672 {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xf0,
673  0x58,0x8b,0x57,0x57,0x70,0x20,0x00,0x06,
674  0x01}},
675 {{0x7e,0x63,0x63,0x82,0x6b,0x13,0x75,0xf0,
676  0x58,0x8b,0x57,0x57,0x76,0x20,0x00,0x06,
677  0x01}},
678 {{0x8c,0x63,0x63,0x87,0x72,0x16,0x7e,0xf0,
679  0x59,0x8d,0x57,0x57,0x7f,0x00,0x00,0x06,
680  0x01}},
681 {{0x7e,0x63,0x63,0x82,0x6c,0x14,0x75,0xe0,
682  0x58,0x0b,0x57,0x57,0x76,0x20,0x00,0x06,
683  0x01}},
684 {{0x7e,0x63,0x63,0x82,0x6c,0x14,0x75,0xe0,   /* 0x14 */
685  0x58,0x0b,0x57,0x57,0x76,0x20,0x00,0x06,
686  0x01}},
687 {{0x99,0x7f,0x7f,0x9d,0x84,0x1a,0x96,0x1f,
688  0x7f,0x83,0x7f,0x7f,0x97,0x10,0x00,0x02,
689  0x00}},
690 {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
691  0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
692  0x01}},
693 {{0xa1,0x7f,0x7f,0x85,0x86,0x97,0x24,0xf5,
694  0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
695  0x01}},
696 {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf5,
697  0x00,0x83,0xff,0xff,0x1f,0x10,0x00,0x02,
698  0x01}},
699 {{0xa7,0x7f,0x7f,0x8b,0x89,0x95,0x26,0xf5,
700  0x00,0x83,0xff,0xff,0x27,0x10,0x00,0x02,
701  0x01}},
702 {{0x9f,0x7f,0x7f,0x83,0x83,0x93,0x1e,0xf5,
703  0x00,0x84,0xff,0xff,0x1f,0x10,0x00,0x02,
704  0x01}},
705 {{0xa2,0x7f,0x7f,0x86,0x84,0x94,0x37,0xf5,
706  0x0b,0x82,0xff,0xff,0x38,0x10,0x00,0x02,
707  0x01}},
708 {{0xcf,0x9f,0x9f,0x93,0xb2,0x01,0x14,0xba,
709  0x00,0x83,0xff,0xff,0x15,0x00,0x00,0x03,
710  0x00}},
711 {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0x5a,
712  0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07,
713  0x01}},
714 {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0x5a,  /* 0x1e */
715  0x00,0x83,0xff,0xff,0x29,0x09,0x00,0x07,
716  0x01}},
717 {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0x5a,
718  0x00,0x83,0xff,0xff,0x2f,0x09,0x00,0x07,
719  0x01}},
720 {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
721  0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
722  0x00}},
723 {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
724  0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
725  0x00}},
726 {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
727  0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
728  0x00}},
729 {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,
730  0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
731  0x00}},
732 {{0x09,0xc7,0xc7,0x8d,0xd3,0x0b,0xe0,0x10,  /* 36: 1600x1200x85Hz */
733  0xb0,0x83,0xaf,0xaf,0xe1,0x2f,0x01,0x04,
734  0x00}},
735 {{0x3f,0xef,0xef,0x83,0xfd,0x1a,0xda,0x1f,  /* 37: 1920x1440x60Hz */
736  0xa0,0x84,0x9f,0x9f,0xdb,0x1f,0x01,0x01,
737  0x00}},
738 {{0x55,0xff,0xff,0x99,0x0d,0x0c,0x3e,0xba,
739  0x00,0x84,0xff,0xff,0x3f,0x0f,0x41,0x05,
740  0x00}},
741 {{0xdc,0x9f,0x9f,0x00,0xab,0x19,0xe6,0xef,
742  0xc0,0xc3,0xbf,0xbf,0xe7,0x10,0x00,0x07,
743  0x01}},
744 {{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba,  /* 0x28 */
745  0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06,
746  0x01}},
747 {{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba,
748  0x26,0x89,0xdf,0xdf,0x6f,0x00,0x00,0x06,
749  0x01}},
750 {{0x7f,0x63,0x63,0x82,0x6b,0x13,0x75,0xba,
751  0x29,0x8c,0xdf,0xdf,0x75,0x00,0x00,0x06,
752  0x01}},
753 {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf1,
754  0xaf,0x85,0x3f,0x3f,0x25,0x30,0x00,0x02,
755  0x01}},
756 {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1,
757  0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02,
758  0x01}},
759 {{0xa7,0x7f,0x7f,0x88,0x89,0x15,0x26,0xf1,
760  0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02,
761  0x01}},
762 {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4,
763  0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07,
764  0x01}},
765 {{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xd4,
766  0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07,
767  0x01}},
768 {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4,
769  0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07,
770  0x01}},
771 {{0x6b,0x59,0x59,0x8f,0x5e,0x8c,0x0b,0x3e,
772  0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
773  0x00}},
774 {{0x7b,0x59,0x63,0x9f,0x6a,0x93,0x6f,0xf0,  /* 0x32 */
775  0x58,0x8a,0x3f,0x57,0x70,0x20,0x00,0x05,
776  0x01}},
777 {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1,  /* 0x33 - 1024x600 */
778  0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02,
779  0x01}},
780 {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,  /* 0x34 - 1152x768 */
781  0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
782  0x01}}
783};
784
785typedef struct _SiS300_MCLKDataStruct
786{
787	UCHAR SR28,SR29,SR2A;
788	USHORT CLOCK;
789} SiS300_MCLKDataStruct;
790
791static const SiS300_MCLKDataStruct  SiS300_MCLKData_630[] =	/* 630 */
792{ /* TW: at 0x54 in BIOS */
793	{ 0x5a,0x64,0x80, 66},
794	{ 0xb3,0x45,0x80, 83},
795	{ 0x37,0x61,0x80,100},
796	{ 0x37,0x22,0x80,133},
797	{ 0x37,0x61,0x80,100},
798	{ 0x37,0x61,0x80,100},
799	{ 0x37,0x61,0x80,100},
800	{ 0x37,0x61,0x80,100}
801};
802
803static const SiS300_MCLKDataStruct  SiS300_MCLKData_300[] =  /* 300 */
804{ /* TW: at 0x54 in BIOS */
805	{ 0x68,0x43,0x80,125},
806	{ 0x68,0x43,0x80,125},
807	{ 0x68,0x43,0x80,125},
808	{ 0x37,0x61,0x80,100},
809	{ 0x37,0x61,0x80,100},
810	{ 0x37,0x61,0x80,100},
811	{ 0x37,0x61,0x80,100},
812	{ 0x37,0x61,0x80,100}
813};
814
815typedef struct _SiS300_ECLKDataStruct
816{
817	UCHAR SR2E,SR2F,SR30;
818	USHORT CLOCK;
819} SiS300_ECLKDataStruct;
820
821static const SiS300_ECLKDataStruct  SiS300_ECLKData[]=
822{
823	{ 0x54,0x43,0x80,100},
824	{ 0x53,0x43,0x80,100},
825	{ 0x55,0x43,0x80,100},
826	{ 0x52,0x43,0x80,100},
827	{ 0x3f,0x42,0x80,100},
828	{ 0x54,0x43,0x80,100},
829	{ 0x54,0x43,0x80,100},
830	{ 0x54,0x43,0x80,100}
831};
832
833typedef struct _SiS300_VCLKDataStruct
834{
835	UCHAR SR2B,SR2C;
836	USHORT CLOCK;
837} SiS300_VCLKDataStruct;
838
839static const SiS300_VCLKDataStruct  SiS300_VCLKData[]=
840{
841	{ 0x1b,0xe1, 25},
842	{ 0x4e,0xe4, 28},
843	{ 0x57,0xe4, 32},
844	{ 0xc3,0xc8, 36},
845	{ 0x42,0xc3, 40},
846	{ 0x5d,0xc4, 45},
847	{ 0x52,0x65, 50},
848	{ 0x53,0x65, 50},
849	{ 0x6d,0x66, 56},
850	{ 0x5a,0x64, 65},
851	{ 0x46,0x44, 68},
852	{ 0x3e,0x43, 75},
853	{ 0x6d,0x46, 76}, /* 0x0c: 800x600 | LVDS_2(CH), MITAC(CH);  - LVDS2(CH), A901(301B): 0xb1,0x46, 76 */
854	{ 0x41,0x43, 79},
855	{ 0x31,0x42, 79},
856	{ 0x46,0x25, 85},
857	{ 0x78,0x29, 87}, /* 0x10 */
858	{ 0x62,0x44, 95},
859	{ 0x2b,0x22,105},
860	{ 0x49,0x24,106},
861	{ 0xc3,0x28,108},
862	{ 0x3c,0x23,109},
863	{ 0xf7,0x2c,132},
864	{ 0xd4,0x28,136},
865	{ 0x41,0x05,158},
866	{ 0x43,0x05,162},
867	{ 0xe1,0x0f,175},
868	{ 0xfc,0x12,189},
869	{ 0xde,0x26,194},
870	{ 0x54,0x05,203},
871	{ 0x3f,0x03,230},
872	{ 0x30,0x02,234},
873	{ 0x24,0x01,266},  /* 0x20 */
874	{ 0x52,0x2a, 54},  /* 301 TV */
875	{ 0x52,0x6a, 27},  /* 301 TV */
876	{ 0x62,0x24, 70},  /* 301 TV */
877	{ 0x62,0x64, 70},  /* 301 TV */
878	{ 0xa8,0x4c, 30},  /* 301 TV */
879	{ 0x20,0x26, 33},  /* 301 TV */
880	{ 0x31,0xc2, 39},
881	{ 0xbf,0xc8, 35},  /* 0x28 */
882	{ 0x60,0x36, 30},  /* 0x29  CH/UNTSC TEXT | LVDS_2(CH) - LVDS2(CH), A901(301B), Mitac(CH): 0xe0, 0xb6, 30 */
883	{ 0x40,0x4a, 28},
884	{ 0x9f,0x46, 44},
885	{ 0x97,0x2c, 26},
886	{ 0x44,0xe4, 25},
887	{ 0x7e,0x32, 47},
888	{ 0x8a,0x24, 31},  /* 0x2f  CH/PAL TEXT | LVDS_2(CH), Mitac(CH) -  LVDS2(CH), A901(301B): 0x57, 0xe4, 31 */
889	{ 0x97,0x2c, 26},
890	{ 0xce,0x3c, 39},
891	{ 0x52,0x4a, 36},
892	{ 0x34,0x61, 95},
893	{ 0x78,0x27,108},
894	{ 0xce,0x25,189},
895	{ 0x45,0x6b, 21},  /* 0x36 */  /* TW: Added from Mitac */
896	{ 0xff,0x00,  0}
897};
898
899
900static const UCHAR  SiS300_ScreenOffset[] =
901{
902	0x14,0x19,0x20,0x28,0x32,0x40,0x50,
903        0x64,0x78,0x80,0x2d,0x35,0x48,0xff
904};
905
906typedef struct _SiS300_StResInfoStruct
907{
908	USHORT HTotal;
909	USHORT VTotal;
910} SiS300_StResInfoStruct;
911
912static const SiS300_StResInfoStruct  SiS300_StResInfo[] =
913{
914	{ 640,400},
915	{ 640,350},
916	{ 720,400},
917	{ 720,350},
918	{ 640,480}
919};
920
921typedef struct _SiS300_ModeResInfoStruct
922{
923	USHORT HTotal;
924	USHORT VTotal;
925	UCHAR  XChar;
926	UCHAR  YChar;
927} SiS300_ModeResInfoStruct;
928
929static const SiS300_ModeResInfoStruct  SiS300_ModeResInfo[] =
930{
931	{  320, 200, 8, 8},  /* 0x00 */
932	{  320, 240, 8, 8},  /* 0x01 */
933	{  320, 400, 8, 8},  /* 0x02 */
934	{  400, 300, 8, 8},  /* 0x03 */
935	{  512, 384, 8, 8},  /* 0x04 */
936	{  640, 400, 8,16},  /* 0x05 */
937	{  640, 480, 8,16},  /* 0x06 */
938	{  800, 600, 8,16},  /* 0x07 */
939	{ 1024, 768, 8,16},  /* 0x08 */
940	{ 1280,1024, 8,16},  /* 0x09 */
941	{ 1600,1200, 8,16},  /* 0x0a */
942	{ 1920,1440, 8,16},  /* 0x0b */
943	{  720, 480, 8,16},  /* 0x0c */
944	{  720, 576, 8,16},  /* 0x0d */
945	{ 1280, 960, 8,16},  /* 0x0e */
946	{ 1024, 600, 8,16},  /* 0x0f */
947	{ 1152, 768, 8,16}   /* 0x10 */
948};
949
950static const UCHAR SiS300_OutputSelect = 0x40;
951
952static const UCHAR SiS300_SoftSetting = 30;
953
954#ifndef LINUX_XF86
955static UCHAR SiS300_SR07 = 0x10;
956#endif
957
958static const UCHAR  SiS300_SR15[8][4] =
959{
960	{0x01,0x09,0xa3,0x00},
961	{0x43,0x43,0x43,0x00},
962	{0x1e,0x1e,0x1e,0x00},
963	{0x2a,0x2a,0x2a,0x00},
964	{0x06,0x06,0x06,0x00},
965	{0x00,0x00,0x00,0x00},
966	{0x00,0x00,0x00,0x00},
967	{0x00,0x00,0x00,0x00}
968};
969
970#ifndef LINUX_XF86
971static UCHAR SiS300_SR1F = 0x00;
972static UCHAR SiS300_SR21 = 0x16;
973static UCHAR SiS300_SR22 = 0xb2;
974static UCHAR SiS300_SR23 = 0xf6;
975static UCHAR SiS300_SR24 = 0x0d;
976static UCHAR SiS300_SR25[] = {0x0,0x0};
977static UCHAR SiS300_SR31 = 0x00;
978static UCHAR SiS300_SR32 = 0x11;
979static UCHAR SiS300_SR33 = 0x00;
980static UCHAR SiS300_CRT2Data_1_2 = 0x40;
981static UCHAR SiS300_CRT2Data_4_D = 0x00;
982static UCHAR SiS300_CRT2Data_4_E = 0x00;
983static UCHAR SiS300_CRT2Data_4_10 = 0x80;
984
985static const USHORT SiS300_RGBSenseData = 0xd1;
986static const USHORT SiS300_VideoSenseData = 0xb3;
987static const USHORT SiS300_YCSenseData = 0xb9;
988static const USHORT SiS300_RGBSenseData2 = 0x0190;     /*301b*/
989static const USHORT SiS300_VideoSenseData2 = 0x0174;
990static const USHORT SiS300_YCSenseData2 = 0x016b;
991
992static const UCHAR SiS300_CR40[5][4];
993
994static UCHAR SiS300_CR49[2];
995#endif
996
997static const UCHAR SiS300_NTSCPhase[]  = {0x21,0xed,0xba,0x08};  /* TW: Was {0x21,0xed,0x8a,0x08}; */
998static const UCHAR SiS300_PALPhase[]   = {0x2a,0x05,0xe3,0x00};  /* TW: Was {0x2a,0x05,0xd3,0x00};  */
999static const UCHAR SiS300_PALMPhase[]  = {0x21,0xE4,0x2E,0x9B};  /* palmn */
1000static const UCHAR SiS300_PALNPhase[]  = {0x21,0xF4,0x3E,0xBA};
1001static const UCHAR SiS300_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6};  /* 301b */
1002static const UCHAR SiS300_PALPhase2[]  = {0x2a,0x09,0x86,0xe9};  /* 301b */
1003static const UCHAR SiS300_PALMPhase2[] = {0x21,0xE6,0xEF,0xA4}; /* TW: palm 301b*/
1004static const UCHAR SiS300_PALNPhase2[] = {0x21,0xF6,0x94,0x46}; /* TW: paln 301b*/
1005
1006typedef struct _SiS300_PanelDelayTblStruct
1007{
1008	UCHAR timer[2];
1009} SiS300_PanelDelayTblStruct;
1010
1011static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTbl[] =
1012{
1013	{{0x05,0xaa}}, /* TW: From 2.04.5a */
1014	{{0x05,0x14}},
1015	{{0x05,0x36}},
1016	{{0x05,0x14}},
1017	{{0x05,0x14}},
1018	{{0x05,0x14}},
1019	{{0x05,0x90}},
1020	{{0x05,0x90}},
1021	{{0x05,0x14}},
1022	{{0x05,0x14}},
1023	{{0x05,0x14}},
1024	{{0x05,0x14}},
1025	{{0x20,0x80}},
1026	{{0x05,0x14}},
1027	{{0x05,0x40}},
1028	{{0x05,0x60}}
1029};
1030
1031static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTblLVDS[] =
1032{
1033	{{0x05,0xaa}},
1034	{{0x05,0x14}},
1035	{{0x05,0x36}},
1036	{{0x05,0x14}},
1037	{{0x05,0x14}},
1038	{{0x05,0x14}},
1039	{{0x05,0x90}},
1040	{{0x05,0x90}},
1041	{{0x05,0x14}},
1042	{{0x05,0x14}},
1043	{{0x05,0x14}},
1044	{{0x05,0x14}},  /* 2.07a (JVC): 14,96 */
1045	{{0x05,0x28}},  /* 2.04.5c: 20, 80 - Clevo (2.04.2c): 05, 28 */
1046	{{0x05,0x14}},
1047	{{0x05,0x14}},  /* Some BIOSes: 05, 40 */
1048	{{0x05,0x60}}
1049};
1050
1051typedef struct _SiS300_LCDDataStruct
1052{
1053	USHORT RVBHCMAX;
1054	USHORT RVBHCFACT;
1055	USHORT VGAHT;
1056	USHORT VGAVT;
1057	USHORT LCDHT;
1058	USHORT LCDVT;
1059} SiS300_LCDDataStruct;
1060
1061static const SiS300_LCDDataStruct  SiS300_StLCD1024x768Data[]=
1062{
1063	{   66,  31, 992, 510,1320, 816},
1064	{   66,  31, 992, 510,1320, 816},
1065	{  176,  75, 900, 510,1320, 816},
1066	{  176,  75, 900, 510,1320, 816},
1067	{   66,  31, 992, 510,1320, 816},
1068	{   27,  16,1024, 650,1350, 832},
1069	{    1,   1,1344, 806,1344, 806}
1070};
1071
1072static const SiS300_LCDDataStruct  SiS300_ExtLCD1024x768Data[]=
1073{
1074	{   12,   5, 896, 512,1344, 806},
1075	{   12,   5, 896, 510,1344, 806},
1076	{   32,  15,1008, 505,1344, 806},
1077	{   32,  15,1008, 514,1344, 806},
1078	{   12,   5, 896, 500,1344, 806},
1079	{   42,  25,1024, 625,1344, 806},
1080	{    1,   1,1344, 806,1344, 806},
1081	{   12,   5, 896, 500,1344, 806},
1082	{   42,  25,1024, 625,1344, 806},
1083	{    1,   1,1344, 806,1344, 806},
1084	{   12,   5, 896, 500,1344, 806},
1085	{   42,  25,1024, 625,1344, 806},
1086	{    1,   1,1344, 806,1344, 806}
1087};
1088
1089static const SiS300_LCDDataStruct  SiS300_St2LCD1024x768Data[]=
1090{
1091	{   62,  25, 800, 546,1344, 806},
1092	{   32,  15, 930, 546,1344, 806},
1093	{   32,  15, 930, 546,1344, 806},
1094	{  104,  45, 945, 496,1344, 806},
1095	{   62,  25, 800, 546,1344, 806},
1096	{   31,  18,1008, 624,1344, 806},
1097	{    1,   1,1344, 806,1344, 806}
1098};
1099
1100static const SiS300_LCDDataStruct  SiS300_StLCD1280x1024Data[]=
1101{
1102	{    4,   1, 880, 510,1650,1088},
1103	{    4,   1, 880, 510,1650,1088},
1104	{  176,  45, 900, 510,1650,1088},
1105	{  176,  45, 900, 510,1650,1088},
1106	{    4,   1, 880, 510,1650,1088},
1107	{   13,   5,1024, 675,1560,1152},
1108	{   16,   9,1266, 804,1688,1072},
1109	{    1,   1,1688,1066,1688,1066}
1110};
1111
1112static const SiS300_LCDDataStruct  SiS300_ExtLCD1280x1024Data[]=
1113{
1114	{  211,  60,1024, 501,1688,1066},
1115	{  211,  60,1024, 508,1688,1066},
1116	{  211,  60,1024, 501,1688,1066},
1117	{  211,  60,1024, 508,1688,1066},
1118	{  211,  60,1024, 500,1688,1066},
1119	{  211,  75,1024, 625,1688,1066},
1120	{  211, 120,1280, 798,1688,1066},
1121	{    1,   1,1688,1066,1688,1066}
1122};
1123
1124static const SiS300_LCDDataStruct  SiS300_St2LCD1280x1024Data[]=
1125{
1126	{   22,   5, 800, 510,1650,1088},
1127	{   22,   5, 800, 510,1650,1088},
1128	{  176,  45, 900, 510,1650,1088},
1129	{  176,  45, 900, 510,1650,1088},
1130	{   22,   5, 800, 510,1650,1088},
1131	{   13,   5,1024, 675,1560,1152},
1132	{   16,   9,1266, 804,1688,1072},
1133	{    1,   1,1688,1066,1688,1066}
1134};
1135
1136static const SiS300_LCDDataStruct  SiS300_NoScaleData1024x768[]=
1137{
1138	{    1,   1, 800, 449, 800, 449},
1139	{    1,   1, 800, 449, 800, 449},
1140	{    1,   1, 900, 449, 900, 449},
1141	{    1,   1, 900, 449, 900, 449},
1142	{    1,   1, 800, 525, 800, 525},
1143	{    1,   1,1056, 628,1056, 628},
1144	{    1,   1,1344, 806,1344, 806},
1145	{    1,   1,1688,1066,1688,1066}
1146};
1147
1148static const SiS300_LCDDataStruct  SiS300_NoScaleData1280x1024[]=  /* TW: Fake */
1149{
1150	{    1,   1, 800, 449, 800, 449},
1151	{    1,   1, 800, 449, 800, 449},
1152	{    1,   1, 900, 449, 900, 449},
1153	{    1,   1, 900, 449, 900, 449},
1154	{    1,   1, 800, 525, 800, 525},
1155	{    1,   1,1056, 628,1056, 628},
1156	{    1,   1,1344, 806,1344, 806},
1157	{    1,   1,1688,1066,1688,1066}
1158};
1159
1160static const SiS300_LCDDataStruct  SiS300_LCD1280x960Data[]=
1161{
1162	{    9,   2, 800, 500,1800,1000},
1163	{    9,   2, 800, 500,1800,1000},
1164	{    4,   1, 900, 500,1800,1000},
1165	{    4,   1, 900, 500,1800,1000},
1166	{    9,   2, 800, 500,1800,1000},
1167	{   30,  11,1056, 625,1800,1000},
1168	{    5,   3,1350, 800,1800,1000},
1169	{    1,   1,1576,1050,1576,1050},
1170	{    1,   1,1800,1000,1800,1000}
1171};
1172
1173static const SiS300_LCDDataStruct  SiS300_ExtLCD1400x1050Data[] =  /* TW: New */
1174{
1175	{    0,   0,   0,   0,   0,   0},
1176	{    0,   0,   0,   0,   0,   0},
1177	{    0,   0,   0,   0,   0,   0},
1178	{    0,   0,   0,   0,   0,   0},
1179	{    0,   0,   0,   0,   0,   0},
1180	{    0,   0,   0,   0,   0,   0},
1181	{    0,   0,   0,   0,   0,   0},
1182	{    0,   0,   0,   0,   0,   0},
1183	{    0,   0,   0,   0,   0,   0},
1184	{    0,   0,   0,   0,   0,   0}
1185};
1186
1187static const SiS300_LCDDataStruct  SiS300_ExtLCD1600x1200Data[] =  /* TW: New */
1188{
1189	{    0,   0,   0,   0,   0,   0},
1190	{    0,   0,   0,   0,   0,   0},
1191	{    0,   0,   0,   0,   0,   0},
1192	{    0,   0,   0,   0,   0,   0},
1193	{    0,   0,   0,   0,   0,   0},
1194	{    0,   0,   0,   0,   0,   0},
1195	{    0,   0,   0,   0,   0,   0},
1196	{    0,   0,   0,   0,   0,   0},
1197	{    0,   0,   0,   0,   0,   0},
1198	{    0,   0,   0,   0,   0,   0}
1199};
1200
1201static const SiS300_LCDDataStruct  SiS300_StLCD1400x1050Data[] =  /* TW: New */
1202{
1203	{    0,   0,   0,   0,   0,   0},
1204	{    0,   0,   0,   0,   0,   0},
1205	{    0,   0,   0,   0,   0,   0},
1206	{    0,   0,   0,   0,   0,   0},
1207	{    0,   0,   0,   0,   0,   0},
1208	{    0,   0,   0,   0,   0,   0},
1209	{    0,   0,   0,   0,   0,   0},
1210	{    0,   0,   0,   0,   0,   0},
1211	{    0,   0,   0,   0,   0,   0},
1212	{    0,   0,   0,   0,   0,   0}
1213};
1214
1215static const SiS300_LCDDataStruct  SiS300_StLCD1600x1200Data[] =  /* TW: New */
1216{
1217	{    0,   0,   0,   0,   0,   0},
1218	{    0,   0,   0,   0,   0,   0},
1219	{    0,   0,   0,   0,   0,   0},
1220	{    0,   0,   0,   0,   0,   0},
1221	{    0,   0,   0,   0,   0,   0},
1222	{    0,   0,   0,   0,   0,   0},
1223	{    0,   0,   0,   0,   0,   0},
1224	{    0,   0,   0,   0,   0,   0},
1225	{    0,   0,   0,   0,   0,   0},
1226	{    0,   0,   0,   0,   0,   0}
1227};
1228
1229static const SiS300_LCDDataStruct  SiS300_NoScaleData1400x1050[] =  /* TW: New */
1230{
1231	{    0,   0,   0,   0,   0,   0},
1232	{    0,   0,   0,   0,   0,   0},
1233	{    0,   0,   0,   0,   0,   0},
1234	{    0,   0,   0,   0,   0,   0},
1235	{    0,   0,   0,   0,   0,   0},
1236	{    0,   0,   0,   0,   0,   0},
1237	{    0,   0,   0,   0,   0,   0},
1238	{    0,   0,   0,   0,   0,   0},
1239	{    0,   0,   0,   0,   0,   0},
1240	{    0,   0,   0,   0,   0,   0}
1241};
1242
1243static const SiS300_LCDDataStruct  SiS300_NoScaleData1600x1200[] =  /* TW: New */
1244{
1245	{    0,   0,   0,   0,   0,   0},
1246	{    0,   0,   0,   0,   0,   0},
1247	{    0,   0,   0,   0,   0,   0},
1248	{    0,   0,   0,   0,   0,   0},
1249	{    0,   0,   0,   0,   0,   0},
1250	{    0,   0,   0,   0,   0,   0},
1251	{    0,   0,   0,   0,   0,   0},
1252	{    0,   0,   0,   0,   0,   0},
1253	{    0,   0,   0,   0,   0,   0},
1254	{    0,   0,   0,   0,   0,   0}
1255};
1256
1257
1258typedef struct _SiS300_TVDataStruct
1259{
1260	USHORT RVBHCMAX;
1261	USHORT RVBHCFACT;
1262	USHORT VGAHT;
1263	USHORT VGAVT;
1264	USHORT TVHDE;
1265	USHORT TVVDE;
1266	USHORT RVBHRS;
1267	UCHAR FlickerMode;
1268	USHORT HALFRVBHRS;
1269	UCHAR RY1COE;
1270	UCHAR RY2COE;
1271	UCHAR RY3COE;
1272	UCHAR RY4COE;
1273} SiS300_TVDataStruct;
1274
1275static const SiS300_TVDataStruct  SiS300_StPALData[]=
1276{
1277	{    1,   1, 864, 525,1270, 400, 100,   0, 760,0xf4,0xff,0x1c,0x22},
1278	{    1,   1, 864, 525,1270, 350, 100,   0, 760,0xf4,0xff,0x1c,0x22},
1279	{    1,   1, 864, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
1280	{    1,   1, 864, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
1281	{    1,   1, 864, 525,1270, 480,  50,   0, 760,0xf4,0xff,0x1c,0x22},
1282	{    1,   1, 864, 525,1270, 600,  50,   0,   0,0xf4,0xff,0x1c,0x22}
1283};
1284
1285static const SiS300_TVDataStruct  SiS300_ExtPALData[]=
1286{
1287	{   27,  10, 848, 448,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
1288	{  108,  35, 848, 398,1270, 530,  50,   0,  50,0xf4,0xff,0x1c,0x22},
1289	{   12,   5, 954, 448,1270, 530,  50,   0,  50,0xf1,0x04,0x1f,0x18},
1290	{    9,   4, 960, 463,1644, 438,  50,   0,  50,0xf4,0x0b,0x1c,0x0a},
1291	{    9,   4, 848, 528,1270, 530,   0,   0,  50,0xf5,0xfb,0x1b,0x2a},
1292	{   36,  25,1060, 648,1316, 530, 438,   0, 438,0xeb,0x05,0x25,0x16},
1293	{    3,   2,1080, 619,1270, 540, 438,   0, 438,0xf3,0x00,0x1d,0x20},
1294	{    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20}
1295
1296};
1297
1298static const SiS300_TVDataStruct  SiS300_StNTSCData[]=
1299{
1300	{    1,   1, 858, 525,1270, 400,  50,   0, 760,0xf1,0x04,0x1f,0x18},
1301	{    1,   1, 858, 525,1270, 350,  50,   0, 640,0xf1,0x04,0x1f,0x18},
1302	{    1,   1, 858, 525,1270, 400,   0,   0, 720,0xf1,0x04,0x1f,0x18},
1303	{    1,   1, 858, 525,1270, 350,   0,   0, 720,0xf4,0x0b,0x1c,0x0a},
1304	{    1,   1, 858, 525,1270, 480,   0,   0, 760,0xf1,0x04,0x1f,0x18}
1305};
1306
1307static const SiS300_TVDataStruct  SiS300_ExtNTSCData[]=
1308{
1309	{  143,  65, 858, 443,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
1310	{   88,  35, 858, 393,1270, 440, 171,   0, 171,0xf1,0x04,0x1f,0x18},
1311	{  143,  70, 924, 443,1270, 440,  92,   0,  92,0xf1,0x04,0x1f,0x18},
1312	{  143,  70, 924, 393,1270, 440,  92,   0,  92,0xf4,0x0b,0x1c,0x0a},
1313	{  143,  76, 836, 523,1270, 440, 224,   0,   0,0xf1,0x05,0x1f,0x16},
1314	{  143, 120,1056, 643,1270, 440,   0, 128,   0,0xf4,0x10,0x1c,0x00},
1315	{  143,  76, 836, 523,1270, 440,   0, 128,   0,0xee,0x0c,0x22,0x08},
1316	{   65,  64,1056, 791,1270, 480, 638,   0,   0,0xf1,0x04,0x1f,0x18}
1317};
1318
1319static const SiS_TVDataStruct  SiS300_St1HiTVData[]=
1320{
1321 	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
1322};
1323
1324static const SiS_TVDataStruct  SiS300_St2HiTVData[]=
1325{
1326 	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
1327};
1328
1329static const SiS_TVDataStruct  SiS300_ExtHiTVData[]=
1330{
1331 	{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
1332};
1333
1334static const UCHAR SiS300_NTSCTiming[] = {
1335	0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
1336	0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
1337	0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
1338/*	0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,   - old */
1339	0x0c,0x50,0x00,0x99,0x00,0xec,0x4a,0x17,  /* new (2.04.5a) */
1340/*	0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,   - old */
1341	0x88,0x00,0x4b,0x00,0x00,0xe2,0x00,0x02,  /* new */
1342	0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
1343	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
1344	0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
1345};
1346
1347static const UCHAR SiS300_PALTiming[] = {
1348	0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
1349	0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
1350	0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
1351/*      0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,   - old */
1352	0x70,0x50,0x00,0x97,0x00,0xd7,0x5d,0x17,  /* new */
1353/*	0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,   -old */
1354	0x88,0x00,0x45,0x00,0x00,0xe8,0x00,0x02,  /* new */
1355	0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
1356	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
1357	0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
1358};
1359
1360#ifdef oldHV
1361static const UCHAR SiS300_HiTVExtTiming[] = {   /* TW: New */
1362        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
1363	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
1364	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
1365	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
1366	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
1367	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
1368	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
1369	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
1370};
1371
1372static const UCHAR SiS300_HiTVSt1Timing[] = {   /* TW: New */
1373        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
1374	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
1375	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
1376	0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
1377	0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
1378	0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
1379	0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
1380	0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
1381};
1382
1383static const UCHAR SiS300_HiTVSt2Timing[] = {   /* TW: New */
1384        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
1385	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
1386	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
1387	0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
1388	0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
1389	0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
1390	0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
1391	0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
1392};
1393
1394static const UCHAR SiS300_HiTVTextTiming[] = {   /* TW: New */
1395        0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
1396	0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
1397	0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
1398	0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
1399	0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
1400	0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
1401        0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
1402	0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
1403};
1404
1405static const UCHAR SiS300_HiTVGroup3Data[] = {   /* TW: New */
1406        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
1407	0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
1408	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
1409	0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
1410	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
1411	0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
1412	0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
1413	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
1414};
1415
1416static const UCHAR SiS300_HiTVGroup3Simu[] = {   /* TW: New */
1417        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
1418	0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
1419	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
1420	0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
1421	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
1422	0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
1423	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
1424	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
1425};
1426
1427static const UCHAR SiS300_HiTVGroup3Text[] = {   /* TW: New */
1428        0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
1429	0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
1430	0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
1431	0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
1432	0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
1433	0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
1434	0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
1435	0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
1436};
1437#endif
1438
1439typedef struct _SiS300_LVDSDataStruct
1440{
1441	USHORT VGAHT;
1442	USHORT VGAVT;
1443	USHORT LCDHT;
1444	USHORT LCDVT;
1445} SiS300_LVDSDataStruct;
1446
1447static const SiS300_LVDSDataStruct  SiS300_LVDS320x480Data_1[]=
1448{
1449	{848, 433,400, 525},
1450	{848, 389,400, 525},
1451	{848, 433,400, 525},
1452	{848, 389,400, 525},
1453	{848, 518,400, 525},
1454	{1056,628,400, 525},
1455	{400, 525,400, 525},
1456	{800, 449,1000, 644},
1457	{800, 525,1000, 635}
1458};
1459
1460static const SiS300_LVDSDataStruct  SiS300_LVDS800x600Data_1[]=
1461{
1462	{848, 433,1060, 629},
1463	{848, 389,1060, 629},
1464	{848, 433,1060, 629},
1465	{848, 389,1060, 629},
1466	{848, 518,1060, 629},
1467	{1056, 628,1056, 628},
1468	{1056, 628,1056, 628},
1469	{800, 449,1000, 644},
1470	{800, 525,1000, 635}
1471};
1472
1473static const SiS300_LVDSDataStruct  SiS300_LVDS800x600Data_2[]=
1474{
1475	{1056, 628,1056, 628},
1476	{1056, 628,1056, 628},
1477	{1056, 628,1056, 628},
1478	{1056, 628,1056, 628},
1479	{1056, 628,1056, 628},
1480	{1056, 628,1056, 628},
1481	{1056, 628,1056, 628},
1482	{800, 449,1000, 644},
1483	{800, 525,1000, 635}
1484};
1485
1486static const SiS300_LVDSDataStruct  SiS300_LVDS1024x768Data_1[]=
1487{
1488	{840, 438,1344, 806},
1489	{840, 409,1344, 806},
1490	{840, 438,1344, 806},
1491	{840, 409,1344, 806},
1492	{840, 518,1344, 806},
1493	{1050, 638,1344, 806},
1494	{1344, 806,1344, 806},
1495	{800, 449,1280, 801},
1496	{800, 525,1280, 813}
1497};
1498
1499static const SiS300_LVDSDataStruct  SiS300_LVDS1024x768Data_2[]=
1500{
1501	{1344, 806,1344, 806},
1502	{1344, 806,1344, 806},
1503	{1344, 806,1344, 806},
1504	{1344, 806,1344, 806},
1505	{1344, 806,1344, 806},
1506	{1344, 806,1344, 806},
1507	{1344, 806,1344, 806},
1508	{800, 449,1280, 801},
1509	{800, 525,1280, 813}
1510};
1511
1512static const SiS300_LVDSDataStruct  SiS300_LVDS1280x1024Data_1[]=
1513{
1514	{840, 438,1344, 806},
1515	{840, 409,1344, 806},
1516	{840, 438,1344, 806},
1517	{840, 409,1344, 806},
1518	{840, 518,1344, 806},
1519	{1050, 638,1344, 806},
1520	{1344, 806,1344, 806},
1521	{800, 449,1280, 801},
1522	{800, 525,1280, 813}
1523};
1524
1525static const SiS300_LVDSDataStruct  SiS300_LVDS1280x1024Data_2[]=
1526{
1527	{1344, 806,1344, 806},
1528	{1344, 806,1344, 806},
1529	{1344, 806,1344, 806},
1530	{1344, 806,1344, 806},
1531	{1344, 806,1344, 806},
1532	{1344, 806,1344, 806},
1533	{1344, 806,1344, 806},
1534	{800, 449,1280, 801},
1535	{800, 525,1280, 813}
1536};
1537
1538static const SiS300_LVDSDataStruct  SiS300_LVDS1400x1050Data_1[]=   /* TW: New */
1539{
1540        {928, 416, 1688, 1066},
1541	{928, 366, 1688, 1066},
1542	{928, 416, 1688, 1066},
1543	{928, 366, 1688, 1066},
1544	{928, 496, 1688, 1066},
1545	{1088, 616, 1688, 1066},
1546	{1312, 784, 1688, 1066},
1547	{1568, 1040, 1688, 1066},
1548	{1688, 1066, 1688, 1066}
1549};
1550
1551static const SiS300_LVDSDataStruct  SiS300_LVDS1400x1050Data_2[]=   /* TW: New */
1552{
1553        {1688,1066, 1688,1066},
1554	{1688,1066, 1688,1066},
1555	{1688,1066, 1688,1066},
1556	{1688,1066, 1688,1066},
1557	{1688,1066, 1688,1066},
1558	{1688,1066, 1688,1066},
1559	{1688,1066, 1688,1066},
1560	{1688,1066, 1688,1066},
1561	{1688,1066, 1688,1066},
1562};
1563
1564/* TW: New: */
1565static const SiS300_LVDSDataStruct  SiS300_LVDS1024x600Data_1[]=
1566{
1567	{840, 604,1344, 800},
1568	{840, 560,1344, 800},
1569	{840, 604,1344, 800},
1570	{840, 560,1344, 800},
1571	{840, 689,1344, 800},
1572	{1050, 800,1344, 800},
1573	{1344, 800,1344, 800},
1574	{800, 449,1280, 789},
1575	{800, 525,1280, 785}
1576};
1577
1578/* TW: New: */
1579static const SiS300_LVDSDataStruct  SiS300_LVDS1024x600Data_2[]=
1580{
1581	{1344, 800,1344, 800},
1582	{1344, 800,1344, 800},
1583	{1344, 800,1344, 800},
1584	{1344, 800,1344, 800},
1585	{1344, 800,1344, 800},
1586	{1344, 800,1344, 800},
1587	{1344, 800,1344, 800},
1588	{800, 449,1280, 801},
1589	{800, 525,1280, 813}
1590};
1591
1592/* TW: New: */
1593static const SiS300_LVDSDataStruct  SiS300_LVDS1152x768Data_1[]=
1594{
1595	{840, 438,1344, 806},
1596	{840, 409,1344, 806},
1597	{840, 438,1344, 806},
1598	{840, 409,1344, 806},
1599	{840, 518,1344, 806},
1600	{1050, 638,1344, 806},
1601	{1344, 806,1344, 806},
1602	{800, 449,1280, 801},
1603	{800, 525,1280, 813}
1604};
1605
1606/* TW: New: */
1607static const SiS300_LVDSDataStruct  SiS300_LVDS1152x768Data_2[]=
1608{
1609	{1344, 806,1344, 806},
1610	{1344, 806,1344, 806},
1611	{1344, 806,1344, 806},
1612	{1344, 806,1344, 806},
1613	{1344, 806,1344, 806},
1614	{1344, 806,1344, 806},
1615	{1344, 806,1344, 806},
1616	{800, 449,1280, 801},
1617	{800, 525,1280, 813}
1618};
1619
1620/* TW: New in 650/LVDS BIOS - resolution unknown */
1621static const SiS300_LVDSDataStruct  SiS300_LVDSXXXxXXXData_1[]=   /* TW: New */
1622{
1623        { 800, 449, 800, 449},
1624	{ 800, 449, 800, 449},
1625	{ 900, 449, 900, 449},
1626	{ 900, 449, 900, 449},
1627	{ 800, 525, 800, 525},
1628	{1056, 628,1056, 628},
1629	{1344, 806,1344, 806},
1630	{1688, 806,1688, 806}
1631};
1632
1633static const SiS300_LVDSDataStruct  SiS300_LVDS640x480Data_1[]=
1634{
1635	{800, 449, 800, 449},
1636	{800, 449, 800, 449},
1637	{800, 449, 800, 449},
1638	{800, 449, 800, 449},
1639	{800, 525, 800, 525},
1640	{1056, 628,1056, 628},
1641	{1056, 628,1056, 628},
1642	{1056, 628,1056, 628},
1643	{1056, 628,1056, 628}
1644};
1645
1646static const SiS300_LVDSDataStruct  SiS300_LVDS1280x960Data_1[]=   /* TW: New */
1647{
1648	{840, 438,1344, 806},
1649	{840, 409,1344, 806},
1650	{840, 438,1344, 806},
1651	{840, 409,1344, 806},
1652	{840, 518,1344, 806},
1653	{1050, 638,1344, 806},
1654	{1344, 806,1344, 806},
1655	{800, 449,1280, 801},
1656	{800, 525,1280, 813}
1657};
1658
1659static const SiS300_LVDSDataStruct  SiS300_LVDS1280x960Data_2[]=   /* TW: New */
1660{
1661	{1344, 806,1344, 806},
1662	{1344, 806,1344, 806},
1663	{1344, 806,1344, 806},
1664	{1344, 806,1344, 806},
1665	{1344, 806,1344, 806},
1666	{1344, 806,1344, 806},
1667	{1344, 806,1344, 806},
1668	{800, 449,1280, 801},
1669	{800, 525,1280, 813}
1670};
1671
1672static const SiS300_LVDSDataStruct  SiS300_LCDA1400x1050Data_1[]=   /* TW: New */
1673{	/* TW: Might be temporary (invalid) data */
1674        {928, 416, 1688, 1066},
1675	{928, 366, 1688, 1066},
1676	{1008, 416, 1688, 1066},
1677	{1008, 366, 1688, 1066},
1678	{1200, 530, 1688, 1066},
1679	{1088, 616, 1688, 1066},
1680	{1312, 784, 1688, 1066},
1681	{1568, 1040, 1688, 1066},
1682	{1688, 1066, 1688, 1066}
1683};
1684
1685static const SiS300_LVDSDataStruct  SiS300_LCDA1400x1050Data_2[]=   /* TW: New */
1686{	/* TW: Temporary data. Not valid */
1687	{1344, 806,1344, 806},
1688	{1344, 806,1344, 806},
1689	{1344, 806,1344, 806},
1690	{1344, 806,1344, 806},
1691	{1344, 806,1344, 806},
1692	{1344, 806,1344, 806},
1693	{1344, 806,1344, 806},
1694	{800, 449,1280, 801},
1695	{800, 525,1280, 813}
1696};
1697
1698static const SiS300_LVDSDataStruct  SiS300_LCDA1600x1200Data_1[]=   /* TW: New */
1699{	/* TW: Temporary data. Not valid */
1700	{1344, 806,1344, 806},
1701	{1344, 806,1344, 806},
1702	{1344, 806,1344, 806},
1703	{1344, 806,1344, 806},
1704	{1344, 806,1344, 806},
1705	{1344, 806,1344, 806},
1706	{1344, 806,1344, 806},
1707	{800, 449,1280, 801},
1708	{800, 525,1280, 813}
1709};
1710
1711static const SiS300_LVDSDataStruct  SiS300_LCDA1600x1200Data_2[]=   /* TW: New */
1712{	/* TW: Temporary data. Not valid */
1713	{0, 0, 0, 0},
1714	{0, 0, 0, 0},
1715	{0, 0, 0, 0},
1716	{0, 0, 0, 0},
1717	{0, 0, 0, 0},
1718	{0, 0, 0, 0},
1719	{0, 0, 0, 0},
1720	{0, 0, 0, 0},
1721	{0, 0, 0, 0},
1722	{0, 0, 0, 0},
1723	{0, 0, 0, 0},
1724	{0, 0, 0, 0}
1725};
1726
1727
1728/* TW: New: */
1729static const SiS300_LVDSDataStruct  SiS300_CHTVUNTSCData[]=
1730{
1731	{840, 600, 840, 600},
1732	{840, 600, 840, 600},
1733	{840, 600, 840, 600},
1734	{840, 600, 840, 600},
1735	{784, 600, 784, 600},
1736	{1064, 750,1064, 750}
1737};
1738
1739static const SiS300_LVDSDataStruct  SiS300_CHTVONTSCData[]=
1740{
1741	{840, 525, 840, 525},
1742	{840, 525, 840, 525},
1743	{840, 525, 840, 525},
1744	{840, 525, 840, 525},
1745	{784, 525, 784, 525},
1746	{1040, 700,1040, 700}
1747};
1748
1749static const SiS300_LVDSDataStruct  SiS300_CHTVUPALData[]=
1750{
1751	{1008, 625,1008, 625},
1752	{1008, 625,1008, 625},
1753	{1008, 625,1008, 625},
1754	{1008, 625,1008, 625},
1755	{840, 750, 840, 750},
1756	{936, 836, 936, 836}
1757};
1758
1759static const SiS300_LVDSDataStruct  SiS300_CHTVOPALData[]=
1760{
1761	{1008, 625,1008, 625},
1762	{1008, 625,1008, 625},
1763	{1008, 625,1008, 625},
1764	{1008, 625,1008, 625},
1765	{840, 625, 840, 625},
1766	{960, 750, 960, 750}
1767};
1768/* TW: new end */
1769
1770typedef struct _SiS300_LVDSDesStruct
1771{
1772	USHORT LCDHDES;
1773	USHORT LCDVDES;
1774} SiS300_LVDSDesStruct;
1775
1776static const SiS300_LVDSDesStruct  SiS300_PanelType00_1[]=
1777{
1778	{0, 626},
1779	{0, 624},
1780	{0, 626},
1781	{0, 624},
1782	{0, 624},
1783	{ 0, 627},
1784	{ 0, 627},
1785	{ 0,   0},
1786	{ 0,   0}
1787};
1788
1789static const SiS300_LVDSDesStruct  SiS300_PanelType01_1[]=
1790{
1791	{1343, 798},
1792	{1343, 794},
1793	{1343, 798},
1794	{1343, 794},
1795	{1343,   0},
1796	{1343,   0},
1797	{ 0, 805},
1798	{ 0, 794},
1799	{ 0,   0}
1800};
1801
1802static const SiS300_LVDSDesStruct  SiS300_PanelType02_1[]=
1803{
1804	{0, 626},
1805	{0, 624},
1806	{0, 626},
1807	{0, 624},
1808	{0, 624},
1809	{ 0, 627},
1810	{ 0, 627},
1811	{ 0,   0},
1812	{ 0,   0}
1813};
1814
1815static const SiS300_LVDSDesStruct  SiS300_PanelType03_1[]=
1816{
1817	{ 8, 436},
1818	{ 8, 440},
1819	{ 8, 436},
1820	{ 8, 440},
1821	{ 8, 512},
1822	{1343, 798},
1823	{1343, 794},
1824	{1343, 798},
1825	{1343, 794}
1826};
1827
1828static const SiS300_LVDSDesStruct  SiS300_PanelType04_1[]=
1829{
1830	{1343, 798},
1831	{1343, 794},
1832	{1343, 798},
1833	{1343, 794},
1834	{1343,   0},
1835	{1343,   0},
1836	{ 0, 805},
1837	{ 0, 794},
1838	{ 0,   0}
1839};
1840
1841static const SiS300_LVDSDesStruct  SiS300_PanelType05_1[]=
1842{
1843	{1343, 798},
1844	{1343, 794},
1845	{1343, 798},
1846	{1343, 794},
1847	{1343,   0},
1848	{1343,   0},
1849	{ 0, 805},
1850	{ 0, 794},
1851	{ 0,   0}
1852};
1853
1854static const SiS300_LVDSDesStruct  SiS300_PanelType06_1[]=
1855{
1856	{1343, 798},
1857	{1343, 794},
1858	{1343, 798},
1859	{1343, 794},
1860	{1343,   0},
1861	{1343,   0},
1862	{ 0, 805},
1863	{ 0, 794},
1864	{ 0,   0}
1865};
1866
1867static const SiS300_LVDSDesStruct  SiS300_PanelType07_1[]=
1868{
1869	{1343, 798},
1870	{1343, 794},
1871	{1343, 798},
1872	{1343, 794},
1873	{1343,   0},
1874	{1343,   0},
1875	{ 0, 805},
1876	{ 0, 794},
1877	{ 0,   0}
1878};
1879
1880static const SiS300_LVDSDesStruct  SiS300_PanelType08_1[]=
1881{
1882	{1059, 626},
1883	{1059, 624},
1884	{1059, 626},
1885	{1059, 624},
1886	{1059, 624},
1887	{ 0, 627},
1888	{ 0, 627},
1889	{ 0,   0},
1890	{ 0,   0}
1891};
1892
1893static const SiS300_LVDSDesStruct  SiS300_PanelType09_1[]=
1894{
1895	{1343, 798},
1896	{1343, 794},
1897	{1343, 798},
1898	{1343, 794},
1899	{1343,   0},
1900	{1343,   0},
1901	{ 0, 805},
1902	{ 0, 794},
1903	{ 0,   0}
1904};
1905
1906static const SiS300_LVDSDesStruct  SiS300_PanelType0a_1[]=
1907{
1908	{1059, 626},
1909	{1059, 624},
1910	{1059, 626},
1911	{1059, 624},
1912	{1059, 624},
1913	{ 0, 627},
1914	{ 0, 627},
1915	{ 0,   0},
1916	{ 0,   0}
1917};
1918
1919static const SiS300_LVDSDesStruct  SiS300_PanelType0b_1[]=
1920{
1921	{1343, 0},
1922	{1343, 0},
1923	{1343, 0},
1924	{1343, 0},
1925	{1343, 0},   /* 640x480 - BIOS 1343, 0 */
1926	{1343, 0},
1927	{ 0, 799},
1928	{ 0, 0},
1929	{ 0, 0}
1930};
1931
1932static const SiS300_LVDSDesStruct  SiS300_PanelType0c_1[]=
1933{
1934	{1343, 798},
1935	{1343, 794},
1936	{1343, 798},
1937	{1343, 794},
1938	{1343,   0},
1939	{1343,   0},
1940	{ 0, 805},
1941	{ 0, 794},
1942	{ 0,   0}
1943};
1944
1945static const SiS300_LVDSDesStruct  SiS300_PanelType0d_1[]=
1946{
1947	{1343, 798},
1948	{1343, 794},
1949	{1343, 798},
1950	{1343, 794},
1951	{1343,   0},
1952	{1343,   0},
1953	{ 0, 805},
1954	{ 0, 794},
1955	{ 0,   0}
1956};
1957
1958static const SiS300_LVDSDesStruct  SiS300_PanelType0e_1[]=
1959{
1960	{1343, 798},
1961	{1343, 794},
1962	{1343, 798},
1963	{1343, 794},
1964	{1343,   0},  /* 640x480 */
1965	{1343,   0},  /* 800x600 */
1966	{ 0, 805},    /* 1024x768 */
1967	{ 0, 794},    /* 1280x1024 */
1968	{ 0,   0}     /* 1280x960 - not applicable */
1969};
1970
1971static const SiS300_LVDSDesStruct  SiS300_PanelType0f_1[]=
1972{
1973	{1343, 798},
1974	{1343, 794},
1975	{1343, 798},
1976	{1343, 794},
1977	{1343,   0},
1978	{1343,   0},
1979	{ 0, 805},
1980	{ 0, 794},
1981	{ 0,   0}
1982};
1983
1984static const SiS300_LVDSDesStruct  SiS300_PanelType00_2[]=
1985{
1986	{976, 527},
1987	{976, 502},
1988	{976, 527},
1989	{976, 502},
1990	{976, 567},
1991	{ 0, 627},
1992	{ 0, 627},
1993	{ 0,   0},
1994	{ 0,   0}
1995};
1996
1997static const SiS300_LVDSDesStruct  SiS300_PanelType01_2[]=
1998{
1999	{1152, 622},
2000	{1152, 597},
2001	{1152, 622},
2002	{1152, 597},
2003	{1152, 662},
2004	{1232, 722},
2005	{ 0, 805},
2006	{ 0, 794},
2007	{ 0,   0}
2008};
2009
2010static const SiS300_LVDSDesStruct  SiS300_PanelType02_2[]=
2011{
2012	{976, 527},
2013	{976, 502},
2014	{976, 527},
2015	{976, 502},
2016	{976, 567},
2017	{ 0, 627},
2018	{ 0, 627},
2019	{ 0,   0},
2020	{ 0,   0}
2021};
2022
2023static const SiS300_LVDSDesStruct  SiS300_PanelType03_2[]=
2024{
2025	{1152, 622},
2026	{1152, 597},
2027	{1152, 622},
2028	{1152, 597},
2029	{1152, 662},
2030	{1232, 722},
2031	{   0, 805},
2032	{1152, 622},
2033	{1152, 597}
2034};
2035
2036static const SiS300_LVDSDesStruct  SiS300_PanelType04_2[]=
2037{
2038	{1152, 622},
2039	{1152, 597},
2040	{1152, 622},
2041	{1152, 597},
2042	{1152, 662},
2043	{1232, 722},
2044	{   0, 805},
2045	{   0, 794},
2046	{   0,   0}
2047};
2048
2049static const SiS300_LVDSDesStruct  SiS300_PanelType05_2[]=
2050{
2051	{1152, 622},
2052	{1152, 597},
2053	{1152, 622},
2054	{1152, 597},
2055	{1152, 662},
2056	{1232, 722},
2057	{   0, 805},
2058	{   0, 794},
2059	{   0,   0}
2060};
2061
2062static const SiS300_LVDSDesStruct  SiS300_PanelType06_2[]=
2063{
2064	{1152, 622},
2065	{1152, 597},
2066	{1152, 622},
2067	{1152, 597},
2068	{1152, 662},
2069	{1232, 722},
2070	{   0, 805},
2071	{   0, 794},
2072	{   0,   0}
2073};
2074
2075static const SiS300_LVDSDesStruct  SiS300_PanelType07_2[]=
2076{
2077 	{1152, 622},
2078 	{1152, 597},
2079 	{1152, 622},
2080 	{1152, 597},
2081 	{1152, 662},
2082 	{1232, 722},
2083	{   0, 805},
2084	{   0, 794},
2085	{   0,   0}
2086};
2087
2088static const SiS300_LVDSDesStruct  SiS300_PanelType08_2[]=
2089{
2090 	{976, 527},
2091 	{976, 502},
2092 	{976, 527},
2093 	{976, 502},
2094 	{976, 567},
2095 	{  0, 627},
2096 	{  0, 627},
2097 	{  0,   0},
2098 	{  0,   0}
2099};
2100
2101static const SiS300_LVDSDesStruct  SiS300_PanelType09_2[]=
2102{
2103 	{1152, 622},
2104 	{1152, 597},
2105 	{1152, 622},
2106 	{1152, 597},
2107 	{1152, 662},
2108 	{1232, 722},
2109 	{   0, 805},
2110 	{   0, 794},
2111 	{   0,   0}
2112};
2113
2114static const SiS300_LVDSDesStruct  SiS300_PanelType0a_2[]=
2115{
2116 	{976, 527},
2117 	{976, 502},
2118 	{976, 527},
2119 	{976, 502},
2120 	{976, 567},
2121 	{  0, 627},
2122 	{  0, 627},
2123 	{  0,   0},
2124 	{  0,   0}
2125};
2126
2127static const SiS300_LVDSDesStruct  SiS300_PanelType0b_2[]=
2128{
2129 	{ 1152, 700},
2130 	{ 1152, 675},
2131 	{ 1152, 700},
2132 	{ 1152, 675},
2133 	{ 1152, 740},
2134 	{ 1232, 799},
2135 	{    0, 799},
2136 	{    0,   0},
2137 	{    0,   0}
2138};
2139
2140static const SiS300_LVDSDesStruct  SiS300_PanelType0c_2[]=
2141{
2142 	{1152, 622},
2143 	{1152, 597},
2144 	{1152, 622},
2145 	{1152, 597},
2146 	{1152, 662},
2147 	{1232, 722},
2148 	{   0, 805},
2149 	{   0, 794},
2150 	{   0,   0}
2151};
2152
2153static const SiS300_LVDSDesStruct  SiS300_PanelType0d_2[]=
2154{
2155 	{1152, 622},
2156 	{1152, 597},
2157 	{1152, 622},
2158 	{1152, 597},
2159 	{1152, 662},
2160 	{1232, 722},
2161 	{   0, 805},
2162 	{   0, 794},
2163 	{   0,   0}
2164};
2165
2166static const SiS300_LVDSDesStruct  SiS300_PanelType0e_2[]=
2167{
2168 	{1152, 622},
2169 	{1152, 597},
2170 	{1152, 622},
2171 	{1152, 597},
2172 	{1152, 662},
2173 	{1232, 722},
2174 	{   0, 805},
2175 	{   0, 794},
2176 	{   0,   0}
2177};
2178
2179static const SiS300_LVDSDesStruct  SiS300_PanelType0f_2[]=
2180{
2181 	{1152, 622},
2182 	{1152, 597},
2183 	{1152, 622},
2184 	{1152, 597},
2185 	{1152, 662},
2186 	{1232, 722},
2187 	{   0, 805},
2188 	{   0, 794},
2189 	{   0,   0}
2190};
2191
2192static const SiS300_LVDSDesStruct SiS300_PanelType1076_1[]=   /* TW: New */
2193{
2194	{ 0 , 0},
2195	{ 0 , 0},
2196	{ 0 , 0},
2197	{ 0 , 0},
2198	{ 0 , 0},
2199	{ 0 , 0},
2200	{ 0 , 0},
2201	{ 0 , 0},
2202	{ 0 , 0}
2203};
2204
2205static const SiS300_LVDSDesStruct SiS300_PanelType1076_2[]=   /* TW: New */
2206{
2207	{ 1152, 622 },
2208	{ 1152, 597 },
2209	{ 1152, 622 },
2210	{ 1152, 597 },
2211	{ 1152, 622 },
2212	{ 1232, 722 },
2213	{    0, 0   },
2214	{    0, 794 },
2215	{    0, 0   }
2216};
2217
2218static const SiS300_LVDSDesStruct SiS300_PanelType1210_1[]=   /* TW: New */
2219{
2220	{ 0 , 0},
2221	{ 0 , 0},
2222	{ 0 , 0},
2223	{ 0 , 0},
2224	{ 0 , 0},
2225	{ 0 , 0},
2226	{ 0 , 0},
2227	{ 0 , 0},
2228	{ 0 , 0}
2229};
2230
2231static const SiS300_LVDSDesStruct SiS300_PanelType1210_2[]=   /* TW: New */
2232{
2233	{ 0 , 0},
2234	{ 0 , 0},
2235	{ 0 , 0},
2236	{ 0 , 0},
2237	{ 0 , 0},
2238	{ 0 , 0},
2239	{ 0 , 0},
2240	{ 0 , 0},
2241	{ 0 , 0}
2242};
2243
2244static const SiS300_LVDSDesStruct SiS300_PanelType1296_1[]=   /* TW: New */
2245{
2246	{ 0 , 0},
2247	{ 0 , 0},
2248	{ 0 , 0},
2249	{ 0 , 0},
2250	{ 0 , 0},
2251	{ 0 , 0},
2252	{ 0 , 0},
2253	{ 0 , 0},
2254	{ 0 , 0}
2255};
2256
2257static const SiS300_LVDSDesStruct SiS300_PanelType1296_2[]=   /* TW: New */
2258{
2259	{ 0 , 0},
2260	{ 0 , 0},
2261	{ 0 , 0},
2262	{ 0 , 0},
2263	{ 0 , 0},
2264	{ 0 , 0},
2265	{ 0 , 0},
2266	{ 0 , 0},
2267	{ 0 , 0}
2268};
2269
2270
2271/* TW: New */
2272static const SiS300_LVDSDesStruct  SiS300_CHTVUNTSCDesData[]=
2273{
2274 	{ 0,   0},
2275 	{ 0,   0},
2276 	{ 0,   0},
2277 	{ 0,   0},
2278 	{ 0,   0},
2279 	{ 0,   0}
2280};
2281
2282static const SiS300_LVDSDesStruct  SiS300_CHTVONTSCDesData[]=
2283{
2284 	{ 0,   0},
2285 	{ 0,   0},
2286 	{ 0,   0},
2287 	{ 0,   0},
2288 	{ 0,   0},
2289 	{ 0,   0}
2290};
2291
2292static const SiS300_LVDSDesStruct  SiS300_CHTVUPALDesData[]=
2293{
2294 	{256,   0},
2295 	{256,   0},
2296 	{256,   0},
2297 	{256,   0},
2298 	{  0,   0},
2299 	{  0,   0}
2300};
2301
2302static const SiS300_LVDSDesStruct  SiS300_CHTVOPALDesData[]=
2303{
2304 	{256,   0},
2305 	{256,   0},
2306 	{256,   0},
2307 	{256,   0},
2308 	{  0,   0},
2309 	{  0,   0}
2310};
2311/* TW: New end */
2312
2313typedef struct _SiS300_LVDSCRT1DataStruct
2314{
2315UCHAR CR[15];
2316} SiS300_LVDSCRT1DataStruct;
2317
2318static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1[]=
2319{
2320	{{0x65,0x4f,0x89,0x56,0x83,0xaf,0x1f,
2321	  0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
2322	  0x00 }},
2323	{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
2324	  0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
2325	  0x00 }},
2326	{{0x65,0x4f,0x89,0x56,0x83,0xaf,0x1f,
2327	  0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
2328	  0x00 }},
2329	{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
2330	  0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
2331	  0x00 }},
2332	{{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
2333	  0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
2334	  0x00 }},
2335	{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
2336	  0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
2337	  0x01 }}
2338};
2339
2340static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1[]=
2341{
2342	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
2343	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
2344	  0x00}},
2345	{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
2346	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
2347	  0x00}},
2348	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
2349	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
2350	  0x00}},
2351	{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
2352	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
2353	  0x00}},
2354	{{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
2355	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
2356	  0x00}},
2357	{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
2358	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
2359	  0x01}},
2360	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2361	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2362	  0x01} }
2363};
2364
2365static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1[]=
2366{
2367	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
2368	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
2369	  0x00 }},
2370	{{0x63,0x4f,0x87,0x54,0x9f,0x82,0x1f,
2371	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
2372	  0x00 }},
2373	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
2374	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
2375	  0x00 }},
2376	{{0x63,0x4f,0x87,0x54,0x9f,0x82,0x1f,
2377	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
2378	  0x00 }},
2379	{{0x63,0x4f,0x87,0x54,0x9f,0x04,0x3e,
2380	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
2381	  0x00 }},
2382	{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
2383	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
2384	  0x01 }},
2385	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2386	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2387	  0x01 }}
2388};
2389
2390static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1_H[]=
2391{
2392	{{0x30,0x27,0x94,0x2c,0x92,0xaf,0x1f,
2393	  0x90,0x85,0x8f,0xab,0x30,0x00,0x04,
2394	  0x00 }},
2395	{{0x30,0x27,0x94,0x2c,0x92,0x83,0x1f,
2396	  0x5e,0x83,0x5d,0x79,0x10,0x00,0x04,
2397	  0x00 }},
2398	{{0x30,0x27,0x94,0x2c,0x92,0xaf,0x1f,
2399	  0x90,0x85,0x8f,0xab,0x30,0x00,0x04,
2400	  0x00 }},
2401	{{0x30,0x27,0x94,0x2c,0x92,0x83,0x1f,
2402	  0x5e,0x83,0x5d,0x79,0x10,0x00,0x04,
2403	  0x00 }},
2404	{{0x30,0x27,0x94,0x2c,0x92,0x04,0x3e,
2405	  0xe0,0x85,0xdf,0xfb,0x10,0x00,0x04,
2406	  0x00 }},
2407	{{0x3d,0x31,0x81,0x37,0x1f,0x72,0xf0,
2408	  0x58,0x8c,0x57,0x73,0x20,0x00,0x05,
2409	  0x01 }}
2410};
2411
2412static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1_H[]=
2413{
2414	{{0x37,0x27,0x9B,0x2b,0x94,0xc4,0x1f,
2415	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
2416	  0x00 }},
2417	{{0x37,0x27,0x9B,0x2b,0x94,0x97,0x1f,
2418	  0x60,0x87,0x5D,0x83,0x01,0x00,0x44,
2419	  0x00}},
2420	{{0x37,0x27,0x9B,0x2b,0x94,0xc4,0x1f,
2421	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
2422	  0x00}},
2423	{{0x37,0x27,0x9B,0x2b,0x94,0x97,0x1f,
2424	  0x60,0x87,0x5D,0x83,0x01,0x00,0x44,
2425	  0x00}},
2426	{{0x37,0x27,0x9B,0x2b,0x94,0x04,0x3e,
2427	  0xE2,0x89,0xDf,0x05,0x00,0x00,0x44,
2428	  0x00}},
2429	{{0x41,0x31,0x85,0x35,0x1d,0x7c,0xf0,
2430	  0x5A,0x8F,0x57,0x7D,0x20,0x00,0x55,
2431	  0x01}},
2432	{{0x4f,0x3F,0x93,0x45,0x0D,0x24,0xf5,
2433	  0x02,0x88,0xFf,0x25,0x10,0x00,0x01,
2434	  0x01 }}
2435};
2436
2437static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1_H[]=
2438{
2439	{{0x2f,0x27,0x93,0x2b,0x90,0xb4,0x1f,
2440	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x04,
2441	  0x00 }},
2442	{{0x2f,0x27,0x93,0x2b,0x90,0x82,0x1f,
2443	  0x60,0x87,0x5d,0x83,0x10,0x00,0x04,
2444	  0x00 }},
2445	{{0x2f,0x27,0x93,0x2b,0x90,0xb4,0x1f,
2446	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x04,
2447	  0x00 }},
2448	{{0x2f,0x27,0x93,0x2b,0x90,0x82,0x1f,
2449	  0x60,0x87,0x5d,0x83,0x10,0x00,0x04,
2450	  0x00 }},
2451	{{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
2452	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x04,
2453	  0x00 }},
2454	{{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
2455	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
2456	  0x01 }},
2457	{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2458	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2459	  0x01 }}
2460};
2461
2462static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2[]=
2463{
2464	{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
2465	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x06,
2466	  0x00 }},
2467	{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
2468	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x06,
2469	  0x00 }},
2470	{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
2471	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x06,
2472	  0x00 }},
2473	{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
2474	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x06,
2475	  0x00 }},
2476	{{0x7f,0x4f,0x83,0x62,0x12,0x72,0xba,
2477	  0x1c,0x80,0xdf,0x73,0x00,0x00,0x06,
2478	  0x00 }},
2479	{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
2480	  0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
2481	  0x01 }}
2482};
2483
2484static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2[]=
2485{
2486	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2487	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2488	  0x00 }},
2489	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2490	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2491	  0x00 }},
2492	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2493	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2494	  0x00 }},
2495	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2496	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2497	  0x00 }},
2498	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2499	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
2500	  0x00 }},
2501	{{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
2502	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
2503	  0x01 }},
2504	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2505	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2506	  0x01 }}
2507};
2508
2509static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2[]=
2510{
2511	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2512	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2513	  0x00 }},
2514	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2515	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2516	  0x00 }},
2517	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2518	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2519	  0x00 }},
2520	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2521	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2522	  0x00 }},
2523	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2524	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
2525	  0x00 }},
2526	{{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
2527	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
2528	  0x01 }},
2529	{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2530	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2531	  0x01 }}
2532};
2533
2534static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2_H[]=
2535{
2536	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
2537	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
2538	  0x00 }},
2539	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
2540	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x05,
2541	  0x00 }},
2542	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
2543	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
2544	  0x00 }},
2545	{{0x3d,0x27,0x81,0x3a,0x1a,0x72,0x3e,
2546	  0xdb,0x8f,0x5d,0x73,0x20,0x00,0x05,
2547	  0x00 }},
2548	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0xba,
2549	  0x1c,0x80,0xdf,0x73,0x00,0x00,0x05,
2550	  0x00 }},
2551	{{0x3d,0x31,0x81,0x37,0x1f,0x72,0xf0,
2552	  0x58,0x8c,0x57,0x73,0x20,0x00,0x05,
2553	  0x01 }}
2554};
2555
2556static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2_H[]=
2557{
2558	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2559	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2560	  0x00 }},
2561	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2562	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2563	  0x00 }},
2564	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2565	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2566	  0x00 }},
2567	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2568	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2569	  0x00 }},
2570	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2571	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
2572	  0x00 }},
2573	{{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
2574	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
2575	  0x01 }},
2576	{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2577	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2578	  0x01 }}
2579};
2580
2581static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2_H[]=
2582{
2583	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
2584	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2585	  0x00 }},
2586	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
2587	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2588	  0x00 }},
2589	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
2590	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2591	  0x00 }},
2592	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
2593	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2594	  0x00 }},
2595	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
2596	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
2597	  0x00 }},
2598	{{0x4f,0x31,0x93,0x3e,0x86,0x24,0xf1,
2599	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
2600	  0x01 }},
2601	{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2602	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2603	  0x01}}
2604};
2605
2606static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_1[] =
2607{
2608        {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
2609	  0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
2610	  0x00}},
2611        {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
2612	  0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
2613	  0x00}},
2614        {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
2615	  0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
2616	  0x00}},
2617        {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
2618	  0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
2619	  0x00}},
2620        {{0x64,0x4f,0x88,0x54,0x9f,0xaf,0xba,
2621	  0x3b,0x82,0xdf,0xb0,0x00,0x00,0x01,
2622	  0x00}},
2623        {{0x7e,0x63,0x82,0x68,0x15,0x1e,0xf1,
2624	  0xae,0x85,0x57,0x1f,0x30,0x00,0x26,
2625	  0x01}},
2626        {{0xa3,0x7f,0x87,0x86,0x97,0x1e,0xf1,
2627	  0xae,0x85,0x57,0x1f,0x30,0x00,0x02,
2628	  0x01}}
2629};
2630
2631static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_1_H[] =
2632{
2633        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
2634	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
2635	  0x00}},
2636        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
2637	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
2638          0x00}},
2639        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
2640	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
2641	  0x00}},
2642        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
2643	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
2644	  0x00}},
2645        {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
2646	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
2647	  0x00}},
2648        {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
2649	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
2650	  0x01}},
2651        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2652	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2653	  0x01}}
2654};
2655
2656static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_2[] =
2657{
2658        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2659	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2660	  0x00}},
2661        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2662	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2663	  0x00}},
2664        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2665	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2666	  0x00}},
2667        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2668          0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2669	  0x00}},
2670        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2671	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
2672	  0x00}},
2673        {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
2674	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
2675	  0x01}},
2676        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2677	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2678	  0x01}}
2679};
2680
2681static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x600_2_H[] =
2682{
2683        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2684	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2685	  0x00}},
2686        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2687	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2688	  0x00}},
2689        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2690	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2691	  0x00}},
2692        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2693	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2694	  0x00}},
2695        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2696	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
2697	  0x00}},
2698        {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
2699	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
2700	  0x01}},
2701        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2702	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2703	  0x01}}
2704};
2705
2706static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_1[] =
2707{
2708        {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
2709	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
2710	  0x00}},
2711        {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
2712	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
2713	  0x00}},
2714        {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
2715	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
2716	  0x00}},
2717        {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
2718	  0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
2719	  0x00}},
2720        {{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
2721	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
2722	  0x00}},
2723        {{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
2724	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
2725	  0x01}},
2726        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2727	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2728	  0x01}}
2729};
2730
2731static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_1_H[] =
2732{
2733        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
2734	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
2735	  0x00}},
2736        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
2737	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
2738	  0x00}},
2739        {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
2740	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
2741	  0x00}},
2742        {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
2743	  0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
2744	  0x00}},
2745        {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
2746	  0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
2747	  0x00}},
2748        {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
2749	  0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
2750	  0x01}},
2751        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2752	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2753	  0x01}}
2754};
2755
2756static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_2[] =
2757{
2758        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2759	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2760	  0x00}},
2761        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2762	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2763	  0x00}},
2764        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2765	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
2766	  0x00}},
2767        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2768	  0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
2769	  0x00}},
2770        {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
2771	  0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
2772	  0x00}},
2773        {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
2774	  0xae,0x84,0x57,0x25,0x30,0x00,0x02,
2775	  0x01}},
2776        {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
2777	  0x02,0x88,0xff,0x25,0x10,0x00,0x02,
2778	  0x01}}
2779};
2780
2781static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11152x768_2_H[] =
2782{
2783        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2784	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2785	  0x00}},
2786        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2787	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2788	  0x00}},
2789        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2790	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
2791	  0x00}},
2792        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2793	  0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
2794	  0x00}},
2795        {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
2796	  0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
2797	  0x00}},
2798        {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
2799	  0xae,0x84,0x57,0x25,0x30,0x00,0x01,
2800	  0x01}},
2801        {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
2802	  0x02,0x88,0xff,0x25,0x10,0x00,0x01,
2803	  0x01}}
2804};
2805
2806/* TW: New */
2807static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UNTSC[]=
2808{
2809	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2810	  0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
2811	  0x00 }},
2812	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2813	  0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
2814	  0x00 }},
2815	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2816	  0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
2817	  0x00 }},
2818	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
2819	  0xd0,0x82,0x5d,0x57,0x00,0x00,0x01,
2820	  0x00 }},
2821	{{0x5d,0x4f,0x81,0x53,0x9c,0x56,0xba,
2822	  0x18,0x84,0xdf,0x57,0x00,0x00,0x01,
2823	  0x00 }},
2824	{{0x80,0x63,0x84,0x6c,0x17,0xec,0xf0,
2825	  0x90,0x8c,0x57,0xed,0x20,0x00,0x06,
2826	  0x01 }}
2827};
2828
2829static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1ONTSC[]=
2830{
2831	{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
2832	  0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
2833	  0x00 }},
2834	{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
2835	  0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
2836	  0x00 }},
2837	{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
2838	  0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
2839	  0x00 }},
2840	{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
2841	  0xb0,0x8d,0x5d,0x0c,0x00,0x00,0x01,
2842	  0x00 }},
2843	{{0x5d,0x4f,0x81,0x56,0x9c,0x0b,0x3e,
2844	  0xe8,0x84,0xdf,0x0c,0x00,0x00,0x01,
2845	  0x00 }},
2846	{{0x7d,0x63,0x81,0x6a,0x16,0xba,0xf0,
2847	  0x7f,0x86,0x57,0xbb,0x00,0x00,0x06,
2848	  0x01 }}
2849};
2850
2851static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UPAL[]=
2852{
2853	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2854	  0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
2855	  0x00 }},
2856	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2857	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2858	  0x00 }},
2859	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2860	  0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
2861	  0x00 }},
2862	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2863	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2864	  0x00 }},
2865	{{0x64,0x4f,0x88,0x55,0x80,0xec,0xba,
2866	  0x50,0x84,0xdf,0xed,0x00,0x00,0x05,
2867	  0x00 }},
2868	{{0x70,0x63,0x94,0x68,0x8d,0x42,0xf1,
2869	  0xc8,0x8c,0x57,0xe9,0x20,0x00,0x05,
2870	  0x01 }}
2871};
2872
2873static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1OPAL[]=
2874{
2875	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2876	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
2877	  0x00 }},
2878	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2879	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2880	  0x00 }},
2881	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2882	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
2883	  0x00 }},
2884	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
2885	  0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
2886	  0x00 }},
2887	{{0x64,0x4f,0x88,0x55,0x80,0x6f,0xba,
2888	  0x20,0x83,0xdf,0x70,0x00,0x00,0x05,
2889	  0x00 }},
2890	{{0x73,0x63,0x97,0x69,0x8e,0xec,0xf0,
2891	  0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
2892	  0x01 }}
2893};
2894/* TW: New end */
2895
2896/* TW: New */
2897typedef struct _SiS300_CHTVRegDataStruct
2898{
2899	UCHAR Reg[16];
2900} SiS300_CHTVRegDataStruct;
2901
2902static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] = {
2903	{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2904	{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2905	{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2906	{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2907	{{0x6a,0x6a,0x00,0x2d,0xfa,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 17: 640x480 NTSC 7/8  */
2908	{{0x8d,0xc4,0x00,0x3b,0xfb,0,0,0,0,0,0,0,0,0,0,0}}  /* Mode 24: 800x600 NTSC 7/10 */
2909};
2910
2911static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] = {
2912	{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2913	{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2914	{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2915	{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
2916	{{0x69,0x6a,0x00,0x1e,0xfd,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 16: 640x480 NTSC 1/1 */
2917	{{0x8c,0xb4,0x00,0x32,0xf9,0,0,0,0,0,0,0,0,0,0,0}}  /* Mode 23: 800x600 NTSC 3/4 */
2918};
2919
2920static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] = {
2921	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
2922	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
2923	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
2924	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
2925	{{0x63,0x94,0x01,0x50,0x30,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 15: 640x480 PAL 5/6 */
2926	/* TW: For 800x600, 3/4 is VERY underscan */
2927	{{0x84,0x64,0x01,0x4e,0x2f,0,0,0,0,0,0,0,0,0,0,0}}  /* Mode 21: 800x600 PAL 3/4 */
2928	/* TW: Mode 20 is still underscan, use it instead? */
2929	/* {{0x83,0x76,0x01,0x40,0x31}} */ /* Mode 20: 800x600 PAL 5/6 */
2930};
2931
2932static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] = {
2933	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
2934	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
2935	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
2936	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
2937	{{0x61,0x94,0x01,0x36,0x30,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 14: 640x480 PAL 1/1 */
2938	{{0x83,0x76,0x01,0x40,0x31,0,0,0,0,0,0,0,0,0,0,0}}  /* Mode 20: 800x600 PAL 5/6 */
2939	/* {{0x81,0x12,0x01,0x50,0x34}}  */ /* TW: (test) Mode 19: 800x600 PAL 1/1 */
2940};
2941/* TW: New end */
2942
2943/* TW: New */
2944static const UCHAR SiS300_CHTVVCLKUNTSC[] = {0x29,0x29,0x29,0x29,0x2a,0x2e};
2945
2946static const UCHAR SiS300_CHTVVCLKONTSC[] = {0x2c,0x2c,0x2c,0x2c,0x2d,0x2b};
2947
2948static const UCHAR SiS300_CHTVVCLKUPAL[]  = {0x2f,0x2f,0x2f,0x2f,0x2f,0x31};
2949
2950static const UCHAR SiS300_CHTVVCLKOPAL[]  = {0x2f,0x2f,0x2f,0x2f,0x30,0x32};
2951/* TW: New end */
2952
2953
2954