VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.13.0/xf86.h@ 61522

Last change on this file since 61522 was 43251, checked in by vboxsync, 12 years ago

Additions/x11: added headers for X.Org Server 1.13.

  • Property svn:eol-style set to native
File size: 18.8 KB
Line 
1/*
2 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Except as contained in this notice, the name of the copyright holder(s)
23 * and author(s) shall not be used in advertising or otherwise to promote
24 * the sale, use or other dealings in this Software without prior written
25 * authorization from the copyright holder(s) and author(s).
26 */
27
28/*
29 * This file contains declarations for public XFree86 functions and variables,
30 * and definitions of public macros.
31 *
32 * "public" means available to video drivers.
33 */
34
35#ifndef _XF86_H
36#define _XF86_H
37
38#if HAVE_XORG_CONFIG_H
39#include <xorg-config.h>
40#elif HAVE_DIX_CONFIG_H
41#include <dix-config.h>
42#endif
43
44#include "xf86str.h"
45#include "xf86Opt.h"
46#include <X11/Xfuncproto.h>
47#include <stdarg.h>
48#ifdef RANDR
49#include <X11/extensions/randr.h>
50#endif
51
52#include "propertyst.h"
53
54/* General parameters */
55extern _X_EXPORT int xf86DoConfigure;
56extern _X_EXPORT int xf86DoShowOptions;
57extern _X_EXPORT Bool xf86DoConfigurePass1;
58
59extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
60
61#define xf86ScreenKey (&xf86ScreenKeyRec)
62
63extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec;
64
65#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec)
66
67extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
68extern _X_EXPORT const unsigned char byte_reversed[256];
69extern _X_EXPORT Bool fbSlotClaimed;
70
71#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
72extern _X_EXPORT Bool sbusSlotClaimed;
73#endif
74
75#if defined(XSERVER_PLATFORM_BUS)
76extern _X_EXPORT int platformSlotClaimed;
77#endif
78
79extern _X_EXPORT confDRIRec xf86ConfigDRI;
80extern _X_EXPORT Bool xf86DRI2Enabled(void);
81
82extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */
83
84#define XF86SCRNINFO(p) xf86ScreenToScrn(p)
85
86#define XF86FLIP_PIXELS() \
87 do { \
88 if (xf86GetFlipPixels()) { \
89 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
90 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
91 } \
92 while (0)
93
94#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
95
96#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
97 (((p) == Pix24Use32) ? 32 : 0))
98
99/* Function Prototypes */
100#ifndef _NO_XF86_PROTOTYPES
101
102/* PCI related */
103#ifdef XSERVER_LIBPCIACCESS
104#include <pciaccess.h>
105extern _X_EXPORT int pciSlotClaimed;
106
107extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *);
108extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp,
109 int chipset, GDevPtr dev, Bool active);
110extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev);
111extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
112 int *device, int *func);
113extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus,
114 int device, int func);
115extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device *pPci);
116extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device *pPci,
117 memType base);
118extern _X_EXPORT struct pci_device *xf86GetPciInfoForEntity(int entityIndex);
119extern _X_EXPORT int xf86MatchPciInstances(const char *driverName,
120 int vendorID, SymTabPtr chipsets,
121 PciChipsets * PCIchipsets,
122 GDevPtr * devList, int numDevs,
123 DriverPtr drvp, int **foundEntities);
124extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
125 int scrnFlag, int entityIndex,
126 PciChipsets * p_chip,
127 void *dummy, EntityProc init,
128 EntityProc enter,
129 EntityProc leave,
130 pointer private);
131/* Obsolete! don't use */
132extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
133 int entityIndex,
134 PciChipsets * p_chip,
135 void *dummy, EntityProc init,
136 EntityProc enter,
137 EntityProc leave,
138 pointer private);
139#else
140#define xf86VGAarbiterInit() do {} while (0)
141#define xf86VGAarbiterFini() do {} while (0)
142#define xf86VGAarbiterLock(x) do {} while (0)
143#define xf86VGAarbiterUnlock(x) do {} while (0)
144#define xf86VGAarbiterScrnInit(x) do {} while (0)
145#define xf86VGAarbiterDeviceDecodes() do {} while (0)
146#define xf86VGAarbiterWrapFunctions() do {} while (0)
147#endif
148
149/* xf86Bus.c */
150
151extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex);
152extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev,
153 Bool active);
154extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev,
155 Bool active);
156extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp);
157extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
158extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn,
159 int entityIndex,
160 int instance);
161extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex);
162extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
163extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn,
164 int entityIndex);
165extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
166extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
167 EntityProc enter, EntityProc leave,
168 pointer);
169extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
170extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
171
172extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
173extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
174extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex);
175extern _X_EXPORT void xf86SetEntityShared(int entityIndex);
176extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex);
177extern _X_EXPORT void xf86SetEntitySharable(int entityIndex);
178extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex);
179extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex);
180extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
181extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
182extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
183
184/* xf86Configure.c */
185extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver,
186 BusType bus, void *busData,
187 int chipset);
188
189/* xf86Cursor.c */
190
191extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock);
192extern _X_EXPORT void xf86InitViewport(ScrnInfoPtr pScr);
193extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y);
194extern _X_EXPORT void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
195extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
196extern _X_EXPORT void *xf86GetPointerScreenFuncs(void);
197extern _X_EXPORT void xf86InitOrigins(void);
198extern _X_EXPORT void xf86ReconfigureLayout(void);
199
200/* xf86cvt.c */
201extern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay,
202 float VRefresh, Bool Reduced,
203 Bool Interlaced);
204
205/* xf86DPMS.c */
206
207extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set,
208 int flags);
209
210#ifdef DPMSExtension
211extern _X_EXPORT int DPMSSet(ClientPtr client, int level);
212extern _X_EXPORT Bool DPMSSupported(void);
213#endif
214
215/* xf86DGA.c */
216
217#ifdef XFreeXDGA
218extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs,
219 DGAModePtr modes, int num);
220extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes,
221 int num);
222extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode;
223#endif
224
225/* xf86Events.c */
226
227extern _X_EXPORT void SetTimeSinceLastInputEvent(void);
228extern _X_EXPORT pointer xf86AddInputHandler(int fd, InputHandlerProc proc,
229 pointer data);
230extern _X_EXPORT int xf86RemoveInputHandler(pointer handler);
231extern _X_EXPORT void xf86DisableInputHandler(pointer handler);
232extern _X_EXPORT void xf86EnableInputHandler(pointer handler);
233extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc,
234 pointer data);
235extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler);
236extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler);
237extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler);
238extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
239 handler, pointer data);
240extern _X_EXPORT void xf86InterceptSignals(int *signo);
241extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void));
242extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
243extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
244extern _X_EXPORT void xf86PrintBacktrace(void);
245
246/* xf86Helper.c */
247
248extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module,
249 int flags);
250extern _X_EXPORT void xf86DeleteDriver(int drvIndex);
251extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
252extern _X_EXPORT void xf86DeleteScreen(ScrnInfoPtr pScrn);
253extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
254extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp,
255 int pad);
256extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp,
257 int fbbpp, int depth24flags);
258extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp);
259extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
260extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
261extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
262extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
263extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
264extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable);
265extern _X_EXPORT void
266xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
267 const char *format, va_list args)
268_X_ATTRIBUTE_PRINTF(4, 0);
269extern _X_EXPORT void
270xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
271 const char *format, ...)
272_X_ATTRIBUTE_PRINTF(4, 5);
273extern _X_EXPORT void
274xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
275_X_ATTRIBUTE_PRINTF(3, 4);
276extern _X_EXPORT void
277xf86MsgVerb(MessageType type, int verb, const char *format, ...)
278_X_ATTRIBUTE_PRINTF(3, 4);
279extern _X_EXPORT void
280xf86Msg(MessageType type, const char *format, ...)
281_X_ATTRIBUTE_PRINTF(2, 3);
282extern _X_EXPORT void
283xf86ErrorFVerb(int verb, const char *format, ...)
284_X_ATTRIBUTE_PRINTF(2, 3);
285extern _X_EXPORT void
286xf86ErrorF(const char *format, ...)
287_X_ATTRIBUTE_PRINTF(1, 2);
288extern _X_EXPORT const char *
289xf86TokenToString(SymTabPtr table, int token);
290extern _X_EXPORT int
291xf86StringToToken(SymTabPtr table, const char *string);
292extern _X_EXPORT void
293xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
294extern _X_EXPORT void
295xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips);
296extern _X_EXPORT int
297xf86MatchDevice(const char *drivername, GDevPtr ** driversectlist);
298extern _X_EXPORT const char *
299xf86GetVisualName(int visual);
300extern _X_EXPORT int
301xf86GetVerbosity(void);
302extern _X_EXPORT Pix24Flags
303xf86GetPix24(void);
304extern _X_EXPORT int
305xf86GetDepth(void);
306extern _X_EXPORT rgb
307xf86GetWeight(void);
308extern _X_EXPORT Gamma
309xf86GetGamma(void);
310extern _X_EXPORT Bool
311xf86GetFlipPixels(void);
312extern _X_EXPORT const char *
313xf86GetServerName(void);
314extern _X_EXPORT Bool
315xf86ServerIsExiting(void);
316extern _X_EXPORT Bool
317xf86ServerIsResetting(void);
318extern _X_EXPORT Bool
319xf86ServerIsInitialising(void);
320extern _X_EXPORT Bool
321xf86ServerIsOnlyDetecting(void);
322extern _X_EXPORT Bool
323xf86CaughtSignal(void);
324extern _X_EXPORT Bool
325xf86GetVidModeAllowNonLocal(void);
326extern _X_EXPORT Bool
327xf86GetVidModeEnabled(void);
328extern _X_EXPORT Bool
329xf86GetModInDevAllowNonLocal(void);
330extern _X_EXPORT Bool
331xf86GetModInDevEnabled(void);
332extern _X_EXPORT Bool
333xf86GetAllowMouseOpenFail(void);
334extern _X_EXPORT void
335xf86DisableRandR(void);
336extern _X_EXPORT CARD32
337xorgGetVersion(void);
338extern _X_EXPORT CARD32
339xf86GetModuleVersion(pointer module);
340extern _X_EXPORT pointer
341xf86LoadDrvSubModule(DriverPtr drv, const char *name);
342extern _X_EXPORT pointer
343xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
344extern _X_EXPORT pointer
345xf86LoadOneModule(char *name, pointer optlist);
346extern _X_EXPORT void
347xf86UnloadSubModule(pointer mod);
348extern _X_EXPORT Bool
349xf86LoaderCheckSymbol(const char *name);
350extern _X_EXPORT void
351xf86SetBackingStore(ScreenPtr pScreen);
352extern _X_EXPORT void
353xf86SetSilkenMouse(ScreenPtr pScreen);
354extern _X_EXPORT pointer
355xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, char *port_name,
356 char **adaptor_name, pointer *adaptor_options);
357extern _X_EXPORT void
358xf86GetOS(const char **name, int *major, int *minor, int *teeny);
359extern _X_EXPORT ScrnInfoPtr
360xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
361 int entityIndex, EntityProc init,
362 EntityProc enter, EntityProc leave, pointer private);
363
364extern _X_EXPORT Bool
365xf86IsScreenPrimary(ScrnInfoPtr pScrn);
366extern _X_EXPORT int
367xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
368 int format, unsigned long len, pointer value);
369extern _X_EXPORT Bool
370xf86IsUnblank(int mode);
371
372/* xf86Init.c */
373
374extern _X_EXPORT PixmapFormatPtr
375xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
376extern _X_EXPORT int
377xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
378
379/* xf86Mode.c */
380
381extern _X_EXPORT int
382xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
383 int DivFactor, int MulFactor, int *divider);
384extern _X_EXPORT const char *
385xf86ModeStatusToString(ModeStatus status);
386extern _X_EXPORT ModeStatus
387xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
388 ClockRangePtr clockRanges, LookupModeFlags strategy);
389extern _X_EXPORT ModeStatus
390xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
391extern _X_EXPORT ModeStatus
392xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
393 ClockRangePtr clockRanges,
394 LookupModeFlags strategy,
395 int maxPitch, int virtualX, int virtualY);
396extern _X_EXPORT ModeStatus
397xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags);
398extern _X_EXPORT int
399xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
400 char **modeNames, ClockRangePtr clockRanges,
401 int *linePitches, int minPitch, int maxPitch,
402 int minHeight, int maxHeight, int pitchInc,
403 int virtualX, int virtualY, int apertureSize,
404 LookupModeFlags strategy);
405extern _X_EXPORT void
406xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode);
407extern _X_EXPORT void
408xf86PruneDriverModes(ScrnInfoPtr scrp);
409extern _X_EXPORT void
410xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
411extern _X_EXPORT void
412xf86PrintModes(ScrnInfoPtr scrp);
413extern _X_EXPORT void
414xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
415extern _X_EXPORT double
416xf86ModeHSync(const DisplayModeRec * mode);
417extern _X_EXPORT double
418xf86ModeVRefresh(const DisplayModeRec * mode);
419extern _X_EXPORT void
420xf86SetModeDefaultName(DisplayModePtr mode);
421extern _X_EXPORT void
422xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
423extern _X_EXPORT DisplayModePtr
424xf86DuplicateMode(const DisplayModeRec * pMode);
425extern _X_EXPORT void
426xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec * pMode);
427extern _X_EXPORT DisplayModePtr
428xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
429extern _X_EXPORT Bool
430xf86ModesEqual(const DisplayModeRec * pMode1, const DisplayModeRec * pMode2);
431extern _X_EXPORT void
432xf86PrintModeline(int scrnIndex, DisplayModePtr mode);
433extern _X_EXPORT DisplayModePtr
434xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
435
436/* xf86Option.c */
437
438extern _X_EXPORT void
439xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts);
440
441/* xf86RandR.c */
442#ifdef RANDR
443extern _X_EXPORT Bool
444xf86RandRInit(ScreenPtr pScreen);
445extern _X_EXPORT Rotation
446xf86GetRotation(ScreenPtr pScreen);
447extern _X_EXPORT Bool
448xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
449 int newvirtX, int newvirtY,
450 int newmmWidth, int newmmHeight,
451 Bool resetMode);
452#endif
453
454/* xf86Extensions.c */
455extern void xf86ExtensionInit(void);
456
457/* convert ScreenPtr to ScrnInfoPtr */
458extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
459/* convert ScrnInfoPtr to ScreenPtr */
460extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
461
462#endif /* _NO_XF86_PROTOTYPES */
463
464#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */
465
466#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */
467
468/* flags passed to xf86 allocate screen */
469#define XF86_ALLOCATE_GPU_SCREEN 1
470
471#endif /* _XF86_H */
Note: See TracBrowser for help on using the repository browser.

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