VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.8.0/xf86str.h@ 62425

最後變更 在這個檔案從62425是 28062,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: header files for building X.Org server 1.8 drivers

  • 屬性 svn:eol-style 設為 native
檔案大小: 27.0 KB
 
1
2/*
3 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
4 *
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:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
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.
22 *
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).
27 */
28
29/*
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.
32 */
33
34#ifndef _XF86STR_H
35#define _XF86STR_H
36
37#include "misc.h"
38#include "input.h"
39#include "scrnintstr.h"
40#include "pixmapstr.h"
41#include "colormapst.h"
42#include "xf86Module.h"
43#include "xf86Opt.h"
44#include "xf86Pci.h"
45
46#include <pciaccess.h>
47
48/**
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
52 * must be 64-bits.
53 */
54#include <inttypes.h>
55#if defined(__powerpc__)
56typedef uint64_t memType;
57#else
58typedef uintptr_t memType;
59#endif
60
61
62/* Video mode flags */
63
64typedef enum {
65 V_PHSYNC = 0x0001,
66 V_NHSYNC = 0x0002,
67 V_PVSYNC = 0x0004,
68 V_NVSYNC = 0x0008,
69 V_INTERLACE = 0x0010,
70 V_DBLSCAN = 0x0020,
71 V_CSYNC = 0x0040,
72 V_PCSYNC = 0x0080,
73 V_NCSYNC = 0x0100,
74 V_HSKEW = 0x0200, /* hskew provided */
75 V_BCAST = 0x0400,
76 V_PIXMUX = 0x1000,
77 V_DBLCLK = 0x2000,
78 V_CLKDIV2 = 0x4000
79} ModeFlags;
80
81typedef enum {
82 INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
83} CrtcAdjustFlags;
84
85/* Flags passed to ChipValidMode() */
86typedef enum {
87 MODECHECK_INITIAL = 0,
88 MODECHECK_FINAL = 1
89} ModeCheckFlags;
90
91/* These are possible return values for xf86CheckMode() and ValidMode() */
92typedef enum {
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 */
131} ModeStatus;
132
133/*
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.
136 */
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 */
147
148/* Video mode */
149typedef struct _DisplayModeRec {
150 struct _DisplayModeRec * prev;
151 struct _DisplayModeRec * next;
152 char * name; /* identifier for the mode */
153 ModeStatus status;
154 int type;
155
156 /* These are the values that the user sees/provides */
157 int Clock; /* pixel clock freq (kHz) */
158 int HDisplay; /* horizontal timing */
159 int HSyncStart;
160 int HSyncEnd;
161 int HTotal;
162 int HSkew;
163 int VDisplay; /* vertical timing */
164 int VSyncStart;
165 int VSyncEnd;
166 int VTotal;
167 int VScan;
168 int Flags;
169
170 /* These are the values the hardware uses */
171 int ClockIndex;
172 int SynthClock; /* Actual clock freq to
173 * be programmed (kHz) */
174 int CrtcHDisplay;
175 int CrtcHBlankStart;
176 int CrtcHSyncStart;
177 int CrtcHSyncEnd;
178 int CrtcHBlankEnd;
179 int CrtcHTotal;
180 int CrtcHSkew;
181 int CrtcVDisplay;
182 int CrtcVBlankStart;
183 int CrtcVSyncStart;
184 int CrtcVSyncEnd;
185 int CrtcVBlankEnd;
186 int CrtcVTotal;
187 Bool CrtcHAdjusted;
188 Bool CrtcVAdjusted;
189 int PrivSize;
190 INT32 * Private;
191 int PrivFlags;
192
193 float HSync, VRefresh;
194} DisplayModeRec, *DisplayModePtr;
195
196/* The monitor description */
197
198#define MAX_HSYNC 8
199#define MAX_VREFRESH 8
200
201typedef struct { float hi, lo; } range;
202
203typedef struct { CARD32 red, green, blue; } rgb;
204
205typedef struct { float red, green, blue; } Gamma;
206
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)
211
212typedef struct {
213 char * id;
214 char * vendor;
215 char * model;
216 int nHsync;
217 range hsync[MAX_HSYNC];
218 int nVrefresh;
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 */
223 int widthmm;
224 int heightmm;
225 pointer options;
226 pointer DDC;
227 Bool reducedblanking; /* Allow CVT reduced blanking modes? */
228 int maxPixClock; /* in kHz, like mode->Clock */
229} MonRec, *MonPtr;
230
231/* the list of clock ranges */
232typedef 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;
239 int ClockMulFactor;
240 int ClockDivFactor;
241 int PrivFlags;
242} ClockRange, *ClockRangePtr;
243
244/*
245 * The driverFunc. xorgDriverFuncOp specifies the action driver should
246 * perform. If requested option is not supported function should return
247 * FALSE. pointer can be used to pass arguments to the function or
248 * to return data to the caller.
249 */
250typedef struct _ScrnInfoRec *ScrnInfoPtr;
251
252/* do not change order */
253typedef enum {
254 RR_GET_INFO,
255 RR_SET_CONFIG,
256 RR_GET_MODE_MM,
257 GET_REQUIRED_HW_INTERFACES = 10
258} xorgDriverFuncOp;
259
260typedef Bool xorgDriverFuncProc (ScrnInfoPtr, xorgDriverFuncOp,
261 pointer);
262
263/* RR_GET_INFO, RR_SET_CONFIG */
264typedef struct {
265 int rotation;
266 int rate;
267 int width;
268 int height;
269} xorgRRConfig;
270
271typedef union {
272 short RRRotations;
273 xorgRRConfig RRConfig;
274} xorgRRRotation, *xorgRRRotationPtr;
275
276/* RR_GET_MODE_MM */
277typedef struct {
278 DisplayModePtr mode;
279 int virtX;
280 int virtY;
281 int mmWidth;
282 int mmHeight;
283} xorgRRModeMM, *xorgRRModeMMPtr;
284
285/* GET_REQUIRED_HW_INTERFACES */
286#define HW_IO 1
287#define HW_MMIO 2
288#define HW_SKIP_CONSOLE 4
289#define NEED_IO_ENABLED(x) (x & HW_IO)
290
291typedef CARD32 xorgHWFlags;
292
293/*
294 * The driver list struct. This contains the information required for each
295 * driver before a ScrnInfoRec has been allocated.
296 */
297struct _DriverRec;
298
299typedef struct {
300 int driverVersion;
301 char * driverName;
302 void (*Identify)(int flags);
303 Bool (*Probe)(struct _DriverRec *drv, int flags);
304 const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
305 pointer module;
306 int refCount;
307} DriverRec1;
308
309struct _SymTabRec;
310struct _PciChipsets;
311
312typedef struct _DriverRec {
313 int driverVersion;
314 char * driverName;
315 void (*Identify)(int flags);
316 Bool (*Probe)(struct _DriverRec *drv, int flags);
317 const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
318 pointer module;
319 int refCount;
320 xorgDriverFuncProc *driverFunc;
321
322 const struct pci_id_match * supported_devices;
323 Bool (*PciProbe)( struct _DriverRec * drv, int entity_num,
324 struct pci_device * dev, intptr_t match_data );
325} DriverRec, *DriverPtr;
326
327/*
328 * AddDriver flags
329 */
330#define HaveDriverFuncs 1
331
332/*
333 * These are the private bus types. New types can be added here. Types
334 * required for the public interface should be added to xf86str.h, with
335 * function prototypes added to xf86.h.
336 */
337
338/* Tolerate prior #include <linux/input.h> */
339#if defined(linux) && defined(_INPUT_H)
340#undef BUS_NONE
341#undef BUS_ISA
342#undef BUS_PCI
343#undef BUS_SBUS
344#undef BUS_last
345#endif
346
347typedef enum {
348 BUS_NONE,
349 BUS_ISA,
350 BUS_PCI,
351 BUS_SBUS,
352 BUS_last /* Keep last */
353} BusType;
354
355struct pci_device;
356
357typedef struct {
358 int fbNum;
359} SbusBusId;
360
361typedef struct _bus {
362 BusType type;
363 union {
364 struct pci_device *pci;
365 SbusBusId sbus;
366 } id;
367} BusRec, *BusPtr;
368
369#define MAXCLOCKS 128
370typedef enum {
371 DAC_BPP8 = 0,
372 DAC_BPP16,
373 DAC_BPP24,
374 DAC_BPP32,
375 MAXDACSPEEDS
376} DacSpeedIndex;
377
378typedef struct {
379 char * identifier;
380 char * vendor;
381 char * board;
382 char * chipset;
383 char * ramdac;
384 char * driver;
385 struct _confscreenrec * myScreenSection;
386 Bool claimed;
387 int dacSpeeds[MAXDACSPEEDS];
388 int numclocks;
389 int clock[MAXCLOCKS];
390 char * clockchip;
391 char * busID;
392 Bool active;
393 Bool inUse;
394 int videoRam;
395 int textClockFreq;
396 unsigned long BiosBase; /* Base address of video BIOS */
397 unsigned long MemBase; /* Frame buffer base address */
398 unsigned long IOBase;
399 int chipID;
400 int chipRev;
401 pointer options;
402 int irq;
403 int screen; /* For multi-CRTC cards */
404} GDevRec, *GDevPtr;
405
406typedef struct {
407 char * identifier;
408 char * driver;
409 pointer commonOptions;
410 pointer extraOptions;
411} IDevRec, *IDevPtr;
412
413typedef struct {
414 int frameX0;
415 int frameY0;
416 int virtualX;
417 int virtualY;
418 int depth;
419 int fbbpp;
420 rgb weight;
421 rgb blackColour;
422 rgb whiteColour;
423 int defaultVisual;
424 char ** modes;
425 pointer options;
426} DispRec, *DispPtr;
427
428typedef struct _confxvportrec {
429 char * identifier;
430 pointer options;
431} confXvPortRec, *confXvPortPtr;
432
433typedef struct _confxvadaptrec {
434 char * identifier;
435 int numports;
436 confXvPortPtr ports;
437 pointer options;
438} confXvAdaptorRec, *confXvAdaptorPtr;
439
440typedef struct _confscreenrec {
441 char * id;
442 int screennum;
443 int defaultdepth;
444 int defaultbpp;
445 int defaultfbbpp;
446 MonPtr monitor;
447 GDevPtr device;
448 int numdisplays;
449 DispPtr displays;
450 int numxvadaptors;
451 confXvAdaptorPtr xvadaptors;
452 pointer options;
453} confScreenRec, *confScreenPtr;
454
455typedef enum {
456 PosObsolete = -1,
457 PosAbsolute = 0,
458 PosRightOf,
459 PosLeftOf,
460 PosAbove,
461 PosBelow,
462 PosRelative
463} PositionType;
464
465typedef struct _screenlayoutrec {
466 confScreenPtr screen;
467 char * topname;
468 confScreenPtr top;
469 char * bottomname;
470 confScreenPtr bottom;
471 char * leftname;
472 confScreenPtr left;
473 char * rightname;
474 confScreenPtr right;
475 PositionType where;
476 int x;
477 int y;
478 char * refname;
479 confScreenPtr refscreen;
480} screenLayoutRec, *screenLayoutPtr;
481
482typedef struct _serverlayoutrec {
483 char * id;
484 screenLayoutPtr screens;
485 GDevPtr inactives;
486 IDevPtr* inputs; /* NULL terminated */
487 pointer options;
488} serverLayoutRec, *serverLayoutPtr;
489
490typedef struct _confdribufferrec {
491 int count;
492 int size;
493 enum {
494 XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
495 } flags;
496} confDRIBufferRec, *confDRIBufferPtr;
497
498typedef struct _confdrirec {
499 int group;
500 int mode;
501 int bufs_count;
502 confDRIBufferRec *bufs;
503} confDRIRec, *confDRIPtr;
504
505/* These values should be adjusted when new fields are added to ScrnInfoRec */
506#define NUM_RESERVED_INTS 16
507#define NUM_RESERVED_POINTERS 14
508#define NUM_RESERVED_FUNCS 11
509
510typedef pointer (*funcPointer)(void);
511
512/* flags for depth 24 pixmap options */
513typedef enum {
514 Pix24DontCare = 0,
515 Pix24Use24,
516 Pix24Use32
517} Pix24Flags;
518
519/* Power management events: so far we only support APM */
520
521typedef enum {
522 XF86_APM_UNKNOWN = -1,
523 XF86_APM_SYS_STANDBY,
524 XF86_APM_SYS_SUSPEND,
525 XF86_APM_CRITICAL_SUSPEND,
526 XF86_APM_USER_STANDBY,
527 XF86_APM_USER_SUSPEND,
528 XF86_APM_STANDBY_RESUME,
529 XF86_APM_NORMAL_RESUME,
530 XF86_APM_CRITICAL_RESUME,
531 XF86_APM_LOW_BATTERY,
532 XF86_APM_POWER_STATUS_CHANGE,
533 XF86_APM_UPDATE_TIME,
534 XF86_APM_CAPABILITY_CHANGED,
535 XF86_APM_STANDBY_FAILED,
536 XF86_APM_SUSPEND_FAILED
537} pmEvent;
538
539typedef enum {
540 PM_WAIT,
541 PM_CONTINUE,
542 PM_FAILED,
543 PM_NONE
544} pmWait;
545
546typedef struct _PciChipsets {
547 /**
548 * Key used to match this device with its name in an array of
549 * \c SymTabRec.
550 */
551 int numChipset;
552
553 /**
554 * This value is quirky. Depending on the driver, it can take on one of
555 * three meanings. In drivers that have exactly one vendor ID (e.g.,
556 * radeon, mga, i810) the low 16-bits are the device ID.
557 *
558 * In drivers that can have multiple vendor IDs (e.g., the glint driver
559 * can have either 3dlabs' ID or TI's ID, the i740 driver can have either
560 * Intel's ID or Real3D's ID, etc.) the low 16-bits are the device ID and
561 * the high 16-bits are the vendor ID.
562 *
563 * In drivers that don't have a specific vendor (e.g., vga) contains the
564 * device ID for either the generic VGA or generic 8514 devices. This
565 * turns out to be the same as the subclass and programming interface
566 * value (e.g., the full 24-bit class for the VGA device is 0x030000 (or
567 * 0x000101) and for 8514 is 0x030001).
568 */
569 int PCIid;
570
571/* dummy place holders for drivers to build against old/new servers */
572#define RES_UNDEFINED NULL
573#define RES_EXCLUSIVE_VGA NULL
574#define RES_SHARED_VGA NULL
575 void *dummy;
576} PciChipsets;
577
578
579/* Entity properties */
580typedef void (*EntityProc)(int entityIndex,pointer private);
581
582typedef struct _entityInfo {
583 int index;
584 BusRec location;
585 int chipset;
586 Bool active;
587 GDevPtr device;
588 DriverPtr driver;
589} EntityInfoRec, *EntityInfoPtr;
590
591/* server states */
592
593typedef enum {
594 SETUP,
595 OPERATING
596} xf86State;
597
598/* DGA */
599
600typedef struct {
601 int num; /* A unique identifier for the mode (num > 0) */
602 DisplayModePtr mode;
603 int flags; /* DGA_CONCURRENT_ACCESS, etc... */
604 int imageWidth; /* linear accessible portion (pixels) */
605 int imageHeight;
606 int pixmapWidth; /* Xlib accessible portion (pixels) */
607 int pixmapHeight; /* both fields ignored if no concurrent access */
608 int bytesPerScanline;
609 int byteOrder; /* MSBFirst, LSBFirst */
610 int depth;
611 int bitsPerPixel;
612 unsigned long red_mask;
613 unsigned long green_mask;
614 unsigned long blue_mask;
615 short visualClass;
616 int viewportWidth;
617 int viewportHeight;
618 int xViewportStep; /* viewport position granularity */
619 int yViewportStep;
620 int maxViewportX; /* max viewport origin */
621 int maxViewportY;
622 int viewportFlags; /* types of page flipping possible */
623 int offset; /* offset into physical memory */
624 unsigned char *address; /* server's mapped framebuffer */
625 int reserved1;
626 int reserved2;
627} DGAModeRec, *DGAModePtr;
628
629typedef struct {
630 DGAModePtr mode;
631 PixmapPtr pPix;
632} DGADeviceRec, *DGADevicePtr;
633
634/*
635 * Flags for driver Probe() functions.
636 */
637#define PROBE_DEFAULT 0x00
638#define PROBE_DETECT 0x01
639#define PROBE_TRYHARD 0x02
640
641/*
642 * Driver entry point types
643 */
644
645typedef Bool xf86ProbeProc (DriverPtr, int);
646typedef Bool xf86PreInitProc (ScrnInfoPtr, int);
647typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**);
648typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int);
649typedef void xf86AdjustFrameProc (int, int, int, int);
650typedef Bool xf86EnterVTProc (int, int);
651typedef void xf86LeaveVTProc (int, int);
652typedef void xf86FreeScreenProc (int, int);
653typedef ModeStatus xf86ValidModeProc (int, DisplayModePtr, Bool, int);
654typedef void xf86EnableDisableFBAccessProc(int, Bool);
655typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
656typedef int xf86ChangeGammaProc (int, Gamma);
657typedef void xf86PointerMovedProc (int, int, int);
658typedef Bool xf86PMEventProc (int, pmEvent, Bool);
659typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
660typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
661typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
662
663
664/*
665 * ScrnInfoRec
666 *
667 * There is one of these for each screen, and it holds all the screen-specific
668 * information.
669 *
670 * Note: the size and layout must be kept the same across versions. New
671 * fields are to be added in place of the "reserved*" fields. No fields
672 * are to be dependent on compile-time defines.
673 */
674
675
676typedef struct _ScrnInfoRec {
677 int driverVersion;
678 char * driverName; /* canonical name used in */
679 /* the config file */
680 ScreenPtr pScreen; /* Pointer to the ScreenRec */
681 int scrnIndex; /* Number of this screen */
682 Bool configured; /* Is this screen valid */
683 int origIndex; /* initial number assigned to
684 * this screen before
685 * finalising the number of
686 * available screens */
687
688 /* Display-wide screenInfo values needed by this screen */
689 int imageByteOrder;
690 int bitmapScanlineUnit;
691 int bitmapScanlinePad;
692 int bitmapBitOrder;
693 int numFormats;
694 PixmapFormatRec formats[MAXFORMATS];
695 PixmapFormatRec fbFormat;
696
697 int bitsPerPixel; /* fb bpp */
698 Pix24Flags pixmap24; /* pixmap pref for depth 24 */
699 int depth; /* depth of default visual */
700 MessageType depthFrom; /* set from config? */
701 MessageType bitsPerPixelFrom; /* set from config? */
702 rgb weight; /* r/g/b weights */
703 rgb mask; /* rgb masks */
704 rgb offset; /* rgb offsets */
705 int rgbBits; /* Number of bits in r/g/b */
706 Gamma gamma; /* Gamma of the monitor */
707 int defaultVisual; /* default visual class */
708 int maxHValue; /* max horizontal timing */
709 int maxVValue; /* max vertical timing value */
710 int virtualX; /* Virtual width */
711 int virtualY; /* Virtual height */
712 int xInc; /* Horizontal timing increment */
713 MessageType virtualFrom; /* set from config? */
714 int displayWidth; /* memory pitch */
715 int frameX0; /* viewport position */
716 int frameY0;
717 int frameX1;
718 int frameY1;
719 int zoomLocked; /* Disallow mode changes */
720 DisplayModePtr modePool; /* list of compatible modes */
721 DisplayModePtr modes; /* list of actual modes */
722 DisplayModePtr currentMode; /* current mode
723 * This was previously
724 * overloaded with the modes
725 * field, which is a pointer
726 * into a circular list */
727 confScreenPtr confScreen; /* Screen config info */
728 MonPtr monitor; /* Monitor information */
729 DispPtr display; /* Display information */
730 int * entityList; /* List of device entities */
731 int numEntities;
732 int widthmm; /* physical display dimensions
733 * in mm */
734 int heightmm;
735 int xDpi; /* width DPI */
736 int yDpi; /* height DPI */
737 char * name; /* Name to prefix messages */
738 pointer driverPrivate; /* Driver private area */
739 DevUnion * privates; /* Other privates can hook in
740 * here */
741 DriverPtr drv; /* xf86DriverList[] entry */
742 pointer module; /* Pointer to module head */
743 int colorKey;
744 int overlayFlags;
745
746 /* Some of these may be moved out of here into the driver private area */
747
748 char * chipset; /* chipset name */
749 char * ramdac; /* ramdac name */
750 char * clockchip; /* clock name */
751 Bool progClock; /* clock is programmable */
752 int numClocks; /* number of clocks */
753 int clock[MAXCLOCKS]; /* list of clock frequencies */
754 int videoRam; /* amount of video ram (kb) */
755 unsigned long biosBase; /* Base address of video BIOS */
756 unsigned long memPhysBase; /* Physical address of FB */
757 unsigned long fbOffset; /* Offset of FB in the above */
758 IOADDRESS domainIOBase; /* Domain I/O base address */
759 int memClk; /* memory clock */
760 int textClockFreq; /* clock of text mode */
761 Bool flipPixels; /* swap default black/white */
762 pointer options;
763
764 int chipID;
765 int chipRev;
766
767 /* Allow screens to be enabled/disabled individually */
768 Bool vtSema;
769 DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
770
771 /* hw cursor moves at SIGIO time */
772 Bool silkenMouse;
773
774 /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
775 ClockRangePtr clockRanges;
776 int adjustFlags;
777
778 /*
779 * These can be used when the minor ABI version is incremented.
780 * The NUM_* parameters must be reduced appropriately to keep the
781 * structure size and alignment unchanged.
782 */
783 int reservedInt[NUM_RESERVED_INTS];
784
785 int * entityInstanceList;
786 struct pci_device *vgaDev;
787
788 pointer reservedPtr[NUM_RESERVED_POINTERS];
789
790 /*
791 * Driver entry points.
792 *
793 */
794
795 xf86ProbeProc *Probe;
796 xf86PreInitProc *PreInit;
797 xf86ScreenInitProc *ScreenInit;
798 xf86SwitchModeProc *SwitchMode;
799 xf86AdjustFrameProc *AdjustFrame;
800 xf86EnterVTProc *EnterVT;
801 xf86LeaveVTProc *LeaveVT;
802 xf86FreeScreenProc *FreeScreen;
803 xf86ValidModeProc *ValidMode;
804 xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
805 xf86SetDGAModeProc *SetDGAMode;
806 xf86ChangeGammaProc *ChangeGamma;
807 xf86PointerMovedProc *PointerMoved;
808 xf86PMEventProc *PMEvent;
809 xf86DPMSSetProc *DPMSSet;
810 xf86LoadPaletteProc *LoadPalette;
811 xf86SetOverscanProc *SetOverscan;
812 xorgDriverFuncProc *DriverFunc;
813
814 /*
815 * This can be used when the minor ABI version is incremented.
816 * The NUM_* parameter must be reduced appropriately to keep the
817 * structure size and alignment unchanged.
818 */
819 funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
820
821} ScrnInfoRec;
822
823
824typedef struct {
825 Bool (*OpenFramebuffer)(
826 ScrnInfoPtr pScrn,
827 char **name,
828 unsigned char **mem,
829 int *size,
830 int *offset,
831 int *extra
832 );
833 void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
834 Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
835 void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
836 int (*GetViewport)(ScrnInfoPtr pScrn);
837 void (*Sync)(ScrnInfoPtr);
838 void (*FillRect)(
839 ScrnInfoPtr pScrn,
840 int x, int y, int w, int h,
841 unsigned long color
842 );
843 void (*BlitRect)(
844 ScrnInfoPtr pScrn,
845 int srcx, int srcy,
846 int w, int h,
847 int dstx, int dsty
848 );
849 void (*BlitTransRect)(
850 ScrnInfoPtr pScrn,
851 int srcx, int srcy,
852 int w, int h,
853 int dstx, int dsty,
854 unsigned long color
855 );
856} DGAFunctionRec, *DGAFunctionPtr;
857
858typedef struct _SymTabRec {
859 int token; /* id of the token */
860 const char * name; /* token name */
861} SymTabRec, *SymTabPtr;
862
863/* flags for xf86LookupMode */
864typedef enum {
865 LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
866 LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
867 LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
868 LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
869 LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
870 LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
871} LookupModeFlags;
872
873#define NoDepth24Support 0x00
874#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
875#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
876#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
877#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
878#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
879#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
880
881
882/* For DPMS */
883typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
884
885/* Input handler proc */
886typedef void (*InputHandlerProc)(int fd, pointer data);
887
888/* These are used by xf86GetClocks */
889#define CLK_REG_SAVE -1
890#define CLK_REG_RESTORE -2
891
892/*
893 * misc constants
894 */
895#define INTERLACE_REFRESH_WEIGHT 1.5
896#define SYNC_TOLERANCE 0.01 /* 1 percent */
897#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
898
899
900#define OVERLAY_8_32_DUALFB 0x00000001
901#define OVERLAY_8_24_DUALFB 0x00000002
902#define OVERLAY_8_16_DUALFB 0x00000004
903#define OVERLAY_8_32_PLANAR 0x00000008
904
905/* Values of xf86Info.mouseFlags */
906#define MF_CLEAR_DTR 1
907#define MF_CLEAR_RTS 2
908
909/* Action Events */
910typedef enum {
911 ACTION_TERMINATE = 0, /* Terminate Server */
912 ACTION_NEXT_MODE = 10, /* Switch to next video mode */
913 ACTION_PREV_MODE,
914 ACTION_SWITCHSCREEN = 100, /* VT switch */
915 ACTION_SWITCHSCREEN_NEXT,
916 ACTION_SWITCHSCREEN_PREV,
917} ActionEvent;
918
919#endif /* _XF86STR_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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