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
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 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>
57 #include "xf86Version.h"
61 #ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
62 #include <linux/ioctl.h>
90 typedef unsigned char UCHAR
;
94 typedef unsigned short USHORT
;
98 typedef unsigned long ULONG
;
102 typedef UCHAR BOOLEAN
;
110 typedef unsigned long SISIOADDRESS
;
114 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
115 typedef unsigned long IOADDRESS
;
116 typedef unsigned long SISIOADDRESS
;
118 typedef IOADDRESS SISIOADDRESS
;
122 enum _SIS_CHIP_TYPE
{
130 SIS_315H
, /* SiS 310 */
157 LCD_320x480
, /* FSTN */
163 LCD_640x480_2
, /* DSTN */
164 LCD_640x480_3
, /* DSTN */
172 typedef unsigned int SIS_LCD_TYPE
;
177 typedef struct _SIS_HW_INFO SIS_HW_INFO
, *PSIS_HW_INFO
;
179 typedef BOOLEAN (*PSIS_QUERYSPACE
) (PSIS_HW_INFO
, ULONG
, ULONG
, ULONG
*);
184 PCITAG PciTag
; /* PCI Tag */
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 */
206 ULONG ulCRT2LCDType
; /* defined in the data structure type */
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
;
233 CARD32 sisfb_id
; /* for identifying sisfb */
235 #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
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 */
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
;
258 CARD32 sisfb_vbflags
;
259 CARD32 sisfb_currentvbflags
;
261 CARD32 sisfb_scalelcd
;
262 CARD32 sisfb_specialtiming
;
265 CARD8 sisfb_emi30
,sisfb_emi31
,sisfb_emi32
,sisfb_emi33
;
266 CARD8 sisfb_haveemilcd
;
270 CARD16 sisfb_tvxpos
, sisfb_tvypos
; /* Warning: Values + 32 ! */
272 CARD8 reserved
[208]; /* for future use */