VirtualBox

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

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

export to OSE

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