VirtualBox

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

最後變更 在這個檔案從67129是 51223,由 vboxsync 提交於 11 年 前

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

  • 屬性 svn:eol-style 設為 native
檔案大小: 17.6 KB
 
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#ifndef IN_MODULE
44#include <stdarg.h>
45#else
46#include "xf86_ansic.h"
47#endif
48#ifdef RANDR
49#include <X11/extensions/randr.h>
50#endif
51
52#include "propertyst.h"
53
54/* General parameters */
55extern int xf86DoConfigure;
56extern Bool xf86DoConfigurePass1;
57extern int xf86ScreenIndex; /* Index into pScreen.devPrivates */
58extern int xf86CreateRootWindowIndex; /* Index into pScreen.devPrivates */
59extern int xf86PixmapIndex;
60extern Bool xf86ResAccessEnter;
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#ifdef __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/* variables for debugging */
89#ifdef BUILDDEBUG
90extern char* xf86p8bit[];
91extern CARD32 xf86DummyVar1;
92extern CARD32 xf86DummyVar2;
93extern CARD32 xf86DummyVar3;
94#endif
95
96/* Function Prototypes */
97#ifndef _NO_XF86_PROTOTYPES
98
99/* xf86Bus.c */
100
101Bool xf86CheckPciSlot(int bus, int device, int func);
102int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
103 int chipset, GDevPtr dev, Bool active);
104Bool xf86ParsePciBusString(const char *busID, int *bus, int *device,
105 int *func);
106Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
107void xf86FormatPciBusNumber(int busnum, char *buffer);
108pciVideoPtr *xf86GetPciVideoInfo(void);
109pciConfigPtr *xf86GetPciConfigInfo(void);
110void xf86SetPciVideo(pciVideoPtr, resType);
111void xf86PrintResList(int verb, resPtr list);
112resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex);
113int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
114int xf86GetIsaInfoForScreen(int scrnIndex);
115int xf86GetFbInfoForScreen(int scrnIndex);
116Bool xf86ParseIsaBusString(const char *busID);
117int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
118int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
119void xf86EnableAccess(ScrnInfoPtr pScrn);
120void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn);
121Bool xf86IsPrimaryPci(pciVideoPtr pPci);
122Bool xf86IsPrimaryIsa(void);
123int xf86CheckPciGAType(pciVideoPtr pPci);
124/* new RAC */
125resPtr xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex);
126resPtr xf86JoinResLists(resPtr rlist1, resPtr rlist2);
127resPtr xf86DupResList(const resPtr rlist);
128void xf86FreeResList(resPtr rlist);
129void xf86ClaimFixedResources(resList list, int entityIndex);
130Bool xf86DriverHasEntities(DriverPtr drvp);
131void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
132void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
133 int instance);
134int xf86GetNumEntityInstances(int entityIndex);
135GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
136void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
137EntityInfoPtr xf86GetEntityInfo(int entityIndex);
138pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
139int xf86GetPciEntity(int bus, int dev, int func);
140Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
141 EntityProc enter, EntityProc leave, pointer);
142void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type);
143resPtr xf86RegisterResources(int entityIndex, resList list,
144 unsigned long Access);
145Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base);
146void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
147 xf86SetAccessFuncPtr oldFuncs);
148Bool xf86IsEntityPrimary(int entityIndex);
149Bool xf86FixPciResource(int entityIndex, int prt, memType alignment,
150 unsigned long type);
151resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
152resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
153void xf86EnterServerState(xf86State state);
154resRange xf86GetBlock(unsigned long type, memType size,
155 memType window_start, memType window_end,
156 memType align_mask, resPtr avoid);
157resRange xf86GetSparse(unsigned long type, memType fixed_bits,
158 memType decode_mask, memType address_mask,
159 resPtr avoid);
160memType xf86ChkConflict(resRange *rgp, int entityIndex);
161Bool xf86IsPciDevPresent(int bus, int dev, int func);
162ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
163Bool xf86NoSharedResources(int screenIndex, resType res);
164resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2);
165pciVideoPtr xf86FindPciDeviceVendor(CARD16 vendorID, CARD16 deviceID,
166 char n, pciVideoPtr pvp_exclude);
167pciVideoPtr xf86FindPciClass(CARD8 intf, CARD8 subClass, CARD16 class,
168 char n, pciVideoPtr pvp_exclude);
169#ifdef INCLUDE_DEPRECATED
170void xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable);
171#endif
172void xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg);
173Bool xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func);
174#ifdef async
175Bool xf86QueueAsyncEvent(void (*func)(pointer),pointer arg);
176#endif
177
178int xf86GetLastScrnFlag(int entityIndex);
179void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
180Bool xf86IsEntityShared(int entityIndex);
181void xf86SetEntityShared(int entityIndex);
182Bool xf86IsEntitySharable(int entityIndex);
183void xf86SetEntitySharable(int entityIndex);
184Bool xf86IsPrimInitDone(int entityIndex);
185void xf86SetPrimInitDone(int entityIndex);
186void xf86ClearPrimInitDone(int entityIndex);
187int xf86AllocateEntityPrivateIndex(void);
188DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
189
190/* xf86Configure.c */
191GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
192 void *busData, int chipset);
193GDevPtr xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo,
194 int chipset);
195
196/* xf86Cursor.c */
197
198void xf86LockZoom(ScreenPtr pScreen, int lock);
199void xf86InitViewport(ScrnInfoPtr pScr);
200void xf86SetViewport(ScreenPtr pScreen, int x, int y);
201void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
202Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
203void *xf86GetPointerScreenFuncs(void);
204void xf86InitOrigins(void);
205void xf86ReconfigureLayout(void);
206
207/* xf86DPMS.c */
208
209Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
210
211/* xf86DGA.c */
212
213Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
214 int num);
215Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
216xf86SetDGAModeProc xf86SetDGAMode;
217
218/* xf86Events.c */
219
220void SetTimeSinceLastInputEvent(void);
221pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
222int xf86RemoveInputHandler(pointer handler);
223void xf86DisableInputHandler(pointer handler);
224void xf86EnableInputHandler(pointer handler);
225void xf86InterceptSignals(int *signo);
226void xf86InterceptSigIll(void (*sigillhandler)(void));
227Bool xf86EnableVTSwitch(Bool new);
228Bool xf86CommonSpecialKey(int key, Bool down, int modifiers);
229void xf86ProcessActionEvent(ActionEvent action, void *arg);
230
231/* xf86Helper.c */
232
233void xf86AddDriver(DriverPtr driver, pointer module, int flags);
234void xf86DeleteDriver(int drvIndex);
235ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
236void xf86DeleteScreen(int scrnIndex, int flags);
237int xf86AllocateScrnInfoPrivateIndex(void);
238Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
239Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
240 int depth24flags);
241void xf86PrintDepthBpp(ScrnInfoPtr scrp);
242Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
243Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
244Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
245void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
246void xf86SetBlackWhitePixels(ScreenPtr pScreen);
247void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
248void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
249 const char *format, va_list args);
250void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
251 const char *format, ...) _printf_attribute(4,5);
252void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
253 _printf_attribute(3,4);
254void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
255 _printf_attribute(3,4);
256void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
257void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
258void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
259const char *xf86TokenToString(SymTabPtr table, int token);
260int xf86StringToToken(SymTabPtr table, const char *string);
261void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
262void xf86PrintChipsets(const char *drvname, const char *drvmsg,
263 SymTabPtr chips);
264int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
265int xf86MatchPciInstances(const char *driverName, int vendorID,
266 SymTabPtr chipsets, PciChipsets *PCIchipsets,
267 GDevPtr *devList, int numDevs, DriverPtr drvp,
268 int **foundEntities);
269int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
270 IsaChipsets *ISAchipsets, DriverPtr drvp,
271 FindIsaDevProc FindIsaDevice, GDevPtr *devList,
272 int numDevs, int **foundEntities);
273void xf86GetClocks(ScrnInfoPtr pScrn, int num,
274 Bool (*ClockFunc)(ScrnInfoPtr, int),
275 void (*ProtectRegs)(ScrnInfoPtr, Bool),
276 void (*BlankScreen)(ScrnInfoPtr, Bool),
277 IOADDRESS vertsyncreg, int maskval,
278 int knownclkindex, int knownclkvalue);
279void xf86SetPriority(Bool up);
280const char *xf86GetVisualName(int visual);
281int xf86GetVerbosity(void);
282Pix24Flags xf86GetPix24(void);
283int xf86GetDepth(void);
284rgb xf86GetWeight(void);
285Gamma xf86GetGamma(void);
286Bool xf86GetFlipPixels(void);
287const char *xf86GetServerName(void);
288Bool xf86ServerIsExiting(void);
289Bool xf86ServerIsResetting(void);
290Bool xf86ServerIsInitialising(void);
291Bool xf86ServerIsOnlyDetecting(void);
292Bool xf86ServerIsOnlyProbing(void);
293Bool xf86CaughtSignal(void);
294Bool xf86GetVidModeAllowNonLocal(void);
295Bool xf86GetVidModeEnabled(void);
296Bool xf86GetModInDevAllowNonLocal(void);
297Bool xf86GetModInDevEnabled(void);
298Bool xf86GetAllowMouseOpenFail(void);
299Bool xf86IsPc98(void);
300void xf86DisableRandR(void);
301CARD32 xf86GetVersion(void);
302CARD32 xorgGetVersion(void);
303CARD32 xf86GetModuleVersion(pointer module);
304pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
305pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
306pointer xf86LoadOneModule(char *name, pointer optlist);
307void xf86UnloadSubModule(pointer mod);
308Bool xf86LoaderCheckSymbol(const char *name);
309void xf86LoaderReqSymLists(const char **, ...);
310void xf86LoaderReqSymbols(const char *, ...);
311void xf86LoaderRefSymLists(const char **, ...);
312void xf86LoaderRefSymbols(const char *, ...);
313void xf86SetBackingStore(ScreenPtr pScreen);
314void xf86SetSilkenMouse(ScreenPtr pScreen);
315int xf86NewSerialNumber(WindowPtr p, pointer unused);
316pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
317 char **adaptor_name, pointer *adaptor_options);
318void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
319ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag,
320 int entityIndex,PciChipsets *p_chip,
321 resList res, EntityProc init,
322 EntityProc enter, EntityProc leave,
323 pointer private);
324ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag,
325 int entityIndex, IsaChipsets *i_chip,
326 resList res, EntityProc init,
327 EntityProc enter, EntityProc leave,
328 pointer private);
329ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
330 int entityIndex, EntityProc init,
331 EntityProc enter, EntityProc leave,
332 pointer private);
333/* Obsolete! don't use */
334Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
335 int entityIndex,PciChipsets *p_chip,
336 resList res, EntityProc init,
337 EntityProc enter, EntityProc leave,
338 pointer private);
339/* Obsolete! don't use */
340Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn,
341 int entityIndex, IsaChipsets *i_chip,
342 resList res, EntityProc init,
343 EntityProc enter, EntityProc leave,
344 pointer private);
345void xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
346 resList res, EntityProc init,
347 EntityProc enter, EntityProc leave,
348 pointer private);
349void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
350 resList res, EntityProc init,
351 EntityProc enter, EntityProc leave,
352 pointer private);
353void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
354 EntityProc enter, EntityProc leave,
355 pointer private);
356Bool xf86IsScreenPrimary(int scrnIndex);
357int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
358 int format, unsigned long len,
359 pointer value);
360Bool xf86IsUnblank(int mode);
361
362#ifdef XFree86LOADER
363void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
364void xf86DeleteModuleInfo(int idx);
365#endif
366
367/* xf86Debug.c */
368#ifdef BUILDDEBUG
369 void xf86Break1(void);
370void xf86Break2(void);
371void xf86Break3(void);
372CARD8 xf86PeekFb8(CARD8 *p);
373CARD16 xf86PeekFb16(CARD16 *p);
374CARD32 xf86PeekFb32(CARD32 *p);
375void xf86PokeFb8(CARD8 *p, CARD8 v);
376void xf86PokeFb16(CARD16 *p, CARD16 v);
377void xf86PokeFb32(CARD16 *p, CARD32 v);
378CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
379CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
380CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
381void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
382void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
383void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
384extern void xf86SPTimestamp(xf86TsPtr* timestamp, char* string);
385extern void xf86STimestamp(xf86TsPtr* timestamp);
386#endif
387
388/* xf86Init.c */
389
390PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
391int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
392
393/* xf86Mode.c */
394
395int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
396 int DivFactor, int MulFactor, int *divider);
397const char *xf86ModeStatusToString(ModeStatus status);
398ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
399 ClockRangePtr clockRanges, LookupModeFlags strategy);
400ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
401ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
402 ClockRangePtr clockRanges,
403 LookupModeFlags strategy,
404 int maxPitch, int virtualX,
405 int virtualY);
406ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
407 int flags);
408int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
409 char **modeNames, ClockRangePtr clockRanges,
410 int *linePitches, int minPitch, int maxPitch,
411 int minHeight, int maxHeight, int pitchInc,
412 int virtualX, int virtualY, int apertureSize,
413 LookupModeFlags strategy);
414void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
415void xf86PruneDriverModes(ScrnInfoPtr scrp);
416void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
417void xf86PrintModes(ScrnInfoPtr scrp);
418void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
419
420/* xf86Option.c */
421
422void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts);
423
424
425/* xf86RandR.c */
426#ifdef RANDR
427Bool xf86RandRInit (ScreenPtr pScreen);
428void xf86RandRSetInitialMode (ScreenPtr pScreen);
429Rotation xf86GetRotation(ScreenPtr pScreen);
430Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
431 int newvirtX, int newvirtY,
432 int newmmWidth, int newmmHeight, Bool resetMode);
433#endif
434
435/* xf86VidModeExtentionInit.c */
436
437Bool VidModeExtensionInit(ScreenPtr pScreen);
438
439/* xf86Versions.c */
440CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag);
441Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface,
442 CARD32 version, int flags);
443
444
445#endif /* _NO_XF86_PROTOTYPES */
446
447#endif /* _XF86_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette