VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/1.5/xorg/xf86.h@ 9233

Last change on this file since 9233 was 9233, checked in by vboxsync, 17 years ago

Additions/x11: added header files for X.org server 1.5

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