1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h,v 1.21 2004/01/23 22:29:06 twini Exp $ */
3 * General type definitions for universal mode switching modules
5 * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
7 * If distributed as part of the Linux kernel, the following license terms
10 * * This program is free software; you can redistribute it and/or modify
11 * * it under the terms of the GNU General Public License as published by
12 * * the Free Software Foundation; either version 2 of the named License,
13 * * or any later version.
15 * * This program is distributed in the hope that it will be useful,
16 * * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * * GNU General Public License for more details.
20 * * You should have received a copy of the GNU General Public License
21 * * along with this program; if not, write to the Free Software
22 * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24 * Otherwise, the following license terms apply:
26 * * Redistribution and use in source and binary forms, with or without
27 * * modification, are permitted provided that the following conditions
29 * * 1) Redistributions of source code must retain the above copyright
30 * * notice, this list of conditions and the following disclaimer.
31 * * 2) Redistributions in binary form must reproduce the above copyright
32 * * notice, this list of conditions and the following disclaimer in the
33 * * documentation and/or other materials provided with the distribution.
34 * * 3) All advertising materials mentioning features or use of this software
35 * * must display the following acknowledgement: "This product includes
36 * * software developed by Thomas Winischhofer, Vienna, Austria."
37 * * 4) The name of the author may not be used to endorse or promote products
38 * * derived from this software without specific prior written permission.
40 * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
41 * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42 * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
43 * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
44 * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46 * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47 * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
49 * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 * Author: Thomas Winischhofer <thomas@winischhofer.net>
59 #include "xf86Version.h"
63 #ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
64 #include <linux/ioctl.h>
92 typedef unsigned char UCHAR
;
96 typedef unsigned short USHORT
;
100 typedef unsigned long ULONG
;
104 typedef UCHAR BOOLEAN
;
112 typedef unsigned long SISIOADDRESS
;
116 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
117 typedef unsigned long IOADDRESS
;
118 typedef unsigned long SISIOADDRESS
;
120 typedef IOADDRESS SISIOADDRESS
;
124 #ifndef LINUX_KERNEL /* For the linux kernel, this is defined in sisfb.h */
125 #ifndef SIS_CHIP_TYPE
126 typedef enum _SIS_CHIP_TYPE
{
136 SIS_315H
, /* SiS 310 */
138 SIS_315PRO
, /* SiS 325 */
152 #ifndef SIS_VB_CHIP_TYPE
153 typedef enum _SIS_VB_CHIP_TYPE
{
163 VB_CHIP_UNKNOWN
, /* other video bridge or no video bridge */
169 typedef enum _SIS_LCD_TYPE
{
179 LCD_320x480
, /* FSTN, DSTN */
185 LCD_640x480_2
, /* FSTN, DSTN */
186 LCD_640x480_3
, /* FSTN, DSTN */
196 typedef struct _SIS_DSReg
200 } SIS_DSReg
, *PSIS_DSReg
;
205 typedef struct _SIS_HW_INFO SIS_HW_INFO
, *PSIS_HW_INFO
;
207 typedef BOOLEAN (*PSIS_QUERYSPACE
) (PSIS_HW_INFO
, ULONG
, ULONG
, ULONG
*);
212 PCITAG PciTag
; /* PCI Tag */
215 UCHAR
*pjVirtualRomBase
; /* ROM image */
217 BOOLEAN UseROM
; /* Use the ROM image if provided */
219 UCHAR
*pjVideoMemoryAddress
;/* base virtual memory address */
220 /* of Linear VGA memory */
222 ULONG ulVideoMemorySize
; /* size, in bytes, of the memory on the board */
223 SISIOADDRESS ulIOAddress
; /* base I/O address of VGA ports (0x3B0) */
224 UCHAR jChipType
; /* Used to Identify SiS Graphics Chip */
225 /* defined in the data structure type */
226 /* "SIS_CHIP_TYPE" */
228 UCHAR jChipRevision
; /* Used to Identify SiS Graphics Chip Revision */
229 UCHAR ujVBChipID
; /* the ID of video bridge */
230 /* defined in the data structure type */
231 /* "SIS_VB_CHIP_TYPE" */
236 USHORT usExternalChip
; /* NO VB or other video bridge (other than */
237 /* SiS video bridge) */
239 ULONG ulCRT2LCDType
; /* defined in the data structure type */
242 BOOLEAN bIntegratedMMEnabled
;/* supporting integration MM enable */
244 BOOLEAN bSkipDramSizing
; /* True: Skip video memory sizing. */
247 PSIS_DSReg pSR
; /* restore SR registers in initial function. */
248 /* end data :(idx, val) = (FF, FF). */
249 /* Note : restore SR registers if */
250 /* bSkipDramSizing = TRUE */
252 PSIS_DSReg pCR
; /* restore CR registers in initial function. */
253 /* end data :(idx, val) = (FF, FF) */
254 /* Note : restore cR registers if */
255 /* bSkipDramSizing = TRUE */
258 PSIS_QUERYSPACE pQueryVGAConfigSpace
; /* Get/Set VGA Configuration */
261 PSIS_QUERYSPACE pQueryNorthBridgeSpace
;/* Get/Set North Bridge */
266 /* Addtional IOCTL for communication sisfb <> X driver */
267 /* If changing this, sisfb.h must also be changed (for sisfb) */
269 #ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */
271 /* ioctl for identifying and giving some info (esp. memory heap start) */
272 #define SISFB_GET_INFO 0x80046ef8 /* Wow, what a terrible hack... */
274 /* Structure argument for SISFB_GET_INFO ioctl */
275 typedef struct _SISFB_INFO sisfb_info
, *psisfb_info
;
278 unsigned long sisfb_id
; /* for identifying sisfb */
280 #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
282 int chip_id
; /* PCI ID of detected chip */
283 int memory
; /* video memory in KB which sisfb manages */
284 int heapstart
; /* heap start (= sisfb "mem" argument) in KB */
285 unsigned char fbvidmode
; /* current sisfb mode */
287 unsigned char sisfb_version
;
288 unsigned char sisfb_revision
;
289 unsigned char sisfb_patchlevel
;
291 unsigned char sisfb_caps
; /* sisfb's capabilities */
293 int sisfb_tqlen
; /* turbo queue length (in KB) */
295 unsigned int sisfb_pcibus
; /* The card's PCI ID */
296 unsigned int sisfb_pcislot
;
297 unsigned int sisfb_pcifunc
;
299 unsigned char sisfb_lcdpdc
;
301 unsigned char sisfb_lcda
;
303 unsigned long sisfb_vbflags
;
304 unsigned long sisfb_currentvbflags
;
307 unsigned long sisfb_specialtiming
;
309 unsigned char sisfb_haveemi
;
310 unsigned char sisfb_emi30
,sisfb_emi31
,sisfb_emi32
,sisfb_emi33
;
311 unsigned char sisfb_haveemilcd
;
313 char reserved
[213]; /* for future use */