VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/xf86str.h@ 98148

Last change on this file since 98148 was 69098, checked in by vboxsync, 8 years ago

Clean up XFree86 driver header files.
bugref:3810: X11 Guest Additions maintenance
Over the years we have cleaned up the layout in the tree of the X.Org
header files we use to build drivers. The XFree86 ones were still in their
original, rather sub-optimal layout. This change fixes that.

  • Property svn:eol-style set to native
File size: 29.0 KB
Line 
1/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.90 2002/11/25 14:04:56 eich Exp $ */
2
3/*
4 * Copyright (c) 1997-2000 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#include "pixmapstr.h"
19#include "xf86Module.h"
20#include "xf86Opt.h"
21#include "xf86Pci.h"
22
23/*
24 * memType is of the size of the addressable memory (machine size)
25 * usually unsigned long.
26 */
27typedef unsigned long memType;
28
29/* Video mode flags */
30
31typedef enum {
32 V_PHSYNC = 0x0001,
33 V_NHSYNC = 0x0002,
34 V_PVSYNC = 0x0004,
35 V_NVSYNC = 0x0008,
36 V_INTERLACE = 0x0010,
37 V_DBLSCAN = 0x0020,
38 V_CSYNC = 0x0040,
39 V_PCSYNC = 0x0080,
40 V_NCSYNC = 0x0100,
41 V_HSKEW = 0x0200, /* hskew provided */
42 V_BCAST = 0x0400,
43 V_PIXMUX = 0x1000,
44 V_DBLCLK = 0x2000,
45 V_CLKDIV2 = 0x4000
46} ModeFlags;
47
48typedef enum {
49 INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
50} CrtcAdjustFlags;
51
52/* Flags passed to ChipValidMode() */
53typedef enum {
54 MODECHECK_INITIAL = 0,
55 MODECHECK_FINAL = 1
56} ModeCheckFlags;
57
58/* These are possible return values for xf86CheckMode() and ValidMode() */
59typedef enum {
60 MODE_OK = 0, /* Mode OK */
61 MODE_HSYNC, /* hsync out of range */
62 MODE_VSYNC, /* vsync out of range */
63 MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
64 MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
65 MODE_BAD_WIDTH, /* requires an unsupported linepitch */
66 MODE_NOMODE, /* no mode with a maching name */
67 MODE_NO_INTERLACE, /* interlaced mode not supported */
68 MODE_NO_DBLESCAN, /* doublescan mode not supported */
69 MODE_NO_VSCAN, /* multiscan mode not supported */
70 MODE_MEM, /* insufficient video memory */
71 MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
72 MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
73 MODE_MEM_VIRT, /* insufficient video memory given virtual size */
74 MODE_NOCLOCK, /* no fixed clock available */
75 MODE_CLOCK_HIGH, /* clock required is too high */
76 MODE_CLOCK_LOW, /* clock required is too low */
77 MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
78 MODE_BAD_HVALUE, /* horizontal timing was out of range */
79 MODE_BAD_VVALUE, /* vertical timing was out of range */
80 MODE_BAD_VSCAN, /* VScan value out of range */
81 MODE_HSYNC_NARROW, /* horizontal sync too narrow */
82 MODE_HSYNC_WIDE, /* horizontal sync too wide */
83 MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
84 MODE_HBLANK_WIDE, /* horizontal blanking too wide */
85 MODE_VSYNC_NARROW, /* vertical sync too narrow */
86 MODE_VSYNC_WIDE, /* vertical sync too wide */
87 MODE_VBLANK_NARROW, /* vertical blanking too narrow */
88 MODE_VBLANK_WIDE, /* vertical blanking too wide */
89 MODE_PANEL, /* exceeds panel dimensions */
90 MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
91 MODE_ONE_WIDTH, /* only one width is supported */
92 MODE_ONE_HEIGHT, /* only one height is supported */
93 MODE_ONE_SIZE, /* only one resolution is supported */
94 MODE_BAD = -2, /* unspecified reason */
95 MODE_ERROR = -1 /* error condition */
96} ModeStatus;
97
98# define M_T_BUILTIN 0x01 /* built-in mode */
99# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
100# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
101# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
102 /* built-in mode - configure CRTC and clock */
103# define M_T_DEFAULT 0x10 /* (VESA) default modes */
104# define M_T_USERDEF 0x20 /* One of the modes from the config file */
105
106/* Video mode */
107typedef struct _DisplayModeRec {
108 struct _DisplayModeRec * prev;
109 struct _DisplayModeRec * next;
110 char * name; /* identifier for the mode */
111 ModeStatus status;
112 int type;
113
114 /* These are the values that the user sees/provides */
115 int Clock; /* pixel clock freq */
116 int HDisplay; /* horizontal timing */
117 int HSyncStart;
118 int HSyncEnd;
119 int HTotal;
120 int HSkew;
121 int VDisplay; /* vertical timing */
122 int VSyncStart;
123 int VSyncEnd;
124 int VTotal;
125 int VScan;
126 int Flags;
127
128 /* These are the values the hardware uses */
129 int ClockIndex;
130 int SynthClock; /* Actual clock freq to
131 * be programmed */
132 int CrtcHDisplay;
133 int CrtcHBlankStart;
134 int CrtcHSyncStart;
135 int CrtcHSyncEnd;
136 int CrtcHBlankEnd;
137 int CrtcHTotal;
138 int CrtcHSkew;
139 int CrtcVDisplay;
140 int CrtcVBlankStart;
141 int CrtcVSyncStart;
142 int CrtcVSyncEnd;
143 int CrtcVBlankEnd;
144 int CrtcVTotal;
145 Bool CrtcHAdjusted;
146 Bool CrtcVAdjusted;
147 int PrivSize;
148 INT32 * Private;
149 int PrivFlags;
150
151 float HSync, VRefresh;
152} DisplayModeRec, *DisplayModePtr;
153
154/* The monitor description */
155
156#define MAX_HSYNC 8
157#define MAX_VREFRESH 8
158
159typedef struct { float hi, lo; } range;
160
161typedef struct { CARD32 red, green, blue; } rgb;
162
163typedef struct { float red, green, blue; } Gamma;
164
165/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
166#define GAMMA_MAX 10.0
167#define GAMMA_MIN (1.0 / GAMMA_MAX)
168#define GAMMA_ZERO (GAMMA_MIN / 100.0)
169
170typedef struct {
171 char * id;
172 char * vendor;
173 char * model;
174 int nHsync;
175 range hsync[MAX_HSYNC];
176 int nVrefresh;
177 range vrefresh[MAX_VREFRESH];
178 DisplayModePtr Modes; /* Start of the monitor's mode list */
179 DisplayModePtr Last; /* End of the monitor's mode list */
180 Gamma gamma; /* Gamma of the monitor */
181 int widthmm;
182 int heightmm;
183 pointer options;
184 pointer DDC;
185} MonRec, *MonPtr;
186
187/* the list of clock ranges */
188typedef struct x_ClockRange {
189 struct x_ClockRange *next;
190 int minClock;
191 int maxClock;
192 int clockIndex; /* -1 for programmable clocks */
193 Bool interlaceAllowed;
194 Bool doubleScanAllowed;
195 int ClockMulFactor;
196 int ClockDivFactor;
197 int PrivFlags;
198} ClockRange, *ClockRangePtr;
199
200/* Need to store the strategy with clockRange for VidMode extension */
201typedef struct x_ClockRanges {
202 struct x_ClockRanges *next;
203 int minClock;
204 int maxClock;
205 int clockIndex; /* -1 for programmable clocks */
206 Bool interlaceAllowed;
207 Bool doubleScanAllowed;
208 int ClockMulFactor;
209 int ClockDivFactor;
210 int PrivFlags;
211 int strategy;
212} ClockRanges, *ClockRangesPtr;
213
214/*
215 * The driver list struct. This contains the information required for each
216 * driver before a ScrnInfoRec has been allocated.
217 */
218typedef struct _DriverRec {
219 int driverVersion;
220 char * driverName;
221 void (*Identify)(int flags);
222 Bool (*Probe)(struct _DriverRec *drv, int flags);
223 const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
224 pointer module;
225 int refCount;
226} DriverRec, *DriverPtr;
227
228#ifdef XFree86LOADER
229/*
230 * The optional module list struct. This allows modules exporting helping
231 * functions to configuration tools, the Xserver, or any other
232 * application/module interested in such information.
233 */
234typedef struct _ModuleInfoRec {
235 int moduleVersion;
236 char * moduleName;
237 pointer module;
238 int refCount;
239 const OptionInfoRec * (*AvailableOptions)(void *unused);
240 pointer unused[8]; /* leave some space for more fields */
241} ModuleInfoRec, *ModuleInfoPtr;
242#endif
243
244/*
245 * These are the private bus types. New types can be added here. Types
246 * required for the public interface should be added to xf86str.h, with
247 * function prototypes added to xf86.h.
248 */
249
250/* Tolerate prior #include <linux/input.h> */
251#if defined(linux) && defined(_INPUT_H)
252#undef BUS_NONE
253#undef BUS_ISA
254#undef BUS_PCI
255#undef BUS_SBUS
256#undef BUS_last
257#endif
258
259typedef enum {
260 BUS_NONE,
261 BUS_ISA,
262 BUS_PCI,
263 BUS_SBUS,
264 BUS_last /* Keep last */
265} BusType;
266
267typedef struct {
268 int bus;
269 int device;
270 int func;
271} PciBusId;
272
273typedef struct {
274 unsigned int dummy;
275} IsaBusId;
276
277typedef struct {
278 int fbNum;
279} SbusBusId;
280
281typedef struct _bus {
282 BusType type;
283 union {
284 IsaBusId isa;
285 PciBusId pci;
286 SbusBusId sbus;
287 } id;
288} BusRec, *BusPtr;
289
290#define MAXCLOCKS 128
291typedef enum {
292 DAC_BPP8 = 0,
293 DAC_BPP16,
294 DAC_BPP24,
295 DAC_BPP32,
296 MAXDACSPEEDS
297} DacSpeedIndex;
298
299typedef struct {
300 char * identifier;
301 char * vendor;
302 char * board;
303 char * chipset;
304 char * ramdac;
305 char * driver;
306 struct _confscreenrec * myScreenSection;
307 Bool claimed;
308 int dacSpeeds[MAXDACSPEEDS];
309 int numclocks;
310 int clock[MAXCLOCKS];
311 char * clockchip;
312 char * busID;
313 Bool active;
314 Bool inUse;
315 int videoRam;
316 int textClockFreq;
317 unsigned long BiosBase; /* Base address of video BIOS */
318 unsigned long MemBase; /* Frame buffer base address */
319 unsigned long IOBase;
320 int chipID;
321 int chipRev;
322 pointer options;
323 int irq;
324 int screen; /* For multi-CRTC cards */
325} GDevRec, *GDevPtr;
326
327typedef int (*FindIsaDevProc)(GDevPtr dev);
328
329typedef struct {
330 char * identifier;
331 char * driver;
332 pointer commonOptions;
333 pointer extraOptions;
334} IDevRec, *IDevPtr;
335
336typedef struct {
337 int vendor;
338 int chipType;
339 int chipRev;
340 int subsysVendor;
341 int subsysCard;
342 int bus;
343 int device;
344 int func;
345 int class;
346 int subclass;
347 int interface;
348 memType memBase[6];
349 memType ioBase[6];
350 int size[6];
351 unsigned char type[6];
352 memType biosBase;
353 int biosSize;
354 pointer thisCard;
355 Bool validSize;
356 Bool validate;
357 CARD32 listed_class;
358} pciVideoRec, *pciVideoPtr;
359
360typedef struct {
361 int frameX0;
362 int frameY0;
363 int virtualX;
364 int virtualY;
365 int depth;
366 int fbbpp;
367 rgb weight;
368 rgb blackColour;
369 rgb whiteColour;
370 int defaultVisual;
371 char ** modes;
372 pointer options;
373} DispRec, *DispPtr;
374
375typedef struct _confxvportrec {
376 char * identifier;
377 pointer options;
378} confXvPortRec, *confXvPortPtr;
379
380typedef struct _confxvadaptrec {
381 char * identifier;
382 int numports;
383 confXvPortPtr ports;
384 pointer options;
385} confXvAdaptorRec, *confXvAdaptorPtr;
386
387typedef struct _confscreenrec {
388 char * id;
389 int screennum;
390 int defaultdepth;
391 int defaultbpp;
392 int defaultfbbpp;
393 MonPtr monitor;
394 GDevPtr device;
395 int numdisplays;
396 DispPtr displays;
397 int numxvadaptors;
398 confXvAdaptorPtr xvadaptors;
399 pointer options;
400} confScreenRec, *confScreenPtr;
401
402typedef enum {
403 PosObsolete = -1,
404 PosAbsolute = 0,
405 PosRightOf,
406 PosLeftOf,
407 PosAbove,
408 PosBelow,
409 PosRelative
410} PositionType;
411
412typedef struct _screenlayoutrec {
413 confScreenPtr screen;
414 char * topname;
415 confScreenPtr top;
416 char * bottomname;
417 confScreenPtr bottom;
418 char * leftname;
419 confScreenPtr left;
420 char * rightname;
421 confScreenPtr right;
422 PositionType where;
423 int x;
424 int y;
425 char * refname;
426 confScreenPtr refscreen;
427} screenLayoutRec, *screenLayoutPtr;
428
429typedef struct _serverlayoutrec {
430 char * id;
431 screenLayoutPtr screens;
432 GDevPtr inactives;
433 IDevPtr inputs;
434 pointer options;
435} serverLayoutRec, *serverLayoutPtr;
436
437typedef struct _confdribufferrec {
438 int count;
439 int size;
440 enum {
441 XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
442 } flags;
443} confDRIBufferRec, *confDRIBufferPtr;
444
445typedef struct _confdrirec {
446 int group;
447 int mode;
448 int bufs_count;
449 confDRIBufferRec *bufs;
450} confDRIRec, *confDRIPtr;
451
452/* These values should be adjusted when new fields are added to ScrnInfoRec */
453#define NUM_RESERVED_INTS 16
454#define NUM_RESERVED_POINTERS 15
455#define NUM_RESERVED_FUNCS 16
456
457typedef pointer (*funcPointer)(void);
458
459/* Flags for driver messages */
460typedef enum {
461 X_PROBED, /* Value was probed */
462 X_CONFIG, /* Value was given in the config file */
463 X_DEFAULT, /* Value is a default */
464 X_CMDLINE, /* Value was given on the command line */
465 X_NOTICE, /* Notice */
466 X_ERROR, /* Error message */
467 X_WARNING, /* Warning message */
468 X_INFO, /* Informational message */
469 X_NONE, /* No prefix */
470 X_NOT_IMPLEMENTED /* Not implemented */
471} MessageType;
472
473/* flags for depth 24 pixmap options */
474typedef enum {
475 Pix24DontCare = 0,
476 Pix24Use24,
477 Pix24Use32
478} Pix24Flags;
479
480/* Power management events: so far we only support APM */
481
482typedef enum {
483 XF86_APM_UNKNOWN = -1,
484 XF86_APM_SYS_STANDBY,
485 XF86_APM_SYS_SUSPEND,
486 XF86_APM_CRITICAL_SUSPEND,
487 XF86_APM_USER_STANDBY,
488 XF86_APM_USER_SUSPEND,
489 XF86_APM_STANDBY_RESUME,
490 XF86_APM_NORMAL_RESUME,
491 XF86_APM_CRITICAL_RESUME,
492 XF86_APM_LOW_BATTERY,
493 XF86_APM_POWER_STATUS_CHANGE,
494 XF86_APM_UPDATE_TIME,
495 XF86_APM_CAPABILITY_CHANGED,
496 XF86_APM_STANDBY_FAILED,
497 XF86_APM_SUSPEND_FAILED
498} pmEvent;
499
500typedef enum {
501 PM_WAIT,
502 PM_CONTINUE,
503 PM_FAILED,
504 PM_NONE
505} pmWait;
506
507/*
508 * The IO access enabler struct. This contains the address for
509 * the IOEnable/IODisable funcs for their specific bus along
510 * with a pointer to data needed by them
511 */
512typedef struct _AccessRec {
513 void (*AccessDisable)(void *arg);
514 void (*AccessEnable)(void *arg);
515 void *arg;
516} xf86AccessRec, *xf86AccessPtr;
517
518typedef struct {
519 xf86AccessPtr mem;
520 xf86AccessPtr io;
521 xf86AccessPtr io_mem;
522} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
523
524/* bus-access-related types */
525typedef enum {
526 NONE,
527 IO,
528 MEM_IO,
529 MEM
530} resType;
531
532typedef struct _EntityAccessRec {
533 xf86AccessPtr fallback;
534 xf86AccessPtr pAccess;
535 resType rt;
536 pointer busAcc;
537 struct _EntityAccessRec *next;
538} EntityAccessRec, *EntityAccessPtr;
539
540typedef struct _CurrAccRec {
541 EntityAccessPtr pMemAccess;
542 EntityAccessPtr pIoAccess;
543} xf86CurrentAccessRec, *xf86CurrentAccessPtr;
544
545/* new RAC */
546
547/* Resource Type values */
548#define ResNone ((unsigned long)(-1))
549
550#define ResMem 0x0001
551#define ResIo 0x0002
552#define ResIrq 0x0003
553#define ResDma 0x0004
554#define ResPciCfg 0x000e /* PCI Configuration space */
555#define ResPhysMask 0x000F
556
557#define ResExclusive 0x0010
558#define ResShared 0x0020
559#define ResAny 0x0040
560#define ResAccMask 0x0070
561#define ResUnused 0x0080
562
563#define ResUnusedOpr 0x0100
564#define ResDisableOpr 0x0200
565#define ResOprMask 0x0300
566
567#define ResBlock 0x0400
568#define ResSparse 0x0800
569#define ResExtMask 0x0C00
570
571#define ResEstimated 0x001000
572#define ResInit 0x002000
573#define ResBios 0x004000
574#define ResMiscMask 0x00F000
575
576#define ResBus 0x010000
577#define ResOverlap 0x020000
578
579#if defined(__alpha__) && defined(linux)
580# define ResDomain 0x1ff000000ul
581#else
582# define ResDomain 0xff000000ul
583#endif
584#define ResTypeMask (ResPhysMask | ResDomain) /* For conflict check */
585
586#define ResEnd ResNone
587
588#define ResExcMemBlock (ResMem | ResExclusive | ResBlock)
589#define ResExcIoBlock (ResIo | ResExclusive | ResBlock)
590#define ResShrMemBlock (ResMem | ResShared | ResBlock)
591#define ResShrIoBlock (ResIo | ResShared | ResBlock)
592#define ResExcUusdMemBlock (ResMem | ResExclusive | ResUnused | ResBlock)
593#define ResExcUusdIoBlock (ResIo | ResExclusive | ResUnused | ResBlock)
594#define ResShrUusdMemBlock (ResMem | ResShared | ResUnused | ResBlock)
595#define ResShrUusdIoBlock (ResIo | ResShared | ResUnused | ResBlock)
596#define ResExcUusdMemSparse (ResMem | ResExclusive | ResUnused | ResSparse)
597#define ResExcUusdIoSparse (ResIo | ResExclusive | ResUnused | ResSparse)
598#define ResShrUusdMemSparse (ResMem | ResShared | ResUnused | ResSparse)
599#define ResShrUusdIoSparse (ResIo | ResShared | ResUnused | ResSparse)
600
601#define ResExcMemSparse (ResMem | ResExclusive | ResSparse)
602#define ResExcIoSparse (ResIo | ResExclusive | ResSparse)
603#define ResShrMemSparse (ResMem | ResShared | ResSparse)
604#define ResShrIoSparse (ResIo | ResShared | ResSparse)
605#define ResUusdMemSparse (ResMem | ResUnused | ResSparse)
606#define ResUusdIoSparse (ResIo | ResUnused | ResSparse)
607
608#define ResIsMem(r) (((r)->type & ResPhysMask) == ResMem)
609#define ResIsIo(r) (((r)->type & ResPhysMask) == ResIo)
610#define ResIsExclusive(r) (((r)->type & ResAccMask) == ResExclusive)
611#define ResIsShared(r) (((r)->type & ResAccMask) == ResShared)
612#define ResIsUnused(r) (((r)->type & ResAccMask) == ResUnused)
613#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock)
614#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse)
615#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated)
616#define ResCanOverlap(r) (ResIsEstimated(r) || ((r)->type & ResOverlap))
617
618typedef struct {
619 unsigned long type; /* shared, exclusive, unused etc. */
620 memType a;
621 memType b;
622} resRange, *resList;
623
624#define RANGE_TYPE(type, domain) \
625 (((unsigned long)(domain) << 24) | ((type) & ~ResBus))
626#define RANGE(r,u,v,t) {\
627 (r).a = (u);\
628 (r).b = (v);\
629 (r).type = (t);\
630 }
631
632#define rBase a
633#define rMask b
634#define rBegin a
635#define rEnd b
636
637/* resource record */
638typedef struct _resRec *resPtr;
639typedef struct _resRec {
640 resRange val;
641 int entityIndex; /* who owns the resource */
642 resPtr next;
643} resRec;
644
645#define sparse_base val.rBase
646#define sparse_mask val.rMask
647#define block_begin val.rBegin
648#define block_end val.rEnd
649#define res_type val.type
650
651typedef struct {
652 int numChipset;
653 resRange *resList;
654} IsaChipsets;
655
656typedef struct {
657 int numChipset;
658 int PCIid;
659 resRange *resList;
660} PciChipsets;
661
662/* Entity properties */
663typedef void (*EntityProc)(int entityIndex,pointer private);
664
665typedef struct _entityInfo {
666 int index;
667 BusRec location;
668 int chipset;
669 Bool active;
670 resPtr resources;
671 GDevPtr device;
672 DriverPtr driver;
673} EntityInfoRec, *EntityInfoPtr;
674
675/* server states */
676
677typedef enum {
678 SETUP,
679 OPERATING
680} xf86State;
681
682typedef enum {
683 NOTIFY_SETUP_TRANSITION,
684 NOTIFY_SETUP,
685 NOTIFY_OPERATING,
686 NOTIFY_OPERATING_TRANSITION,
687 NOTIFY_ENABLE,
688 NOTIFY_ENTER,
689 NOTIFY_LEAVE
690} xf86NotifyState;
691
692typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
693
694/* DGA */
695
696typedef struct {
697 int num; /* A unique identifier for the mode (num > 0) */
698 DisplayModePtr mode;
699 int flags; /* DGA_CONCURRENT_ACCESS, etc... */
700 int imageWidth; /* linear accessible portion (pixels) */
701 int imageHeight;
702 int pixmapWidth; /* Xlib accessible portion (pixels) */
703 int pixmapHeight; /* both fields ignored if no concurrent access */
704 int bytesPerScanline;
705 int byteOrder; /* MSBFirst, LSBFirst */
706 int depth;
707 int bitsPerPixel;
708 unsigned long red_mask;
709 unsigned long green_mask;
710 unsigned long blue_mask;
711 short visualClass;
712 int viewportWidth;
713 int viewportHeight;
714 int xViewportStep; /* viewport position granularity */
715 int yViewportStep;
716 int maxViewportX; /* max viewport origin */
717 int maxViewportY;
718 int viewportFlags; /* types of page flipping possible */
719 int offset; /* offset into physical memory */
720 unsigned char *address; /* server's mapped framebuffer */
721 int reserved1;
722 int reserved2;
723} DGAModeRec, *DGAModePtr;
724
725typedef struct {
726 DGAModePtr mode;
727 PixmapPtr pPix;
728} DGADeviceRec, *DGADevicePtr;
729
730/*
731 * Flags for driver Probe() functions.
732 */
733#define PROBE_DEFAULT 0x00
734#define PROBE_DETECT 0x01
735#define PROBE_TRYHARD 0x02
736
737/*
738 * Driver entry point types
739 */
740typedef struct _ScrnInfoRec *ScrnInfoPtr;
741
742typedef Bool xf86ProbeProc (DriverPtr, int);
743typedef Bool xf86PreInitProc (ScrnInfoPtr, int);
744typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**);
745typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int);
746typedef void xf86AdjustFrameProc (int, int, int, int);
747typedef Bool xf86EnterVTProc (int, int);
748typedef void xf86LeaveVTProc (int, int);
749typedef void xf86FreeScreenProc (int, int);
750typedef int xf86ValidModeProc (int, DisplayModePtr, Bool, int);
751typedef void xf86EnableDisableFBAccessProc(int, Bool);
752typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
753typedef int xf86ChangeGammaProc (int, Gamma);
754typedef void xf86PointerMovedProc (int, int, int);
755typedef Bool xf86PMEventProc (int, pmEvent, Bool);
756
757/*
758 * ScrnInfoRec
759 *
760 * There is one of these for each screen, and it holds all the screen-specific
761 * information.
762 *
763 * Note: the size and layout must be kept the same across versions. New
764 * fields are to be added in place of the "reserved*" fields. No fields
765 * are to be dependent on compile-time defines.
766 */
767
768
769typedef struct _ScrnInfoRec {
770 int driverVersion;
771 char * driverName; /* canonical name used in */
772 /* the config file */
773 ScreenPtr pScreen; /* Pointer to the ScreenRec */
774 int scrnIndex; /* Number of this screen */
775 Bool configured; /* Is this screen valid */
776 int origIndex; /* initial number assigned to
777 * this screen before
778 * finalising the number of
779 * available screens */
780
781 /* Display-wide screenInfo values needed by this screen */
782 int imageByteOrder;
783 int bitmapScanlineUnit;
784 int bitmapScanlinePad;
785 int bitmapBitOrder;
786 int numFormats;
787 PixmapFormatRec formats[MAXFORMATS];
788 PixmapFormatRec fbFormat;
789
790 int bitsPerPixel; /* fb bpp */
791 Pix24Flags pixmap24; /* pixmap pref for depth 24 */
792 int depth; /* depth of default visual */
793 MessageType depthFrom; /* set from config? */
794 MessageType bitsPerPixelFrom; /* set from config? */
795 rgb weight; /* r/g/b weights */
796 rgb mask; /* rgb masks */
797 rgb offset; /* rgb offsets */
798 int rgbBits; /* Number of bits in r/g/b */
799 Gamma gamma; /* Gamma of the monitor */
800 int defaultVisual; /* default visual class */
801 int maxHValue; /* max horizontal timing */
802 int maxVValue; /* max vertical timing value */
803 int virtualX; /* Virtual width */
804 int virtualY; /* Virtual height */
805 int xInc; /* Horizontal timing increment */
806 MessageType virtualFrom; /* set from config? */
807 int displayWidth; /* memory pitch */
808 int frameX0; /* viewport position */
809 int frameY0;
810 int frameX1;
811 int frameY1;
812 int zoomLocked; /* Disallow mode changes */
813 DisplayModePtr modePool; /* list of compatible modes */
814 DisplayModePtr modes; /* list of actual modes */
815 DisplayModePtr currentMode; /* current mode
816 * This was previously
817 * overloaded with the modes
818 * field, which is a pointer
819 * into a circular list */
820 confScreenPtr confScreen; /* Screen config info */
821 MonPtr monitor; /* Monitor information */
822 DispPtr display; /* Display information */
823 int * entityList; /* List of device entities */
824 int numEntities;
825 int widthmm; /* physical display dimensions
826 * in mm */
827 int heightmm;
828 int xDpi; /* width DPI */
829 int yDpi; /* height DPI */
830 char * name; /* Name to prefix messages */
831 pointer driverPrivate; /* Driver private area */
832 DevUnion * privates; /* Other privates can hook in
833 * here */
834 DriverPtr drv; /* xf86DriverList[] entry */
835 pointer module; /* Pointer to module head */
836 int colorKey;
837 int overlayFlags;
838
839 /* Some of these may be moved out of here into the driver private area */
840
841 char * chipset; /* chipset name */
842 char * ramdac; /* ramdac name */
843 char * clockchip; /* clock name */
844 Bool progClock; /* clock is programmable */
845 int numClocks; /* number of clocks */
846 int clock[MAXCLOCKS]; /* list of clock frequencies */
847 int videoRam; /* amount of video ram (kb) */
848 unsigned long biosBase; /* Base address of video BIOS */
849 unsigned long memPhysBase; /* Physical address of FB */
850 unsigned long fbOffset; /* Offset of FB in the above */
851 IOADDRESS domainIOBase; /* Domain I/O base address */
852 int memClk; /* memory clock */
853 int textClockFreq; /* clock of text mode */
854 Bool flipPixels; /* swap default black/white */
855 pointer options;
856
857 int chipID;
858 int chipRev;
859 int racMemFlags;
860 int racIoFlags;
861 pointer access;
862 xf86CurrentAccessPtr CurrentAccess;
863 resType resourceType;
864 pointer busAccess;
865
866 /* Allow screens to be enabled/disabled individually */
867 Bool vtSema;
868 DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
869
870 /* hw cursor moves at SIGIO time */
871 Bool silkenMouse;
872
873 /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
874 ClockRangesPtr clockRanges;
875 int adjustFlags;
876
877 /*
878 * These can be used when the minor ABI version is incremented.
879 * The NUM_* parameters must be reduced appropriately to keep the
880 * structure size and alignment unchanged.
881 */
882 int reservedInt[NUM_RESERVED_INTS];
883
884 int * entityInstanceList;
885 pointer reservedPtr[NUM_RESERVED_POINTERS];
886
887 /*
888 * Driver entry points.
889 *
890 */
891
892 xf86ProbeProc *Probe;
893 xf86PreInitProc *PreInit;
894 xf86ScreenInitProc *ScreenInit;
895 xf86SwitchModeProc *SwitchMode;
896 xf86AdjustFrameProc *AdjustFrame;
897 xf86EnterVTProc *EnterVT;
898 xf86LeaveVTProc *LeaveVT;
899 xf86FreeScreenProc *FreeScreen;
900 xf86ValidModeProc *ValidMode;
901 xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
902 xf86SetDGAModeProc *SetDGAMode;
903 xf86ChangeGammaProc *ChangeGamma;
904 xf86PointerMovedProc *PointerMoved;
905 xf86PMEventProc *PMEvent;
906
907 /*
908 * This can be used when the minor ABI version is incremented.
909 * The NUM_* parameter must be reduced appropriately to keep the
910 * structure size and alignment unchanged.
911 */
912 funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
913
914} ScrnInfoRec;
915
916
917typedef struct {
918 Bool (*OpenFramebuffer)(
919 ScrnInfoPtr pScrn,
920 char **name,
921 unsigned char **mem,
922 int *size,
923 int *offset,
924 int *extra
925 );
926 void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
927 Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
928 void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
929 int (*GetViewport)(ScrnInfoPtr pScrn);
930 void (*Sync)(ScrnInfoPtr);
931 void (*FillRect)(
932 ScrnInfoPtr pScrn,
933 int x, int y, int w, int h,
934 unsigned long color
935 );
936 void (*BlitRect)(
937 ScrnInfoPtr pScrn,
938 int srcx, int srcy,
939 int w, int h,
940 int dstx, int dsty
941 );
942 void (*BlitTransRect)(
943 ScrnInfoPtr pScrn,
944 int srcx, int srcy,
945 int w, int h,
946 int dstx, int dsty,
947 unsigned long color
948 );
949} DGAFunctionRec, *DGAFunctionPtr;
950
951typedef struct {
952 int token; /* id of the token */
953 const char * name; /* token name */
954} SymTabRec, *SymTabPtr;
955
956/* flags for xf86LookupMode */
957typedef enum {
958 LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
959 LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
960 LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
961 LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
962 LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
963 LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
964} LookupModeFlags;
965
966#define NoDepth24Support 0x00
967#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
968#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
969#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
970#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
971#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
972#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
973
974
975/* For DPMS */
976typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
977
978/* Input handler proc */
979typedef void (*InputHandlerProc)(int fd, pointer data);
980
981/* These are used by xf86GetClocks */
982#define CLK_REG_SAVE -1
983#define CLK_REG_RESTORE -2
984
985/* xf86Debug.c */
986#ifdef BUILDDEBUG
987typedef struct {
988 long sec;
989 long usec;
990} xf86TsRec, *xf86TsPtr;
991#endif
992
993/*
994 * misc constants
995 */
996#define INTERLACE_REFRESH_WEIGHT 1.5
997#define SYNC_TOLERANCE 0.01 /* 1 percent */
998#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
999
1000
1001#define OVERLAY_8_32_DUALFB 0x00000001
1002#define OVERLAY_8_24_DUALFB 0x00000002
1003#define OVERLAY_8_16_DUALFB 0x00000004
1004#define OVERLAY_8_32_PLANAR 0x00000008
1005
1006#if 0
1007#define LD_RESOLV_IFDONE 0 /* only check if no more
1008 delays pending */
1009#define LD_RESOLV_NOW 1 /* finish one delay step */
1010#define LD_RESOLV_FORCE 2 /* force checking... */
1011#endif
1012
1013/* Values of xf86Info.mouseFlags */
1014#define MF_CLEAR_DTR 1
1015#define MF_CLEAR_RTS 2
1016
1017/* Action Events */
1018typedef enum {
1019 ACTION_TERMINATE = 0, /* Terminate Server */
1020 ACTION_NEXT_MODE = 10, /* Switch to next video mode */
1021 ACTION_PREV_MODE,
1022 ACTION_DISABLEGRAB = 20, /* Cancel server/pointer/kbd grabs */
1023 ACTION_CLOSECLIENT, /* Kill client holding grab */
1024 ACTION_SWITCHSCREEN = 100, /* VT switch */
1025 ACTION_SWITCHSCREEN_NEXT,
1026 ACTION_SWITCHSCREEN_PREV
1027} ActionEvent;
1028
1029#endif /* _XF86STR_H */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette