1/* Copyright (C) 2003-2006 by XGI Technology, Taiwan.
2 *
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation on the rights to use, copy, modify, merge,
9 * publish, distribute, sublicense, and/or sell copies of the Software,
10 * and to permit persons to whom the Software is furnished to do so,
11 * subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial
15 * portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NON-INFRINGEMENT.  IN NO EVENT SHALL XGI AND/OR
21 *  ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 */
26
27
28#ifndef _VB_STRUCT_
29#define _VB_STRUCT_
30
31
32typedef struct _XGI_PanelDelayTblStruct
33{
34 UCHAR timer[2];
35} XGI_PanelDelayTblStruct;
36
37typedef struct _XGI_LCDDataStruct
38{
39 USHORT RVBHCMAX;
40 USHORT RVBHCFACT;
41 USHORT VGAHT;
42 USHORT VGAVT;
43 USHORT LCDHT;
44 USHORT LCDVT;
45} XGI_LCDDataStruct;
46
47
48typedef struct _XGI_LVDSCRT1HDataStruct
49{
50 UCHAR Reg[8];
51} XGI_LVDSCRT1HDataStruct;
52typedef struct _XGI_LVDSCRT1VDataStruct
53{
54 UCHAR Reg[7];
55} XGI_LVDSCRT1VDataStruct;
56
57
58typedef struct _XGI_TVDataStruct
59{
60 USHORT RVBHCMAX;
61 USHORT RVBHCFACT;
62 USHORT VGAHT;
63 USHORT VGAVT;
64 USHORT TVHDE;
65 USHORT TVVDE;
66 USHORT RVBHRS;
67 UCHAR FlickerMode;
68 USHORT HALFRVBHRS;
69 UCHAR RY1COE;
70 UCHAR RY2COE;
71 UCHAR RY3COE;
72 UCHAR RY4COE;
73} XGI_TVDataStruct;
74
75typedef struct _XGI_LVDSDataStruct
76{
77 USHORT VGAHT;
78 USHORT VGAVT;
79 USHORT LCDHT;
80 USHORT LCDVT;
81} XGI_LVDSDataStruct;
82
83typedef struct _XGI_LVDSDesStruct
84{
85 USHORT LCDHDES;
86 USHORT LCDVDES;
87} XGI_LVDSDesStruct;
88
89typedef struct _XGI_LVDSCRT1DataStruct
90{
91 UCHAR CR[15];
92} XGI_LVDSCRT1DataStruct;
93
94/*add for LCDA*/
95
96
97typedef struct _XGI_StStruct
98{
99 UCHAR St_ModeID;
100 USHORT St_ModeFlag;
101 UCHAR St_StTableIndex;
102 UCHAR St_CRT2CRTC;
103 UCHAR St_CRT2CRTC2;
104 UCHAR St_ResInfo;
105 UCHAR VB_StTVFlickerIndex;
106 UCHAR VB_StTVEdgeIndex;
107 UCHAR VB_StTVYFilterIndex;
108} XGI_StStruct;
109
110typedef struct _XGI_StandTableStruct
111{
112 UCHAR CRT_COLS;
113 UCHAR ROWS;
114 UCHAR CHAR_HEIGHT;
115 USHORT CRT_LEN;
116 UCHAR SR[4];
117 UCHAR MISC;
118 UCHAR CRTC[0x19];
119 UCHAR ATTR[0x14];
120 UCHAR GRC[9];
121} XGI_StandTableStruct;
122
123typedef struct _XGI_ExtStruct
124{
125 UCHAR Ext_ModeID;
126 USHORT Ext_ModeFlag;
127 USHORT Ext_ModeInfo;
128 USHORT Ext_Point;
129 USHORT Ext_VESAID;
130 UCHAR Ext_VESAMEMSize;
131 UCHAR Ext_RESINFO;
132 UCHAR VB_ExtTVFlickerIndex;
133 UCHAR VB_ExtTVEdgeIndex;
134 UCHAR VB_ExtTVYFilterIndex;
135 UCHAR REFindex;
136} XGI_ExtStruct;
137
138typedef struct _XGI_Ext2Struct
139{
140 USHORT Ext_InfoFlag;
141 UCHAR Ext_CRT1CRTC;
142 UCHAR Ext_CRTVCLK;
143 UCHAR Ext_CRT2CRTC;
144 UCHAR Ext_CRT2CRTC2;
145 UCHAR  ModeID;
146 USHORT XRes;
147 USHORT YRes;
148 /* USHORT ROM_OFFSET; */
149} XGI_Ext2Struct;
150
151
152typedef struct _XGI_MCLKDataStruct
153{
154 UCHAR SR28,SR29,SR2A;
155 USHORT CLOCK;
156} XGI_MCLKDataStruct;
157
158typedef struct _XGI_ECLKDataStruct
159{
160 UCHAR SR2E,SR2F,SR30;
161 USHORT CLOCK;
162} XGI_ECLKDataStruct;
163
164typedef struct _XGI_VCLKDataStruct
165{
166 UCHAR SR2B,SR2C;
167 USHORT CLOCK;
168} XGI_VCLKDataStruct;
169
170typedef struct _XGI_VBVCLKDataStruct
171{
172 UCHAR Part4_A,Part4_B;
173 USHORT CLOCK;
174} XGI_VBVCLKDataStruct;
175
176typedef struct _XGI_StResInfoStruct
177{
178 USHORT HTotal;
179 USHORT VTotal;
180} XGI_StResInfoStruct;
181
182typedef struct _XGI_ModeResInfoStruct
183{
184 USHORT HTotal;
185 USHORT VTotal;
186 UCHAR  XChar;
187 UCHAR  YChar;
188} XGI_ModeResInfoStruct;
189
190typedef struct _XGI_LCDNBDesStruct
191{
192  UCHAR NB[12];
193} XGI_LCDNBDesStruct;
194 /*add for new UNIVGABIOS*/
195typedef struct _XGI_LCDDesStruct
196{
197 USHORT LCDHDES;
198 USHORT LCDHRS;
199 USHORT LCDVDES;
200 USHORT LCDVRS;
201} XGI_LCDDesStruct;
202
203typedef struct _XGI_LCDDataTablStruct
204{
205 UCHAR  PANELID;
206 USHORT MASK;
207 USHORT CAP;
208 USHORT DATAPTR;
209} XGI_LCDDataTablStruct;
210
211typedef struct _XGI_TVTablDataStruct
212{
213 USHORT MASK;
214 USHORT CAP;
215 USHORT DATAPTR;
216} XGI_TVDataTablStruct;
217
218typedef struct _XGI330_LCDDesDataStruct
219{
220 USHORT LCDHDES;
221 USHORT LCDHRS;
222 USHORT LCDVDES;
223 USHORT LCDVRS;
224} XGI330_LCDDataDesStruct;
225
226
227typedef struct _XGI330_LVDSDataStruct
228{
229 USHORT VGAHT;
230 USHORT VGAVT;
231 USHORT LCDHT;
232 USHORT LCDVT;
233} XGI330_LVDSDataStruct;
234
235typedef struct _XGI330_LCDDesDataStruct2
236{
237 USHORT LCDHDES;
238 USHORT LCDHRS;
239 USHORT LCDVDES;
240 USHORT LCDVRS;
241 USHORT LCDHSync;
242 USHORT LCDVSync;
243} XGI330_LCDDataDesStruct2;
244
245typedef struct _XGI330_LCDDataStruct
246{
247 USHORT RVBHCMAX;
248 USHORT RVBHCFACT;
249 USHORT VGAHT;
250 USHORT VGAVT;
251 USHORT LCDHT;
252 USHORT LCDVT;
253} XGI330_LCDDataStruct;
254
255
256typedef struct _XGI330_TVDataStruct
257{
258 USHORT RVBHCMAX;
259 USHORT RVBHCFACT;
260 USHORT VGAHT;
261 USHORT VGAVT;
262 USHORT TVHDE;
263 USHORT TVVDE;
264 USHORT RVBHRS;
265 UCHAR FlickerMode;
266 USHORT HALFRVBHRS;
267} XGI330_TVDataStruct;
268
269typedef struct _XGI330_LCDDataTablStruct
270{
271 UCHAR  PANELID;
272 USHORT MASK;
273 USHORT CAP;
274 USHORT DATAPTR;
275} XGI330_LCDDataTablStruct;
276
277typedef struct _XGI330_TVDataTablStruct
278{
279 USHORT MASK;
280 USHORT CAP;
281 USHORT DATAPTR;
282} XGI330_TVDataTablStruct;
283
284
285typedef struct _XGI330_CHTVDataStruct
286{
287 USHORT VGAHT;
288 USHORT VGAVT;
289 USHORT LCDHT;
290 USHORT LCDVT;
291} XGI330_CHTVDataStruct;
292
293typedef struct _XGI_TimingHStruct
294{
295  UCHAR data[8];
296} XGI_TimingHStruct;
297
298typedef struct _XGI_TimingVStruct
299{
300  UCHAR data[7];
301} XGI_TimingVStruct;
302
303/* Jong 10/04/2007; merge code */
304typedef struct _XGI_CH7007TV_TimingHStruct
305{
306  UCHAR data[10];
307} XGI_CH7007TV_TimingHStruct;
308
309/* Jong 10/04/2007; merge code */
310typedef struct _XGI_CH7007TV_TimingVStruct
311{
312  UCHAR data[10];
313} XGI_CH7007TV_TimingVStruct;
314
315/* Jong 10/04/2007; merge code */
316typedef struct _XGI_XG21CRT1Struct
317{
318 UCHAR ModeID,CR02,CR03,CR15,CR16;
319} XGI_XG21CRT1Struct;
320
321typedef struct _XGI330_CHTVRegDataStruct
322{
323 UCHAR Reg[16];
324} XGI330_CHTVRegDataStruct;
325
326typedef struct _XGI330_LCDCapStruct
327{
328 		UCHAR      LCD_ID;
329                USHORT     LCD_Capability;
330                UCHAR      LCD_SetFlag;
331                UCHAR      LCD_DelayCompensation;
332                UCHAR      LCD_HSyncWidth;
333                UCHAR      LCD_VSyncWidth;
334                UCHAR      LCD_VCLK;
335                UCHAR      LCDA_VCLKData1;
336                UCHAR      LCDA_VCLKData2;
337                UCHAR      LCUCHAR_VCLKData1;
338                UCHAR      LCUCHAR_VCLKData2;
339                UCHAR      PSC_S1;
340                UCHAR      PSC_S2;
341                UCHAR      PSC_S3;
342                UCHAR      PSC_S4;
343                UCHAR      PSC_S5;
344                UCHAR      PWD_2B;
345                UCHAR      PWD_2C;
346                UCHAR      PWD_2D;
347                UCHAR      PWD_2E;
348                UCHAR      PWD_2F;
349                UCHAR      Spectrum_31;
350                UCHAR      Spectrum_32;
351                UCHAR      Spectrum_33;
352                UCHAR      Spectrum_34;
353} XGI330_LCDCapStruct;
354
355/* Jong 10/04/2007; merge code */
356typedef struct _XGI21_LVDSCapStruct
357{
358                USHORT     LVDS_Capability;
359                USHORT     LVDSHT;
360                USHORT     LVDSVT;
361                USHORT     LVDSHDE;
362                USHORT     LVDSVDE;
363                USHORT     LVDSHFP;
364                USHORT     LVDSVFP;
365                USHORT     LVDSHSYNC;
366                USHORT     LVDSVSYNC;
367                UCHAR      VCLKData1;
368                UCHAR      VCLKData2;
369                UCHAR      PSC_S1;
370                UCHAR      PSC_S2;
371                UCHAR      PSC_S3;
372                UCHAR      PSC_S4;
373                UCHAR      PSC_S5;
374} XGI21_LVDSCapStruct;
375
376typedef struct _XGI_CRT1TableStruct
377{
378  UCHAR CR[15];
379} XGI_CRT1TableStruct;
380
381
382typedef struct _XGI330_VCLKDataStruct
383{
384    UCHAR SR2B,SR2C;
385    USHORT CLOCK;
386} XGI330_VCLKDataStruct;
387
388typedef struct _XGI301C_Tap4TimingStruct
389{
390    USHORT DE;
391    UCHAR  Reg[64];   /* C0-FF */
392} XGI301C_Tap4TimingStruct;
393
394typedef struct _XGI_New_StandTableStruct
395{
396	UCHAR  CRT_COLS;
397	UCHAR  ROWS;
398	UCHAR  CHAR_HEIGHT;
399	USHORT CRT_LEN;
400	UCHAR  SR[4];
401	UCHAR  MISC;
402	UCHAR  CRTC[0x19];
403	UCHAR  ATTR[0x14];
404	UCHAR  GRC[9];
405} XGI_New_StandTableStruct;
406
407typedef UCHAR DRAM8Type[8];
408typedef UCHAR DRAM4Type[4];
409typedef UCHAR DRAM32Type[32];
410typedef UCHAR DRAM2Type[2];
411
412typedef struct _VB_DEVICE_INFO  VB_DEVICE_INFO,*PVB_DEVICE_INFO;
413
414#define AGP_REG_SIZE 12
415#define CR40_SIZE    24
416#define CR6B_SIZE    8
417#define CR6E_SIZE    8
418#define CR6F_SIZE    8
419#define CR89_SIZE    8
420#define SR15_SIZE    4
421#define MCLK_SIZE    8
422#define ECLK_SIZE    8
423
424struct _VB_DEVICE_INFO
425{
426    BOOLEAN  ISXPDOS;
427
428    ULONG   P3c4,P3d4,P3c0,P3ce,P3c2,P3cc;
429    ULONG   P3ca,P3c6,P3c7,P3c8,P3c9,P3da;
430    ULONG   Part0Port,Part1Port,Part2Port;
431    ULONG   Part3Port,Part4Port,Part5Port;
432    ULONG   RVBHCFACT,RVBHCMAX,RVBHRS;
433    ULONG   VGAVT,VGAHT,VGAVDE,VGAHDE;
434    ULONG   VT,HT,VDE,HDE;
435    ULONG   LCDHRS,LCDVRS,LCDHDES,LCDVDES;
436	/*
437    USHORT   P3c4,P3d4,P3c0,P3ce,P3c2,P3cc;
438    USHORT   P3ca,P3c6,P3c7,P3c8,P3c9,P3da;
439    USHORT   Part0Port,Part1Port,Part2Port;
440    USHORT   Part3Port,Part4Port,Part5Port;
441    USHORT   RVBHCFACT,RVBHCMAX,RVBHRS;
442    USHORT   VGAVT,VGAHT,VGAVDE,VGAHDE;
443    USHORT   VT,HT,VDE,HDE;
444    USHORT   LCDHRS,LCDVRS,LCDHDES,LCDVDES; */
445
446    USHORT   ModeType;
447    USHORT   IF_DEF_TRUMPION,IF_DEF_DSTN;
448    USHORT   IF_DEF_CRT2Monitor,IF_DEF_VideoCapture;
449    USHORT   IF_DEF_CH7017,IF_DEF_LCDA,IF_DEF_YPbPr,IF_DEF_ScaleLCD,IF_DEF_OEMUtil,IF_DEF_PWD;
450    USHORT   IF_DEF_ExpLink;
451    USHORT   IF_DEF_CH7005,IF_DEF_HiVision; /* Jong 10/08/2007; merge code */
452    USHORT   IF_DEF_CH7007; /* Jong 10/04/2007; merge code */
453    USHORT   LCDResInfo,LCDTypeInfo, VBType;/*301b*/
454    USHORT   VBInfo,TVInfo,LCDInfo;
455    USHORT   VBExtInfo;/*301lv*/
456    USHORT   SetFlag;
457    USHORT   NewFlickerMode;
458    USHORT   SelectCRT2Rate;
459
460    PUCHAR ROMAddr;
461    PUCHAR FBAddr;
462    ULONG BaseAddr;
463    /* USHORT BaseAddr; */
464    XGIIOADDRESS RelIO;
465
466    DRAM4Type  CR6B[CR6B_SIZE];
467
468    UCHAR  XG45CR6E[CR6E_SIZE];
469    UCHAR  XG45CR6F[CR6F_SIZE];
470    DRAM4Type  CR6E[CR6E_SIZE];
471    DRAM32Type CR6F[CR6F_SIZE];
472    DRAM2Type  CR89[CR89_SIZE];
473
474    DRAM8Type  SR15[SR15_SIZE]; /* pointer : point to array */
475    DRAM8Type  CR40[CR40_SIZE];
476    UCHAR  SoftSetting;
477    UCHAR  OutputSelect;
478
479	USHORT IF_DEF_LVDS; /* Jong 10/05/2007; merge code */
480
481    const USHORT *pRGBSenseData;
482    const USHORT *pRGBSenseData2; /*301b*/
483    const USHORT *pVideoSenseData;
484    const USHORT *pVideoSenseData2;
485    const USHORT *pYCSenseData;
486    const USHORT *pYCSenseData2;
487
488    UCHAR  SR07;
489    UCHAR  CR49[2];
490    UCHAR  SR1F;
491    UCHAR  AGPReg[AGP_REG_SIZE];
492    UCHAR  SR16[4];
493    UCHAR  SR21;
494    UCHAR  SR22;
495    UCHAR  SR23;
496    UCHAR  SR24;
497    UCHAR  SR25[2];
498    UCHAR  SR31;
499    UCHAR  SR32;
500    UCHAR  SR33;
501
502	/* Jong 10/05/2007; merge code */
503    UCHAR  *pSR36;
504    UCHAR  CRCF;
505    UCHAR  *pCRD0;
506    UCHAR  *pCRDE;
507    UCHAR  *pCR8F;
508    UCHAR  *pSR40;
509    UCHAR  *pSR41;
510    UCHAR  *pDVOSetting;
511    UCHAR  *pCR2E;
512    UCHAR  *pCR2F;
513    UCHAR  *pCR46;
514    UCHAR  *pCR47;
515
516    UCHAR  CRT2Data_1_2;
517    UCHAR  CRT2Data_4_D;
518    UCHAR  CRT2Data_4_E;
519    UCHAR  CRT2Data_4_10;
520    XGI_MCLKDataStruct  MCLKData[MCLK_SIZE];
521    XGI_ECLKDataStruct  ECLKData[ECLK_SIZE];
522
523    const UCHAR   *XGI_TVDelayList;
524    const UCHAR   *XGI_TVDelayList2;
525    const UCHAR   *CHTVVCLKUNTSC;
526    const UCHAR   *CHTVVCLKONTSC;
527    const UCHAR   *CHTVVCLKUPAL;
528    const UCHAR   *CHTVVCLKOPAL;
529    const UCHAR   *NTSCTiming;
530    const UCHAR   *PALTiming;
531    const UCHAR   *HiTVExtTiming;
532    const UCHAR   *HiTVSt1Timing;
533    const UCHAR   *HiTVSt2Timing;
534    const UCHAR   *HiTVTextTiming;
535    const UCHAR   *YPbPr750pTiming;
536    const UCHAR   *YPbPr525pTiming;
537    const UCHAR   *YPbPr525iTiming;
538    const UCHAR   *HiTVGroup3Data;
539    const UCHAR   *HiTVGroup3Simu;
540    const UCHAR   *HiTVGroup3Text;
541    const UCHAR   *Ren525pGroup3;
542    const UCHAR   *Ren750pGroup3;
543    const UCHAR   *ScreenOffset;
544    UCHAR   DRAMTypeDefinition;
545    UCHAR   I2CDefinition;
546    UCHAR   CR97;
547
548    const XGI330_LCDCapStruct  *LCDCapList;
549    XGI21_LVDSCapStruct  *XG21_LVDSCapList; /* Jong 10/05/2007; merge code */
550
551    XGI_TimingHStruct  TimingH;
552    XGI_TimingVStruct  TimingV;
553
554    const XGI_StStruct          *SModeIDTable;
555    const XGI_StandTableStruct  *StandTable;
556    const XGI_ExtStruct         *EModeIDTable;
557    const XGI_Ext2Struct        *RefIndex;
558    /* XGINew_CRT1TableStruct *CRT1Table; */
559    const XGI_CRT1TableStruct    *XGINEWUB_CRT1Table;
560    const XGI_VCLKDataStruct    *VCLKData;
561    const XGI_VBVCLKDataStruct  *VBVCLKData;
562    const XGI_StResInfoStruct   *StResInfo;
563    const XGI_ModeResInfoStruct *ModeResInfo;
564    XGI_XG21CRT1Struct			*UpdateCRT1;  /* Jong 10/05/2007; merge code */
565};  /* _VB_DEVICE_INFO */
566
567/* Jong 10/04/2007; merge code */
568typedef struct
569{
570    USHORT    Horizontal_ACTIVE;
571    USHORT    Horizontal_FP;
572    USHORT    Horizontal_SYNC;
573    USHORT    Horizontal_BP;
574    USHORT    Vertical_ACTIVE;
575    USHORT    Vertical_FP;
576    USHORT    Vertical_SYNC;
577    USHORT    Vertical_BP;
578    double    DCLK;
579    UCHAR     FrameRate;
580    UCHAR     Interlace;
581    USHORT    Margin;
582} TimingInfo;
583
584#define _VB_STRUCT_
585#endif /* _VB_STRUCT_ */
586