1 dawes 1.1.2.30 /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.1.2.29 1998/01/26 14:05:37 dawes Exp $ */
|
2 dawes 1.1.2.1
3 /*
4 * Copyright (c) 1997 by The XFree86 Project, Inc.
5 */
6
7 /*
8 * This file contains definitions of the public XFree86 data structures/types.
9 * Any data structures that video drivers need to access should go here.
10 */
11
12 #ifndef _XF86STR_H
13 #define _XF86STR_H
14
15 #include "misc.h"
16 #include "input.h"
17 #include "scrnintstr.h"
|
18 hohndel 1.1.2.4 #include "xf86Option.h"
|
19 dawes 1.1.2.10 #include "xf86Module.h"
|
20 dawes 1.1.2.1
21
22 /* Video mode flags */
23
24 typedef enum {
25 V_PHSYNC = 0x0001,
26 V_NHSYNC = 0x0002,
27 V_PVSYNC = 0x0004,
28 V_NVSYNC = 0x0008,
29 V_INTERLACE = 0x0010,
30 V_DBLSCAN = 0x0020,
31 V_CSYNC = 0x0040,
32 V_PCSYNC = 0x0080,
33 V_NCSYNC = 0x0100,
34 V_HSKEW = 0x0200, /* hskew provided */
35 V_PIXMUX = 0x1000,
36 V_DBLCLK = 0x2000,
37 V_CLKDIV2 = 0x4000
38 } ModeFlags;
39
|
40 dawes 1.1.2.30 typedef enum {
41 INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
42 } CrtcAdjustFlags;
43
44
|
45 dawes 1.1.2.13 /* These are possible return values for xf86CheckMode() and ValidMode() */
46 typedef enum {
47 MODE_OK = 0, /* Mode OK */
48 MODE_HSYNC, /* hsync out of range */
49 MODE_VSYNC, /* vsync out of range */
|
50 dawes 1.1.2.16 MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
51 MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
|
52 dawes 1.1.2.13 MODE_BAD_WIDTH, /* requires an unsupported linepitch */
|
53 dawes 1.1.2.14 MODE_NOMODE, /* no mode with a maching name */
|
54 dawes 1.1.2.13 MODE_NO_INTERLACE, /* interlaced mode not supported */
55 MODE_NO_DBLESCAN, /* doublescan mode not supported */
56 MODE_MEM, /* insufficient video memory */
|
57 dawes 1.1.2.16 MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
58 MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
59 MODE_MEM_VIRT, /* insufficient video memory given virtual size */
|
60 dawes 1.1.2.13 MODE_NOCLOCK, /* no fixed clock available */
61 MODE_CLOCK_HIGH, /* clock required is too high */
62 MODE_CLOCK_LOW, /* clock required is too low */
|
63 dawes 1.1.2.14 MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
64 MODE_BAD_HVALUE, /* horizontal timing was out of range */
65 MODE_BAD_VVALUE, /* vertical timing was out of range */
66 MODE_BAD, /* unspecified reason */
67 MODE_ERROR = -1 /* error condition */
|
68 dawes 1.1.2.13 } ModeStatus;
69
|
70 dawes 1.1.2.1 /* Video mode */
71
72 typedef struct _DisplayModeRec {
73 struct _DisplayModeRec * prev;
74 struct _DisplayModeRec * next;
75 char * name; /* identifier for the mode */
|
76 dawes 1.1.2.13 ModeStatus status;
|
77 dawes 1.1.2.1
78 /* These are the values that the user sees/provides */
79 int Clock; /* pixel clock freq */
80 int HDisplay; /* horizontal timing */
81 int HSyncStart;
82 int HSyncEnd;
83 int HTotal;
84 int HSkew;
85 int VDisplay; /* vertical timing */
86 int VSyncStart;
87 int VSyncEnd;
88 int VTotal;
|
89 dawes 1.1.2.14 int Flags;
|
90 dawes 1.1.2.1
91 /* These are the values the hardware uses */
92 int ClockIndex;
93 int SynthClock; /* Actual clock freq to
94 * be programmed */
95 int CrtcHDisplay;
96 int CrtcHSyncStart;
97 int CrtcHSyncEnd;
98 int CrtcHTotal;
99 int CrtcHSkew;
100 int CrtcVDisplay;
101 int CrtcVSyncStart;
102 int CrtcVSyncEnd;
103 int CrtcVTotal;
104 Bool CrtcHAdjusted;
105 Bool CrtcVAdjusted;
106 int PrivSize;
107 INT32 * Private;
108 } DisplayModeRec, *DisplayModePtr;
109
110 /* The monitor description */
111 dawes 1.1.2.1
112 #define MAX_HSYNC 8
113 #define MAX_VREFRESH 8
114
115 typedef struct { float hi, lo; } range;
116
|
117 dawes 1.1.2.17 typedef struct { int red, green, blue; } rgb;
118
|
119 dawes 1.1.2.1 typedef struct {
120 char * id;
121 char * vendor;
122 char * model;
|
123 dawes 1.1.2.22 int dpmsSupport;
|
124 dawes 1.1.2.16 int nHsync;
|
125 dawes 1.1.2.1 range hsync[MAX_HSYNC];
|
126 dawes 1.1.2.16 int nVrefresh;
|
127 dawes 1.1.2.1 range vrefresh[MAX_VREFRESH];
128 DisplayModePtr Modes; /* Start of the monitor's mode list */
129 DisplayModePtr Last; /* End of the monitor's mode list */
130 } MonRec, *MonPtr;
131
132 /* the list of clock ranges */
133 typedef struct x_ClockRange {
134 struct x_ClockRange *next;
135 int minClock;
136 int maxClock;
|
137 dawes 1.1.2.13 int clockIndex; /* -1 for programmable clocks */
|
138 dawes 1.1.2.1 Bool interlaceAllowed;
139 Bool doubleScanAllowed;
140 } ClockRange, *ClockRangePtr;
141
|
142 dawes 1.1.2.3 /* Public bus-related types */
|
143 dawes 1.1.2.2
144 /* A crude attempt to characterise ISA/VLB types */
145 typedef enum {
146 ISA_COLOR,
147 ISA_MONO,
148 ISA_OTHER
|
149 dawes 1.1.2.3 } IsaBusType;
|
150 dawes 1.1.2.2
151 /* Differnet PCI video cards */
152 typedef enum {
153 PCI_ONLY,
154 PCI_VGA,
155 PCI_SHARED_VGA
|
156 dawes 1.1.2.3 } PciBusType;
|
157 dawes 1.1.2.2
158
|
159 dawes 1.1.2.1 #define MAXCLOCKS 128
|
160 dawes 1.1.2.26 typedef enum {
161 DAC_BPP8 = 0,
162 DAC_BPP16,
163 DAC_BPP24,
164 DAC_BPP32,
165 MAXDACSPEEDS
166 } DacSpeedIndex;
167
|
168 dawes 1.1.2.9 typedef struct {
169 char *identifier;
170 char *vendor;
171 char *board;
172 char *chipset;
173 char *ramdac;
|
174 hohndel 1.1.2.21 char *driver;
175 struct _confscreenrec *myScreenSection;
176 Bool claimed;
|
177 dawes 1.1.2.9 int dacSpeeds[MAXDACSPEEDS];
178 int clocks;
179 int clock[MAXCLOCKS];
|
180 hohndel 1.1.2.20 char *clockchip;
|
181 dawes 1.1.2.28 char *busID;
|
182 dawes 1.1.2.9 OFlagSet options;
183 OFlagSet clockOptions;
184 OFlagSet xconfigFlag;
185 int videoRam;
186 unsigned long speedup;
187 char *clockprog;
188 int textClockValue;
|
189 dawes 1.1.2.26 int BiosBase; /* Base address of video BIOS */
|
190 dawes 1.1.2.9 unsigned long MemBase; /* Frame buffer base address */
|
191 dawes 1.1.2.26 unsigned long IOBase;
192 unsigned int DACBase;
193 unsigned long COPBase;
194 unsigned int POSBase;
|
195 dawes 1.1.2.9 int instance;
196 int s3Madjust;
197 int s3Nadjust;
198 int s3MClk;
199 int chipID;
200 int chipRev;
|
201 dawes 1.1.2.26 unsigned long VGABase; /* VGA ot XGA 64K aperture base address */
|
202 dawes 1.1.2.9 int s3RefClk;
203 int s3BlankDelay;
204 char *DCConfig;
205 char *DCOptions;
206 int MemClk; /* General flag used for memory clocking */
207 } GDevRec, *GDevPtr;
208
209 typedef struct {
210 int vendor;
211 int chipType;
212 int chipRev;
213 int bus;
214 int device;
215 int func;
216 unsigned long memBase[6];
217 unsigned long ioBase[6];
218 unsigned long biosBase;
219 pointer thisCard;
220 } pciVideoRec, *pciVideoPtr;
|
221 hohndel 1.1.2.18
222 typedef struct {
223 int frameX0;
224 int frameY0;
225 int virtualX;
226 int virtualY;
227 int depth;
|
228 dawes 1.1.2.28 int bpp;
|
229 hohndel 1.1.2.20 char ** modes;
|
230 hohndel 1.1.2.18 } DispRec, *DispPtr;
231
|
232 hohndel 1.1.2.21 typedef struct _confscreenrec {
|
233 dawes 1.1.2.28 char * id;
|
234 hohndel 1.1.2.18 int colordepth;
235 MonPtr monitor;
236 GDevPtr device;
|
237 dawes 1.1.2.29 int numdisplays;
|
238 hohndel 1.1.2.18 DispPtr displays;
239 } confScreenRec, *confScreenPtr;
240
|
241 hohndel 1.1.2.21 typedef struct _screenlayoutrec {
|
242 hohndel 1.1.2.18 confScreenPtr screen;
243 confScreenPtr top;
244 confScreenPtr bottom;
245 confScreenPtr left;
246 confScreenPtr right;
247 } screenLayoutRec, *screenLayoutPtr;
|
248 dawes 1.1.2.9
|
249 dawes 1.1.2.1 /* These values should be adjusted when new fields are added to ScrnInfoRec */
250 #define NUM_RESERVED_INTS 16
251 #define NUM_RESERVED_POINTERS 16
252 #define NUM_RESERVED_FUNCS 16
253
254 typedef pointer (*funcPointer)(void);
255
256 /*
257 * ScrnInfoRec
258 *
259 * There is one of these for each screen, and it holds all the screen-specific
260 * information.
261 *
262 * Note: the size and layout must be kept the same across versions. New
263 * fields are to be added in place of the "reserved*" fields. No fields
264 * are to be dependent on complie-time defines.
265 */
266
267 typedef struct _ScrnInfoRec {
268 int driverVersion;
|
269 hohndel 1.1.2.21 char * driverName; /* canonical name used in */
270 /* the config file */
|
271 dawes 1.1.2.1 ScreenPtr pScreen; /* Pointer to the ScreenRec */
272 int scrnIndex; /* Number of this screen */
273 Bool configured; /* Is this screen valid */
274 int tmpIndex; /* initial number assigned to
275 * this screen before
276 * finalising the number of
|
277 dawes 1.1.2.13 * available screens */
|
278 dawes 1.1.2.1 int bitsPerPixel; /* bpp for default visual */
279 int depth; /* depth of default visual */
|
280 dawes 1.1.2.17 rgb weight; /* r/g/b weights */
281 rgb mask; /* rgb masks */
|
282 dawes 1.1.2.13 int rgbBits; /* Number of bits in r/g/b */
|
283 dawes 1.1.2.1 float redGamma; /* Gamma values */
284 float blueGamma; /* Gamma values */
285 float greenGamma; /* Gamma values */
286 int defaultVisual; /* default visual class */
|
287 dawes 1.1.2.14 int maxHValue; /* max horizontal timing */
288 int maxVValue; /* max vertical timing value */
|
289 dawes 1.1.2.1 int virtualX; /* Virtual width */
290 int virtualY; /* Virtual height */
291 int displayWidth; /* memory pitch */
292 int frameX0; /* viewport position */
293 int frameY0;
294 int frameX1;
295 int frameY1;
|
296 dawes 1.1.2.6 int zoomLocked; /* Disallow mode changes */
|
297 dawes 1.1.2.14 DisplayModePtr modePool; /* list of compatible modes */
298 DisplayModePtr modes; /* list of actual modes */
|
299 dawes 1.1.2.1 DisplayModePtr currentMode; /* current mode
|
300 dawes 1.1.2.10 * This was previously
|
301 dawes 1.1.2.1 * overloaded with the modes
302 * field, which is a pointer
303 * into a circular list */
|
304 dawes 1.1.2.28 confScreenPtr confScreen; /* Screen config info */
|
305 dawes 1.1.2.1 MonPtr monitor; /* Monitor information */
306 GDevPtr device; /* device information */
|
307 dawes 1.1.2.27 DispPtr display; /* Display information */
|
308 dawes 1.1.2.9 int width; /* physical display dimensions
|
309 dawes 1.1.2.1 * in mm */
310 int height;
311 char * name; /* Name to prefix messages */
312 pointer driverPrivate; /* Driver private area */
313 int numPrivates; /* Number of privates */
314 DevUnion * privates; /* Other privates can hook in
|
315 dawes 1.1.2.10 * here */
|
316 dawes 1.1.2.1
|
317 dawes 1.1.2.2 char ** requiredModules; /* List of modules needed */
|
318 dawes 1.1.2.1
319 /* Some of these may be moved out of here into the driver private area */
320
321 OFlagSet options; /* Option flags */
322 char * chipset; /* chipset name */
323 char * ramdac; /* ramdac name */
|
324 dawes 1.1.2.13 char * clockchip; /* clock name */
325 Bool progClock; /* clock is programmable */
|
326 dawes 1.1.2.1 int dacSpeeds[MAXDACSPEEDS];/* list of clock limits */
327 int numClocks; /* number of clocks */
328 int clock[MAXCLOCKS]; /* list of clock frequencies */
329 int minClock; /* min clock frequency */
330 int maxClock; /* max clock frequency */
|
331 dawes 1.1.2.16 ClockRangePtr clockRanges; /* clock ranges */
|
332 dawes 1.1.2.1 int videoRam; /* amount of video ram (kb) */
333 unsigned long biosBase; /* Base address of video BIOS */
334 unsigned long memBase; /* Frame buffer base address */
335 #if 0 /* This should go */
336 unsigned long speedup; /* Use SpeedUp code */
337 #endif
338 int memClk; /* memory clock */
|
339 dawes 1.1.2.13 int textClockFreq; /* clock of text mode */
|
340 dawes 1.1.2.1
341 Bool bankedMono;
|
342 dawes 1.1.2.17 rgb blackColour;
343 rgb whiteColour;
|
344 dawes 1.1.2.1
345 #if 0 /* Out of date (obsoleted with the new parser code) */
346 int * validTokens;
347 #endif
348
349 int chipID;
350 int chipRev;
|
351 dawes 1.1.2.6
|
352 dawes 1.1.2.7 /* This is here to allow for DGA to be enabled on a single screen. */
353 Bool vtSema;
354
355 /* Keep track of the DGA state */
|
356 dawes 1.1.2.8 Bool DGAActive;
|
357 dawes 1.1.2.6 int DGAFlags;
|
358 dawes 1.1.2.1
359 #if 0
360 /* These definitely belong in the driver private area */
361 unsigned int IObase; /* AGX - video card I/O reg base */
362 unsigned int DACbase; /* AGX - dac I/O reg base */
363 unsigned long COPbase; /* AGX - coprocessor memory base */
364 unsigned int POSbase; /* AGX - I/O address of POS regs */
365 int instance; /* AGX - XGA video card instance number */
366 unsigned long VGAbase; /* AGX - 64K aperture memory address */
367 int s3Madjust;
368 int s3Nadjust;
369 int s3MClk;
370 int s3RefClk;
371 int s3BlankDelay;
372 #endif
373
374 int reservedInt[NUM_RESERVED_INTS];
375 pointer reservedPtr[NUM_RESERVED_POINTERS];
376
|
377 dawes 1.1.2.5 /*
378 * Driver entry points.
379 *
380 * All of the mandatory entry points are here, even though some don't
381 * need to be accessed through this structure (for example if they
382 * are registered directly through pScreen).
383 *
384 * The mandatory ones are: Probe, PreInit, ScreenInit, EnterVT,
385 * LeaveVT, CloseScreen, SaveScreen.
386 */
|
387 dawes 1.1.2.1
388 Bool (*ParseConfig)(/* undecided */);
389 Bool (*Probe)(int flags);
390 Bool (*PreInit)(struct _ScrnInfoRec *pScrn, int flags);
391 Bool (*ScreenInit)(int scrnIndex, ScreenPtr pScreen,
392 int argc, char **argv);
393 Bool (*SwitchMode)(int scrnIndex, DisplayModePtr mode,
394 int flags);
395 void (*AdjustFrame)(int scrnIndex, int x, int y, int flags);
396 void (*EnterVT)(int scrnIndex, int flags);
397 void (*LeaveVT)(int scrnIndex, int flags);
|
398 dawes 1.1.2.24 CloseScreenProcPtr CloseScreen;
|
399 dawes 1.1.2.2 void (*FreeScreen)(int scrnIndex, int flags);
|
400 dawes 1.1.2.1 int (*ValidMode)(int scrnIndex, DisplayModePtr mode,
401 Bool verbose, int flags);
|
402 dawes 1.1.2.5 Bool (*SaveScreen)(ScreenPtr pScreen, Bool unblank);
|
403 dawes 1.1.2.1
404 /* For DPMS */
405 void (*DPMSSet)(int scrnIndex, int level, int flags);
406
407 /* For DGA */
408 Bool (*GetDGAParameters)(int scrnIndex,
409 unsigned long *physBase,
410 int *physSize, int *memSize);
411 Bool (*DGASetDirectMode)(int scrnIndex, Bool on);
|
412 dawes 1.1.2.7 void (*DGASetBank)(int scrnIndex, int bank, int flags);
|
413 dawes 1.1.2.1
414 funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
415
416 } ScrnInfoRec, *ScrnInfoPtr;
|
417 dawes 1.1.2.2
418 /*
419 * The driver list struct. This contains the information required for each
420 * driver before a ScrnInfoRec has been allocated.
421 */
422 typedef struct {
423 int driverVersion;
424 char * driverName;
425 void (*Register)(int flags);
|
426 dawes 1.1.2.9 Bool (*ParseConfig)(/*ParseInfoPtr raw*/);
|
427 dawes 1.1.2.2 Bool (*Probe)(int flags);
428 pointer parseInfo; /* Driver-specific parsed info */
429 } DriverRec, *DriverPtr;
430
|
431 dawes 1.1.2.1
432 /* These are the possible flags for ValidMode */
433 typedef enum {
434 MODE_USED, /* this mode is really being used in the */
435 /* modes line of the Display Subsection */
436 MODE_SUGGESTED, /* this mode is included in the available*/
437 /* modes in the Monitor Section */
438 MODE_VID /* this is called from the VidMode extension */
439 } ValidModeFlags;
|
440 dawes 1.1.2.9
441 /* flags for xf86SaveRestoreImage */
442 typedef enum {
443 SaveImage,
444 RestoreImage,
445 FreeImage
446 } SaveRestoreFlags;
|
447 dawes 1.1.2.1
448 /* flags for xf86LookupMode */
449 typedef enum {
450 LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
|
451 dawes 1.1.2.14 LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
452 LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
|
453 dawes 1.1.2.16 LOOKUP_LIST_ORDER /* Pick first useful mode in list */
|
454 dawes 1.1.2.1 } LookupModeFlags;
|
455 dawes 1.1.2.13
456 /* Flags for driver messages */
457 typedef enum {
458 X_PROBED, /* Value was probed */
459 X_CONFIG, /* Value was given in the config file */
460 X_DEFAULT, /* Value is a default */
|
461 dawes 1.1.2.25 X_CMDLINE, /* Value was given on the command line */
462 X_NOTICE, /* Notice */
463 X_ERROR, /* Error message */
464 X_WARNING, /* Warning message */
465 X_INFO, /* Informational message */
466 X_NONE /* No prefix */
|
467 dawes 1.1.2.13 } MessageType;
|
468 dawes 1.1.2.1
|
469 hohndel 1.1.2.15 /*
470 * mouse protocol types
471 */
|
472 dawes 1.1.2.19 typedef enum {
473 PROT_MS = 0, /* Microsoft */
474 PROT_MSC, /* Mouse Systems Corp */
475 PROT_MM, /* MMseries */
476 PROT_LOGI, /* Logitech */
477 PROT_BM, /* BusMouse ??? */
478 PROT_LOGIMAN, /* MouseMan / TrackMan */
479 PROT_PS2, /* PS/2 mouse */
480 PROT_MMHIT, /* MM_HitTab */
481 PROT_GLIDEPOINT, /* ALPS GlidePoint */
482 PROT_MSINTELLIMOUSE, /* Microsoft IntelliMouse */
483 NUM_PROTOCOLS /* MUST BE LAST */
484 } MouseProtocol;
|
485 hohndel 1.1.2.15
486 /*
|
487 dawes 1.1.2.19 * keyboard specialKeyMap paramters
|
488 hohndel 1.1.2.15 */
|
489 dawes 1.1.2.19 typedef enum {
490 K_INDEX_LEFTALT = 0,
491 K_INDEX_RIGHTALT,
492 K_INDEX_SCROLLLOCK,
493 K_INDEX_RIGHTCTL,
494 NUM_KEYMAP_TYPES
495 } KeymapIndex;
496
497 typedef enum {
498 KM_META = 0,
499 KM_COMPOSE,
500 KM_MODESHIFT,
501 KM_MODELOCK,
502 KM_SCROLLLOCK,
503 KM_CONTROL
504 } KeymapKey;
|
505 hohndel 1.1.2.15
506 /*
507 * misc constants
508 */
|
509 dawes 1.1.2.1 #define INTERLACE_REFRESH_WEIGHT 1.5
|
510 dawes 1.1.2.16 #define SYNC_TOLERANCE 0.01 /* 1 percent */
511 #define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
|
512 dawes 1.1.2.1
513 #define LD_RESOLV_IFDONE 0 /* only check if no more
514 delays pending */
515 #define LD_RESOLV_NOW 1 /* finish one delay step */
516 #define LD_RESOLV_FORCE 2 /* force checking... */
517
518 #endif /* _XF86STR_H */
|