VirtualBox

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

Last change on this file since 22633 was 17471, checked in by vboxsync, 16 years ago

export to OSE

  • Property svn:eol-style set to native
File size: 12.9 KB
Line 
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 <jens@tungstengraphics.com>
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{
55 DRI_CONTEXT_2DONLY = 0x01,
56 DRI_CONTEXT_PRESERVED = 0x02,
57 DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
58} DRIContextFlags;
59
60#define DRI_NO_CONTEXT 0
61#define DRI_2D_CONTEXT 1
62#define DRI_3D_CONTEXT 2
63
64typedef int DRISwapMethod;
65
66#define DRI_HIDE_X_CONTEXT 0
67#define DRI_SERVER_SWAP 1
68#define DRI_KERNEL_SWAP 2
69
70typedef int DRIWindowRequests;
71
72#define DRI_NO_WINDOWS 0
73#define DRI_3D_WINDOWS_ONLY 1
74#define DRI_ALL_WINDOWS 2
75
76
77typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
78typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags);
79
80
81/*
82 * These functions can be wrapped by the DRI. Each of these have
83 * generic default funcs (initialized in DRICreateInfoRec) and can be
84 * overridden by the driver in its [driver]DRIScreenInit function.
85 */
86typedef struct {
87 ScreenWakeupHandlerProcPtr WakeupHandler;
88 ScreenBlockHandlerProcPtr BlockHandler;
89 WindowExposuresProcPtr WindowExposures;
90 CopyWindowProcPtr CopyWindow;
91 ValidateTreeProcPtr ValidateTree;
92 PostValidateTreeProcPtr PostValidateTree;
93 ClipNotifyProcPtr ClipNotify;
94 AdjustFramePtr AdjustFrame;
95} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
96
97
98/*
99 * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned
100 * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also
101 * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163
102 * showed that this was inadequate. The DRIInfoRec structure is now versioned
103 * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18.
104 *
105 * Revision history:
106 * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION.
107 * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION.
108 * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer.
109 */
110
111#define DRIINFO_MAJOR_VERSION 5
112#define DRIINFO_MINOR_VERSION 4
113#define DRIINFO_PATCH_VERSION 0
114
115typedef unsigned long long (*DRITexOffsetStartProcPtr)(PixmapPtr pPix);
116typedef void (*DRITexOffsetFinishProcPtr)(PixmapPtr pPix);
117
118typedef struct {
119 /* driver call back functions
120 *
121 * New fields should be added at the end for backwards compatibility.
122 * Bump the DRIINFO patch number to indicate bugfixes.
123 * Bump the DRIINFO minor number to indicate new fields.
124 * Bump the DRIINFO major number to indicate binary-incompatible changes.
125 */
126 Bool (*CreateContext)(ScreenPtr pScreen,
127 VisualPtr visual,
128 drm_context_t hHWContext,
129 void* pVisualConfigPriv,
130 DRIContextType context);
131 void (*DestroyContext)(ScreenPtr pScreen,
132 drm_context_t hHWContext,
133 DRIContextType context);
134 void (*SwapContext)(ScreenPtr pScreen,
135 DRISyncType syncType,
136 DRIContextType readContextType,
137 void* readContextStore,
138 DRIContextType writeContextType,
139 void* writeContextStore);
140 void (*InitBuffers)(WindowPtr pWin,
141 RegionPtr prgn,
142 CARD32 indx);
143 void (*MoveBuffers)(WindowPtr pWin,
144 DDXPointRec ptOldOrg,
145 RegionPtr prgnSrc,
146 CARD32 indx);
147 void (*TransitionTo3d)(ScreenPtr pScreen);
148 void (*TransitionTo2d)(ScreenPtr pScreen);
149
150 void (*SetDrawableIndex)(WindowPtr pWin, CARD32 indx);
151 Bool (*OpenFullScreen)(ScreenPtr pScreen);
152 Bool (*CloseFullScreen)(ScreenPtr pScreen);
153
154 /* wrapped functions */
155 DRIWrappedFuncsRec wrap;
156
157 /* device info */
158 char* drmDriverName;
159 char* clientDriverName;
160 char* busIdString;
161 int ddxDriverMajorVersion;
162 int ddxDriverMinorVersion;
163 int ddxDriverPatchVersion;
164 pointer frameBufferPhysicalAddress;
165 long frameBufferSize;
166 long frameBufferStride;
167 long SAREASize;
168 int maxDrawableTableEntry;
169 int ddxDrawableTableEntry;
170 long contextSize;
171 DRISwapMethod driverSwapMethod;
172 DRIWindowRequests bufferRequests;
173 int devPrivateSize;
174 void* devPrivate;
175 Bool createDummyCtx;
176 Bool createDummyCtxPriv;
177
178 /* New with DRI version 4.1.0 */
179 void (*TransitionSingleToMulti3D)(ScreenPtr pScreen);
180 void (*TransitionMultiToSingle3D)(ScreenPtr pScreen);
181
182 /* New with DRI version 5.1.0 */
183 void (*ClipNotify)(ScreenPtr pScreen, WindowPtr *ppWin, int num);
184
185 /* New with DRI version 5.2.0 */
186 Bool allocSarea;
187 Bool keepFDOpen;
188
189 /* New with DRI version 5.3.0 */
190 DRITexOffsetStartProcPtr texOffsetStart;
191 DRITexOffsetFinishProcPtr texOffsetFinish;
192
193 /* New with DRI version 5.4.0 */
194 int dontMapFrameBuffer;
195 drm_handle_t hFrameBuffer; /* Handle to framebuffer, either
196 * mapped by DDX driver or DRI */
197
198} DRIInfoRec, *DRIInfoPtr;
199
200
201extern Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn, unsigned long sAreaSize,
202 const char *busID,
203 const char *drmDriverName);
204
205extern Bool DRIScreenInit(ScreenPtr pScreen,
206 DRIInfoPtr pDRIInfo,
207 int *pDRMFD);
208
209extern void DRICloseScreen(ScreenPtr pScreen);
210
211extern Bool DRIExtensionInit(void);
212
213extern void DRIReset(void);
214
215extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
216 Bool *isCapable);
217
218extern Bool DRIOpenConnection(ScreenPtr pScreen,
219 drm_handle_t * hSAREA,
220 char **busIdString);
221
222extern Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
223
224extern Bool DRICloseConnection(ScreenPtr pScreen);
225
226extern Bool DRIGetClientDriverName(ScreenPtr pScreen,
227 int* ddxDriverMajorVersion,
228 int* ddxDriverMinorVersion,
229 int* ddxDriverPatchVersion,
230 char** clientDriverName);
231
232extern Bool DRICreateContext(ScreenPtr pScreen,
233 VisualPtr visual,
234 XID context,
235 drm_context_t * pHWContext);
236
237extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
238
239extern Bool DRIContextPrivDelete(pointer pResource, XID id);
240
241extern Bool DRICreateDrawable(ScreenPtr pScreen,
242 ClientPtr client,
243 DrawablePtr pDrawable,
244 drm_drawable_t * hHWDrawable);
245
246extern Bool DRIDestroyDrawable(ScreenPtr pScreen,
247 ClientPtr client,
248 DrawablePtr pDrawable);
249
250extern Bool DRIDrawablePrivDelete(pointer pResource,
251 XID id);
252
253extern Bool DRIGetDrawableInfo(ScreenPtr pScreen,
254 DrawablePtr pDrawable,
255 unsigned int* indx,
256 unsigned int* stamp,
257 int* X,
258 int* Y,
259 int* W,
260 int* H,
261 int* numClipRects,
262 drm_clip_rect_t ** pClipRects,
263 int* backX,
264 int* backY,
265 int* numBackClipRects,
266 drm_clip_rect_t ** pBackClipRects);
267
268extern Bool DRIGetDeviceInfo(ScreenPtr pScreen,
269 drm_handle_t * hFrameBuffer,
270 int* fbOrigin,
271 int* fbSize,
272 int* fbStride,
273 int* devPrivateSize,
274 void** pDevPrivate);
275
276extern DRIInfoPtr DRICreateInfoRec(void);
277
278extern void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
279
280extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
281
282extern void DRIWakeupHandler(pointer wakeupData,
283 int result,
284 pointer pReadmask);
285
286extern void DRIBlockHandler(pointer blockData,
287 OSTimePtr pTimeout,
288 pointer pReadmask);
289
290extern void DRIDoWakeupHandler(int screenNum,
291 pointer wakeupData,
292 unsigned long result,
293 pointer pReadmask);
294
295extern void DRIDoBlockHandler(int screenNum,
296 pointer blockData,
297 pointer pTimeout,
298 pointer pReadmask);
299
300extern void DRISwapContext(int drmFD,
301 void *oldctx,
302 void *newctx);
303
304extern void *DRIGetContextStore(DRIContextPrivPtr context);
305
306extern void DRIWindowExposures(WindowPtr pWin,
307 RegionPtr prgn,
308 RegionPtr bsreg);
309
310extern Bool DRIDestroyWindow(WindowPtr pWin);
311
312extern void DRICopyWindow(WindowPtr pWin,
313 DDXPointRec ptOldOrg,
314 RegionPtr prgnSrc);
315
316extern int DRIValidateTree(WindowPtr pParent,
317 WindowPtr pChild,
318 VTKind kind);
319
320extern void DRIPostValidateTree(WindowPtr pParent,
321 WindowPtr pChild,
322 VTKind kind);
323
324extern void DRIClipNotify(WindowPtr pWin,
325 int dx,
326 int dy);
327
328extern CARD32 DRIGetDrawableIndex(WindowPtr pWin);
329
330extern void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
331
332extern void DRILock(ScreenPtr pScreen, int flags);
333
334extern void DRIUnlock(ScreenPtr pScreen);
335
336extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
337
338extern void *DRIGetSAREAPrivate(ScreenPtr pScreen);
339
340extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
341 CARD32 drawable_index);
342
343extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
344 drm_context_t * pHWContext,
345 DRIContextFlags flags);
346
347extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen,
348 drm_context_t hHWContext,
349 DRIContextFlags flags);
350
351extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
352
353extern drm_context_t DRIGetContext(ScreenPtr pScreen);
354
355extern void DRIQueryVersion(int *majorVersion,
356 int *minorVersion,
357 int *patchVersion);
358
359extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags);
360
361extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
362 int dx,
363 int dy,
364 int *xdir,
365 int *ydir,
366 RegionPtr reg);
367
368extern char *DRICreatePCIBusID(const struct pci_device *PciInfo);
369
370extern int drmInstallSIGIOHandler(int fd, void (*f)(int, void *, void *));
371extern int drmRemoveSIGIOHandler(int fd);
372extern int DRIMasterFD(ScrnInfoPtr pScrn);
373
374extern void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
375
376extern drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
377
378extern void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
379 DRITexOffsetStartProcPtr *texOffsetStartFunc,
380 DRITexOffsetFinishProcPtr *texOffsetFinishFunc);
381
382#define _DRI_H_
383
384#endif
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