VirtualBox

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

Last change on this file since 78293 was 43272, checked in by vboxsync, 12 years ago

Additions/x11: more original X server headers.

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