initial commit with v2.6.9
[linux-2.6.9-moxart.git] / drivers / video / sis / vgatypes.h
blobca7caf0e6269e617d5eccbd7bc9522d7d06cdbb0
1 /* $XFree86$ */
2 /* $XdotOrg$ */
3 /*
4 * General type definitions for universal mode switching modules
6 * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
8 * If distributed as part of the Linux kernel, the following license terms
9 * apply:
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
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
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 EXPRESSED 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>
53 #ifndef _VGATYPES_
54 #define _VGATYPES_
56 #ifdef LINUX_XF86
57 #include "xf86Version.h"
58 #include "xf86Pci.h"
59 #endif
61 #ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
62 #include <linux/ioctl.h>
63 #endif
65 #ifndef FALSE
66 #define FALSE 0
67 #endif
69 #ifndef TRUE
70 #define TRUE 1
71 #endif
73 #ifndef NULL
74 #define NULL 0
75 #endif
77 #ifndef CHAR
78 typedef char CHAR;
79 #endif
81 #ifndef SHORT
82 typedef short SHORT;
83 #endif
85 #ifndef LONG
86 typedef long LONG;
87 #endif
89 #ifndef UCHAR
90 typedef unsigned char UCHAR;
91 #endif
93 #ifndef USHORT
94 typedef unsigned short USHORT;
95 #endif
97 #ifndef ULONG
98 typedef unsigned long ULONG;
99 #endif
101 #ifndef BOOLEAN
102 typedef UCHAR BOOLEAN;
103 #endif
105 #ifndef bool
106 typedef UCHAR bool;
107 #endif
109 #ifdef LINUX_KERNEL
110 typedef unsigned long SISIOADDRESS;
111 #endif
113 #ifdef LINUX_XF86
114 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
115 typedef unsigned long IOADDRESS;
116 typedef unsigned long SISIOADDRESS;
117 #else
118 typedef IOADDRESS SISIOADDRESS;
119 #endif
120 #endif
122 enum _SIS_CHIP_TYPE {
123 SIS_VGALegacy = 0,
124 SIS_530,
125 SIS_OLD,
126 SIS_300,
127 SIS_630,
128 SIS_730,
129 SIS_540,
130 SIS_315H, /* SiS 310 */
131 SIS_315,
132 SIS_315PRO,
133 SIS_550,
134 SIS_650,
135 SIS_740,
136 SIS_330,
137 SIS_661,
138 SIS_741,
139 SIS_660,
140 SIS_760,
141 SIS_761,
142 SIS_340,
143 MAX_SIS_CHIP
146 #ifdef LINUX_KERNEL
147 enum _SIS_LCD_TYPE {
148 LCD_INVALID = 0,
149 LCD_800x600,
150 LCD_1024x768,
151 LCD_1280x1024,
152 LCD_1280x960,
153 LCD_640x480,
154 LCD_1600x1200,
155 LCD_1920x1440,
156 LCD_2048x1536,
157 LCD_320x480, /* FSTN */
158 LCD_1400x1050,
159 LCD_1152x864,
160 LCD_1152x768,
161 LCD_1280x768,
162 LCD_1024x600,
163 LCD_640x480_2, /* DSTN */
164 LCD_640x480_3, /* DSTN */
165 LCD_848x480,
166 LCD_1280x800,
167 LCD_1680x1050,
168 LCD_1280x720,
169 LCD_CUSTOM,
170 LCD_UNKNOWN
172 typedef unsigned int SIS_LCD_TYPE;
173 #endif
175 #ifndef SIS_HW_INFO
177 typedef struct _SIS_HW_INFO SIS_HW_INFO, *PSIS_HW_INFO;
179 typedef BOOLEAN (*PSIS_QUERYSPACE) (PSIS_HW_INFO, ULONG, ULONG, ULONG *);
181 struct _SIS_HW_INFO
183 #ifdef LINUX_XF86
184 PCITAG PciTag; /* PCI Tag */
185 #endif
187 UCHAR *pjVirtualRomBase; /* ROM image */
189 BOOLEAN UseROM; /* Use the ROM image if provided */
191 UCHAR *pjVideoMemoryAddress;/* base virtual memory address */
192 /* of Linear VGA memory */
194 ULONG ulVideoMemorySize; /* size, in bytes, of the memory on the board */
196 SISIOADDRESS ulIOAddress; /* base I/O address of VGA ports (0x3B0; relocated) */
198 UCHAR jChipType; /* Used to Identify SiS Graphics Chip */
199 /* defined in the enum "SIS_CHIP_TYPE" (above or sisfb.h) */
201 UCHAR jChipRevision; /* Used to Identify SiS Graphics Chip Revision */
203 BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */
205 #ifdef LINUX_KERNEL
206 ULONG ulCRT2LCDType; /* defined in the data structure type */
207 /* "SIS_LCD_TYPE" */
208 #endif
210 #endif
212 /* Addtional IOCTLs for communication sisfb <> X driver */
213 /* If changing this, sisfb.h must also be changed (for sisfb) */
215 #ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */
217 /* ioctl for identifying and giving some info (esp. memory heap start) */
218 #define SISFB_GET_INFO_SIZE 0x8004f300
219 #define SISFB_GET_INFO 0x8000f301 /* Must be patched with result from ..._SIZE at D[29:16] */
220 /* deprecated ioctl number (for older versions of sisfb) */
221 #define SISFB_GET_INFO_OLD 0x80046ef8
223 /* ioctls for tv parameters (position) */
224 #define SISFB_SET_TVPOSOFFSET 0x4004f304
226 /* lock sisfb from register access */
227 #define SISFB_SET_LOCK 0x4004f306
229 /* Structure argument for SISFB_GET_INFO ioctl */
230 typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
232 struct _SISFB_INFO {
233 CARD32 sisfb_id; /* for identifying sisfb */
234 #ifndef SISFB_ID
235 #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
236 #endif
237 CARD32 chip_id; /* PCI ID of detected chip */
238 CARD32 memory; /* video memory in KB which sisfb manages */
239 CARD32 heapstart; /* heap start (= sisfb "mem" argument) in KB */
240 CARD8 fbvidmode; /* current sisfb mode */
242 CARD8 sisfb_version;
243 CARD8 sisfb_revision;
244 CARD8 sisfb_patchlevel;
246 CARD8 sisfb_caps; /* sisfb's capabilities */
248 CARD32 sisfb_tqlen; /* turbo queue length (in KB) */
250 CARD32 sisfb_pcibus; /* The card's PCI ID */
251 CARD32 sisfb_pcislot;
252 CARD32 sisfb_pcifunc;
254 CARD8 sisfb_lcdpdc;
256 CARD8 sisfb_lcda;
258 CARD32 sisfb_vbflags;
259 CARD32 sisfb_currentvbflags;
261 CARD32 sisfb_scalelcd;
262 CARD32 sisfb_specialtiming;
264 CARD8 sisfb_haveemi;
265 CARD8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
266 CARD8 sisfb_haveemilcd;
268 CARD8 sisfb_lcdpdca;
270 CARD16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
272 CARD8 reserved[208]; /* for future use */
274 #endif
276 #endif