3
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
5
* Permission is hereby granted, free of charge, to any person obtaining a
6
* copy of this software and associated documentation files (the "Software"),
7
* to deal in the Software without restriction, including without limitation
8
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
* and/or sell copies of the Software, and to permit persons to whom the
10
* Software is furnished to do so, subject to the following conditions:
12
* The above copyright notice and this permission notice shall be included in
13
* all copies or substantial portions of the Software.
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
* OTHER DEALINGS IN THE SOFTWARE.
23
* Except as contained in this notice, the name of the copyright holder(s)
24
* and author(s) shall not be used in advertising or otherwise to promote
25
* the sale, use or other dealings in this Software without prior written
26
* authorization from the copyright holder(s) and author(s).
30
* This file contains definitions of the public XFree86 data structures/types.
31
* Any data structures that video drivers need to access should go here.
39
#include "scrnintstr.h"
40
#include "pixmapstr.h"
41
#include "colormapst.h"
42
#include "xf86Module.h"
46
#include <pciaccess.h>
49
* Integer type that is of the size of the addressable memory (machine size).
50
* On most platforms \c uintptr_t will suffice. However, on some mixed
51
* 32-bit / 64-bit platforms, such as 32-bit binaries on 64-bit PowerPC, this
55
#if defined(__powerpc__)
56
typedef uint64_t memType;
58
typedef uintptr_t memType;
62
/* Video mode flags */
74
V_HSKEW = 0x0200, /* hskew provided */
82
INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
85
/* Flags passed to ChipValidMode() */
87
MODECHECK_INITIAL = 0,
91
/* These are possible return values for xf86CheckMode() and ValidMode() */
93
MODE_OK = 0, /* Mode OK */
94
MODE_HSYNC, /* hsync out of range */
95
MODE_VSYNC, /* vsync out of range */
96
MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
97
MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
98
MODE_BAD_WIDTH, /* requires an unsupported linepitch */
99
MODE_NOMODE, /* no mode with a maching name */
100
MODE_NO_INTERLACE, /* interlaced mode not supported */
101
MODE_NO_DBLESCAN, /* doublescan mode not supported */
102
MODE_NO_VSCAN, /* multiscan mode not supported */
103
MODE_MEM, /* insufficient video memory */
104
MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
105
MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
106
MODE_MEM_VIRT, /* insufficient video memory given virtual size */
107
MODE_NOCLOCK, /* no fixed clock available */
108
MODE_CLOCK_HIGH, /* clock required is too high */
109
MODE_CLOCK_LOW, /* clock required is too low */
110
MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
111
MODE_BAD_HVALUE, /* horizontal timing was out of range */
112
MODE_BAD_VVALUE, /* vertical timing was out of range */
113
MODE_BAD_VSCAN, /* VScan value out of range */
114
MODE_HSYNC_NARROW, /* horizontal sync too narrow */
115
MODE_HSYNC_WIDE, /* horizontal sync too wide */
116
MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
117
MODE_HBLANK_WIDE, /* horizontal blanking too wide */
118
MODE_VSYNC_NARROW, /* vertical sync too narrow */
119
MODE_VSYNC_WIDE, /* vertical sync too wide */
120
MODE_VBLANK_NARROW, /* vertical blanking too narrow */
121
MODE_VBLANK_WIDE, /* vertical blanking too wide */
122
MODE_PANEL, /* exceeds panel dimensions */
123
MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
124
MODE_ONE_WIDTH, /* only one width is supported */
125
MODE_ONE_HEIGHT, /* only one height is supported */
126
MODE_ONE_SIZE, /* only one resolution is supported */
127
MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
128
MODE_BANDWIDTH, /* mode requires too much memory bandwidth */
129
MODE_BAD = -2, /* unspecified reason */
130
MODE_ERROR = -1 /* error condition */
134
* The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN.
135
* Preferred will bubble a mode to the top within a set.
137
# define M_T_BUILTIN 0x01 /* built-in mode */
138
# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
139
# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
140
# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
141
/* built-in mode - configure CRTC and clock */
142
# define M_T_PREFERRED 0x08 /* preferred mode within a set */
143
# define M_T_DEFAULT 0x10 /* (VESA) default modes */
144
# define M_T_USERDEF 0x20 /* One of the modes from the config file */
145
# define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */
146
# define M_T_USERPREF 0x80 /* mode preferred by the user config */
149
typedef struct _DisplayModeRec {
150
struct _DisplayModeRec * prev;
151
struct _DisplayModeRec * next;
152
char * name; /* identifier for the mode */
156
/* These are the values that the user sees/provides */
157
int Clock; /* pixel clock freq (kHz) */
158
int HDisplay; /* horizontal timing */
163
int VDisplay; /* vertical timing */
170
/* These are the values the hardware uses */
172
int SynthClock; /* Actual clock freq to
173
* be programmed (kHz) */
193
float HSync, VRefresh;
194
} DisplayModeRec, *DisplayModePtr;
196
/* The monitor description */
199
#define MAX_VREFRESH 8
201
typedef struct { float hi, lo; } range;
203
typedef struct { CARD32 red, green, blue; } rgb;
205
typedef struct { float red, green, blue; } Gamma;
207
/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
208
#define GAMMA_MAX 10.0
209
#define GAMMA_MIN (1.0 / GAMMA_MAX)
210
#define GAMMA_ZERO (GAMMA_MIN / 100.0)
217
range hsync[MAX_HSYNC];
219
range vrefresh[MAX_VREFRESH];
220
DisplayModePtr Modes; /* Start of the monitor's mode list */
221
DisplayModePtr Last; /* End of the monitor's mode list */
222
Gamma gamma; /* Gamma of the monitor */
227
Bool reducedblanking; /* Allow CVT reduced blanking modes? */
228
int maxPixClock; /* in kHz, like mode->Clock */
231
/* the list of clock ranges */
232
typedef struct x_ClockRange {
233
struct x_ClockRange *next;
234
int minClock; /* (kHz) */
235
int maxClock; /* (kHz) */
236
int clockIndex; /* -1 for programmable clocks */
237
Bool interlaceAllowed;
238
Bool doubleScanAllowed;
242
} ClockRange, *ClockRangePtr;
244
/* Need to store the strategy with clockRange for VidMode extension */
245
typedef struct x_ClockRanges {
246
struct x_ClockRanges *next;
249
int clockIndex; /* -1 for programmable clocks */
250
Bool interlaceAllowed;
251
Bool doubleScanAllowed;
256
} ClockRanges, *ClockRangesPtr;
259
* The driverFunc. xorgDriverFuncOp specifies the action driver should
260
* perform. If requested option is not supported function should return
261
* FALSE. pointer can be used to pass arguments to the function or
262
* to return data to the caller.
264
typedef struct _ScrnInfoRec *ScrnInfoPtr;
266
/* do not change order */
271
GET_REQUIRED_HW_INTERFACES = 10
274
typedef Bool xorgDriverFuncProc (ScrnInfoPtr, xorgDriverFuncOp,
277
/* RR_GET_INFO, RR_SET_CONFIG */
287
xorgRRConfig RRConfig;
288
} xorgRRRotation, *xorgRRRotationPtr;
297
} xorgRRModeMM, *xorgRRModeMMPtr;
299
/* GET_REQUIRED_HW_INTERFACES */
302
#define NEED_IO_ENABLED(x) (x & HW_IO)
304
typedef CARD32 xorgHWFlags;
307
* The driver list struct. This contains the information required for each
308
* driver before a ScrnInfoRec has been allocated.
315
void (*Identify)(int flags);
316
Bool (*Probe)(struct _DriverRec *drv, int flags);
317
const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
325
typedef struct _DriverRec {
328
void (*Identify)(int flags);
329
Bool (*Probe)(struct _DriverRec *drv, int flags);
330
const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
333
xorgDriverFuncProc *driverFunc;
335
const struct pci_id_match * supported_devices;
336
Bool (*PciProbe)( struct _DriverRec * drv, int entity_num,
337
struct pci_device * dev, intptr_t match_data );
338
} DriverRec, *DriverPtr;
343
#define HaveDriverFuncs 1
347
* The optional module list struct. This allows modules exporting helping
348
* functions to configuration tools, the Xserver, or any other
349
* application/module interested in such information.
351
_X_DEPRECATED typedef struct _ModuleInfoRec {
356
const OptionInfoRec * (*AvailableOptions)(void *unused);
357
pointer unused[8]; /* leave some space for more fields */
358
} ModuleInfoRec, *ModuleInfoPtr;
361
* These are the private bus types. New types can be added here. Types
362
* required for the public interface should be added to xf86str.h, with
363
* function prototypes added to xf86.h.
366
/* Tolerate prior #include <linux/input.h> */
367
#if defined(linux) && defined(_INPUT_H)
380
BUS_last /* Keep last */
393
typedef struct _bus {
397
struct pci_device *pci;
402
#define MAXCLOCKS 128
418
struct _confscreenrec * myScreenSection;
420
int dacSpeeds[MAXDACSPEEDS];
422
int clock[MAXCLOCKS];
429
unsigned long BiosBase; /* Base address of video BIOS */
430
unsigned long MemBase; /* Frame buffer base address */
431
unsigned long IOBase;
436
int screen; /* For multi-CRTC cards */
439
typedef int (*FindIsaDevProc)(GDevPtr dev);
444
pointer commonOptions;
445
pointer extraOptions;
463
typedef struct _confxvportrec {
466
} confXvPortRec, *confXvPortPtr;
468
typedef struct _confxvadaptrec {
473
} confXvAdaptorRec, *confXvAdaptorPtr;
475
typedef struct _confscreenrec {
486
confXvAdaptorPtr xvadaptors;
488
} confScreenRec, *confScreenPtr;
500
typedef struct _screenlayoutrec {
501
confScreenPtr screen;
505
confScreenPtr bottom;
514
confScreenPtr refscreen;
515
} screenLayoutRec, *screenLayoutPtr;
517
typedef struct _serverlayoutrec {
519
screenLayoutPtr screens;
521
IDevPtr* inputs; /* NULL terminated */
523
} serverLayoutRec, *serverLayoutPtr;
525
typedef struct _confdribufferrec {
529
XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
531
} confDRIBufferRec, *confDRIBufferPtr;
533
typedef struct _confdrirec {
537
confDRIBufferRec *bufs;
538
} confDRIRec, *confDRIPtr;
540
/* These values should be adjusted when new fields are added to ScrnInfoRec */
541
#define NUM_RESERVED_INTS 16
542
#define NUM_RESERVED_POINTERS 15
543
#define NUM_RESERVED_FUNCS 11
545
typedef pointer (*funcPointer)(void);
547
/* flags for depth 24 pixmap options */
554
/* Power management events: so far we only support APM */
557
XF86_APM_UNKNOWN = -1,
558
XF86_APM_SYS_STANDBY,
559
XF86_APM_SYS_SUSPEND,
560
XF86_APM_CRITICAL_SUSPEND,
561
XF86_APM_USER_STANDBY,
562
XF86_APM_USER_SUSPEND,
563
XF86_APM_STANDBY_RESUME,
564
XF86_APM_NORMAL_RESUME,
565
XF86_APM_CRITICAL_RESUME,
566
XF86_APM_LOW_BATTERY,
567
XF86_APM_POWER_STATUS_CHANGE,
568
XF86_APM_UPDATE_TIME,
569
XF86_APM_CAPABILITY_CHANGED,
570
XF86_APM_STANDBY_FAILED,
571
XF86_APM_SUSPEND_FAILED
582
* The IO access enabler struct. This contains the address for
583
* the IOEnable/IODisable funcs for their specific bus along
584
* with a pointer to data needed by them
586
typedef struct _AccessRec {
587
void (*AccessDisable)(void *arg);
588
void (*AccessEnable)(void *arg);
590
} xf86AccessRec, *xf86AccessPtr;
595
xf86AccessPtr io_mem;
596
} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
598
/* bus-access-related types */
606
typedef struct _EntityAccessRec {
607
xf86AccessPtr fallback;
608
xf86AccessPtr pAccess;
611
struct _EntityAccessRec *next;
612
} EntityAccessRec, *EntityAccessPtr;
614
typedef struct _CurrAccRec {
615
EntityAccessPtr pMemAccess;
616
EntityAccessPtr pIoAccess;
617
} xf86CurrentAccessRec, *xf86CurrentAccessPtr;
621
/* Resource Type values */
622
#define ResNone ((unsigned long)(-1))
624
#define ResMem 0x0001
626
#define ResIrq 0x0003
627
#define ResDma 0x0004
628
#define ResPciCfg 0x000e /* PCI Configuration space */
629
#define ResPhysMask 0x000F
631
#define ResExclusive 0x0010
632
#define ResShared 0x0020
633
#define ResAny 0x0040
634
#define ResAccMask 0x0070
635
#define ResUnused 0x0080
637
#define ResUnusedOpr 0x0100
638
#define ResDisableOpr 0x0200
639
#define ResOprMask 0x0300
641
#define ResBlock 0x0400
642
#define ResSparse 0x0800
643
#define ResExtMask 0x0C00
645
#define ResEstimated 0x001000
646
#define ResInit 0x002000
647
#define ResBios 0x004000
648
#define ResMiscMask 0x00F000
650
#define ResBus 0x010000
651
#define ResOverlap 0x020000
653
#if defined(__alpha__) && defined(linux)
654
# define ResDomain 0x1ff000000ul
656
# define ResDomain 0xff000000ul
658
#define ResTypeMask (ResPhysMask | ResDomain) /* For conflict check */
660
#define ResEnd ResNone
662
#define ResExcMemBlock (ResMem | ResExclusive | ResBlock)
663
#define ResExcIoBlock (ResIo | ResExclusive | ResBlock)
664
#define ResShrMemBlock (ResMem | ResShared | ResBlock)
665
#define ResShrIoBlock (ResIo | ResShared | ResBlock)
666
#define ResExcUusdMemBlock (ResMem | ResExclusive | ResUnused | ResBlock)
667
#define ResExcUusdIoBlock (ResIo | ResExclusive | ResUnused | ResBlock)
668
#define ResShrUusdMemBlock (ResMem | ResShared | ResUnused | ResBlock)
669
#define ResShrUusdIoBlock (ResIo | ResShared | ResUnused | ResBlock)
670
#define ResExcUusdMemSparse (ResMem | ResExclusive | ResUnused | ResSparse)
671
#define ResExcUusdIoSparse (ResIo | ResExclusive | ResUnused | ResSparse)
672
#define ResShrUusdMemSparse (ResMem | ResShared | ResUnused | ResSparse)
673
#define ResShrUusdIoSparse (ResIo | ResShared | ResUnused | ResSparse)
675
#define ResExcMemSparse (ResMem | ResExclusive | ResSparse)
676
#define ResExcIoSparse (ResIo | ResExclusive | ResSparse)
677
#define ResShrMemSparse (ResMem | ResShared | ResSparse)
678
#define ResShrIoSparse (ResIo | ResShared | ResSparse)
679
#define ResUusdMemSparse (ResMem | ResUnused | ResSparse)
680
#define ResUusdIoSparse (ResIo | ResUnused | ResSparse)
682
#define ResIsMem(r) (((r)->type & ResPhysMask) == ResMem)
683
#define ResIsIo(r) (((r)->type & ResPhysMask) == ResIo)
684
#define ResIsExclusive(r) (((r)->type & ResAccMask) == ResExclusive)
685
#define ResIsShared(r) (((r)->type & ResAccMask) == ResShared)
686
#define ResIsUnused(r) (((r)->type & ResAccMask) == ResUnused)
687
#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock)
688
#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse)
689
#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated)
690
#define ResCanOverlap(r) (ResIsEstimated(r) || ((r)->type & ResOverlap))
693
unsigned long type; /* shared, exclusive, unused etc. */
696
} resRange, *resList;
698
#define RANGE_TYPE(type, domain) \
699
(((unsigned long)(domain) << 24) | ((type) & ~ResBus))
700
#define RANGE(r,u,v,t) {\
711
/* resource record */
712
typedef struct _resRec *resPtr;
713
typedef struct _resRec {
715
int entityIndex; /* who owns the resource */
719
#define sparse_base val.rBase
720
#define sparse_mask val.rMask
721
#define block_begin val.rBegin
722
#define block_end val.rEnd
723
#define res_type val.type
730
typedef struct _PciChipsets {
732
* Key used to match this device with its name in an array of
738
* This value is quirky. Depending on the driver, it can take on one of
739
* three meanings. In drivers that have exactly one vendor ID (e.g.,
740
* radeon, mga, i810) the low 16-bits are the device ID.
742
* In drivers that can have multiple vendor IDs (e.g., the glint driver
743
* can have either 3dlabs' ID or TI's ID, the i740 driver can have either
744
* Intel's ID or Real3D's ID, etc.) the low 16-bits are the device ID and
745
* the high 16-bits are the vendor ID.
747
* In drivers that don't have a specific vendor (e.g., vga) contains the
748
* device ID for either the generic VGA or generic 8514 devices. This
749
* turns out to be the same as the subclass and programming interface
750
* value (e.g., the full 24-bit class for the VGA device is 0x030000 (or
751
* 0x000101) and for 8514 is 0x030001).
756
* Resources associated with this type of device.
761
/* Entity properties */
762
typedef void (*EntityProc)(int entityIndex,pointer private);
764
typedef struct _entityInfo {
772
} EntityInfoRec, *EntityInfoPtr;
782
NOTIFY_SETUP_TRANSITION,
785
NOTIFY_OPERATING_TRANSITION,
791
typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
796
int num; /* A unique identifier for the mode (num > 0) */
798
int flags; /* DGA_CONCURRENT_ACCESS, etc... */
799
int imageWidth; /* linear accessible portion (pixels) */
801
int pixmapWidth; /* Xlib accessible portion (pixels) */
802
int pixmapHeight; /* both fields ignored if no concurrent access */
803
int bytesPerScanline;
804
int byteOrder; /* MSBFirst, LSBFirst */
807
unsigned long red_mask;
808
unsigned long green_mask;
809
unsigned long blue_mask;
813
int xViewportStep; /* viewport position granularity */
815
int maxViewportX; /* max viewport origin */
817
int viewportFlags; /* types of page flipping possible */
818
int offset; /* offset into physical memory */
819
unsigned char *address; /* server's mapped framebuffer */
822
} DGAModeRec, *DGAModePtr;
827
} DGADeviceRec, *DGADevicePtr;
830
* Flags for driver Probe() functions.
832
#define PROBE_DEFAULT 0x00
833
#define PROBE_DETECT 0x01
834
#define PROBE_TRYHARD 0x02
837
* Driver entry point types
840
typedef Bool xf86ProbeProc (DriverPtr, int);
841
typedef Bool xf86PreInitProc (ScrnInfoPtr, int);
842
typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**);
843
typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int);
844
typedef void xf86AdjustFrameProc (int, int, int, int);
845
typedef Bool xf86EnterVTProc (int, int);
846
typedef void xf86LeaveVTProc (int, int);
847
typedef void xf86FreeScreenProc (int, int);
848
typedef ModeStatus xf86ValidModeProc (int, DisplayModePtr, Bool, int);
849
typedef void xf86EnableDisableFBAccessProc(int, Bool);
850
typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
851
typedef int xf86ChangeGammaProc (int, Gamma);
852
typedef void xf86PointerMovedProc (int, int, int);
853
typedef Bool xf86PMEventProc (int, pmEvent, Bool);
854
typedef int xf86HandleMessageProc (int, const char*, const char*, char**);
855
typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
856
typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
857
typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
863
* There is one of these for each screen, and it holds all the screen-specific
866
* Note: the size and layout must be kept the same across versions. New
867
* fields are to be added in place of the "reserved*" fields. No fields
868
* are to be dependent on compile-time defines.
872
typedef struct _ScrnInfoRec {
874
char * driverName; /* canonical name used in */
875
/* the config file */
876
ScreenPtr pScreen; /* Pointer to the ScreenRec */
877
int scrnIndex; /* Number of this screen */
878
Bool configured; /* Is this screen valid */
879
int origIndex; /* initial number assigned to
881
* finalising the number of
882
* available screens */
884
/* Display-wide screenInfo values needed by this screen */
886
int bitmapScanlineUnit;
887
int bitmapScanlinePad;
890
PixmapFormatRec formats[MAXFORMATS];
891
PixmapFormatRec fbFormat;
893
int bitsPerPixel; /* fb bpp */
894
Pix24Flags pixmap24; /* pixmap pref for depth 24 */
895
int depth; /* depth of default visual */
896
MessageType depthFrom; /* set from config? */
897
MessageType bitsPerPixelFrom; /* set from config? */
898
rgb weight; /* r/g/b weights */
899
rgb mask; /* rgb masks */
900
rgb offset; /* rgb offsets */
901
int rgbBits; /* Number of bits in r/g/b */
902
Gamma gamma; /* Gamma of the monitor */
903
int defaultVisual; /* default visual class */
904
int maxHValue; /* max horizontal timing */
905
int maxVValue; /* max vertical timing value */
906
int virtualX; /* Virtual width */
907
int virtualY; /* Virtual height */
908
int xInc; /* Horizontal timing increment */
909
MessageType virtualFrom; /* set from config? */
910
int displayWidth; /* memory pitch */
911
int frameX0; /* viewport position */
915
int zoomLocked; /* Disallow mode changes */
916
DisplayModePtr modePool; /* list of compatible modes */
917
DisplayModePtr modes; /* list of actual modes */
918
DisplayModePtr currentMode; /* current mode
919
* This was previously
920
* overloaded with the modes
921
* field, which is a pointer
922
* into a circular list */
923
confScreenPtr confScreen; /* Screen config info */
924
MonPtr monitor; /* Monitor information */
925
DispPtr display; /* Display information */
926
int * entityList; /* List of device entities */
928
int widthmm; /* physical display dimensions
931
int xDpi; /* width DPI */
932
int yDpi; /* height DPI */
933
char * name; /* Name to prefix messages */
934
pointer driverPrivate; /* Driver private area */
935
DevUnion * privates; /* Other privates can hook in
937
DriverPtr drv; /* xf86DriverList[] entry */
938
pointer module; /* Pointer to module head */
942
/* Some of these may be moved out of here into the driver private area */
944
char * chipset; /* chipset name */
945
char * ramdac; /* ramdac name */
946
char * clockchip; /* clock name */
947
Bool progClock; /* clock is programmable */
948
int numClocks; /* number of clocks */
949
int clock[MAXCLOCKS]; /* list of clock frequencies */
950
int videoRam; /* amount of video ram (kb) */
951
unsigned long biosBase; /* Base address of video BIOS */
952
unsigned long memPhysBase; /* Physical address of FB */
953
unsigned long fbOffset; /* Offset of FB in the above */
954
IOADDRESS domainIOBase; /* Domain I/O base address */
955
int memClk; /* memory clock */
956
int textClockFreq; /* clock of text mode */
957
Bool flipPixels; /* swap default black/white */
965
xf86CurrentAccessPtr CurrentAccess;
966
resType resourceType;
969
/* Allow screens to be enabled/disabled individually */
971
DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
973
/* hw cursor moves at SIGIO time */
976
/* Storage for clockRanges and adjustFlags for use with the VidMode ext */
977
ClockRangesPtr clockRanges;
981
* These can be used when the minor ABI version is incremented.
982
* The NUM_* parameters must be reduced appropriately to keep the
983
* structure size and alignment unchanged.
985
int reservedInt[NUM_RESERVED_INTS];
987
int * entityInstanceList;
988
pointer reservedPtr[NUM_RESERVED_POINTERS];
991
* Driver entry points.
995
xf86ProbeProc *Probe;
996
xf86PreInitProc *PreInit;
997
xf86ScreenInitProc *ScreenInit;
998
xf86SwitchModeProc *SwitchMode;
999
xf86AdjustFrameProc *AdjustFrame;
1000
xf86EnterVTProc *EnterVT;
1001
xf86LeaveVTProc *LeaveVT;
1002
xf86FreeScreenProc *FreeScreen;
1003
xf86ValidModeProc *ValidMode;
1004
xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
1005
xf86SetDGAModeProc *SetDGAMode;
1006
xf86ChangeGammaProc *ChangeGamma;
1007
xf86PointerMovedProc *PointerMoved;
1008
xf86PMEventProc *PMEvent;
1009
xf86HandleMessageProc *HandleMessage;
1010
xf86DPMSSetProc *DPMSSet;
1011
xf86LoadPaletteProc *LoadPalette;
1012
xf86SetOverscanProc *SetOverscan;
1013
xorgDriverFuncProc *DriverFunc;
1016
* This can be used when the minor ABI version is incremented.
1017
* The NUM_* parameter must be reduced appropriately to keep the
1018
* structure size and alignment unchanged.
1020
funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
1026
Bool (*OpenFramebuffer)(
1029
unsigned char **mem,
1034
void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
1035
Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
1036
void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
1037
int (*GetViewport)(ScrnInfoPtr pScrn);
1038
void (*Sync)(ScrnInfoPtr);
1041
int x, int y, int w, int h,
1050
void (*BlitTransRect)(
1057
} DGAFunctionRec, *DGAFunctionPtr;
1059
typedef struct _SymTabRec {
1060
int token; /* id of the token */
1061
const char * name; /* token name */
1062
} SymTabRec, *SymTabPtr;
1064
/* flags for xf86LookupMode */
1066
LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
1067
LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
1068
LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
1069
LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
1070
LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
1071
LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
1074
#define NoDepth24Support 0x00
1075
#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
1076
#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
1077
#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
1078
#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
1079
#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
1080
#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
1084
typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
1086
/* Input handler proc */
1087
typedef void (*InputHandlerProc)(int fd, pointer data);
1089
/* These are used by xf86GetClocks */
1090
#define CLK_REG_SAVE -1
1091
#define CLK_REG_RESTORE -2
1098
} xf86TsRec, *xf86TsPtr;
1104
#define INTERLACE_REFRESH_WEIGHT 1.5
1105
#define SYNC_TOLERANCE 0.01 /* 1 percent */
1106
#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
1109
#define OVERLAY_8_32_DUALFB 0x00000001
1110
#define OVERLAY_8_24_DUALFB 0x00000002
1111
#define OVERLAY_8_16_DUALFB 0x00000004
1112
#define OVERLAY_8_32_PLANAR 0x00000008
1115
#define LD_RESOLV_IFDONE 0 /* only check if no more
1117
#define LD_RESOLV_NOW 1 /* finish one delay step */
1118
#define LD_RESOLV_FORCE 2 /* force checking... */
1121
/* Values of xf86Info.mouseFlags */
1122
#define MF_CLEAR_DTR 1
1123
#define MF_CLEAR_RTS 2
1127
ACTION_TERMINATE = 0, /* Terminate Server */
1128
ACTION_NEXT_MODE = 10, /* Switch to next video mode */
1130
ACTION_DISABLEGRAB = 20, /* Cancel server/pointer/kbd grabs */
1131
ACTION_CLOSECLIENT, /* Kill client holding grab */
1132
ACTION_SWITCHSCREEN = 100, /* VT switch */
1133
ACTION_SWITCHSCREEN_NEXT,
1134
ACTION_SWITCHSCREEN_PREV,
1135
ACTION_MESSAGE = 9999 /* Generic message passing */
1138
/* xf86Versions.c */
1140
* Never change existing values, and always assign values explicitly.
1141
* NUM_BUILTIN_IFS must always be the last entry.
1144
BUILTIN_IF_OSMOUSE = 0,
1145
BUILTIN_IF_OSKBD = 1,
1150
* These are intentionally the same as the module version macros.
1151
* It is possible to register a module as providing a specific interface,
1152
* in which case the module's version is used. This feature isn't
1153
* really ready for use yet though.
1156
#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \
1157
((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
1158
#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
1159
#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
1160
#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers) ((vers) & 0xFFFF)
1162
#endif /* _XF86STR_H */