1706f2543Smrg
2706f2543Smrg/*
3706f2543Smrg * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
4706f2543Smrg *
5706f2543Smrg * Permission is hereby granted, free of charge, to any person obtaining a
6706f2543Smrg * copy of this software and associated documentation files (the "Software"),
7706f2543Smrg * to deal in the Software without restriction, including without limitation
8706f2543Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9706f2543Smrg * and/or sell copies of the Software, and to permit persons to whom the
10706f2543Smrg * Software is furnished to do so, subject to the following conditions:
11706f2543Smrg *
12706f2543Smrg * The above copyright notice and this permission notice shall be included in
13706f2543Smrg * all copies or substantial portions of the Software.
14706f2543Smrg *
15706f2543Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16706f2543Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17706f2543Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18706f2543Smrg * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19706f2543Smrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20706f2543Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21706f2543Smrg * OTHER DEALINGS IN THE SOFTWARE.
22706f2543Smrg *
23706f2543Smrg * Except as contained in this notice, the name of the copyright holder(s)
24706f2543Smrg * and author(s) shall not be used in advertising or otherwise to promote
25706f2543Smrg * the sale, use or other dealings in this Software without prior written
26706f2543Smrg * authorization from the copyright holder(s) and author(s).
27706f2543Smrg */
28706f2543Smrg
29706f2543Smrg/*
30706f2543Smrg * This file contains definitions of the public XFree86 data structures/types.
31706f2543Smrg * Any data structures that video drivers need to access should go here.
32706f2543Smrg */
33706f2543Smrg
34706f2543Smrg#ifndef _XF86STR_H
35706f2543Smrg#define _XF86STR_H
36706f2543Smrg
37706f2543Smrg#include "misc.h"
38706f2543Smrg#include "input.h"
39706f2543Smrg#include "scrnintstr.h"
40706f2543Smrg#include "pixmapstr.h"
41706f2543Smrg#include "colormapst.h"
42706f2543Smrg#include "xf86Module.h"
43706f2543Smrg#include "xf86Opt.h"
44706f2543Smrg#include "xf86Pci.h"
45706f2543Smrg
46706f2543Smrg#include <pciaccess.h>
47706f2543Smrg
48706f2543Smrg/**
49706f2543Smrg * Integer type that is of the size of the addressable memory (machine size).
50706f2543Smrg * On most platforms \c uintptr_t will suffice.  However, on some mixed
51706f2543Smrg * 32-bit / 64-bit platforms, such as 32-bit binaries on 64-bit PowerPC, this
52706f2543Smrg * must be 64-bits.
53706f2543Smrg */
54706f2543Smrg#include <inttypes.h>
55706f2543Smrg#if defined(__powerpc__)
56706f2543Smrgtypedef uint64_t memType;
57706f2543Smrg#else
58706f2543Smrgtypedef uintptr_t memType;
59706f2543Smrg#endif
60706f2543Smrg
61706f2543Smrg
62706f2543Smrg/* Video mode flags */
63706f2543Smrg
64706f2543Smrgtypedef enum {
65706f2543Smrg    V_PHSYNC	= 0x0001,
66706f2543Smrg    V_NHSYNC	= 0x0002,
67706f2543Smrg    V_PVSYNC	= 0x0004,
68706f2543Smrg    V_NVSYNC	= 0x0008,
69706f2543Smrg    V_INTERLACE	= 0x0010,
70706f2543Smrg    V_DBLSCAN	= 0x0020,
71706f2543Smrg    V_CSYNC	= 0x0040,
72706f2543Smrg    V_PCSYNC	= 0x0080,
73706f2543Smrg    V_NCSYNC	= 0x0100,
74706f2543Smrg    V_HSKEW	= 0x0200,	/* hskew provided */
75706f2543Smrg    V_BCAST	= 0x0400,
76706f2543Smrg    V_PIXMUX	= 0x1000,
77706f2543Smrg    V_DBLCLK	= 0x2000,
78706f2543Smrg    V_CLKDIV2	= 0x4000
79706f2543Smrg} ModeFlags;
80706f2543Smrg
81706f2543Smrgtypedef enum {
82706f2543Smrg    INTERLACE_HALVE_V	= 0x0001	/* Halve V values for interlacing */
83706f2543Smrg} CrtcAdjustFlags;
84706f2543Smrg
85706f2543Smrg/* Flags passed to ChipValidMode() */
86706f2543Smrgtypedef enum {
87706f2543Smrg    MODECHECK_INITIAL = 0,
88706f2543Smrg    MODECHECK_FINAL   = 1
89706f2543Smrg} ModeCheckFlags;
90706f2543Smrg
91706f2543Smrg/* These are possible return values for xf86CheckMode() and ValidMode() */
92706f2543Smrgtypedef enum {
93706f2543Smrg    MODE_OK	= 0,	/* Mode OK */
94706f2543Smrg    MODE_HSYNC,		/* hsync out of range */
95706f2543Smrg    MODE_VSYNC,		/* vsync out of range */
96706f2543Smrg    MODE_H_ILLEGAL,	/* mode has illegal horizontal timings */
97706f2543Smrg    MODE_V_ILLEGAL,	/* mode has illegal horizontal timings */
98706f2543Smrg    MODE_BAD_WIDTH,	/* requires an unsupported linepitch */
99706f2543Smrg    MODE_NOMODE,	/* no mode with a maching name */
100706f2543Smrg    MODE_NO_INTERLACE,	/* interlaced mode not supported */
101706f2543Smrg    MODE_NO_DBLESCAN,	/* doublescan mode not supported */
102706f2543Smrg    MODE_NO_VSCAN,	/* multiscan mode not supported */
103706f2543Smrg    MODE_MEM,		/* insufficient video memory */
104706f2543Smrg    MODE_VIRTUAL_X,	/* mode width too large for specified virtual size */
105706f2543Smrg    MODE_VIRTUAL_Y,	/* mode height too large for specified virtual size */
106706f2543Smrg    MODE_MEM_VIRT,	/* insufficient video memory given virtual size */
107706f2543Smrg    MODE_NOCLOCK,	/* no fixed clock available */
108706f2543Smrg    MODE_CLOCK_HIGH,	/* clock required is too high */
109706f2543Smrg    MODE_CLOCK_LOW,	/* clock required is too low */
110706f2543Smrg    MODE_CLOCK_RANGE,	/* clock/mode isn't in a ClockRange */
111706f2543Smrg    MODE_BAD_HVALUE,	/* horizontal timing was out of range */
112706f2543Smrg    MODE_BAD_VVALUE,	/* vertical timing was out of range */
113706f2543Smrg    MODE_BAD_VSCAN,	/* VScan value out of range */
114706f2543Smrg    MODE_HSYNC_NARROW,	/* horizontal sync too narrow */
115706f2543Smrg    MODE_HSYNC_WIDE,	/* horizontal sync too wide */
116706f2543Smrg    MODE_HBLANK_NARROW,	/* horizontal blanking too narrow */
117706f2543Smrg    MODE_HBLANK_WIDE,	/* horizontal blanking too wide */
118706f2543Smrg    MODE_VSYNC_NARROW,	/* vertical sync too narrow */
119706f2543Smrg    MODE_VSYNC_WIDE,	/* vertical sync too wide */
120706f2543Smrg    MODE_VBLANK_NARROW,	/* vertical blanking too narrow */
121706f2543Smrg    MODE_VBLANK_WIDE,	/* vertical blanking too wide */
122706f2543Smrg    MODE_PANEL,         /* exceeds panel dimensions */
123706f2543Smrg    MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
124706f2543Smrg    MODE_ONE_WIDTH,     /* only one width is supported */
125706f2543Smrg    MODE_ONE_HEIGHT,    /* only one height is supported */
126706f2543Smrg    MODE_ONE_SIZE,      /* only one resolution is supported */
127706f2543Smrg    MODE_NO_REDUCED,    /* monitor doesn't accept reduced blanking */
128706f2543Smrg    MODE_BANDWIDTH,	/* mode requires too much memory bandwidth */
129706f2543Smrg    MODE_BAD = -2,	/* unspecified reason */
130706f2543Smrg    MODE_ERROR	= -1	/* error condition */
131706f2543Smrg} ModeStatus;
132706f2543Smrg
133706f2543Smrg/*
134706f2543Smrg * The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN.
135706f2543Smrg * Preferred will bubble a mode to the top within a set.
136706f2543Smrg */
137706f2543Smrg# define M_T_BUILTIN 0x01        /* built-in mode */
138706f2543Smrg# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
139706f2543Smrg# define M_T_CRTC_C  (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC  */
140706f2543Smrg# define M_T_CLOCK_CRTC_C  (M_T_CLOCK_C | M_T_CRTC_C)
141706f2543Smrg                               /* built-in mode - configure CRTC and clock */
142706f2543Smrg# define M_T_PREFERRED 0x08	/* preferred mode within a set */
143706f2543Smrg# define M_T_DEFAULT 0x10	/* (VESA) default modes */
144706f2543Smrg# define M_T_USERDEF 0x20	/* One of the modes from the config file */
145706f2543Smrg# define M_T_DRIVER  0x40	/* Supplied by the driver (EDID, etc) */
146706f2543Smrg# define M_T_USERPREF 0x80	/* mode preferred by the user config */
147706f2543Smrg
148706f2543Smrg/* Video mode */
149706f2543Smrgtypedef struct _DisplayModeRec {
150706f2543Smrg    struct _DisplayModeRec *	prev;
151706f2543Smrg    struct _DisplayModeRec *	next;
152706f2543Smrg    char *			name;		/* identifier for the mode */
153706f2543Smrg    ModeStatus			status;
154706f2543Smrg    int				type;
155706f2543Smrg
156706f2543Smrg    /* These are the values that the user sees/provides */
157706f2543Smrg    int				Clock;		/* pixel clock freq (kHz) */
158706f2543Smrg    int				HDisplay;	/* horizontal timing */
159706f2543Smrg    int				HSyncStart;
160706f2543Smrg    int				HSyncEnd;
161706f2543Smrg    int				HTotal;
162706f2543Smrg    int				HSkew;
163706f2543Smrg    int				VDisplay;	/* vertical timing */
164706f2543Smrg    int				VSyncStart;
165706f2543Smrg    int				VSyncEnd;
166706f2543Smrg    int				VTotal;
167706f2543Smrg    int				VScan;
168706f2543Smrg    int				Flags;
169706f2543Smrg
170706f2543Smrg  /* These are the values the hardware uses */
171706f2543Smrg    int				ClockIndex;
172706f2543Smrg    int				SynthClock;	/* Actual clock freq to
173706f2543Smrg					  	 * be programmed  (kHz) */
174706f2543Smrg    int				CrtcHDisplay;
175706f2543Smrg    int				CrtcHBlankStart;
176706f2543Smrg    int				CrtcHSyncStart;
177706f2543Smrg    int				CrtcHSyncEnd;
178706f2543Smrg    int				CrtcHBlankEnd;
179706f2543Smrg    int				CrtcHTotal;
180706f2543Smrg    int				CrtcHSkew;
181706f2543Smrg    int				CrtcVDisplay;
182706f2543Smrg    int				CrtcVBlankStart;
183706f2543Smrg    int				CrtcVSyncStart;
184706f2543Smrg    int				CrtcVSyncEnd;
185706f2543Smrg    int				CrtcVBlankEnd;
186706f2543Smrg    int				CrtcVTotal;
187706f2543Smrg    Bool			CrtcHAdjusted;
188706f2543Smrg    Bool			CrtcVAdjusted;
189706f2543Smrg    int				PrivSize;
190706f2543Smrg    INT32 *			Private;
191706f2543Smrg    int				PrivFlags;
192706f2543Smrg
193706f2543Smrg    float			HSync, VRefresh;
194706f2543Smrg} DisplayModeRec, *DisplayModePtr;
195706f2543Smrg
196706f2543Smrg/* The monitor description */
197706f2543Smrg
198706f2543Smrg#define MAX_HSYNC 8
199706f2543Smrg#define MAX_VREFRESH 8
200706f2543Smrg
201706f2543Smrgtypedef struct { float hi, lo; } range;
202706f2543Smrg
203706f2543Smrgtypedef struct { CARD32 red, green, blue; } rgb;
204706f2543Smrg
205706f2543Smrgtypedef struct { float red, green, blue; } Gamma;
206706f2543Smrg
207706f2543Smrg/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
208706f2543Smrg#define GAMMA_MAX	10.0
209706f2543Smrg#define GAMMA_MIN	(1.0 / GAMMA_MAX)
210706f2543Smrg#define GAMMA_ZERO	(GAMMA_MIN / 100.0)
211706f2543Smrg
212706f2543Smrgtypedef struct {
213706f2543Smrg    char *		id;
214706f2543Smrg    char *		vendor;
215706f2543Smrg    char *		model;
216706f2543Smrg    int			nHsync;
217706f2543Smrg    range		hsync[MAX_HSYNC];
218706f2543Smrg    int			nVrefresh;
219706f2543Smrg    range		vrefresh[MAX_VREFRESH];
220706f2543Smrg    DisplayModePtr	Modes;		/* Start of the monitor's mode list */
221706f2543Smrg    DisplayModePtr	Last;		/* End of the monitor's mode list */
222706f2543Smrg    Gamma		gamma;		/* Gamma of the monitor */
223706f2543Smrg    int			widthmm;
224706f2543Smrg    int			heightmm;
225706f2543Smrg    pointer		options;
226706f2543Smrg    pointer		DDC;
227706f2543Smrg    Bool                reducedblanking; /* Allow CVT reduced blanking modes? */
228706f2543Smrg    int			maxPixClock;	 /* in kHz, like mode->Clock */
229706f2543Smrg} MonRec, *MonPtr;
230706f2543Smrg
231706f2543Smrg/* the list of clock ranges */
232706f2543Smrgtypedef struct x_ClockRange {
233706f2543Smrg    struct x_ClockRange *next;
234706f2543Smrg    int			minClock;	/* (kHz) */
235706f2543Smrg    int			maxClock;	/* (kHz) */
236706f2543Smrg    int			clockIndex;	/* -1 for programmable clocks */
237706f2543Smrg    Bool		interlaceAllowed;
238706f2543Smrg    Bool		doubleScanAllowed;
239706f2543Smrg    int			ClockMulFactor;
240706f2543Smrg    int			ClockDivFactor;
241706f2543Smrg    int			PrivFlags;
242706f2543Smrg} ClockRange, *ClockRangePtr;
243706f2543Smrg
244706f2543Smrg/*
245706f2543Smrg * The driverFunc. xorgDriverFuncOp specifies the action driver should
246706f2543Smrg * perform. If requested option is not supported function should return
247706f2543Smrg * FALSE. pointer can be used to pass arguments to the function or
248706f2543Smrg * to return data to the caller.
249706f2543Smrg */
250706f2543Smrgtypedef struct _ScrnInfoRec *ScrnInfoPtr;
251706f2543Smrg
252706f2543Smrg/* do not change order */
253706f2543Smrgtypedef enum {
254706f2543Smrg    RR_GET_INFO,
255706f2543Smrg    RR_SET_CONFIG,
256706f2543Smrg    RR_GET_MODE_MM,
257706f2543Smrg    GET_REQUIRED_HW_INTERFACES = 10
258706f2543Smrg} xorgDriverFuncOp;
259706f2543Smrg
260706f2543Smrgtypedef Bool xorgDriverFuncProc		  (ScrnInfoPtr, xorgDriverFuncOp,
261706f2543Smrg					   pointer);
262706f2543Smrg
263706f2543Smrg/* RR_GET_INFO, RR_SET_CONFIG */
264706f2543Smrgtypedef struct {
265706f2543Smrg    int rotation;
266706f2543Smrg    int rate;
267706f2543Smrg    int width;
268706f2543Smrg    int height;
269706f2543Smrg} xorgRRConfig;
270706f2543Smrg
271706f2543Smrgtypedef union {
272706f2543Smrg    short RRRotations;
273706f2543Smrg    xorgRRConfig RRConfig;
274706f2543Smrg} xorgRRRotation, *xorgRRRotationPtr;
275706f2543Smrg
276706f2543Smrg/* RR_GET_MODE_MM */
277706f2543Smrgtypedef struct {
278706f2543Smrg    DisplayModePtr mode;
279706f2543Smrg    int virtX;
280706f2543Smrg    int virtY;
281706f2543Smrg    int mmWidth;
282706f2543Smrg    int mmHeight;
283706f2543Smrg} xorgRRModeMM, *xorgRRModeMMPtr;
284706f2543Smrg
285706f2543Smrg/* GET_REQUIRED_HW_INTERFACES */
286706f2543Smrg#define HW_IO 1
287706f2543Smrg#define HW_MMIO 2
288706f2543Smrg#define HW_SKIP_CONSOLE 4
289706f2543Smrg#define NEED_IO_ENABLED(x) (x & HW_IO)
290706f2543Smrg
291706f2543Smrgtypedef CARD32 xorgHWFlags;
292706f2543Smrg
293706f2543Smrg/*
294706f2543Smrg * The driver list struct.  This contains the information required for each
295706f2543Smrg * driver before a ScrnInfoRec has been allocated.
296706f2543Smrg */
297706f2543Smrgstruct _DriverRec;
298706f2543Smrg
299706f2543Smrgtypedef struct {
300706f2543Smrg    int			driverVersion;
301706f2543Smrg    char *		driverName;
302706f2543Smrg    void		(*Identify)(int flags);
303706f2543Smrg    Bool		(*Probe)(struct _DriverRec *drv, int flags);
304706f2543Smrg    const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
305706f2543Smrg    pointer		module;
306706f2543Smrg    int			refCount;
307706f2543Smrg} DriverRec1;
308706f2543Smrg
309706f2543Smrgstruct _SymTabRec;
310706f2543Smrgstruct _PciChipsets;
311706f2543Smrg
312706f2543Smrgtypedef struct _DriverRec {
313706f2543Smrg    int			driverVersion;
314706f2543Smrg    char *		driverName;
315706f2543Smrg    void		(*Identify)(int flags);
316706f2543Smrg    Bool		(*Probe)(struct _DriverRec *drv, int flags);
317706f2543Smrg    const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
318706f2543Smrg    pointer		module;
319706f2543Smrg    int			refCount;
320706f2543Smrg    xorgDriverFuncProc  *driverFunc;
321706f2543Smrg
322706f2543Smrg    const struct pci_id_match * supported_devices;
323706f2543Smrg    Bool (*PciProbe)( struct _DriverRec * drv, int entity_num,
324706f2543Smrg        struct pci_device * dev, intptr_t match_data );
325706f2543Smrg} DriverRec, *DriverPtr;
326706f2543Smrg
327706f2543Smrg/*
328706f2543Smrg *  AddDriver flags
329706f2543Smrg */
330706f2543Smrg#define HaveDriverFuncs 1
331706f2543Smrg
332706f2543Smrg/*
333706f2543Smrg * These are the private bus types.  New types can be added here.  Types
334706f2543Smrg * required for the public interface should be added to xf86str.h, with
335706f2543Smrg * function prototypes added to xf86.h.
336706f2543Smrg */
337706f2543Smrg
338706f2543Smrg/* Tolerate prior #include <linux/input.h> */
339706f2543Smrg#if defined(linux) && defined(_INPUT_H)
340706f2543Smrg#undef BUS_NONE
341706f2543Smrg#undef BUS_PCI
342706f2543Smrg#undef BUS_SBUS
343706f2543Smrg#undef BUS_last
344706f2543Smrg#endif
345706f2543Smrg
346706f2543Smrgtypedef enum {
347706f2543Smrg    BUS_NONE,
348706f2543Smrg    BUS_PCI,
349706f2543Smrg    BUS_SBUS,
350706f2543Smrg    BUS_ISA,
351706f2543Smrg    BUS_last    /* Keep last */
352706f2543Smrg} BusType;
353706f2543Smrg
354706f2543Smrgstruct pci_device;
355706f2543Smrg
356706f2543Smrgtypedef struct {
357706f2543Smrg    int		fbNum;
358706f2543Smrg} SbusBusId;
359706f2543Smrg
360706f2543Smrgtypedef struct _bus {
361706f2543Smrg    BusType type;
362706f2543Smrg    union {
363706f2543Smrg	struct pci_device *pci;
364706f2543Smrg	SbusBusId sbus;
365706f2543Smrg    } id;
366706f2543Smrg} BusRec, *BusPtr;
367706f2543Smrg
368706f2543Smrg#define MAXCLOCKS   128
369706f2543Smrgtypedef enum {
370706f2543Smrg    DAC_BPP8 = 0,
371706f2543Smrg    DAC_BPP16,
372706f2543Smrg    DAC_BPP24,
373706f2543Smrg    DAC_BPP32,
374706f2543Smrg    MAXDACSPEEDS
375706f2543Smrg} DacSpeedIndex;
376706f2543Smrg
377706f2543Smrgtypedef struct {
378706f2543Smrg   char *			identifier;
379706f2543Smrg   char *			vendor;
380706f2543Smrg   char *			board;
381706f2543Smrg   char *			chipset;
382706f2543Smrg   char *			ramdac;
383706f2543Smrg   char *			driver;
384706f2543Smrg   struct _confscreenrec *	myScreenSection;
385706f2543Smrg   Bool				claimed;
386706f2543Smrg   int				dacSpeeds[MAXDACSPEEDS];
387706f2543Smrg   int				numclocks;
388706f2543Smrg   int				clock[MAXCLOCKS];
389706f2543Smrg   char *			clockchip;
390706f2543Smrg   char *			busID;
391706f2543Smrg   Bool				active;
392706f2543Smrg   Bool				inUse;
393706f2543Smrg   int				videoRam;
394706f2543Smrg   int				textClockFreq;
395706f2543Smrg   unsigned long		BiosBase;	/* Base address of video BIOS */
396706f2543Smrg   unsigned long		MemBase;	/* Frame buffer base address */
397706f2543Smrg   unsigned long		IOBase;
398706f2543Smrg   int				chipID;
399706f2543Smrg   int				chipRev;
400706f2543Smrg   pointer			options;
401706f2543Smrg   int                          irq;
402706f2543Smrg   int                          screen;         /* For multi-CRTC cards */
403706f2543Smrg} GDevRec, *GDevPtr;
404706f2543Smrg
405706f2543Smrgtypedef struct {
406706f2543Smrg    int			frameX0;
407706f2543Smrg    int			frameY0;
408706f2543Smrg    int			virtualX;
409706f2543Smrg    int			virtualY;
410706f2543Smrg    int			depth;
411706f2543Smrg    int			fbbpp;
412706f2543Smrg    rgb			weight;
413706f2543Smrg    rgb			blackColour;
414706f2543Smrg    rgb			whiteColour;
415706f2543Smrg    int			defaultVisual;
41666a34d92Schristos    const char **	modes;
417706f2543Smrg    pointer		options;
418706f2543Smrg} DispRec, *DispPtr;
419706f2543Smrg
420706f2543Smrgtypedef struct _confxvportrec {
421706f2543Smrg    char *		identifier;
422706f2543Smrg    pointer		options;
423706f2543Smrg} confXvPortRec, *confXvPortPtr;
424706f2543Smrg
425706f2543Smrgtypedef struct _confxvadaptrec {
426706f2543Smrg    char *		identifier;
427706f2543Smrg    int			numports;
428706f2543Smrg    confXvPortPtr	ports;
429706f2543Smrg    pointer		options;
430706f2543Smrg} confXvAdaptorRec, *confXvAdaptorPtr;
431706f2543Smrg
432706f2543Smrgtypedef struct _confscreenrec {
433706f2543Smrg    char *		id;
434706f2543Smrg    int			screennum;
435706f2543Smrg    int			defaultdepth;
436706f2543Smrg    int			defaultbpp;
437706f2543Smrg    int			defaultfbbpp;
438706f2543Smrg    MonPtr		monitor;
439706f2543Smrg    GDevPtr		device;
440706f2543Smrg    int			numdisplays;
441706f2543Smrg    DispPtr		displays;
442706f2543Smrg    int			numxvadaptors;
443706f2543Smrg    confXvAdaptorPtr	xvadaptors;
444706f2543Smrg    pointer		options;
445706f2543Smrg} confScreenRec, *confScreenPtr;
446706f2543Smrg
447706f2543Smrgtypedef enum {
448706f2543Smrg    PosObsolete = -1,
449706f2543Smrg    PosAbsolute = 0,
450706f2543Smrg    PosRightOf,
451706f2543Smrg    PosLeftOf,
452706f2543Smrg    PosAbove,
453706f2543Smrg    PosBelow,
454706f2543Smrg    PosRelative
455706f2543Smrg} PositionType;
456706f2543Smrg
457706f2543Smrgtypedef struct _screenlayoutrec {
458706f2543Smrg    confScreenPtr	screen;
459706f2543Smrg    char *		topname;
460706f2543Smrg    confScreenPtr	top;
461706f2543Smrg    char *		bottomname;
462706f2543Smrg    confScreenPtr	bottom;
463706f2543Smrg    char *		leftname;
464706f2543Smrg    confScreenPtr	left;
465706f2543Smrg    char *		rightname;
466706f2543Smrg    confScreenPtr	right;
467706f2543Smrg    PositionType	where;
468706f2543Smrg    int			x;
469706f2543Smrg    int			y;
470706f2543Smrg    char *		refname;
471706f2543Smrg    confScreenPtr	refscreen;
472706f2543Smrg} screenLayoutRec, *screenLayoutPtr;
473706f2543Smrg
474706f2543Smrgtypedef struct _InputInfoRec InputInfoRec;
475706f2543Smrg
476706f2543Smrgtypedef struct _serverlayoutrec {
477706f2543Smrg    char *		id;
478706f2543Smrg    screenLayoutPtr	screens;
479706f2543Smrg    GDevPtr		inactives;
480706f2543Smrg    InputInfoRec**      inputs; /* NULL terminated */
481706f2543Smrg    pointer		options;
482706f2543Smrg} serverLayoutRec, *serverLayoutPtr;
483706f2543Smrg
484706f2543Smrgtypedef struct _confdribufferrec {
485706f2543Smrg    int                 count;
486706f2543Smrg    int                 size;
487706f2543Smrg    enum {
488706f2543Smrg	XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
489706f2543Smrg    }                   flags;
490706f2543Smrg} confDRIBufferRec, *confDRIBufferPtr;
491706f2543Smrg
492706f2543Smrgtypedef struct _confdrirec {
493706f2543Smrg    int                 group;
494706f2543Smrg    int                 mode;
495706f2543Smrg    int                 bufs_count;
496706f2543Smrg    confDRIBufferRec    *bufs;
497706f2543Smrg} confDRIRec, *confDRIPtr;
498706f2543Smrg
499706f2543Smrg/* These values should be adjusted when new fields are added to ScrnInfoRec */
500706f2543Smrg#define NUM_RESERVED_INTS		16
501706f2543Smrg#define NUM_RESERVED_POINTERS		14
502706f2543Smrg#define NUM_RESERVED_FUNCS		10
503706f2543Smrg
504706f2543Smrgtypedef pointer (*funcPointer)(void);
505706f2543Smrg
506706f2543Smrg/* flags for depth 24 pixmap options */
507706f2543Smrgtypedef enum {
508706f2543Smrg    Pix24DontCare = 0,
509706f2543Smrg    Pix24Use24,
510706f2543Smrg    Pix24Use32
511706f2543Smrg} Pix24Flags;
512706f2543Smrg
513706f2543Smrg/* Power management events: so far we only support APM */
514706f2543Smrg
515706f2543Smrgtypedef enum {
516706f2543Smrg    XF86_APM_UNKNOWN = -1,
517706f2543Smrg    XF86_APM_SYS_STANDBY,
518706f2543Smrg    XF86_APM_SYS_SUSPEND,
519706f2543Smrg    XF86_APM_CRITICAL_SUSPEND,
520706f2543Smrg    XF86_APM_USER_STANDBY,
521706f2543Smrg    XF86_APM_USER_SUSPEND,
522706f2543Smrg    XF86_APM_STANDBY_RESUME,
523706f2543Smrg    XF86_APM_NORMAL_RESUME,
524706f2543Smrg    XF86_APM_CRITICAL_RESUME,
525706f2543Smrg    XF86_APM_LOW_BATTERY,
526706f2543Smrg    XF86_APM_POWER_STATUS_CHANGE,
527706f2543Smrg    XF86_APM_UPDATE_TIME,
528706f2543Smrg    XF86_APM_CAPABILITY_CHANGED,
529706f2543Smrg    XF86_APM_STANDBY_FAILED,
530706f2543Smrg    XF86_APM_SUSPEND_FAILED
531706f2543Smrg} pmEvent;
532706f2543Smrg
533706f2543Smrgtypedef enum {
534706f2543Smrg    PM_WAIT,
535706f2543Smrg    PM_CONTINUE,
536706f2543Smrg    PM_FAILED,
537706f2543Smrg    PM_NONE
538706f2543Smrg} pmWait;
539706f2543Smrg
540706f2543Smrgtypedef struct _PciChipsets {
541706f2543Smrg    /**
542706f2543Smrg     * Key used to match this device with its name in an array of
543706f2543Smrg     * \c SymTabRec.
544706f2543Smrg     */
545706f2543Smrg    int numChipset;
546706f2543Smrg
547706f2543Smrg    /**
548706f2543Smrg     * This value is quirky.  Depending on the driver, it can take on one of
549706f2543Smrg     * three meanings.  In drivers that have exactly one vendor ID (e.g.,
550706f2543Smrg     * radeon, mga, i810) the low 16-bits are the device ID.
551706f2543Smrg     *
552706f2543Smrg     * In drivers that can have multiple vendor IDs (e.g., the glint driver
553706f2543Smrg     * can have either 3dlabs' ID or TI's ID, the i740 driver can have either
554706f2543Smrg     * Intel's ID or Real3D's ID, etc.) the low 16-bits are the device ID and
555706f2543Smrg     * the high 16-bits are the vendor ID.
556706f2543Smrg     *
557706f2543Smrg     * In drivers that don't have a specific vendor (e.g., vga) contains the
558706f2543Smrg     * device ID for either the generic VGA or generic 8514 devices.  This
559706f2543Smrg     * turns out to be the same as the subclass and programming interface
560706f2543Smrg     * value (e.g., the full 24-bit class for the VGA device is 0x030000 (or
561706f2543Smrg     * 0x000101) and for 8514 is 0x030001).
562706f2543Smrg     */
563706f2543Smrg    int PCIid;
564706f2543Smrg
565706f2543Smrg/* dummy place holders for drivers to build against old/new servers */
566706f2543Smrg#define RES_UNDEFINED NULL
567706f2543Smrg#define RES_EXCLUSIVE_VGA NULL
568706f2543Smrg#define RES_SHARED_VGA NULL
569706f2543Smrg    void *dummy;
570706f2543Smrg} PciChipsets;
571706f2543Smrg
572706f2543Smrg
573706f2543Smrg/* Entity properties */
574706f2543Smrgtypedef void (*EntityProc)(int entityIndex,pointer private);
575706f2543Smrg
576706f2543Smrgtypedef struct _entityInfo {
577706f2543Smrg    int index;
578706f2543Smrg    BusRec location;
579706f2543Smrg    int chipset;
580706f2543Smrg    Bool active;
581706f2543Smrg    GDevPtr device;
582706f2543Smrg    DriverPtr driver;
583706f2543Smrg} EntityInfoRec, *EntityInfoPtr;
584706f2543Smrg
585706f2543Smrg/* DGA */
586706f2543Smrg
587706f2543Smrgtypedef struct {
588706f2543Smrg   int num;		/* A unique identifier for the mode (num > 0) */
589706f2543Smrg   DisplayModePtr mode;
590706f2543Smrg   int flags;		/* DGA_CONCURRENT_ACCESS, etc... */
591706f2543Smrg   int imageWidth;	/* linear accessible portion (pixels) */
592706f2543Smrg   int imageHeight;
593706f2543Smrg   int pixmapWidth;	/* Xlib accessible portion (pixels) */
594706f2543Smrg   int pixmapHeight;	/* both fields ignored if no concurrent access */
595706f2543Smrg   int bytesPerScanline;
596706f2543Smrg   int byteOrder;	/* MSBFirst, LSBFirst */
597706f2543Smrg   int depth;
598706f2543Smrg   int bitsPerPixel;
599706f2543Smrg   unsigned long red_mask;
600706f2543Smrg   unsigned long green_mask;
601706f2543Smrg   unsigned long blue_mask;
602706f2543Smrg   short visualClass;
603706f2543Smrg   int viewportWidth;
604706f2543Smrg   int viewportHeight;
605706f2543Smrg   int xViewportStep;	/* viewport position granularity */
606706f2543Smrg   int yViewportStep;
607706f2543Smrg   int maxViewportX;	/* max viewport origin */
608706f2543Smrg   int maxViewportY;
609706f2543Smrg   int viewportFlags;	/* types of page flipping possible */
610706f2543Smrg   int offset;		/* offset into physical memory */
611706f2543Smrg   unsigned char *address;	/* server's mapped framebuffer */
612706f2543Smrg   int reserved1;
613706f2543Smrg   int reserved2;
614706f2543Smrg} DGAModeRec, *DGAModePtr;
615706f2543Smrg
616706f2543Smrgtypedef struct {
617706f2543Smrg   DGAModePtr mode;
618706f2543Smrg   PixmapPtr pPix;
619706f2543Smrg} DGADeviceRec, *DGADevicePtr;
620706f2543Smrg
621706f2543Smrg/*
622706f2543Smrg * Flags for driver Probe() functions.
623706f2543Smrg */
624706f2543Smrg#define PROBE_DEFAULT	  0x00
625706f2543Smrg#define PROBE_DETECT	  0x01
626706f2543Smrg#define PROBE_TRYHARD	  0x02
627706f2543Smrg
628706f2543Smrg/*
629706f2543Smrg * Driver entry point types
630706f2543Smrg */
631706f2543Smrg
632706f2543Smrgtypedef Bool xf86ProbeProc                (DriverPtr, int);
633706f2543Smrgtypedef Bool xf86PreInitProc              (ScrnInfoPtr, int);
634706f2543Smrgtypedef Bool xf86ScreenInitProc           (int, ScreenPtr, int, char**);
635706f2543Smrgtypedef Bool xf86SwitchModeProc           (int, DisplayModePtr, int);
636706f2543Smrgtypedef void xf86AdjustFrameProc          (int, int, int, int);
637706f2543Smrgtypedef Bool xf86EnterVTProc              (int, int);
638706f2543Smrgtypedef void xf86LeaveVTProc              (int, int);
639706f2543Smrgtypedef void xf86FreeScreenProc           (int, int);
640706f2543Smrgtypedef ModeStatus xf86ValidModeProc      (int, DisplayModePtr, Bool, int);
641706f2543Smrgtypedef void xf86EnableDisableFBAccessProc(int, Bool);
642706f2543Smrgtypedef int  xf86SetDGAModeProc           (int, int, DGADevicePtr);
643706f2543Smrgtypedef int  xf86ChangeGammaProc          (int, Gamma);
644706f2543Smrgtypedef void xf86PointerMovedProc         (int, int, int);
645706f2543Smrgtypedef Bool xf86PMEventProc              (int, pmEvent, Bool);
646706f2543Smrgtypedef void xf86DPMSSetProc		  (ScrnInfoPtr, int, int);
647706f2543Smrgtypedef void xf86LoadPaletteProc   (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
648706f2543Smrgtypedef void xf86SetOverscanProc          (ScrnInfoPtr, int);
649706f2543Smrgtypedef void xf86ModeSetProc              (ScrnInfoPtr);
650706f2543Smrg
651706f2543Smrg
652706f2543Smrg/*
653706f2543Smrg * ScrnInfoRec
654706f2543Smrg *
655706f2543Smrg * There is one of these for each screen, and it holds all the screen-specific
656706f2543Smrg * information.
657706f2543Smrg *
658706f2543Smrg * Note: the size and layout must be kept the same across versions.  New
659706f2543Smrg * fields are to be added in place of the "reserved*" fields.  No fields
660706f2543Smrg * are to be dependent on compile-time defines.
661706f2543Smrg */
662706f2543Smrg
663706f2543Smrg
664706f2543Smrgtypedef struct _ScrnInfoRec {
665706f2543Smrg    int			driverVersion;
666706f2543Smrg    char *		driverName;		/* canonical name used in */
667706f2543Smrg						/* the config file */
668706f2543Smrg    ScreenPtr		pScreen;		/* Pointer to the ScreenRec */
669706f2543Smrg    int			scrnIndex;		/* Number of this screen */
670706f2543Smrg    Bool		configured;		/* Is this screen valid */
671706f2543Smrg    int			origIndex;		/* initial number assigned to
672706f2543Smrg						 * this screen before
673706f2543Smrg						 * finalising the number of
674706f2543Smrg						 * available screens */
675706f2543Smrg
676706f2543Smrg    /* Display-wide screenInfo values needed by this screen */
677706f2543Smrg    int			imageByteOrder;
678706f2543Smrg    int			bitmapScanlineUnit;
679706f2543Smrg    int			bitmapScanlinePad;
680706f2543Smrg    int			bitmapBitOrder;
681706f2543Smrg    int			numFormats;
682706f2543Smrg    PixmapFormatRec	formats[MAXFORMATS];
683706f2543Smrg    PixmapFormatRec	fbFormat;
684706f2543Smrg
685706f2543Smrg    int			bitsPerPixel;		/* fb bpp */
686706f2543Smrg    Pix24Flags		pixmap24;		/* pixmap pref for depth 24 */
687706f2543Smrg    int			depth;			/* depth of default visual */
688706f2543Smrg    MessageType		depthFrom;		/* set from config? */
689706f2543Smrg    MessageType		bitsPerPixelFrom;	/* set from config? */
690706f2543Smrg    rgb			weight;			/* r/g/b weights */
691706f2543Smrg    rgb			mask;			/* rgb masks */
692706f2543Smrg    rgb			offset;			/* rgb offsets */
693706f2543Smrg    int			rgbBits;		/* Number of bits in r/g/b */
694706f2543Smrg    Gamma		gamma;			/* Gamma of the monitor */
695706f2543Smrg    int			defaultVisual;		/* default visual class */
696706f2543Smrg    int			maxHValue;		/* max horizontal timing */
697706f2543Smrg    int			maxVValue;		/* max vertical timing value */
698706f2543Smrg    int			virtualX;		/* Virtual width */
699706f2543Smrg    int			virtualY; 		/* Virtual height */
700706f2543Smrg    int			xInc;			/* Horizontal timing increment */
701706f2543Smrg    MessageType		virtualFrom;		/* set from config? */
702706f2543Smrg    int			displayWidth;		/* memory pitch */
703706f2543Smrg    int			frameX0;		/* viewport position */
704706f2543Smrg    int			frameY0;
705706f2543Smrg    int			frameX1;
706706f2543Smrg    int			frameY1;
707706f2543Smrg    int			zoomLocked;		/* Disallow mode changes */
708706f2543Smrg    DisplayModePtr	modePool;		/* list of compatible modes */
709706f2543Smrg    DisplayModePtr	modes;			/* list of actual modes */
710706f2543Smrg    DisplayModePtr	currentMode;		/* current mode
711706f2543Smrg						 * This was previously
712706f2543Smrg						 * overloaded with the modes
713706f2543Smrg						 * field, which is a pointer
714706f2543Smrg						 * into a circular list */
715706f2543Smrg    confScreenPtr	confScreen;		/* Screen config info */
716706f2543Smrg    MonPtr		monitor;		/* Monitor information */
717706f2543Smrg    DispPtr		display;		/* Display information */
718706f2543Smrg    int *		entityList;		/* List of device entities */
719706f2543Smrg    int			numEntities;
720706f2543Smrg    int			widthmm;		/* physical display dimensions
721706f2543Smrg						 * in mm */
722706f2543Smrg    int			heightmm;
723706f2543Smrg    int			xDpi;			/* width DPI */
724706f2543Smrg    int			yDpi;			/* height DPI */
725706f2543Smrg    char *		name;			/* Name to prefix messages */
726706f2543Smrg    pointer		driverPrivate;		/* Driver private area */
727706f2543Smrg    DevUnion *		privates;		/* Other privates can hook in
728706f2543Smrg						 * here */
729706f2543Smrg    DriverPtr		drv;			/* xf86DriverList[] entry */
730706f2543Smrg    pointer		module;			/* Pointer to module head */
731706f2543Smrg    int			colorKey;
732706f2543Smrg    int			overlayFlags;
733706f2543Smrg
734706f2543Smrg    /* Some of these may be moved out of here into the driver private area */
735706f2543Smrg
736706f2543Smrg    char *		chipset;		/* chipset name */
737706f2543Smrg    char *		ramdac;			/* ramdac name */
738706f2543Smrg    char *		clockchip;		/* clock name */
739706f2543Smrg    Bool		progClock;		/* clock is programmable */
740706f2543Smrg    int			numClocks;		/* number of clocks */
741706f2543Smrg    int			clock[MAXCLOCKS];	/* list of clock frequencies */
742706f2543Smrg    int			videoRam;		/* amount of video ram (kb) */
743706f2543Smrg    unsigned long	biosBase;		/* Base address of video BIOS */
744706f2543Smrg    unsigned long	memPhysBase;		/* Physical address of FB */
745706f2543Smrg    unsigned long 	fbOffset;		/* Offset of FB in the above */
746706f2543Smrg    IOADDRESS    	domainIOBase;		/* Domain I/O base address */
747706f2543Smrg    int			memClk;			/* memory clock */
748706f2543Smrg    int			textClockFreq;		/* clock of text mode */
749706f2543Smrg    Bool		flipPixels;		/* swap default black/white */
750706f2543Smrg    pointer		options;
751706f2543Smrg
752706f2543Smrg    int			chipID;
753706f2543Smrg    int			chipRev;
754706f2543Smrg
755706f2543Smrg    /* Allow screens to be enabled/disabled individually */
756706f2543Smrg    Bool		vtSema;
757706f2543Smrg
758706f2543Smrg    /* hw cursor moves at SIGIO time */
759706f2543Smrg    Bool		silkenMouse;
760706f2543Smrg
761706f2543Smrg    /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
762706f2543Smrg    ClockRangePtr	clockRanges;
763706f2543Smrg    int			adjustFlags;
764706f2543Smrg
765706f2543Smrg    /*
766706f2543Smrg     * These can be used when the minor ABI version is incremented.
767706f2543Smrg     * The NUM_* parameters must be reduced appropriately to keep the
768706f2543Smrg     * structure size and alignment unchanged.
769706f2543Smrg     */
770706f2543Smrg    int			reservedInt[NUM_RESERVED_INTS];
771706f2543Smrg
772706f2543Smrg    int *		entityInstanceList;
773706f2543Smrg    struct pci_device   *vgaDev;
774706f2543Smrg
775706f2543Smrg    pointer		reservedPtr[NUM_RESERVED_POINTERS];
776706f2543Smrg
777706f2543Smrg    /*
778706f2543Smrg     * Driver entry points.
779706f2543Smrg     *
780706f2543Smrg     */
781706f2543Smrg
782706f2543Smrg    xf86ProbeProc			*Probe;
783706f2543Smrg    xf86PreInitProc			*PreInit;
784706f2543Smrg    xf86ScreenInitProc			*ScreenInit;
785706f2543Smrg    xf86SwitchModeProc			*SwitchMode;
786706f2543Smrg    xf86AdjustFrameProc			*AdjustFrame;
787706f2543Smrg    xf86EnterVTProc			*EnterVT;
788706f2543Smrg    xf86LeaveVTProc			*LeaveVT;
789706f2543Smrg    xf86FreeScreenProc			*FreeScreen;
790706f2543Smrg    xf86ValidModeProc			*ValidMode;
791706f2543Smrg    xf86EnableDisableFBAccessProc	*EnableDisableFBAccess;
792706f2543Smrg    xf86SetDGAModeProc			*SetDGAMode;
793706f2543Smrg    xf86ChangeGammaProc			*ChangeGamma;
794706f2543Smrg    xf86PointerMovedProc		*PointerMoved;
795706f2543Smrg    xf86PMEventProc			*PMEvent;
796706f2543Smrg    xf86DPMSSetProc			*DPMSSet;
797706f2543Smrg    xf86LoadPaletteProc			*LoadPalette;
798706f2543Smrg    xf86SetOverscanProc			*SetOverscan;
799706f2543Smrg    xorgDriverFuncProc			*DriverFunc;
800706f2543Smrg    xf86ModeSetProc			*ModeSet;
801706f2543Smrg
802706f2543Smrg    /*
803706f2543Smrg     * This can be used when the minor ABI version is incremented.
804706f2543Smrg     * The NUM_* parameter must be reduced appropriately to keep the
805706f2543Smrg     * structure size and alignment unchanged.
806706f2543Smrg     */
807706f2543Smrg    funcPointer		reservedFuncs[NUM_RESERVED_FUNCS];
808706f2543Smrg
809706f2543Smrg} ScrnInfoRec;
810706f2543Smrg
811706f2543Smrg
812706f2543Smrgtypedef struct {
813706f2543Smrg   Bool (*OpenFramebuffer)(
814706f2543Smrg	ScrnInfoPtr pScrn,
815706f2543Smrg	char **name,
816706f2543Smrg	unsigned char **mem,
817706f2543Smrg	int *size,
818706f2543Smrg	int *offset,
819706f2543Smrg        int *extra
820706f2543Smrg   );
821706f2543Smrg   void	(*CloseFramebuffer)(ScrnInfoPtr pScrn);
822706f2543Smrg   Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
823706f2543Smrg   void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
824706f2543Smrg   int  (*GetViewport)(ScrnInfoPtr pScrn);
825706f2543Smrg   void (*Sync)(ScrnInfoPtr);
826706f2543Smrg   void (*FillRect)(
827706f2543Smrg	ScrnInfoPtr pScrn,
828706f2543Smrg	int x, int y, int w, int h,
829706f2543Smrg	unsigned long color
830706f2543Smrg   );
831706f2543Smrg   void (*BlitRect)(
832706f2543Smrg	ScrnInfoPtr pScrn,
833706f2543Smrg	int srcx, int srcy,
834706f2543Smrg	int w, int h,
835706f2543Smrg	int dstx, int dsty
836706f2543Smrg   );
837706f2543Smrg   void (*BlitTransRect)(
838706f2543Smrg	ScrnInfoPtr pScrn,
839706f2543Smrg	int srcx, int srcy,
840706f2543Smrg	int w, int h,
841706f2543Smrg	int dstx, int dsty,
842706f2543Smrg	unsigned long color
843706f2543Smrg   );
844706f2543Smrg} DGAFunctionRec, *DGAFunctionPtr;
845706f2543Smrg
846706f2543Smrgtypedef struct _SymTabRec {
847706f2543Smrg    int			token;		/* id of the token */
848706f2543Smrg    const char *	name;		/* token name */
849706f2543Smrg} SymTabRec, *SymTabPtr;
850706f2543Smrg
851706f2543Smrg/* flags for xf86LookupMode */
852706f2543Smrgtypedef enum {
853706f2543Smrg    LOOKUP_DEFAULT		= 0,	/* Use default mode lookup method */
854706f2543Smrg    LOOKUP_BEST_REFRESH,		/* Pick modes with best refresh */
855706f2543Smrg    LOOKUP_CLOSEST_CLOCK,		/* Pick modes with the closest clock */
856706f2543Smrg    LOOKUP_LIST_ORDER,			/* Pick first useful mode in list */
857706f2543Smrg    LOOKUP_CLKDIV2		= 0x0100, /* Allow half clocks */
858706f2543Smrg    LOOKUP_OPTIONAL_TOLERANCES	= 0x0200  /* Allow missing hsync/vrefresh */
859706f2543Smrg} LookupModeFlags;
860706f2543Smrg
861706f2543Smrg#define NoDepth24Support	0x00
862706f2543Smrg#define Support24bppFb		0x01	/* 24bpp framebuffer supported */
863706f2543Smrg#define Support32bppFb		0x02	/* 32bpp framebuffer supported */
864706f2543Smrg#define SupportConvert24to32	0x04	/* Can convert 24bpp pixmap to 32bpp */
865706f2543Smrg#define SupportConvert32to24	0x08	/* Can convert 32bpp pixmap to 24bpp */
866706f2543Smrg#define PreferConvert24to32	0x10	/* prefer 24bpp pixmap to 32bpp conv */
867706f2543Smrg#define PreferConvert32to24	0x20	/* prefer 32bpp pixmap to 24bpp conv */
868706f2543Smrg
869706f2543Smrg
870706f2543Smrg/* For DPMS */
871706f2543Smrgtypedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
872706f2543Smrg
873706f2543Smrg/* Input handler proc */
874706f2543Smrgtypedef void (*InputHandlerProc)(int fd, pointer data);
875706f2543Smrg
876706f2543Smrg/* These are used by xf86GetClocks */
877706f2543Smrg#define CLK_REG_SAVE		-1
878706f2543Smrg#define CLK_REG_RESTORE		-2
879706f2543Smrg
880706f2543Smrg/*
881706f2543Smrg * misc constants
882706f2543Smrg */
883706f2543Smrg#define INTERLACE_REFRESH_WEIGHT	1.5
884706f2543Smrg#define SYNC_TOLERANCE		0.01	/* 1 percent */
885706f2543Smrg#define CLOCK_TOLERANCE		2000	/* Clock matching tolerance (2MHz) */
886706f2543Smrg
887706f2543Smrg
888706f2543Smrg#define OVERLAY_8_32_DUALFB	0x00000001
889706f2543Smrg#define OVERLAY_8_24_DUALFB	0x00000002
890706f2543Smrg#define OVERLAY_8_16_DUALFB	0x00000004
891706f2543Smrg#define OVERLAY_8_32_PLANAR	0x00000008
892706f2543Smrg
893706f2543Smrg/* Values of xf86Info.mouseFlags */
894706f2543Smrg#define MF_CLEAR_DTR       1
895706f2543Smrg#define MF_CLEAR_RTS       2
896706f2543Smrg
897706f2543Smrg/* Action Events */
898706f2543Smrgtypedef enum {
899706f2543Smrg    ACTION_TERMINATE		= 0,	/* Terminate Server */
900706f2543Smrg    ACTION_NEXT_MODE		= 10,	/* Switch to next video mode */
901706f2543Smrg    ACTION_PREV_MODE,
902706f2543Smrg    ACTION_SWITCHSCREEN		= 100,	/* VT switch */
903706f2543Smrg    ACTION_SWITCHSCREEN_NEXT,
904706f2543Smrg    ACTION_SWITCHSCREEN_PREV,
905706f2543Smrg} ActionEvent;
906706f2543Smrg
907706f2543Smrg#endif /* _XF86STR_H */
908