VirtualBox

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

Last change on this file since 78293 was 54163, checked in by vboxsync, 10 years ago

Additions/x11/vboxvideo: support X.Org Server 1.17 (still untested).

  • Property svn:eol-style set to native
File size: 17.6 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;
58extern _X_EXPORT Bool xorgHWAccess;
59
60extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
61
62#define xf86ScreenKey (&xf86ScreenKeyRec)
63
64extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec;
65
66#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec)
67
68extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
69extern _X_EXPORT const unsigned char byte_reversed[256];
70extern _X_EXPORT Bool fbSlotClaimed;
71
72#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
73extern _X_EXPORT Bool sbusSlotClaimed;
74#endif
75
76#if defined(XSERVER_PLATFORM_BUS)
77extern _X_EXPORT int platformSlotClaimed;
78#endif
79
80extern _X_EXPORT confDRIRec xf86ConfigDRI;
81extern _X_EXPORT Bool xf86DRI2Enabled(void);
82
83extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */
84
85#define XF86SCRNINFO(p) xf86ScreenToScrn(p)
86
87#define XF86FLIP_PIXELS() \
88 do { \
89 if (xf86GetFlipPixels()) { \
90 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
91 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
92 } \
93 while (0)
94
95#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
96
97#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
98 (((p) == Pix24Use32) ? 32 : 0))
99
100/* Function Prototypes */
101#ifndef _NO_XF86_PROTOTYPES
102
103/* PCI related */
104#ifdef XSERVER_LIBPCIACCESS
105#include <pciaccess.h>
106extern _X_EXPORT int pciSlotClaimed;
107
108extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *);
109extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp,
110 int chipset, GDevPtr dev, Bool active);
111extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev);
112extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
113 int *device, int *func);
114extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus,
115 int device, int func);
116extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device *pPci);
117extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device *pPci,
118 memType base);
119extern _X_EXPORT struct pci_device *xf86GetPciInfoForEntity(int entityIndex);
120extern _X_EXPORT int xf86MatchPciInstances(const char *driverName,
121 int vendorID, SymTabPtr chipsets,
122 PciChipsets * PCIchipsets,
123 GDevPtr * devList, int numDevs,
124 DriverPtr drvp, int **foundEntities);
125extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
126 int scrnFlag, int entityIndex,
127 PciChipsets * p_chip,
128 void *dummy, EntityProc init,
129 EntityProc enter,
130 EntityProc leave,
131 void *private);
132#else
133#define xf86VGAarbiterInit() do {} while (0)
134#define xf86VGAarbiterFini() do {} while (0)
135#define xf86VGAarbiterLock(x) do {} while (0)
136#define xf86VGAarbiterUnlock(x) do {} while (0)
137#define xf86VGAarbiterScrnInit(x) do {} while (0)
138#define xf86VGAarbiterDeviceDecodes() do {} while (0)
139#define xf86VGAarbiterWrapFunctions() do {} while (0)
140#endif
141
142/* xf86Bus.c */
143
144extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex);
145extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev,
146 Bool active);
147extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev,
148 Bool active);
149extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp);
150extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
151extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn,
152 int entityIndex,
153 int instance);
154extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex);
155extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
156extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn,
157 int entityIndex);
158extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
159extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
160 EntityProc enter, EntityProc leave,
161 void *);
162extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
163extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
164
165extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
166extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
167extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex);
168extern _X_EXPORT void xf86SetEntityShared(int entityIndex);
169extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex);
170extern _X_EXPORT void xf86SetEntitySharable(int entityIndex);
171extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex);
172extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex);
173extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
174extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
175extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
176
177/* xf86Configure.c */
178extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver,
179 BusType bus, void *busData,
180 int chipset);
181
182/* xf86Cursor.c */
183
184extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock);
185extern _X_EXPORT void xf86InitViewport(ScrnInfoPtr pScr);
186extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y);
187extern _X_EXPORT void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
188extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
189extern _X_EXPORT void *xf86GetPointerScreenFuncs(void);
190extern _X_EXPORT void xf86InitOrigins(void);
191extern _X_EXPORT void xf86ReconfigureLayout(void);
192
193/* xf86DPMS.c */
194
195extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set,
196 int flags);
197
198/* xf86DGA.c */
199
200#ifdef XFreeXDGA
201extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs,
202 DGAModePtr modes, int num);
203extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes,
204 int num);
205extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode;
206#endif
207
208/* xf86Events.c */
209
210typedef struct _InputInfoRec *InputInfoPtr;
211
212extern _X_EXPORT void SetTimeSinceLastInputEvent(void);
213extern _X_EXPORT void *xf86AddInputHandler(int fd, InputHandlerProc proc,
214 void *data);
215extern _X_EXPORT int xf86RemoveInputHandler(void *handler);
216extern _X_EXPORT void xf86DisableInputHandler(void *handler);
217extern _X_EXPORT void xf86EnableInputHandler(void *handler);
218extern _X_EXPORT void *xf86AddGeneralHandler(int fd, InputHandlerProc proc,
219 void *data);
220extern _X_EXPORT int xf86RemoveGeneralHandler(void *handler);
221extern _X_EXPORT void xf86DisableGeneralHandler(void *handler);
222extern _X_EXPORT void xf86EnableGeneralHandler(void *handler);
223extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
224 handler, void *data);
225extern _X_EXPORT void xf86InterceptSignals(int *signo);
226extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void));
227extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
228extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
229extern _X_EXPORT void xf86PrintBacktrace(void);
230extern _X_EXPORT Bool xf86VTOwner(void);
231extern _X_EXPORT void xf86VTLeave(void);
232extern _X_EXPORT void xf86VTEnter(void);
233extern _X_EXPORT void xf86EnableInputDeviceForVTSwitch(InputInfoPtr pInfo);
234extern _X_EXPORT void xf86DisableInputDeviceForVTSwitch(InputInfoPtr pInfo);
235
236/* xf86Helper.c */
237
238extern _X_EXPORT void xf86AddDriver(DriverPtr driver, void *module,
239 int flags);
240extern _X_EXPORT void xf86DeleteDriver(int drvIndex);
241extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
242extern _X_EXPORT void xf86DeleteScreen(ScrnInfoPtr pScrn);
243extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
244extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp,
245 int pad);
246extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp,
247 int fbbpp, int depth24flags);
248extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp);
249extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
250extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
251extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
252extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
253extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
254extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable);
255extern _X_EXPORT void
256xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
257 const char *format, va_list args)
258_X_ATTRIBUTE_PRINTF(4, 0);
259extern _X_EXPORT void
260xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
261 const char *format, ...)
262_X_ATTRIBUTE_PRINTF(4, 5);
263extern _X_EXPORT void
264xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
265_X_ATTRIBUTE_PRINTF(3, 4);
266extern _X_EXPORT void
267xf86MsgVerb(MessageType type, int verb, const char *format, ...)
268_X_ATTRIBUTE_PRINTF(3, 4);
269extern _X_EXPORT void
270xf86Msg(MessageType type, const char *format, ...)
271_X_ATTRIBUTE_PRINTF(2, 3);
272extern _X_EXPORT void
273xf86ErrorFVerb(int verb, const char *format, ...)
274_X_ATTRIBUTE_PRINTF(2, 3);
275extern _X_EXPORT void
276xf86ErrorF(const char *format, ...)
277_X_ATTRIBUTE_PRINTF(1, 2);
278extern _X_EXPORT const char *
279xf86TokenToString(SymTabPtr table, int token);
280extern _X_EXPORT int
281xf86StringToToken(SymTabPtr table, const char *string);
282extern _X_EXPORT void
283xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
284extern _X_EXPORT void
285xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips);
286extern _X_EXPORT int
287xf86MatchDevice(const char *drivername, GDevPtr ** driversectlist);
288extern _X_EXPORT const char *
289xf86GetVisualName(int visual);
290extern _X_EXPORT int
291xf86GetVerbosity(void);
292extern _X_EXPORT Pix24Flags
293xf86GetPix24(void);
294extern _X_EXPORT int
295xf86GetDepth(void);
296extern _X_EXPORT rgb
297xf86GetWeight(void);
298extern _X_EXPORT Gamma
299xf86GetGamma(void);
300extern _X_EXPORT Bool
301xf86GetFlipPixels(void);
302extern _X_EXPORT const char *
303xf86GetServerName(void);
304extern _X_EXPORT Bool
305xf86ServerIsExiting(void);
306extern _X_EXPORT Bool
307xf86ServerIsResetting(void);
308extern _X_EXPORT Bool
309xf86ServerIsInitialising(void);
310extern _X_EXPORT Bool
311xf86ServerIsOnlyDetecting(void);
312extern _X_EXPORT Bool
313xf86CaughtSignal(void);
314extern _X_EXPORT Bool
315xf86GetVidModeAllowNonLocal(void);
316extern _X_EXPORT Bool
317xf86GetVidModeEnabled(void);
318extern _X_EXPORT Bool
319xf86GetModInDevAllowNonLocal(void);
320extern _X_EXPORT Bool
321xf86GetModInDevEnabled(void);
322extern _X_EXPORT Bool
323xf86GetAllowMouseOpenFail(void);
324extern _X_EXPORT void
325xf86DisableRandR(void);
326extern _X_EXPORT CARD32
327xorgGetVersion(void);
328extern _X_EXPORT CARD32
329xf86GetModuleVersion(void *module);
330extern _X_EXPORT void *
331xf86LoadDrvSubModule(DriverPtr drv, const char *name);
332extern _X_EXPORT void *
333xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
334extern _X_EXPORT void *
335xf86LoadOneModule(const char *name, void *optlist);
336extern _X_EXPORT void
337xf86UnloadSubModule(void *mod);
338extern _X_EXPORT Bool
339xf86LoaderCheckSymbol(const char *name);
340extern _X_EXPORT void
341xf86SetBackingStore(ScreenPtr pScreen);
342extern _X_EXPORT void
343xf86SetSilkenMouse(ScreenPtr pScreen);
344extern _X_EXPORT void *
345xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name,
346 const char **adaptor_name, void **adaptor_options);
347extern _X_EXPORT void
348xf86GetOS(const char **name, int *major, int *minor, int *teeny);
349extern _X_EXPORT ScrnInfoPtr
350xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
351 int entityIndex, EntityProc init,
352 EntityProc enter, EntityProc leave, void *private);
353
354extern _X_EXPORT Bool
355xf86IsScreenPrimary(ScrnInfoPtr pScrn);
356extern _X_EXPORT int
357xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
358 int format, unsigned long len, void *value);
359extern _X_EXPORT Bool
360xf86IsUnblank(int mode);
361
362/* xf86Init.c */
363
364extern _X_EXPORT PixmapFormatPtr
365xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
366extern _X_EXPORT int
367xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
368
369/* xf86Mode.c */
370
371extern _X_EXPORT int
372xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
373 int DivFactor, int MulFactor, int *divider);
374extern _X_EXPORT const char *
375xf86ModeStatusToString(ModeStatus status);
376extern _X_EXPORT ModeStatus
377xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
378 ClockRangePtr clockRanges, LookupModeFlags strategy);
379extern _X_EXPORT ModeStatus
380xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
381extern _X_EXPORT ModeStatus
382xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
383 ClockRangePtr clockRanges,
384 LookupModeFlags strategy,
385 int maxPitch, int virtualX, int virtualY);
386extern _X_EXPORT ModeStatus
387xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags);
388extern _X_EXPORT int
389xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
390 const char **modeNames, ClockRangePtr clockRanges,
391 int *linePitches, int minPitch, int maxPitch,
392 int minHeight, int maxHeight, int pitchInc,
393 int virtualX, int virtualY, int apertureSize,
394 LookupModeFlags strategy);
395extern _X_EXPORT void
396xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode);
397extern _X_EXPORT void
398xf86PruneDriverModes(ScrnInfoPtr scrp);
399extern _X_EXPORT void
400xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
401extern _X_EXPORT void
402xf86PrintModes(ScrnInfoPtr scrp);
403extern _X_EXPORT void
404xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
405
406/* xf86Option.c */
407
408extern _X_EXPORT void
409xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts);
410
411/* xf86RandR.c */
412#ifdef RANDR
413extern _X_EXPORT Bool
414xf86RandRInit(ScreenPtr pScreen);
415extern _X_EXPORT Rotation
416xf86GetRotation(ScreenPtr pScreen);
417extern _X_EXPORT Bool
418xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
419 int newvirtX, int newvirtY,
420 int newmmWidth, int newmmHeight,
421 Bool resetMode);
422#endif
423
424/* xf86Extensions.c */
425extern void xf86ExtensionInit(void);
426
427/* convert ScreenPtr to ScrnInfoPtr */
428extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
429/* convert ScrnInfoPtr to ScreenPtr */
430extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
431
432#endif /* _NO_XF86_PROTOTYPES */
433
434#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */
435
436#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */
437
438/* flags passed to xf86 allocate screen */
439#define XF86_ALLOCATE_GPU_SCREEN 1
440
441/* Update the internal total dimensions of all ScreenRecs together */
442extern _X_EXPORT void
443xf86UpdateDesktopDimensions(void);
444
445#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