8 #include "xf86Version.h"
12 #ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
13 #include <linux/ioctl.h>
41 typedef unsigned char UCHAR;
45 typedef unsigned short USHORT;
49 typedef unsigned long ULONG;
53 typedef UCHAR *PUCHAR;
57 typedef USHORT *PUSHORT;
61 typedef ULONG *PULONG;
73 typedef UCHAR BOOLEAN;
81 typedef unsigned long XGIIOADDRESS;
85 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
86 typedef unsigned char IOADDRESS;
87 typedef unsigned char XGIIOADDRESS;
89 typedef IOADDRESS XGIIOADDRESS;
93 #ifndef VBIOS_VER_MAX_LENGTH
94 #define VBIOS_VER_MAX_LENGTH 4
99 #ifndef LINUX_KERNEL /* For the linux kernel, this is defined in xgifb.h */
100 #ifndef XGI_CHIP_TYPE
101 typedef enum _XGI_CHIP_TYPE {
133 #ifndef XGI_VB_CHIP_TYPE
134 typedef enum _XGI_VB_CHIP_TYPE {
144 VB_CHIP_UNKNOWN, /* other video bridge or no video bridge */
150 typedef enum _XGI_LCD_TYPE {
152 LCD_320x480, /* FSTN, DSTN */
154 LCD_640x480_2, /* FSTN, DSTN */
155 LCD_640x480_3, /* FSTN, DSTN */
177 #endif /* not WIN2000 */
180 typedef struct _XGI_DSReg
184 } XGI_DSReg, *PXGI_DSReg;
187 #ifndef XGI_HW_DEVICE_INFO
189 typedef struct _XGI_HW_DEVICE_INFO XGI_HW_DEVICE_INFO, *PXGI_HW_DEVICE_INFO;
191 typedef BOOLEAN (*PXGI_QUERYSPACE) (PXGI_HW_DEVICE_INFO, ULONG, ULONG, ULONG *);
193 struct _XGI_HW_DEVICE_INFO
195 ULONG ulExternalChip; /* NO VB or other video bridge*/
196 /* if ujVBChipID = VB_CHIP_UNKNOWN, */
198 PCITAG PciTag; /* PCI Tag */
201 PUCHAR pjVirtualRomBase; /* ROM image */
203 BOOLEAN UseROM; /* Use the ROM image if provided */
207 PUCHAR pjVideoMemoryAddress;/* base virtual memory address */
208 /* of Linear VGA memory */
210 ULONG ulVideoMemorySize; /* size, in bytes, of the memory on the board */
212 PUCHAR pjIOAddress; /* base I/O address of VGA ports (0x3B0) */
214 PUCHAR pjCustomizedROMImage;
216 PUCHAR pj2ndVideoMemoryAddress;
217 ULONG ul2ndVideoMemorySize;
219 PUCHAR pj2ndIOAddress;
221 XGIIOADDRESS pjIOAddress; // base I/O address of VGA ports (0x3B0)
223 UCHAR jChipType; /* Used to Identify Graphics Chip */
224 /* defined in the data structure type */
225 /* "XGI_CHIP_TYPE" */
227 UCHAR jChipRevision; /* Used to Identify Graphics Chip Revision */
229 UCHAR ujVBChipID; /* the ID of video bridge */
230 /* defined in the data structure type */
231 /* "XGI_VB_CHIP_TYPE" */
235 ULONG ulCRT2LCDType; /* defined in the data structure type */
237 ULONG usExternalChip; /* NO VB or other video bridge (other than */
240 BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */
242 BOOLEAN bSkipDramSizing; /* True: Skip video memory sizing. */
246 BOOLEAN bIsPowerSaving; /* True: XGIInit() is invoked by power management,
247 otherwise by 2nd adapter's initialzation */
249 PXGI_DSReg pSR; /* restore SR registers in initial function. */
250 /* end data :(idx, val) = (FF, FF). */
251 /* Note : restore SR registers if */
252 /* bSkipDramSizing = TRUE */
254 PXGI_DSReg pCR; /* restore CR registers in initial function. */
255 /* end data :(idx, val) = (FF, FF) */
256 /* Note : restore cR registers if */
257 /* bSkipDramSizing = TRUE */
262 PXGI_QUERYSPACE pQueryVGAConfigSpace;
264 PXGI_QUERYSPACE pQueryNorthBridgeSpace;
266 UCHAR szVBIOSVer[VBIOS_VER_MAX_LENGTH];
271 /* Addtional IOCTL for communication xgifb <> X driver */
272 /* If changing this, xgifb.h must also be changed (for xgifb) */
274 #ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */
276 /* ioctl for identifying and giving some info (esp. memory heap start) */
277 #define XGIFB_GET_INFO 0x80046ef8 /* Wow, what a terrible hack... */
279 /* Structure argument for XGIFB_GET_INFO ioctl */
280 typedef struct _XGIFB_INFO xgifb_info, *pxgifb_info;
283 CARD32 xgifb_id; /* for identifying xgifb */
285 #define XGIFB_ID 0x53495346 /* Identify myself with 'XGIF' */
287 CARD32 chip_id; /* PCI ID of detected chip */
288 CARD32 memory; /* video memory in KB which xgifb manages */
289 CARD32 heapstart; /* heap start (= xgifb "mem" argument) in KB */
290 CARD8 fbvidmode; /* current xgifb mode */
293 CARD8 xgifb_revision;
294 CARD8 xgifb_patchlevel;
296 CARD8 xgifb_caps; /* xgifb's capabilities */
298 CARD32 xgifb_tqlen; /* turbo queue length (in KB) */
300 CARD32 xgifb_pcibus; /* The card's PCI ID */
301 CARD32 xgifb_pcislot;
302 CARD32 xgifb_pcifunc;
308 CARD32 xgifb_vbflags;
309 CARD32 xgifb_currentvbflags;
311 CARD32 xgifb_scalelcd;
312 CARD32 xgifb_specialtiming;
315 CARD8 xgifb_emi30,xgifb_emi31,xgifb_emi32,xgifb_emi33;
316 CARD8 xgifb_haveemilcd;
320 CARD8 reserved[212]; /* for future use */