VirtualBox

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

Last change on this file since 68495 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 17.5 KB
Line 
1/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.173 2004/01/27 01:31:44 dawes Exp $ */
2
3/*
4 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Except as contained in this notice, the name of the copyright holder(s)
25 * and author(s) shall not be used in advertising or otherwise to promote
26 * the sale, use or other dealings in this Software without prior written
27 * authorization from the copyright holder(s) and author(s).
28 */
29
30/*
31 * This file contains declarations for public XFree86 functions and variables,
32 * and definitions of public macros.
33 *
34 * "public" means available to video drivers.
35 */
36
37#ifndef _XF86_H
38#define _XF86_H
39
40#include "xf86str.h"
41#include "xf86Opt.h"
42#include <X11/Xfuncproto.h>
43#include <stdarg.h>
44#ifdef RANDR
45#include <X11/extensions/randr.h>
46#endif
47
48#include "propertyst.h"
49
50/* General parameters */
51extern int xf86DoConfigure;
52extern Bool xf86DoConfigurePass1;
53extern int xf86ScreenIndex; /* Index into pScreen.devPrivates */
54extern int xf86CreateRootWindowIndex; /* Index into pScreen.devPrivates */
55extern int xf86PixmapIndex;
56extern Bool xf86ResAccessEnter;
57extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
58extern const unsigned char byte_reversed[256];
59extern ScrnInfoPtr xf86CurrentScreen;
60extern Bool pciSlotClaimed;
61extern Bool isaSlotClaimed;
62extern Bool fbSlotClaimed;
63#ifdef __sparc__
64extern Bool sbusSlotClaimed;
65#endif
66extern confDRIRec xf86ConfigDRI;
67extern Bool xf86inSuspend;
68
69#define XF86SCRNINFO(p) ((ScrnInfoPtr)((p)->devPrivates[xf86ScreenIndex].ptr))
70
71#define XF86FLIP_PIXELS() \
72 do { \
73 if (xf86GetFlipPixels()) { \
74 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
75 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
76 } \
77 while (0)
78
79#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
80
81#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
82 (((p) == Pix24Use32) ? 32 : 0))
83
84/* variables for debugging */
85#ifdef BUILDDEBUG
86extern char* xf86p8bit[];
87extern CARD32 xf86DummyVar1;
88extern CARD32 xf86DummyVar2;
89extern CARD32 xf86DummyVar3;
90#endif
91
92/* Function Prototypes */
93#ifndef _NO_XF86_PROTOTYPES
94
95/* xf86Bus.c */
96
97Bool xf86CheckPciSlot(int bus, int device, int func);
98int xf86ClaimPciSlot(int bus, int device, int func, 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);
104pciVideoPtr *xf86GetPciVideoInfo(void);
105pciConfigPtr *xf86GetPciConfigInfo(void);
106void xf86SetPciVideo(pciVideoPtr, resType);
107void xf86PrintResList(int verb, resPtr list);
108resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
109int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
110int xf86GetIsaInfoForScreen(int scrnIndex);
111int xf86GetFbInfoForScreen(int scrnIndex);
112Bool xf86ParseIsaBusString(const char *busID);
113int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
114int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
115void xf86EnableAccess(ScrnInfoPtr pScrn);
116void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn);
117Bool xf86IsPrimaryPci(pciVideoPtr pPci);
118Bool xf86IsPrimaryIsa(void);
119/* new RAC */
120resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
121resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2);
122resPtr xf86DupResList(const resPtr rlist);
123void xf86FreeResList(resPtr rlist);
124void xf86ClaimFixedResources(resList list, int entityIndex);
125Bool xf86DriverHasEntities(DriverPtr drvp);
126void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
127void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
128 int instance);
129int xf86GetNumEntityInstances(int entityIndex);
130GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
131void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
132EntityInfoPtr xf86GetEntityInfo(int entityIndex);
133pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
134int xf86GetPciEntity(int bus, int dev, int func);
135Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
136 EntityProc enter, EntityProc leave, pointer);
137void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type);
138resPtr xf86RegisterResources(int entityIndex, resList list,
139 unsigned long Access);
140Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base);
141void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
142 xf86SetAccessFuncPtr oldFuncs);
143Bool xf86IsEntityPrimary(int entityIndex);
144Bool xf86FixPciResource(int entityIndex, int prt, memType alignment,
145 unsigned long type);
146resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
147resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
148void xf86EnterServerState(xf86State state);
149resRange xf86GetBlock(unsigned long type, memType size,
150 memType window_start, memType window_end,
151 memType align_mask, resPtr avoid);
152resRange xf86GetSparse(unsigned long type, memType fixed_bits,
153 memType decode_mask, memType address_mask,
154 resPtr avoid);
155memType xf86ChkConflict(resRange *rgp, int entityIndex);
156Bool xf86IsPciDevPresent(int bus, int dev, int func);
157ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
158Bool xf86NoSharedResources(int screenIndex, resType res);
159resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
160pciVideoPtr xf86FindPciDeviceVendor(CARD16 vendorID, CARD16 deviceID,
161 char n, pciVideoPtr pvp_exclude);
162pciVideoPtr xf86FindPciClass(CARD8 intf, CARD8 subClass, CARD16 class,
163 char n, pciVideoPtr pvp_exclude);
164#ifdef INCLUDE_DEPRECATED
165void xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable);
166#endif
167void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
168Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
169#ifdef async
170Bool xf86QueueAsyncEvent(void (*func)(pointer),pointer arg);
171#endif
172
173int xf86GetLastScrnFlag(int entityIndex);
174void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
175Bool xf86IsEntityShared(int entityIndex);
176void xf86SetEntityShared(int entityIndex);
177Bool xf86IsEntitySharable(int entityIndex);
178void xf86SetEntitySharable(int entityIndex);
179Bool xf86IsPrimInitDone(int entityIndex);
180void xf86SetPrimInitDone(int entityIndex);
181void xf86ClearPrimInitDone(int entityIndex);
182int xf86AllocateEntityPrivateIndex(void);
183DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
184
185/* xf86Configure.c */
186GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
187 void *busData, int chipset);
188GDevPtr xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo,
189 int chipset);
190
191/* xf86Cursor.c */
192
193void xf86LockZoom(ScreenPtr pScreen, int lock);
194void xf86InitViewport(ScrnInfoPtr pScr);
195void xf86SetViewport(ScreenPtr pScreen, int x, int y);
196void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
197Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
198void *xf86GetPointerScreenFuncs(void);
199void xf86InitOrigins(void);
200void xf86ReconfigureLayout(void);
201
202/* xf86DPMS.c */
203
204Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
205
206/* xf86DGA.c */
207
208Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
209 int num);
210Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
211xf86SetDGAModeProc xf86SetDGAMode;
212
213/* xf86Events.c */
214
215void SetTimeSinceLastInputEvent(void);
216pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
217int xf86RemoveInputHandler(pointer handler);
218void xf86DisableInputHandler(pointer handler);
219void xf86EnableInputHandler(pointer handler);
220void xf86InterceptSignals(int *signo);
221void xf86InterceptSigIll(void (*sigillhandler)(void));
222Bool xf86EnableVTSwitch(Bool new);
223Bool xf86CommonSpecialKey(int key, Bool down, int modifiers);
224void xf86ProcessActionEvent(ActionEvent action, void *arg);
225
226/* xf86Helper.c */
227
228void xf86AddDriver(DriverPtr driver, pointer module, int flags);
229void xf86DeleteDriver(int drvIndex);
230ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
231void xf86DeleteScreen(int scrnIndex, int flags);
232int xf86AllocateScrnInfoPrivateIndex(void);
233Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
234Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
235 int depth24flags);
236void xf86PrintDepthBpp(ScrnInfoPtr scrp);
237Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
238Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
239Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
240void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
241void xf86SetBlackWhitePixels(ScreenPtr pScreen);
242void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
243void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
244 const char *format, va_list args);
245void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
246 const char *format, ...) _printf_attribute(4,5);
247void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
248 _printf_attribute(3,4);
249void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
250 _printf_attribute(3,4);
251void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
252void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
253void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
254const char *xf86TokenToString(SymTabPtr table, int token);
255int xf86StringToToken(SymTabPtr table, const char *string);
256void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
257void xf86PrintChipsets(const char *drvname, const char *drvmsg,
258 SymTabPtr chips);
259int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
260int xf86MatchPciInstances(const char *driverName, int vendorID,
261 SymTabPtr chipsets, PciChipsets *PCIchipsets,
262 GDevPtr *devList, int numDevs, DriverPtr drvp,
263 int **foundEntities);
264int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
265 IsaChipsets *ISAchipsets, DriverPtr drvp,
266 FindIsaDevProc FindIsaDevice, GDevPtr *devList,
267 int numDevs, int **foundEntities);
268void xf86GetClocks(ScrnInfoPtr pScrn, int num,
269 Bool (*ClockFunc)(ScrnInfoPtr, int),
270 void (*ProtectRegs)(ScrnInfoPtr, Bool),
271 void (*BlankScreen)(ScrnInfoPtr, Bool),
272 IOADDRESS vertsyncreg, int maskval,
273 int knownclkindex, int knownclkvalue);
274void xf86SetPriority(Bool up);
275const char *xf86GetVisualName(int visual);
276int xf86GetVerbosity(void);
277Pix24Flags xf86GetPix24(void);
278int xf86GetDepth(void);
279rgb xf86GetWeight(void);
280Gamma xf86GetGamma(void);
281Bool xf86GetFlipPixels(void);
282const char *xf86GetServerName(void);
283Bool xf86ServerIsExiting(void);
284Bool xf86ServerIsResetting(void);
285Bool xf86ServerIsInitialising(void);
286Bool xf86ServerIsOnlyDetecting(void);
287Bool xf86ServerIsOnlyProbing(void);
288Bool xf86CaughtSignal(void);
289Bool xf86GetVidModeAllowNonLocal(void);
290Bool xf86GetVidModeEnabled(void);
291Bool xf86GetModInDevAllowNonLocal(void);
292Bool xf86GetModInDevEnabled(void);
293Bool xf86GetAllowMouseOpenFail(void);
294Bool xf86IsPc98(void);
295void xf86DisableRandR(void);
296CARD32 xf86GetVersion(void);
297CARD32 xorgGetVersion(void);
298CARD32 xf86GetModuleVersion(pointer module);
299pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
300pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
301pointer xf86LoadOneModule(char *name, pointer optlist);
302void xf86UnloadSubModule(pointer mod);
303Bool xf86LoaderCheckSymbol(const char *name);
304void xf86LoaderReqSymLists(const char **, ...);
305void xf86LoaderReqSymbols(const char *, ...);
306void xf86LoaderRefSymLists(const char **, ...);
307void xf86LoaderRefSymbols(const char *, ...);
308void xf86SetBackingStore(ScreenPtr pScreen);
309void xf86SetSilkenMouse(ScreenPtr pScreen);
310int xf86NewSerialNumber(WindowPtr p, pointer unused);
311pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
312 char **adaptor_name, pointer *adaptor_options);
313void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
314ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
315 int entityIndex,PciChipsets *p_chip,
316 resList res, EntityProc init,
317 EntityProc enter, EntityProc leave,
318 pointer private);
319ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag,
320 int entityIndex, IsaChipsets *i_chip,
321 resList res, EntityProc init,
322 EntityProc enter, EntityProc leave,
323 pointer private);
324ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
325 int entityIndex, EntityProc init,
326 EntityProc enter, EntityProc leave,
327 pointer private);
328/* Obsolete! don't use */
329Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
330 int entityIndex,PciChipsets *p_chip,
331 resList res, EntityProc init,
332 EntityProc enter, EntityProc leave,
333 pointer private);
334/* Obsolete! don't use */
335Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn,
336 int entityIndex, IsaChipsets *i_chip,
337 resList res, EntityProc init,
338 EntityProc enter, EntityProc leave,
339 pointer private);
340void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
341 resList res, EntityProc init,
342 EntityProc enter, EntityProc leave,
343 pointer private);
344void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
345 resList res, EntityProc init,
346 EntityProc enter, EntityProc leave,
347 pointer private);
348void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
349 EntityProc enter, EntityProc leave,
350 pointer private);
351Bool xf86IsScreenPrimary(int scrnIndex);
352int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
353 int format, unsigned long len,
354 pointer value);
355Bool xf86IsUnblank(int mode);
356
357#ifdef XFree86LOADER
358void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
359void xf86DeleteModuleInfo(int idx);
360#endif
361
362/* xf86Debug.c */
363#ifdef BUILDDEBUG
364 void xf86Break1(void);
365void xf86Break2(void);
366void xf86Break3(void);
367CARD8 xf86PeekFb8(CARD8 *p);
368CARD16 xf86PeekFb16(CARD16 *p);
369CARD32 xf86PeekFb32(CARD32 *p);
370void xf86PokeFb8(CARD8 *p, CARD8 v);
371void xf86PokeFb16(CARD16 *p, CARD16 v);
372void xf86PokeFb32(CARD16 *p, CARD32 v);
373CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
374CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
375CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
376void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
377void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
378void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
379extern void xf86SPTimestamp(xf86TsPtr* timestamp, char* string);
380extern void xf86STimestamp(xf86TsPtr* timestamp);
381#endif
382
383/* xf86Init.c */
384
385PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
386int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
387
388/* xf86Mode.c */
389
390int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
391 int DivFactor, int MulFactor, int *divider);
392const char *xf86ModeStatusToString(ModeStatus status);
393ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
394 ClockRangePtr clockRanges, LookupModeFlags strategy);
395ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
396ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
397 ClockRangePtr clockRanges,
398 LookupModeFlags strategy,
399 int maxPitch, int virtualX,
400 int virtualY);
401ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
402 int flags);
403int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
404 char **modeNames, ClockRangePtr clockRanges,
405 int *linePitches, int minPitch, int maxPitch,
406 int minHeight, int maxHeight, int pitchInc,
407 int virtualX, int virtualY, int apertureSize,
408 LookupModeFlags strategy);
409void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
410void xf86PruneDriverModes(ScrnInfoPtr scrp);
411void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
412void xf86PrintModes(ScrnInfoPtr scrp);
413void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
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