VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.17.1/dri.h

最後變更 在這個檔案是 54163,由 vboxsync 提交於 10 年 前

Additions/x11/vboxvideo: support X.Org Server 1.17 (still untested).

  • 屬性 svn:eol-style 設為 native
檔案大小: 13.4 KB
 
1/**************************************************************************
2
3Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4All Rights Reserved.
5
6Permission is hereby granted, free of charge, to any person obtaining a
7copy of this software and associated documentation files (the
8"Software"), to deal in the Software without restriction, including
9without limitation the rights to use, copy, modify, merge, publish,
10distribute, sub license, and/or sell copies of the Software, and to
11permit persons to whom the Software is furnished to do so, subject to
12the following conditions:
13
14The above copyright notice and this permission notice (including the
15next paragraph) shall be included in all copies or substantial portions
16of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
22ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26**************************************************************************/
27
28/*
29 * Authors:
30 * Jens Owen <[email protected]>
31 *
32 */
33
34/* Prototypes for DRI functions */
35
36#ifndef _DRI_H_
37
38#include <pciaccess.h>
39
40#include "scrnintstr.h"
41#include "xf86dri.h"
42
43typedef int DRISyncType;
44
45#define DRI_NO_SYNC 0
46#define DRI_2D_SYNC 1
47#define DRI_3D_SYNC 2
48
49typedef int DRIContextType;
50
51typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr;
52
53typedef enum _DRIContextFlags {
54 DRI_CONTEXT_2DONLY = 0x01,
55 DRI_CONTEXT_PRESERVED = 0x02,
56 DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
57} DRIContextFlags;
58
59#define DRI_NO_CONTEXT 0
60#define DRI_2D_CONTEXT 1
61#define DRI_3D_CONTEXT 2
62
63typedef int DRISwapMethod;
64
65#define DRI_HIDE_X_CONTEXT 0
66#define DRI_SERVER_SWAP 1
67#define DRI_KERNEL_SWAP 2
68
69typedef int DRIWindowRequests;
70
71#define DRI_NO_WINDOWS 0
72#define DRI_3D_WINDOWS_ONLY 1
73#define DRI_ALL_WINDOWS 2
74
75typedef void (*ClipNotifyPtr) (WindowPtr, int, int);
76typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y);
77
78/*
79 * These functions can be wrapped by the DRI. Each of these have
80 * generic default funcs (initialized in DRICreateInfoRec) and can be
81 * overridden by the driver in its [driver]DRIScreenInit function.
82 */
83typedef struct {
84 ScreenWakeupHandlerProcPtr WakeupHandler;
85 ScreenBlockHandlerProcPtr BlockHandler;
86 WindowExposuresProcPtr WindowExposures;
87 CopyWindowProcPtr CopyWindow;
88 ClipNotifyProcPtr ClipNotify;
89 AdjustFramePtr AdjustFrame;
90} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
91
92/*
93 * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned
94 * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also
95 * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163
96 * showed that this was inadequate. The DRIInfoRec structure is now versioned
97 * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18.
98 *
99 * Revision history:
100 * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION.
101 * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION.
102 * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer.
103 */
104
105#define DRIINFO_MAJOR_VERSION 5
106#define DRIINFO_MINOR_VERSION 4
107#define DRIINFO_PATCH_VERSION 0
108
109typedef unsigned long long (*DRITexOffsetStartProcPtr) (PixmapPtr pPix);
110typedef void (*DRITexOffsetFinishProcPtr) (PixmapPtr pPix);
111
112typedef struct {
113 /* driver call back functions
114 *
115 * New fields should be added at the end for backwards compatibility.
116 * Bump the DRIINFO patch number to indicate bugfixes.
117 * Bump the DRIINFO minor number to indicate new fields.
118 * Bump the DRIINFO major number to indicate binary-incompatible changes.
119 */
120 Bool (*CreateContext) (ScreenPtr pScreen,
121 VisualPtr visual,
122 drm_context_t hHWContext,
123 void *pVisualConfigPriv, DRIContextType context);
124 void (*DestroyContext) (ScreenPtr pScreen,
125 drm_context_t hHWContext, DRIContextType context);
126 void (*SwapContext) (ScreenPtr pScreen,
127 DRISyncType syncType,
128 DRIContextType readContextType,
129 void *readContextStore,
130 DRIContextType writeContextType,
131 void *writeContextStore);
132 void (*InitBuffers) (WindowPtr pWin, RegionPtr prgn, CARD32 indx);
133 void (*MoveBuffers) (WindowPtr pWin,
134 DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 indx);
135 void (*TransitionTo3d) (ScreenPtr pScreen);
136 void (*TransitionTo2d) (ScreenPtr pScreen);
137
138 void (*SetDrawableIndex) (WindowPtr pWin, CARD32 indx);
139 Bool (*OpenFullScreen) (ScreenPtr pScreen);
140 Bool (*CloseFullScreen) (ScreenPtr pScreen);
141
142 /* wrapped functions */
143 DRIWrappedFuncsRec wrap;
144
145 /* device info */
146 char *drmDriverName;
147 char *clientDriverName;
148 char *busIdString;
149 int ddxDriverMajorVersion;
150 int ddxDriverMinorVersion;
151 int ddxDriverPatchVersion;
152 void *frameBufferPhysicalAddress;
153 long frameBufferSize;
154 long frameBufferStride;
155 long SAREASize;
156 int maxDrawableTableEntry;
157 int ddxDrawableTableEntry;
158 long contextSize;
159 DRISwapMethod driverSwapMethod;
160 DRIWindowRequests bufferRequests;
161 int devPrivateSize;
162 void *devPrivate;
163 Bool createDummyCtx;
164 Bool createDummyCtxPriv;
165
166 /* New with DRI version 4.1.0 */
167 void (*TransitionSingleToMulti3D) (ScreenPtr pScreen);
168 void (*TransitionMultiToSingle3D) (ScreenPtr pScreen);
169
170 /* New with DRI version 5.1.0 */
171 void (*ClipNotify) (ScreenPtr pScreen, WindowPtr *ppWin, int num);
172
173 /* New with DRI version 5.2.0 */
174 Bool allocSarea;
175 Bool keepFDOpen;
176
177 /* New with DRI version 5.3.0 */
178 DRITexOffsetStartProcPtr texOffsetStart;
179 DRITexOffsetFinishProcPtr texOffsetFinish;
180
181 /* New with DRI version 5.4.0 */
182 int dontMapFrameBuffer;
183 drm_handle_t hFrameBuffer; /* Handle to framebuffer, either
184 * mapped by DDX driver or DRI */
185
186} DRIInfoRec, *DRIInfoPtr;
187
188extern _X_EXPORT Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn,
189 unsigned long sAreaSize,
190 const char *busID,
191 const char *drmDriverName);
192
193extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
194 DRIInfoPtr pDRIInfo, int *pDRMFD);
195
196extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
197
198extern Bool DRIExtensionInit(void);
199
200extern _X_EXPORT void DRIReset(void);
201
202extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
203 Bool *isCapable);
204
205extern _X_EXPORT Bool DRIOpenConnection(ScreenPtr pScreen,
206 drm_handle_t * hSAREA,
207 char **busIdString);
208
209extern _X_EXPORT Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
210
211extern _X_EXPORT Bool DRICloseConnection(ScreenPtr pScreen);
212
213extern _X_EXPORT Bool DRIGetClientDriverName(ScreenPtr pScreen,
214 int *ddxDriverMajorVersion,
215 int *ddxDriverMinorVersion,
216 int *ddxDriverPatchVersion,
217 char **clientDriverName);
218
219extern _X_EXPORT Bool DRICreateContext(ScreenPtr pScreen,
220 VisualPtr visual,
221 XID context, drm_context_t * pHWContext);
222
223extern _X_EXPORT Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
224
225extern _X_EXPORT Bool DRIContextPrivDelete(void *pResource, XID id);
226
227extern _X_EXPORT Bool DRICreateDrawable(ScreenPtr pScreen,
228 ClientPtr client,
229 DrawablePtr pDrawable,
230 drm_drawable_t * hHWDrawable);
231
232extern _X_EXPORT Bool DRIDestroyDrawable(ScreenPtr pScreen,
233 ClientPtr client,
234 DrawablePtr pDrawable);
235
236extern _X_EXPORT Bool DRIDrawablePrivDelete(void *pResource, XID id);
237
238extern _X_EXPORT Bool DRIGetDrawableInfo(ScreenPtr pScreen,
239 DrawablePtr pDrawable,
240 unsigned int *indx,
241 unsigned int *stamp,
242 int *X,
243 int *Y,
244 int *W,
245 int *H,
246 int *numClipRects,
247 drm_clip_rect_t ** pClipRects,
248 int *backX,
249 int *backY,
250 int *numBackClipRects,
251 drm_clip_rect_t ** pBackClipRects);
252
253extern _X_EXPORT Bool DRIGetDeviceInfo(ScreenPtr pScreen,
254 drm_handle_t * hFrameBuffer,
255 int *fbOrigin,
256 int *fbSize,
257 int *fbStride,
258 int *devPrivateSize, void **pDevPrivate);
259
260extern _X_EXPORT DRIInfoPtr DRICreateInfoRec(void);
261
262extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
263
264extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen);
265
266extern _X_EXPORT void DRIWakeupHandler(void *wakeupData,
267 int result, void *pReadmask);
268
269extern _X_EXPORT void DRIBlockHandler(void *blockData,
270 OSTimePtr pTimeout, void *pReadmask);
271
272extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen,
273 unsigned long result,
274 void *pReadmask);
275
276extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen,
277 void *pTimeout, void *pReadmask);
278
279extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx);
280
281extern _X_EXPORT void *DRIGetContextStore(DRIContextPrivPtr context);
282
283extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn);
284
285extern _X_EXPORT Bool DRIDestroyWindow(WindowPtr pWin);
286
287extern _X_EXPORT void DRICopyWindow(WindowPtr pWin,
288 DDXPointRec ptOldOrg, RegionPtr prgnSrc);
289
290extern _X_EXPORT void DRIClipNotify(WindowPtr pWin, int dx, int dy);
291
292extern _X_EXPORT CARD32 DRIGetDrawableIndex(WindowPtr pWin);
293
294extern _X_EXPORT void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
295
296extern _X_EXPORT void DRILock(ScreenPtr pScreen, int flags);
297
298extern _X_EXPORT void DRIUnlock(ScreenPtr pScreen);
299
300extern _X_EXPORT DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
301
302extern _X_EXPORT void *DRIGetSAREAPrivate(ScreenPtr pScreen);
303
304extern _X_EXPORT unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
305 CARD32 drawable_index);
306
307extern _X_EXPORT DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
308 drm_context_t *
309 pHWContext,
310 DRIContextFlags flags);
311
312extern _X_EXPORT DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr
313 pScreen,
314 drm_context_t
315 hHWContext,
316 DRIContextFlags
317 flags);
318
319extern _X_EXPORT Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
320
321extern _X_EXPORT drm_context_t DRIGetContext(ScreenPtr pScreen);
322
323extern _X_EXPORT void DRIQueryVersion(int *majorVersion,
324 int *minorVersion, int *patchVersion);
325
326extern _X_EXPORT void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
327
328extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
329 int dx,
330 int dy,
331 int *xdir, int *ydir, RegionPtr reg);
332
333extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo);
334
335extern _X_EXPORT int drmInstallSIGIOHandler(int fd,
336 void (*f) (int, void *, void *));
337extern _X_EXPORT int drmRemoveSIGIOHandler(int fd);
338extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn);
339
340extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
341
342extern _X_EXPORT drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
343
344extern _X_EXPORT void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
345 DRITexOffsetStartProcPtr *
346 texOffsetStartFunc,
347 DRITexOffsetFinishProcPtr *
348 texOffsetFinishFunc);
349
350#define _DRI_H_
351
352#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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