VirtualBox

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

Last change on this file since 32915 was 17471, checked in by vboxsync, 16 years ago

export to OSE

  • Property svn:eol-style set to native
File size: 17.2 KB
Line 
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 declarations for public XFree86 functions and variables,
31 * and definitions of public macros.
32 *
33 * "public" means available to video drivers.
34 */
35
36#ifndef _XF86_H
37#define _XF86_H
38
39#if HAVE_XORG_CONFIG_H
40#include <xorg-config.h>
41#elif HAVE_DIX_CONFIG_H
42#include <dix-config.h>
43#endif
44
45#include <pciaccess.h>
46
47#include "xf86str.h"
48#include "xf86Opt.h"
49#include <X11/Xfuncproto.h>
50#include <stdarg.h>
51#ifdef RANDR
52#include <X11/extensions/randr.h>
53#endif
54
55#include "propertyst.h"
56
57/* General parameters */
58extern int xf86DoConfigure;
59extern Bool xf86DoModalias;
60extern Bool xf86DoConfigurePass1;
61extern DevPrivateKey xf86ScreenKey;
62extern DevPrivateKey xf86CreateRootWindowKey;
63extern DevPrivateKey xf86PixmapKey;
64extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
65extern const unsigned char byte_reversed[256];
66extern ScrnInfoPtr xf86CurrentScreen;
67extern Bool pciSlotClaimed;
68extern Bool isaSlotClaimed;
69extern Bool fbSlotClaimed;
70#if defined(__sparc__) || defined(__sparc)
71extern Bool sbusSlotClaimed;
72#endif
73extern confDRIRec xf86ConfigDRI;
74extern Bool xf86inSuspend;
75extern Bool xf86DRI2Enabled(void);
76
77#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \
78 xf86ScreenKey))
79#define XF86FLIP_PIXELS() \
80 do { \
81 if (xf86GetFlipPixels()) { \
82 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
83 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
84 } \
85 while (0)
86
87#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
88
89#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
90 (((p) == Pix24Use32) ? 32 : 0))
91
92/* Function Prototypes */
93#ifndef _NO_XF86_PROTOTYPES
94
95/* xf86Bus.c */
96
97Bool xf86CheckPciSlot( const struct pci_device * );
98int xf86ClaimPciSlot( struct pci_device *, DriverPtr drvp,
99 int chipset, GDevPtr dev, Bool active);
100Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
101 int *func);
102Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
103void xf86FormatPciBusNumber(int busnum, char *buffer);
104void xf86PrintResList(int verb, resPtr list);
105resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
106int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
107int xf86GetIsaInfoForScreen(int scrnIndex);
108int xf86GetFbInfoForScreen(int scrnIndex);
109Bool xf86ParseIsaBusString(const char *busID);
110int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
111int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
112void xf86EnableAccess(ScrnInfoPtr pScrn);
113void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn);
114Bool xf86IsPrimaryPci(struct pci_device * pPci);
115Bool xf86IsPrimaryIsa(void);
116/* new RAC */
117resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
118resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2);
119resPtr xf86DupResList(const resPtr rlist);
120void xf86FreeResList(resPtr rlist);
121void xf86ClaimFixedResources(resList list, int entityIndex);
122Bool xf86DriverHasEntities(DriverPtr drvp);
123void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
124void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
125 int instance);
126int xf86GetNumEntityInstances(int entityIndex);
127GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
128void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
129EntityInfoPtr xf86GetEntityInfo(int entityIndex);
130struct pci_device * xf86GetPciInfoForEntity(int entityIndex);
131Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
132 EntityProc enter, EntityProc leave, pointer);
133void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type);
134resPtr xf86RegisterResources(int entityIndex, resList list,
135 unsigned long Access);
136Bool xf86CheckPciMemBase(struct pci_device * pPci, memType base);
137void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
138 xf86SetAccessFuncPtr oldFuncs);
139Bool xf86IsEntityPrimary(int entityIndex);
140resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
141resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
142void xf86EnterServerState(xf86State state);
143memType xf86ChkConflict(resRange *rgp, int entityIndex);
144ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
145Bool xf86NoSharedResources(int screenIndex, resType res);
146resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
147void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
148Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
149
150int xf86GetLastScrnFlag(int entityIndex);
151void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
152Bool xf86IsEntityShared(int entityIndex);
153void xf86SetEntityShared(int entityIndex);
154Bool xf86IsEntitySharable(int entityIndex);
155void xf86SetEntitySharable(int entityIndex);
156Bool xf86IsPrimInitDone(int entityIndex);
157void xf86SetPrimInitDone(int entityIndex);
158void xf86ClearPrimInitDone(int entityIndex);
159int xf86AllocateEntityPrivateIndex(void);
160DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
161
162/* xf86Configure.c */
163GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
164 void *busData, int chipset);
165GDevPtr xf86AddDeviceToConfigure( const char *driver,
166 struct pci_device * pVideo, int chipset );
167
168/* xf86Cursor.c */
169
170void xf86LockZoom(ScreenPtr pScreen, int lock);
171void xf86InitViewport(ScrnInfoPtr pScr);
172void xf86SetViewport(ScreenPtr pScreen, int x, int y);
173void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
174Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
175void *xf86GetPointerScreenFuncs(void);
176void xf86InitOrigins(void);
177void xf86ReconfigureLayout(void);
178
179/* xf86cvt.c */
180DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh,
181 Bool Reduced, Bool Interlaced);
182
183/* xf86DPMS.c */
184
185Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
186
187/* xf86DGA.c */
188
189Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
190 int num);
191Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
192xf86SetDGAModeProc xf86SetDGAMode;
193
194/* xf86Events.c */
195
196void SetTimeSinceLastInputEvent(void);
197pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
198int xf86RemoveInputHandler(pointer handler);
199void xf86DisableInputHandler(pointer handler);
200void xf86EnableInputHandler(pointer handler);
201pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data);
202int xf86RemoveGeneralHandler(pointer handler);
203void xf86DisableGeneralHandler(pointer handler);
204void xf86EnableGeneralHandler(pointer handler);
205void xf86InterceptSignals(int *signo);
206void xf86InterceptSigIll(void (*sigillhandler)(void));
207Bool xf86EnableVTSwitch(Bool new);
208Bool xf86CommonSpecialKey(int key, Bool down, int modifiers);
209void xf86ProcessActionEvent(ActionEvent action, void *arg);
210
211/* xf86Helper.c */
212
213void xf86AddDriver(DriverPtr driver, pointer module, int flags);
214void xf86DeleteDriver(int drvIndex);
215ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
216void xf86DeleteScreen(int scrnIndex, int flags);
217int xf86AllocateScrnInfoPrivateIndex(void);
218Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
219Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
220 int depth24flags);
221void xf86PrintDepthBpp(ScrnInfoPtr scrp);
222Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
223Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
224Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
225void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
226void xf86SetBlackWhitePixels(ScreenPtr pScreen);
227void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
228void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
229 const char *format, va_list args);
230void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
231 const char *format, ...) _printf_attribute(4,5);
232void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
233 _printf_attribute(3,4);
234void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
235 _printf_attribute(3,4);
236void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
237void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
238void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
239const char *xf86TokenToString(SymTabPtr table, int token);
240int xf86StringToToken(SymTabPtr table, const char *string);
241void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
242void xf86PrintChipsets(const char *drvname, const char *drvmsg,
243 SymTabPtr chips);
244int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
245int xf86MatchPciInstances(const char *driverName, int vendorID,
246 SymTabPtr chipsets, PciChipsets *PCIchipsets,
247 GDevPtr *devList, int numDevs, DriverPtr drvp,
248 int **foundEntities);
249int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
250 IsaChipsets *ISAchipsets, DriverPtr drvp,
251 FindIsaDevProc FindIsaDevice, GDevPtr *devList,
252 int numDevs, int **foundEntities);
253void xf86GetClocks(ScrnInfoPtr pScrn, int num,
254 Bool (*ClockFunc)(ScrnInfoPtr, int),
255 void (*ProtectRegs)(ScrnInfoPtr, Bool),
256 void (*BlankScreen)(ScrnInfoPtr, Bool),
257 IOADDRESS vertsyncreg, int maskval,
258 int knownclkindex, int knownclkvalue);
259void xf86SetPriority(Bool up);
260const char *xf86GetVisualName(int visual);
261int xf86GetVerbosity(void);
262Pix24Flags xf86GetPix24(void);
263int xf86GetDepth(void);
264rgb xf86GetWeight(void);
265Gamma xf86GetGamma(void);
266Bool xf86GetFlipPixels(void);
267const char *xf86GetServerName(void);
268Bool xf86ServerIsExiting(void);
269Bool xf86ServerIsResetting(void);
270Bool xf86ServerIsInitialising(void);
271Bool xf86ServerIsOnlyDetecting(void);
272Bool xf86ServerIsOnlyProbing(void);
273Bool xf86CaughtSignal(void);
274Bool xf86GetVidModeAllowNonLocal(void);
275Bool xf86GetVidModeEnabled(void);
276Bool xf86GetModInDevAllowNonLocal(void);
277Bool xf86GetModInDevEnabled(void);
278Bool xf86GetAllowMouseOpenFail(void);
279Bool xf86IsPc98(void);
280void xf86DisableRandR(void);
281CARD32 xf86GetVersion(void);
282CARD32 xorgGetVersion(void);
283CARD32 xf86GetModuleVersion(pointer module);
284pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
285pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
286pointer xf86LoadOneModule(char *name, pointer optlist);
287void xf86UnloadSubModule(pointer mod);
288Bool xf86LoaderCheckSymbol(const char *name);
289void xf86LoaderReqSymLists(const char **, ...);
290void xf86LoaderReqSymbols(const char *, ...);
291void xf86LoaderRefSymLists(const char **, ...);
292void xf86LoaderRefSymbols(const char *, ...);
293void xf86SetBackingStore(ScreenPtr pScreen);
294void xf86SetSilkenMouse(ScreenPtr pScreen);
295int xf86NewSerialNumber(WindowPtr p, pointer unused);
296pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
297 char **adaptor_name, pointer *adaptor_options);
298void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
299ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
300 int entityIndex,PciChipsets *p_chip,
301 resList res, EntityProc init,
302 EntityProc enter, EntityProc leave,
303 pointer private);
304ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag,
305 int entityIndex, IsaChipsets *i_chip,
306 resList res, EntityProc init,
307 EntityProc enter, EntityProc leave,
308 pointer private);
309ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
310 int entityIndex, EntityProc init,
311 EntityProc enter, EntityProc leave,
312 pointer private);
313/* Obsolete! don't use */
314Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
315 int entityIndex,PciChipsets *p_chip,
316 resList res, EntityProc init,
317 EntityProc enter, EntityProc leave,
318 pointer private);
319/* Obsolete! don't use */
320Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn,
321 int entityIndex, IsaChipsets *i_chip,
322 resList res, EntityProc init,
323 EntityProc enter, EntityProc leave,
324 pointer private);
325void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
326 resList res, EntityProc init,
327 EntityProc enter, EntityProc leave,
328 pointer private);
329void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
330 resList res, EntityProc init,
331 EntityProc enter, EntityProc leave,
332 pointer private);
333void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
334 EntityProc enter, EntityProc leave,
335 pointer private);
336Bool xf86IsScreenPrimary(int scrnIndex);
337int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
338 int format, unsigned long len,
339 pointer value);
340Bool xf86IsUnblank(int mode);
341
342_X_DEPRECATED void xf86AddModuleInfo(pointer info, pointer module);
343_X_DEPRECATED void xf86DeleteModuleInfo(int idx);
344void xf86getsecs(long *, long *);
345
346/* xf86Debug.c */
347#ifdef BUILDDEBUG
348CARD8 xf86PeekFb8(CARD8 *p);
349CARD16 xf86PeekFb16(CARD16 *p);
350CARD32 xf86PeekFb32(CARD32 *p);
351void xf86PokeFb8(CARD8 *p, CARD8 v);
352void xf86PokeFb16(CARD16 *p, CARD16 v);
353void xf86PokeFb32(CARD16 *p, CARD32 v);
354CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
355CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
356CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
357void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
358void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
359void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
360#endif
361
362/* xf86Init.c */
363
364PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
365int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
366
367/* xf86Mode.c */
368
369int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
370 int DivFactor, int MulFactor, int *divider);
371const char *xf86ModeStatusToString(ModeStatus status);
372ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
373 ClockRangePtr clockRanges, LookupModeFlags strategy);
374ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
375ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
376 ClockRangePtr clockRanges,
377 LookupModeFlags strategy,
378 int maxPitch, int virtualX,
379 int virtualY);
380ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
381 int flags);
382int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
383 char **modeNames, ClockRangePtr clockRanges,
384 int *linePitches, int minPitch, int maxPitch,
385 int minHeight, int maxHeight, int pitchInc,
386 int virtualX, int virtualY, int apertureSize,
387 LookupModeFlags strategy);
388void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
389void xf86PruneDriverModes(ScrnInfoPtr scrp);
390void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
391void xf86PrintModes(ScrnInfoPtr scrp);
392void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
393double xf86ModeHSync(DisplayModePtr mode);
394double xf86ModeVRefresh(DisplayModePtr mode);
395void xf86SetModeDefaultName(DisplayModePtr mode);
396void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
397DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode);
398DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
399Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2);
400void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
401DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
402
403/* xf86Option.c */
404
405void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts);
406
407
408/* xf86RandR.c */
409#ifdef RANDR
410Bool xf86RandRInit (ScreenPtr pScreen);
411void xf86RandRSetInitialMode (ScreenPtr pScreen);
412Rotation xf86GetRotation(ScreenPtr pScreen);
413Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
414 int newvirtX, int newvirtY,
415 int newmmWidth, int newmmHeight, Bool resetMode);
416#endif
417
418/* xf86VidModeExtentionInit.c */
419
420Bool VidModeExtensionInit(ScreenPtr pScreen);
421
422/* xf86Versions.c */
423CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag);
424Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface,
425 CARD32 version, int flags);
426
427
428#endif /* _NO_XF86_PROTOTYPES */
429
430#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