VirtualBox

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

最後變更 在這個檔案從25078是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

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

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