Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vstruct.h
Go to the documentation of this file.
1 /* $XFree86$ */
2 /* $XdotOrg$ */
3 /*
4  * General structure definitions for universal mode switching modules
5  *
6  * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
7  *
8  * If distributed as part of the Linux kernel, the following license terms
9  * apply:
10  *
11  * * This program is free software; you can redistribute it and/or modify
12  * * it under the terms of the GNU General Public License as published by
13  * * the Free Software Foundation; either version 2 of the named License,
14  * * or any later version.
15  * *
16  * * This program is distributed in the hope that it will be useful,
17  * * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * * GNU General Public License for more details.
20  * *
21  * * You should have received a copy of the GNU General Public License
22  * * along with this program; if not, write to the Free Software
23  * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24  *
25  * Otherwise, the following license terms apply:
26  *
27  * * Redistribution and use in source and binary forms, with or without
28  * * modification, are permitted provided that the following conditions
29  * * are met:
30  * * 1) Redistributions of source code must retain the above copyright
31  * * notice, this list of conditions and the following disclaimer.
32  * * 2) Redistributions in binary form must reproduce the above copyright
33  * * notice, this list of conditions and the following disclaimer in the
34  * * documentation and/or other materials provided with the distribution.
35  * * 3) The name of the author may not be used to endorse or promote products
36  * * derived from this software without specific prior written permission.
37  * *
38  * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
39  * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40  * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
41  * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
42  * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43  * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44  * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
45  * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46  * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
47  * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48  *
49  * Author: Thomas Winischhofer <[email protected]>
50  *
51  */
52 
53 #ifndef _VSTRUCT_H_
54 #define _VSTRUCT_H_
55 
57  unsigned char timer[2];
58 };
59 
60 struct SiS_LCDData {
61  unsigned short RVBHCMAX;
62  unsigned short RVBHCFACT;
63  unsigned short VGAHT;
64  unsigned short VGAVT;
65  unsigned short LCDHT;
66  unsigned short LCDVT;
67 };
68 
69 struct SiS_TVData {
70  unsigned short RVBHCMAX;
71  unsigned short RVBHCFACT;
72  unsigned short VGAHT;
73  unsigned short VGAVT;
74  unsigned short TVHDE;
75  unsigned short TVVDE;
76  unsigned short RVBHRS;
77  unsigned char FlickerMode;
78  unsigned short HALFRVBHRS;
79  unsigned short RVBHRS2;
80  unsigned char RY1COE;
81  unsigned char RY2COE;
82  unsigned char RY3COE;
83  unsigned char RY4COE;
84 };
85 
86 struct SiS_LVDSData {
87  unsigned short VGAHT;
88  unsigned short VGAVT;
89  unsigned short LCDHT;
90  unsigned short LCDVT;
91 };
92 
93 struct SiS_LVDSDes {
94  unsigned short LCDHDES;
95  unsigned short LCDVDES;
96 };
97 
99  unsigned char CR[15];
100 };
101 
103  unsigned char Reg[16];
104 };
105 
106 struct SiS_St {
107  unsigned char St_ModeID;
108  unsigned short St_ModeFlag;
109  unsigned char St_StTableIndex;
110  unsigned char St_CRT2CRTC;
111  unsigned char St_ResInfo;
112  unsigned char VB_StTVFlickerIndex;
113  unsigned char VB_StTVEdgeIndex;
114  unsigned char VB_StTVYFilterIndex;
115  unsigned char St_PDC;
116 };
117 
118 struct SiS_VBMode {
119  unsigned char ModeID;
120  unsigned char VB_TVDelayIndex;
121  unsigned char VB_TVFlickerIndex;
122  unsigned char VB_TVPhaseIndex;
123  unsigned char VB_TVYFilterIndex;
124  unsigned char VB_LCDDelayIndex;
125  unsigned char _VB_LCDHIndex;
126  unsigned char _VB_LCDVIndex;
127 };
128 
130  unsigned char CRT_COLS;
131  unsigned char ROWS;
132  unsigned char CHAR_HEIGHT;
133  unsigned short CRT_LEN;
134  unsigned char SR[4];
135  unsigned char MISC;
136  unsigned char CRTC[0x19];
137  unsigned char ATTR[0x14];
138  unsigned char GRC[9];
139 };
140 
141 struct SiS_Ext {
142  unsigned char Ext_ModeID;
143  unsigned short Ext_ModeFlag;
144  unsigned short Ext_VESAID;
145  unsigned char Ext_RESINFO;
146  unsigned char VB_ExtTVFlickerIndex;
147  unsigned char VB_ExtTVEdgeIndex;
148  unsigned char VB_ExtTVYFilterIndex;
149  unsigned char VB_ExtTVYFilterIndexROM661;
150  unsigned char REFindex;
151  char ROMMODEIDX661;
152 };
153 
154 struct SiS_Ext2 {
155  unsigned short Ext_InfoFlag;
156  unsigned char Ext_CRT1CRTC;
157  unsigned char Ext_CRTVCLK;
158  unsigned char Ext_CRT2CRTC;
159  unsigned char Ext_CRT2CRTC_NS;
160  unsigned char ModeID;
161  unsigned short XRes;
162  unsigned short YRes;
163  unsigned char Ext_PDC;
164  unsigned char Ext_FakeCRT2CRTC;
165  unsigned char Ext_FakeCRT2Clk;
166  unsigned char Ext_CRT1CRTC_NORM;
167  unsigned char Ext_CRTVCLK_NORM;
168  unsigned char Ext_CRT1CRTC_WIDE;
169  unsigned char Ext_CRTVCLK_WIDE;
170 };
171 
173  unsigned char CR[12];
174 };
175 
176 struct SiS_CRT1Table {
177  unsigned char CR[17];
178 };
179 
180 struct SiS_MCLKData {
181  unsigned char SR28,SR29,SR2A;
182  unsigned short CLOCK;
183 };
184 
185 struct SiS_VCLKData {
186  unsigned char SR2B,SR2C;
187  unsigned short CLOCK;
188 };
189 
191  unsigned char Part4_A,Part4_B;
192  unsigned short CLOCK;
193 };
194 
195 struct SiS_StResInfo_S {
196  unsigned short HTotal;
197  unsigned short VTotal;
198 };
199 
201  unsigned short HTotal;
202  unsigned short VTotal;
203  unsigned char XChar;
204  unsigned char YChar;
205 };
206 
207 /* Defines for SiS_CustomT */
208 /* Never change these for sisfb compatibility */
209 #define CUT_NONE 0
210 #define CUT_FORCENONE 1
211 #define CUT_BARCO1366 2
212 #define CUT_BARCO1024 3
213 #define CUT_COMPAQ1280 4
214 #define CUT_COMPAQ12802 5
215 #define CUT_PANEL848 6
216 #define CUT_CLEVO1024 7
217 #define CUT_CLEVO10242 8
218 #define CUT_CLEVO1400 9
219 #define CUT_CLEVO14002 10
220 #define CUT_UNIWILL1024 11
221 #define CUT_ASUSL3000D 12
222 #define CUT_UNIWILL10242 13
223 #define CUT_ACER1280 14
224 #define CUT_COMPAL1400_1 15
225 #define CUT_COMPAL1400_2 16
226 #define CUT_ASUSA2H_1 17
227 #define CUT_ASUSA2H_2 18
228 #define CUT_UNKNOWNLCD 19
229 #define CUT_AOP8060 20
230 #define CUT_PANEL856 21
231 
232 struct SiS_Private
233 {
234  unsigned char ChipType;
235  unsigned char ChipRevision;
236  void *ivideo;
237  unsigned char *VirtualRomBase;
238  bool UseROM;
240  unsigned int VideoMemorySize;
242  SISIOADDRESS IOAddress2; /* For dual chip XGI volari */
243 
266  unsigned short SiS_IF_DEF_LVDS;
267  unsigned short SiS_IF_DEF_CH70xx;
268  unsigned short SiS_IF_DEF_CONEX;
269  unsigned short SiS_IF_DEF_TRUMPION;
270  unsigned short SiS_IF_DEF_DSTN;
271  unsigned short SiS_IF_DEF_FSTN;
272  unsigned short SiS_SysFlags;
273  unsigned char SiS_VGAINFO;
282  bool SiS_ChSW;
285  unsigned int SiS_CustomT;
288  unsigned short SiS_Backup70xx;
289  bool HaveEMI;
292  unsigned char EMI_30,EMI_31,EMI_32,EMI_33;
293  unsigned short SiS_EMIOffset;
294  unsigned short SiS_PWDOffset;
295  short PDC, PDCA;
296  unsigned char SiS_MyCR63;
297  unsigned short SiS_CRT1Mode;
298  unsigned short SiS_flag_clearbuffer;
300  unsigned char SiS_ChannelAB;
301  unsigned char SiS_DataBusWidth;
302  unsigned short SiS_ModeType;
303  unsigned short SiS_VBInfo;
304  unsigned short SiS_TVMode;
305  unsigned short SiS_LCDResInfo;
306  unsigned short SiS_LCDTypeInfo;
307  unsigned short SiS_LCDInfo;
308  unsigned short SiS_LCDInfo661;
309  unsigned short SiS_VBType;
310  unsigned short SiS_VBExtInfo;
311  unsigned short SiS_YPbPr;
312  unsigned short SiS_SelectCRT2Rate;
313  unsigned short SiS_SetFlag;
314  unsigned short SiS_RVBHCFACT;
315  unsigned short SiS_RVBHCMAX;
316  unsigned short SiS_RVBHRS;
317  unsigned short SiS_RVBHRS2;
318  unsigned short SiS_VGAVT;
319  unsigned short SiS_VGAHT;
320  unsigned short SiS_VT;
321  unsigned short SiS_HT;
322  unsigned short SiS_VGAVDE;
323  unsigned short SiS_VGAHDE;
324  unsigned short SiS_VDE;
325  unsigned short SiS_HDE;
326  unsigned short SiS_NewFlickerMode;
327  unsigned short SiS_RY1COE;
328  unsigned short SiS_RY2COE;
329  unsigned short SiS_RY3COE;
330  unsigned short SiS_RY4COE;
331  unsigned short SiS_LCDHDES;
332  unsigned short SiS_LCDVDES;
334  unsigned short SiS_DDC_Index;
335  unsigned short SiS_DDC_Data;
336  unsigned short SiS_DDC_NData;
337  unsigned short SiS_DDC_Clk;
338  unsigned short SiS_DDC_NClk;
339  unsigned short SiS_DDC_DeviceAddr;
340  unsigned short SiS_DDC_ReadAddr;
341  unsigned short SiS_DDC_SecAddr;
342  unsigned short SiS_ChrontelInit;
344  unsigned short SiS661LCD2TableSize;
345 
346  unsigned short SiS_PanelMinLVDS;
347  unsigned short SiS_PanelMin301;
348 
349  const struct SiS_St *SiS_SModeIDTable;
351  const struct SiS_Ext *SiS_EModeIDTable;
352  const struct SiS_Ext2 *SiS_RefIndex;
354  const struct SiS_CRT1Table *SiS_CRT1Table;
357  struct SiS_VCLKData *SiS_VCLKData;
361 
362  const unsigned char *pSiS_OutputSelect;
363  const unsigned char *pSiS_SoftSetting;
364 
365  const unsigned char *SiS_SR15;
366 
369 
370  /* SiS bridge */
371 
389  const struct SiS_TVData *SiS_StPALData;
390  const struct SiS_TVData *SiS_ExtPALData;
391  const struct SiS_TVData *SiS_StNTSCData;
396  const struct SiS_TVData *SiS_St525iData;
397  const struct SiS_TVData *SiS_St525pData;
398  const struct SiS_TVData *SiS_St750pData;
402  const unsigned char *SiS_NTSCTiming;
403  const unsigned char *SiS_PALTiming;
404  const unsigned char *SiS_HiTVExtTiming;
405  const unsigned char *SiS_HiTVSt1Timing;
406  const unsigned char *SiS_HiTVSt2Timing;
407  const unsigned char *SiS_HiTVGroup3Data;
408  const unsigned char *SiS_HiTVGroup3Simu;
409 #if 0
410  const unsigned char *SiS_HiTVTextTiming;
411  const unsigned char *SiS_HiTVGroup3Text;
412 #endif
413 
417 
418  /* LVDS, Chrontel */
419 
440 
445 
458 
468 
469  const unsigned char *SiS_CHTVVCLKUNTSC;
470  const unsigned char *SiS_CHTVVCLKONTSC;
471  const unsigned char *SiS_CHTVVCLKUPAL;
472  const unsigned char *SiS_CHTVVCLKOPAL;
473  const unsigned char *SiS_CHTVVCLKUPALM;
474  const unsigned char *SiS_CHTVVCLKOPALM;
475  const unsigned char *SiS_CHTVVCLKUPALN;
476  const unsigned char *SiS_CHTVVCLKOPALN;
477  const unsigned char *SiS_CHTVVCLKSOPAL;
478 
479  unsigned short PanelXRes, PanelHT;
480  unsigned short PanelYRes, PanelVT;
481  unsigned short PanelHRS, PanelHRE;
482  unsigned short PanelVRS, PanelVRE;
483  unsigned short PanelVCLKIdx300;
484  unsigned short PanelVCLKIdx315;
486 
489  unsigned short CHDisplay;
490  unsigned short CHSyncStart;
491  unsigned short CHSyncEnd;
492  unsigned short CHTotal;
493  unsigned short CHBlankStart;
494  unsigned short CHBlankEnd;
495  unsigned short CVDisplay;
496  unsigned short CVSyncStart;
497  unsigned short CVSyncEnd;
498  unsigned short CVTotal;
499  unsigned short CVBlankStart;
500  unsigned short CVBlankEnd;
501  unsigned int CDClock;
502  unsigned int CFlags;
503  unsigned char CCRT1CRTC[17];
504  unsigned char CSR2B;
505  unsigned char CSR2C;
506  unsigned short CSRClock;
507  unsigned short CSRClock_CRT1;
508  unsigned short CModeFlag;
509  unsigned short CModeFlag_CRT1;
510  unsigned short CInfoFlag;
511 
512  int LVDSHL;
513 
514  bool Backup;
515  unsigned char Backup_Mode;
516  unsigned char Backup_14;
517  unsigned char Backup_15;
518  unsigned char Backup_16;
519  unsigned char Backup_17;
520  unsigned char Backup_18;
521  unsigned char Backup_19;
522  unsigned char Backup_1a;
523  unsigned char Backup_1b;
524  unsigned char Backup_1c;
525  unsigned char Backup_1d;
526 
527  unsigned char Init_P4_0E;
528 
531 
532  unsigned short CP_Vendor, CP_Product;
536  unsigned char CP_PrefSR2B, CP_PrefSR2C;
537  unsigned short CP_PrefClock;
539  int CP_HDisplay[7], CP_VDisplay[7]; /* For Custom LCD panel dimensions */
540  int CP_HTotal[7], CP_VTotal[7];
545  int CP_Clock[7];
546  bool CP_DataValid[7];
548 };
549 
550 #endif
551