VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/7.0/xorg/dri.h@ 18709

Last change on this file since 18709 was 17242, checked in by vboxsync, 16 years ago

Additions/x11/x11include: removed svn:keywords properties from all files under this directory as per SvnKeywords on the wiki. Hopefully this is finally correct

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