4 * General structure definitions for universal mode switching modules
6 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
8 * If distributed as part of the Linux kernel, the following license terms
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.
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.
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
25 * Otherwise, the following license terms apply:
27 * * Redistribution and use in source and binary forms, with or without
28 * * modification, are permitted provided that the following conditions
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.
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.
49 * Author: Thomas Winischhofer <thomas@winischhofer.net>
56 struct SiS_PanelDelayTbl
{
57 unsigned char timer
[2];
61 unsigned short RVBHCMAX
;
62 unsigned short RVBHCFACT
;
70 unsigned short RVBHCMAX
;
71 unsigned short RVBHCFACT
;
76 unsigned short RVBHRS
;
77 unsigned char FlickerMode
;
78 unsigned short HALFRVBHRS
;
79 unsigned short RVBHRS2
;
94 unsigned short LCDHDES
;
95 unsigned short LCDVDES
;
98 struct SiS_LVDSCRT1Data
{
102 struct SiS_CHTVRegData
{
103 unsigned char Reg
[16];
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
;
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
;
129 struct SiS_StandTable_S
{
130 unsigned char CRT_COLS
;
132 unsigned char CHAR_HEIGHT
;
133 unsigned short CRT_LEN
;
136 unsigned char CRTC
[0x19];
137 unsigned char ATTR
[0x14];
138 unsigned char GRC
[9];
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
;
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
;
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
;
172 struct SiS_Part2PortTbl
{
173 unsigned char CR
[12];
176 struct SiS_CRT1Table
{
177 unsigned char CR
[17];
180 struct SiS_MCLKData
{
181 unsigned char SR28
,SR29
,SR2A
;
182 unsigned short CLOCK
;
185 struct SiS_VCLKData
{
186 unsigned char SR2B
,SR2C
;
187 unsigned short CLOCK
;
190 struct SiS_VBVCLKData
{
191 unsigned char Part4_A
,Part4_B
;
192 unsigned short CLOCK
;
195 struct SiS_StResInfo_S
{
196 unsigned short HTotal
;
197 unsigned short VTotal
;
200 struct SiS_ModeResInfo_S
{
201 unsigned short HTotal
;
202 unsigned short VTotal
;
207 /* Defines for SiS_CustomT */
208 /* Never change these for sisfb compatibility */
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
234 unsigned char ChipType
;
235 unsigned char ChipRevision
;
239 #ifdef SIS_LINUX_KERNEL
242 unsigned char *VirtualRomBase
;
244 #ifdef SIS_LINUX_KERNEL
245 unsigned char SISIOMEMTYPE
*VideoMemoryAddress
;
246 unsigned int VideoMemorySize
;
248 SISIOADDRESS IOAddress
;
249 SISIOADDRESS IOAddress2
; /* For dual chip XGI volari */
251 #ifdef SIS_LINUX_KERNEL
254 SISIOADDRESS SiS_P3c4
;
255 SISIOADDRESS SiS_P3d4
;
256 SISIOADDRESS SiS_P3c0
;
257 SISIOADDRESS SiS_P3ce
;
258 SISIOADDRESS SiS_P3c2
;
259 SISIOADDRESS SiS_P3ca
;
260 SISIOADDRESS SiS_P3c6
;
261 SISIOADDRESS SiS_P3c7
;
262 SISIOADDRESS SiS_P3c8
;
263 SISIOADDRESS SiS_P3c9
;
264 SISIOADDRESS SiS_P3cb
;
265 SISIOADDRESS SiS_P3cc
;
266 SISIOADDRESS SiS_P3cd
;
267 SISIOADDRESS SiS_P3da
;
268 SISIOADDRESS SiS_Part1Port
;
269 SISIOADDRESS SiS_Part2Port
;
270 SISIOADDRESS SiS_Part3Port
;
271 SISIOADDRESS SiS_Part4Port
;
272 SISIOADDRESS SiS_Part5Port
;
273 SISIOADDRESS SiS_VidCapt
;
274 SISIOADDRESS SiS_VidPlay
;
275 unsigned short SiS_IF_DEF_LVDS
;
276 unsigned short SiS_IF_DEF_CH70xx
;
277 unsigned short SiS_IF_DEF_CONEX
;
278 unsigned short SiS_IF_DEF_TRUMPION
;
279 unsigned short SiS_IF_DEF_DSTN
;
280 unsigned short SiS_IF_DEF_FSTN
;
281 unsigned short SiS_SysFlags
;
282 unsigned char SiS_VGAINFO
;
284 unsigned short SiS_CP1
, SiS_CP2
, SiS_CP3
, SiS_CP4
;
289 bool SiS_NeedRomModeData
;
290 bool PanelSelfDetected
;
293 bool SiS_CHSOverScan
;
297 unsigned int SiS_CustomT
;
298 int SiS_UseWide
, SiS_UseWideCRT2
;
300 unsigned short SiS_Backup70xx
;
304 unsigned char EMI_30
,EMI_31
,EMI_32
,EMI_33
;
305 unsigned short SiS_EMIOffset
;
306 unsigned short SiS_PWDOffset
;
308 unsigned char SiS_MyCR63
;
309 unsigned short SiS_CRT1Mode
;
310 unsigned short SiS_flag_clearbuffer
;
312 unsigned char SiS_ChannelAB
;
313 unsigned char SiS_DataBusWidth
;
314 unsigned short SiS_ModeType
;
315 unsigned short SiS_VBInfo
;
316 unsigned short SiS_TVMode
;
317 unsigned short SiS_LCDResInfo
;
318 unsigned short SiS_LCDTypeInfo
;
319 unsigned short SiS_LCDInfo
;
320 unsigned short SiS_LCDInfo661
;
321 unsigned short SiS_VBType
;
322 unsigned short SiS_VBExtInfo
;
323 unsigned short SiS_YPbPr
;
324 unsigned short SiS_SelectCRT2Rate
;
325 unsigned short SiS_SetFlag
;
326 unsigned short SiS_RVBHCFACT
;
327 unsigned short SiS_RVBHCMAX
;
328 unsigned short SiS_RVBHRS
;
329 unsigned short SiS_RVBHRS2
;
330 unsigned short SiS_VGAVT
;
331 unsigned short SiS_VGAHT
;
332 unsigned short SiS_VT
;
333 unsigned short SiS_HT
;
334 unsigned short SiS_VGAVDE
;
335 unsigned short SiS_VGAHDE
;
336 unsigned short SiS_VDE
;
337 unsigned short SiS_HDE
;
338 unsigned short SiS_NewFlickerMode
;
339 unsigned short SiS_RY1COE
;
340 unsigned short SiS_RY2COE
;
341 unsigned short SiS_RY3COE
;
342 unsigned short SiS_RY4COE
;
343 unsigned short SiS_LCDHDES
;
344 unsigned short SiS_LCDVDES
;
345 unsigned short SiS_DDC_Port
;
346 unsigned short SiS_DDC_Index
;
347 unsigned short SiS_DDC_Data
;
348 unsigned short SiS_DDC_NData
;
349 unsigned short SiS_DDC_Clk
;
350 unsigned short SiS_DDC_NClk
;
351 unsigned short SiS_DDC_DeviceAddr
;
352 unsigned short SiS_DDC_ReadAddr
;
353 unsigned short SiS_DDC_SecAddr
;
354 unsigned short SiS_ChrontelInit
;
355 bool SiS_SensibleSR11
;
356 unsigned short SiS661LCD2TableSize
;
358 unsigned short SiS_PanelMinLVDS
;
359 unsigned short SiS_PanelMin301
;
361 const struct SiS_St
*SiS_SModeIDTable
;
362 const struct SiS_StandTable_S
*SiS_StandTable
;
363 const struct SiS_Ext
*SiS_EModeIDTable
;
364 const struct SiS_Ext2
*SiS_RefIndex
;
365 const struct SiS_VBMode
*SiS_VBModeIDTable
;
366 const struct SiS_CRT1Table
*SiS_CRT1Table
;
367 const struct SiS_MCLKData
*SiS_MCLKData_0
;
368 const struct SiS_MCLKData
*SiS_MCLKData_1
;
369 struct SiS_VCLKData
*SiS_VCLKData
;
370 struct SiS_VBVCLKData
*SiS_VBVCLKData
;
371 const struct SiS_StResInfo_S
*SiS_StResInfo
;
372 const struct SiS_ModeResInfo_S
*SiS_ModeResInfo
;
374 const unsigned char *pSiS_OutputSelect
;
375 const unsigned char *pSiS_SoftSetting
;
377 const unsigned char *SiS_SR15
;
379 const struct SiS_PanelDelayTbl
*SiS_PanelDelayTbl
;
380 const struct SiS_PanelDelayTbl
*SiS_PanelDelayTblLVDS
;
384 const struct SiS_LCDData
*SiS_ExtLCD1024x768Data
;
385 const struct SiS_LCDData
*SiS_St2LCD1024x768Data
;
386 const struct SiS_LCDData
*SiS_LCD1280x720Data
;
387 const struct SiS_LCDData
*SiS_StLCD1280x768_2Data
;
388 const struct SiS_LCDData
*SiS_ExtLCD1280x768_2Data
;
389 const struct SiS_LCDData
*SiS_LCD1280x800Data
;
390 const struct SiS_LCDData
*SiS_LCD1280x800_2Data
;
391 const struct SiS_LCDData
*SiS_LCD1280x854Data
;
392 const struct SiS_LCDData
*SiS_LCD1280x960Data
;
393 const struct SiS_LCDData
*SiS_ExtLCD1280x1024Data
;
394 const struct SiS_LCDData
*SiS_St2LCD1280x1024Data
;
395 const struct SiS_LCDData
*SiS_StLCD1400x1050Data
;
396 const struct SiS_LCDData
*SiS_ExtLCD1400x1050Data
;
397 const struct SiS_LCDData
*SiS_StLCD1600x1200Data
;
398 const struct SiS_LCDData
*SiS_ExtLCD1600x1200Data
;
399 const struct SiS_LCDData
*SiS_LCD1680x1050Data
;
400 const struct SiS_LCDData
*SiS_NoScaleData
;
401 const struct SiS_TVData
*SiS_StPALData
;
402 const struct SiS_TVData
*SiS_ExtPALData
;
403 const struct SiS_TVData
*SiS_StNTSCData
;
404 const struct SiS_TVData
*SiS_ExtNTSCData
;
405 const struct SiS_TVData
*SiS_St1HiTVData
;
406 const struct SiS_TVData
*SiS_St2HiTVData
;
407 const struct SiS_TVData
*SiS_ExtHiTVData
;
408 const struct SiS_TVData
*SiS_St525iData
;
409 const struct SiS_TVData
*SiS_St525pData
;
410 const struct SiS_TVData
*SiS_St750pData
;
411 const struct SiS_TVData
*SiS_Ext525iData
;
412 const struct SiS_TVData
*SiS_Ext525pData
;
413 const struct SiS_TVData
*SiS_Ext750pData
;
414 const unsigned char *SiS_NTSCTiming
;
415 const unsigned char *SiS_PALTiming
;
416 const unsigned char *SiS_HiTVExtTiming
;
417 const unsigned char *SiS_HiTVSt1Timing
;
418 const unsigned char *SiS_HiTVSt2Timing
;
419 const unsigned char *SiS_HiTVGroup3Data
;
420 const unsigned char *SiS_HiTVGroup3Simu
;
422 const unsigned char *SiS_HiTVTextTiming
;
423 const unsigned char *SiS_HiTVGroup3Text
;
426 const struct SiS_Part2PortTbl
*SiS_CRT2Part2_1024x768_1
;
427 const struct SiS_Part2PortTbl
*SiS_CRT2Part2_1024x768_2
;
428 const struct SiS_Part2PortTbl
*SiS_CRT2Part2_1024x768_3
;
432 const struct SiS_LVDSData
*SiS_LVDS320x240Data_1
;
433 const struct SiS_LVDSData
*SiS_LVDS320x240Data_2
;
434 const struct SiS_LVDSData
*SiS_LVDS640x480Data_1
;
435 const struct SiS_LVDSData
*SiS_LVDS800x600Data_1
;
436 const struct SiS_LVDSData
*SiS_LVDS1024x600Data_1
;
437 const struct SiS_LVDSData
*SiS_LVDS1024x768Data_1
;
438 const struct SiS_LVDSData
*SiS_LVDSBARCO1366Data_1
;
439 const struct SiS_LVDSData
*SiS_LVDSBARCO1366Data_2
;
440 const struct SiS_LVDSData
*SiS_LVDSBARCO1024Data_1
;
441 const struct SiS_LVDSData
*SiS_LVDS848x480Data_1
;
442 const struct SiS_LVDSData
*SiS_LVDS848x480Data_2
;
443 const struct SiS_LVDSData
*SiS_CHTVUNTSCData
;
444 const struct SiS_LVDSData
*SiS_CHTVONTSCData
;
445 const struct SiS_LVDSData
*SiS_CHTVUPALData
;
446 const struct SiS_LVDSData
*SiS_CHTVOPALData
;
447 const struct SiS_LVDSData
*SiS_CHTVUPALMData
;
448 const struct SiS_LVDSData
*SiS_CHTVOPALMData
;
449 const struct SiS_LVDSData
*SiS_CHTVUPALNData
;
450 const struct SiS_LVDSData
*SiS_CHTVOPALNData
;
451 const struct SiS_LVDSData
*SiS_CHTVSOPALData
;
453 const struct SiS_LVDSDes
*SiS_PanelType04_1a
;
454 const struct SiS_LVDSDes
*SiS_PanelType04_2a
;
455 const struct SiS_LVDSDes
*SiS_PanelType04_1b
;
456 const struct SiS_LVDSDes
*SiS_PanelType04_2b
;
458 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1320x240_1
;
459 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1320x240_2
;
460 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1320x240_2_H
;
461 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1320x240_3
;
462 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1320x240_3_H
;
463 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1640x480_1
;
464 const struct SiS_LVDSCRT1Data
*SiS_LVDSCRT1640x480_1_H
;
465 const struct SiS_LVDSCRT1Data
*SiS_CHTVCRT1UNTSC
;
466 const struct SiS_LVDSCRT1Data
*SiS_CHTVCRT1ONTSC
;
467 const struct SiS_LVDSCRT1Data
*SiS_CHTVCRT1UPAL
;
468 const struct SiS_LVDSCRT1Data
*SiS_CHTVCRT1OPAL
;
469 const struct SiS_LVDSCRT1Data
*SiS_CHTVCRT1SOPAL
;
471 const struct SiS_CHTVRegData
*SiS_CHTVReg_UNTSC
;
472 const struct SiS_CHTVRegData
*SiS_CHTVReg_ONTSC
;
473 const struct SiS_CHTVRegData
*SiS_CHTVReg_UPAL
;
474 const struct SiS_CHTVRegData
*SiS_CHTVReg_OPAL
;
475 const struct SiS_CHTVRegData
*SiS_CHTVReg_UPALM
;
476 const struct SiS_CHTVRegData
*SiS_CHTVReg_OPALM
;
477 const struct SiS_CHTVRegData
*SiS_CHTVReg_UPALN
;
478 const struct SiS_CHTVRegData
*SiS_CHTVReg_OPALN
;
479 const struct SiS_CHTVRegData
*SiS_CHTVReg_SOPAL
;
481 const unsigned char *SiS_CHTVVCLKUNTSC
;
482 const unsigned char *SiS_CHTVVCLKONTSC
;
483 const unsigned char *SiS_CHTVVCLKUPAL
;
484 const unsigned char *SiS_CHTVVCLKOPAL
;
485 const unsigned char *SiS_CHTVVCLKUPALM
;
486 const unsigned char *SiS_CHTVVCLKOPALM
;
487 const unsigned char *SiS_CHTVVCLKUPALN
;
488 const unsigned char *SiS_CHTVVCLKOPALN
;
489 const unsigned char *SiS_CHTVVCLKSOPAL
;
491 unsigned short PanelXRes
, PanelHT
;
492 unsigned short PanelYRes
, PanelVT
;
493 unsigned short PanelHRS
, PanelHRE
;
494 unsigned short PanelVRS
, PanelVRE
;
495 unsigned short PanelVCLKIdx300
;
496 unsigned short PanelVCLKIdx315
;
497 bool Alternate1600x1200
;
500 bool CRT1UsesCustomMode
;
501 unsigned short CHDisplay
;
502 unsigned short CHSyncStart
;
503 unsigned short CHSyncEnd
;
504 unsigned short CHTotal
;
505 unsigned short CHBlankStart
;
506 unsigned short CHBlankEnd
;
507 unsigned short CVDisplay
;
508 unsigned short CVSyncStart
;
509 unsigned short CVSyncEnd
;
510 unsigned short CVTotal
;
511 unsigned short CVBlankStart
;
512 unsigned short CVBlankEnd
;
513 unsigned int CDClock
;
515 unsigned char CCRT1CRTC
[17];
518 unsigned short CSRClock
;
519 unsigned short CSRClock_CRT1
;
520 unsigned short CModeFlag
;
521 unsigned short CModeFlag_CRT1
;
522 unsigned short CInfoFlag
;
527 unsigned char Backup_Mode
;
528 unsigned char Backup_14
;
529 unsigned char Backup_15
;
530 unsigned char Backup_16
;
531 unsigned char Backup_17
;
532 unsigned char Backup_18
;
533 unsigned char Backup_19
;
534 unsigned char Backup_1a
;
535 unsigned char Backup_1b
;
536 unsigned char Backup_1c
;
537 unsigned char Backup_1d
;
539 unsigned char Init_P4_0E
;
544 unsigned short CP_Vendor
, CP_Product
;
545 bool CP_HaveCustomData
;
546 int CP_PreferredX
, CP_PreferredY
, CP_PreferredIndex
;
547 int CP_MaxX
, CP_MaxY
, CP_MaxClock
;
548 unsigned char CP_PrefSR2B
, CP_PrefSR2C
;
549 unsigned short CP_PrefClock
;
550 bool CP_Supports64048075
;
551 int CP_HDisplay
[7], CP_VDisplay
[7]; /* For Custom LCD panel dimensions */
552 int CP_HTotal
[7], CP_VTotal
[7];
553 int CP_HSyncStart
[7], CP_VSyncStart
[7];
554 int CP_HSyncEnd
[7], CP_VSyncEnd
[7];
555 int CP_HBlankStart
[7], CP_VBlankStart
[7];
556 int CP_HBlankEnd
[7], CP_VBlankEnd
[7];
558 bool CP_DataValid
[7];
559 bool CP_HSync_P
[7], CP_VSync_P
[7], CP_SyncValid
[7];