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 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 #ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
57 #include <linux/ioctl.h>
58 #include <linux/version.h>
86 typedef unsigned char UCHAR
;
90 typedef unsigned short USHORT
;
94 typedef unsigned long ULONG
;
98 typedef unsigned char BOOLEAN
;
104 typedef unsigned long SISIOADDRESS
;
105 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
106 #include <linux/types.h> /* Need __iomem */
108 #define SISIOMEMTYPE __iomem
113 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
114 typedef unsigned long IOADDRESS
;
115 typedef unsigned long SISIOADDRESS
;
117 typedef IOADDRESS SISIOADDRESS
;
121 enum _SIS_CHIP_TYPE
{
129 SIS_315H
, /* SiS 310 */
146 typedef struct _SIS_HW_INFO SIS_HW_INFO
, *PSIS_HW_INFO
;
151 PCITAG PciTag
; /* PCI Tag */
154 UCHAR
*pjVirtualRomBase
; /* ROM image */
156 BOOLEAN UseROM
; /* Use the ROM image if provided */
159 UCHAR SISIOMEMTYPE
*pjVideoMemoryAddress
;
160 /* base virtual memory address */
161 /* of Linear VGA memory */
163 ULONG ulVideoMemorySize
; /* size, in bytes, of the memory on the board */
166 SISIOADDRESS ulIOAddress
; /* base I/O address of VGA ports (0x3B0; relocated) */
168 UCHAR jChipType
; /* Used to Identify SiS Graphics Chip */
169 /* defined in the enum "SIS_CHIP_TYPE" (above or sisfb.h) */
171 UCHAR jChipRevision
; /* Used to Identify SiS Graphics Chip Revision */
173 BOOLEAN bIntegratedMMEnabled
;/* supporting integration MM enable */
177 /* Addtional IOCTLs for communication sisfb <> X driver */
178 /* If changing this, sisfb.h must also be changed (for sisfb) */
180 #ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */
182 /* ioctl for identifying and giving some info (esp. memory heap start) */
183 #define SISFB_GET_INFO_SIZE 0x8004f300
184 #define SISFB_GET_INFO 0x8000f301 /* Must be patched with result from ..._SIZE at D[29:16] */
185 /* deprecated ioctl number (for older versions of sisfb) */
186 #define SISFB_GET_INFO_OLD 0x80046ef8
188 /* ioctls for tv parameters (position) */
189 #define SISFB_SET_TVPOSOFFSET 0x4004f304
191 /* lock sisfb from register access */
192 #define SISFB_SET_LOCK 0x4004f306
194 /* Structure argument for SISFB_GET_INFO ioctl */
195 typedef struct _SISFB_INFO sisfb_info
, *psisfb_info
;
198 CARD32 sisfb_id
; /* for identifying sisfb */
200 #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
202 CARD32 chip_id
; /* PCI ID of detected chip */
203 CARD32 memory
; /* video memory in KB which sisfb manages */
204 CARD32 heapstart
; /* heap start (= sisfb "mem" argument) in KB */
205 CARD8 fbvidmode
; /* current sisfb mode */
208 CARD8 sisfb_revision
;
209 CARD8 sisfb_patchlevel
;
211 CARD8 sisfb_caps
; /* sisfb's capabilities */
213 CARD32 sisfb_tqlen
; /* turbo queue length (in KB) */
215 CARD32 sisfb_pcibus
; /* The card's PCI ID */
216 CARD32 sisfb_pcislot
;
217 CARD32 sisfb_pcifunc
;
223 CARD32 sisfb_vbflags
;
224 CARD32 sisfb_currentvbflags
;
226 CARD32 sisfb_scalelcd
;
227 CARD32 sisfb_specialtiming
;
230 CARD8 sisfb_emi30
,sisfb_emi31
,sisfb_emi32
,sisfb_emi33
;
231 CARD8 sisfb_haveemilcd
;
235 CARD16 sisfb_tvxpos
, sisfb_tvypos
; /* Warning: Values + 32 ! */
237 CARD8 reserved
[208]; /* for future use */