VirtualBox

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

Last change on this file since 56743 was 28062, checked in by vboxsync, 15 years ago

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

  • Property svn:eol-style set to native
File size: 16.3 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 <pciaccess.h>
45
46#include "xf86str.h"
47#include "xf86Opt.h"
48#include <X11/Xfuncproto.h>
49#include <stdarg.h>
50#ifdef RANDR
51#include <X11/extensions/randr.h>
52#endif
53
54#include "propertyst.h"
55
56/* General parameters */
57extern _X_EXPORT int xf86DoConfigure;
58extern _X_EXPORT int xf86DoShowOptions;
59extern _X_EXPORT Bool xf86DoConfigurePass1;
60extern _X_EXPORT DevPrivateKey xf86ScreenKey;
61extern _X_EXPORT DevPrivateKey xf86CreateRootWindowKey;
62extern _X_EXPORT DevPrivateKey xf86PixmapKey;
63extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
64extern _X_EXPORT const unsigned char byte_reversed[256];
65extern _X_EXPORT Bool pciSlotClaimed;
66extern _X_EXPORT Bool fbSlotClaimed;
67#if defined(__sparc__) || defined(__sparc)
68extern _X_EXPORT Bool sbusSlotClaimed;
69#endif
70extern _X_EXPORT confDRIRec xf86ConfigDRI;
71extern _X_EXPORT Bool xf86inSuspend;
72extern _X_EXPORT Bool xf86DRI2Enabled(void);
73
74extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */
75
76#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \
77 xf86ScreenKey))
78#define XF86FLIP_PIXELS() \
79 do { \
80 if (xf86GetFlipPixels()) { \
81 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
82 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
83 } \
84 while (0)
85
86#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
87
88#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
89 (((p) == Pix24Use32) ? 32 : 0))
90
91/* Function Prototypes */
92#ifndef _NO_XF86_PROTOTYPES
93
94/* xf86Bus.c */
95
96extern _X_EXPORT Bool xf86CheckPciSlot( const struct pci_device * );
97extern _X_EXPORT int xf86ClaimPciSlot( struct pci_device *, DriverPtr drvp,
98 int chipset, GDevPtr dev, Bool active);
99extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *);
100extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
101 int *func);
102extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
103extern _X_EXPORT void xf86FormatPciBusNumber(int busnum, char *buffer);
104extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex);
105extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
106extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
107extern _X_EXPORT void xf86EnableAccess(ScrnInfoPtr pScrn);
108extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device * pPci);
109/* new RAC */
110extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp);
111extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
112extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
113 int instance);
114extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex);
115extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
116extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
117extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
118extern _X_EXPORT struct pci_device * xf86GetPciInfoForEntity(int entityIndex);
119extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
120 EntityProc enter, EntityProc leave, pointer);
121extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device * pPci, memType base);
122extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
123extern _X_EXPORT void xf86EnterServerState(xf86State state);
124extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
125
126extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
127extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
128extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex);
129extern _X_EXPORT void xf86SetEntityShared(int entityIndex);
130extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex);
131extern _X_EXPORT void xf86SetEntitySharable(int entityIndex);
132extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex);
133extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex);
134extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
135extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
136extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
137
138/* xf86Configure.c */
139extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
140 void *busData, int chipset);
141
142/* xf86Cursor.c */
143
144extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock);
145extern _X_EXPORT void xf86InitViewport(ScrnInfoPtr pScr);
146extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y);
147extern _X_EXPORT void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
148extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
149extern _X_EXPORT void *xf86GetPointerScreenFuncs(void);
150extern _X_EXPORT void xf86InitOrigins(void);
151extern _X_EXPORT void xf86ReconfigureLayout(void);
152
153/* xf86cvt.c */
154extern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh,
155 Bool Reduced, Bool Interlaced);
156
157/* xf86DPMS.c */
158
159extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
160
161#ifdef DPMSExtension
162extern _X_EXPORT int DPMSSet(ClientPtr client, int level);
163extern _X_EXPORT Bool DPMSSupported(void);
164#endif
165
166
167/* xf86DGA.c */
168
169#ifdef XFreeXDGA
170extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
171 int num);
172extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
173extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode;
174#endif
175
176/* xf86Events.c */
177
178extern _X_EXPORT void SetTimeSinceLastInputEvent(void);
179extern _X_EXPORT pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
180extern _X_EXPORT int xf86RemoveInputHandler(pointer handler);
181extern _X_EXPORT void xf86DisableInputHandler(pointer handler);
182extern _X_EXPORT void xf86EnableInputHandler(pointer handler);
183extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data);
184extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler);
185extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler);
186extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler);
187extern _X_EXPORT void xf86InterceptSignals(int *signo);
188extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler)(void));
189extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
190extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
191extern _X_EXPORT void xf86PrintBacktrace(void);
192
193/* xf86Helper.c */
194
195extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module, int flags);
196extern _X_EXPORT void xf86DeleteDriver(int drvIndex);
197extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
198extern _X_EXPORT void xf86DeleteScreen(int scrnIndex, int flags);
199extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
200extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
201extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
202 int depth24flags);
203extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp);
204extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
205extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
206extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
207extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
208extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
209extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
210extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
211 const char *format, va_list args);
212extern _X_EXPORT void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
213 const char *format, ...) _printf_attribute(4,5);
214extern _X_EXPORT void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
215 _printf_attribute(3,4);
216extern _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
217 _printf_attribute(3,4);
218extern _X_EXPORT void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
219extern _X_EXPORT void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
220extern _X_EXPORT void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
221extern _X_EXPORT const char *xf86TokenToString(SymTabPtr table, int token);
222extern _X_EXPORT int xf86StringToToken(SymTabPtr table, const char *string);
223extern _X_EXPORT void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
224extern _X_EXPORT void xf86PrintChipsets(const char *drvname, const char *drvmsg,
225 SymTabPtr chips);
226extern _X_EXPORT int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
227extern _X_EXPORT int xf86MatchPciInstances(const char *driverName, int vendorID,
228 SymTabPtr chipsets, PciChipsets *PCIchipsets,
229 GDevPtr *devList, int numDevs, DriverPtr drvp,
230 int **foundEntities);
231extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
232 Bool (*ClockFunc)(ScrnInfoPtr, int),
233 void (*ProtectRegs)(ScrnInfoPtr, Bool),
234 void (*BlankScreen)(ScrnInfoPtr, Bool),
235 IOADDRESS vertsyncreg, int maskval,
236 int knownclkindex, int knownclkvalue);
237extern _X_EXPORT const char *xf86GetVisualName(int visual);
238extern _X_EXPORT int xf86GetVerbosity(void);
239extern _X_EXPORT Pix24Flags xf86GetPix24(void);
240extern _X_EXPORT int xf86GetDepth(void);
241extern _X_EXPORT rgb xf86GetWeight(void);
242extern _X_EXPORT Gamma xf86GetGamma(void);
243extern _X_EXPORT Bool xf86GetFlipPixels(void);
244extern _X_EXPORT const char *xf86GetServerName(void);
245extern _X_EXPORT Bool xf86ServerIsExiting(void);
246extern _X_EXPORT Bool xf86ServerIsResetting(void);
247extern _X_EXPORT Bool xf86ServerIsInitialising(void);
248extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void);
249extern _X_EXPORT Bool xf86CaughtSignal(void);
250extern _X_EXPORT Bool xf86GetVidModeAllowNonLocal(void);
251extern _X_EXPORT Bool xf86GetVidModeEnabled(void);
252extern _X_EXPORT Bool xf86GetModInDevAllowNonLocal(void);
253extern _X_EXPORT Bool xf86GetModInDevEnabled(void);
254extern _X_EXPORT Bool xf86GetAllowMouseOpenFail(void);
255extern _X_EXPORT Bool xf86IsPc98(void);
256extern _X_EXPORT void xf86DisableRandR(void);
257extern _X_EXPORT CARD32 xorgGetVersion(void);
258extern _X_EXPORT CARD32 xf86GetModuleVersion(pointer module);
259extern _X_EXPORT pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
260extern _X_EXPORT pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
261extern _X_EXPORT pointer xf86LoadOneModule(char *name, pointer optlist);
262extern _X_EXPORT void xf86UnloadSubModule(pointer mod);
263extern _X_EXPORT Bool xf86LoaderCheckSymbol(const char *name);
264extern _X_EXPORT void xf86SetBackingStore(ScreenPtr pScreen);
265extern _X_EXPORT void xf86SetSilkenMouse(ScreenPtr pScreen);
266extern _X_EXPORT pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
267 char **adaptor_name, pointer *adaptor_options);
268extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
269extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
270 int entityIndex,PciChipsets *p_chip,
271 void *dummy, EntityProc init,
272 EntityProc enter, EntityProc leave,
273 pointer private);
274extern _X_EXPORT ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
275 int entityIndex, EntityProc init,
276 EntityProc enter, EntityProc leave,
277 pointer private);
278
279/* Obsolete! don't use */
280extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
281 int entityIndex,PciChipsets *p_chip,
282 void *dummy, EntityProc init,
283 EntityProc enter, EntityProc leave,
284 pointer private);
285
286extern _X_EXPORT Bool xf86IsScreenPrimary(int scrnIndex);
287extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
288 int format, unsigned long len,
289 pointer value);
290extern _X_EXPORT Bool xf86IsUnblank(int mode);
291
292/* xf86Init.c */
293
294extern _X_EXPORT PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
295extern _X_EXPORT int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
296
297/* xf86Mode.c */
298
299extern _X_EXPORT int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
300 int DivFactor, int MulFactor, int *divider);
301extern _X_EXPORT const char *xf86ModeStatusToString(ModeStatus status);
302extern _X_EXPORT ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
303 ClockRangePtr clockRanges, LookupModeFlags strategy);
304extern _X_EXPORT ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
305extern _X_EXPORT ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
306 ClockRangePtr clockRanges,
307 LookupModeFlags strategy,
308 int maxPitch, int virtualX,
309 int virtualY);
310extern _X_EXPORT ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
311 int flags);
312extern _X_EXPORT int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
313 char **modeNames, ClockRangePtr clockRanges,
314 int *linePitches, int minPitch, int maxPitch,
315 int minHeight, int maxHeight, int pitchInc,
316 int virtualX, int virtualY, int apertureSize,
317 LookupModeFlags strategy);
318extern _X_EXPORT void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
319extern _X_EXPORT void xf86PruneDriverModes(ScrnInfoPtr scrp);
320extern _X_EXPORT void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
321extern _X_EXPORT void xf86PrintModes(ScrnInfoPtr scrp);
322extern _X_EXPORT void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
323extern _X_EXPORT double xf86ModeHSync(const DisplayModeRec *mode);
324extern _X_EXPORT double xf86ModeVRefresh(const DisplayModeRec *mode);
325extern _X_EXPORT void xf86SetModeDefaultName(DisplayModePtr mode);
326extern _X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
327extern _X_EXPORT DisplayModePtr xf86DuplicateMode(const DisplayModeRec *pMode);
328extern _X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
329extern _X_EXPORT Bool xf86ModesEqual(const DisplayModeRec *pMode1,
330 const DisplayModeRec *pMode2);
331extern _X_EXPORT void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
332extern _X_EXPORT DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
333
334/* xf86Option.c */
335
336extern _X_EXPORT void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts);
337
338
339/* xf86RandR.c */
340#ifdef RANDR
341extern _X_EXPORT Bool xf86RandRInit (ScreenPtr pScreen);
342extern _X_EXPORT Rotation xf86GetRotation(ScreenPtr pScreen);
343extern _X_EXPORT Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
344 int newvirtX, int newvirtY,
345 int newmmWidth, int newmmHeight, Bool resetMode);
346#endif
347
348/* xf86VidModeExtentionInit.c */
349
350extern _X_EXPORT Bool VidModeExtensionInit(ScreenPtr pScreen);
351
352#endif /* _NO_XF86_PROTOTYPES */
353
354#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