1 | /* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.12 2002/10/30 12:52:03 alanh Exp $ */
|
---|
2 | /**************************************************************************
|
---|
3 |
|
---|
4 | Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
---|
5 | All Rights Reserved.
|
---|
6 |
|
---|
7 | Permission is hereby granted, free of charge, to any person obtaining a
|
---|
8 | copy of this software and associated documentation files (the
|
---|
9 | "Software"), to deal in the Software without restriction, including
|
---|
10 | without limitation the rights to use, copy, modify, merge, publish,
|
---|
11 | distribute, sub license, and/or sell copies of the Software, and to
|
---|
12 | permit persons to whom the Software is furnished to do so, subject to
|
---|
13 | the following conditions:
|
---|
14 |
|
---|
15 | The above copyright notice and this permission notice (including the
|
---|
16 | next paragraph) shall be included in all copies or substantial portions
|
---|
17 | of the Software.
|
---|
18 |
|
---|
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
---|
20 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
---|
22 | IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
---|
23 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
---|
24 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
---|
25 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
26 |
|
---|
27 | **************************************************************************/
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * Authors:
|
---|
31 | * Jens Owen <[email protected]>
|
---|
32 | *
|
---|
33 | */
|
---|
34 |
|
---|
35 | #ifndef DRI_STRUCT_H
|
---|
36 | #define DRI_STRUCT_H
|
---|
37 |
|
---|
38 | #include "xf86drm.h"
|
---|
39 |
|
---|
40 |
|
---|
41 | #define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \
|
---|
42 | ((DRIWindowPrivIndex < 0) ? \
|
---|
43 | NULL : \
|
---|
44 | ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr)))
|
---|
45 |
|
---|
46 | #define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \
|
---|
47 | ((DRIPixmapPrivIndex < 0) ? \
|
---|
48 | NULL : \
|
---|
49 | ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr)))
|
---|
50 |
|
---|
51 | typedef struct _DRIDrawablePrivRec
|
---|
52 | {
|
---|
53 | drm_drawable_t hwDrawable;
|
---|
54 | int drawableIndex;
|
---|
55 | ScreenPtr pScreen;
|
---|
56 | int refCount;
|
---|
57 | } DRIDrawablePrivRec, *DRIDrawablePrivPtr;
|
---|
58 |
|
---|
59 | struct _DRIContextPrivRec
|
---|
60 | {
|
---|
61 | drm_context_t hwContext;
|
---|
62 | ScreenPtr pScreen;
|
---|
63 | Bool valid3D;
|
---|
64 | DRIContextFlags flags;
|
---|
65 | void** pContextStore;
|
---|
66 | };
|
---|
67 |
|
---|
68 | #define DRI_SCREEN_PRIV(pScreen) \
|
---|
69 | ((DRIScreenPrivIndex < 0) ? \
|
---|
70 | NULL : \
|
---|
71 | ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr)))
|
---|
72 |
|
---|
73 | #define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
|
---|
74 | (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr))
|
---|
75 |
|
---|
76 |
|
---|
77 | typedef struct _DRIScreenPrivRec
|
---|
78 | {
|
---|
79 | Bool directRenderingSupport;
|
---|
80 | int drmFD; /* File descriptor for /dev/video/? */
|
---|
81 | drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
|
---|
82 | XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
|
---|
83 | drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */
|
---|
84 | drm_context_t myContext; /* DDX Driver's context */
|
---|
85 | DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
|
---|
86 | DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
|
---|
87 | void** hiddenContextStore; /* hidden X context */
|
---|
88 | void** partial3DContextStore; /* parital 3D context */
|
---|
89 | DRIInfoPtr pDriverInfo;
|
---|
90 | int nrWindows;
|
---|
91 | drm_clip_rect_t private_buffer_rect; /* management of private buffers */
|
---|
92 | DrawablePtr fullscreen; /* pointer to fullscreen drawable */
|
---|
93 | drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
|
---|
94 | DRIWrappedFuncsRec wrap;
|
---|
95 | DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
|
---|
96 | DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
|
---|
97 | Bool createDummyCtx;
|
---|
98 | Bool createDummyCtxPriv;
|
---|
99 | Bool grabbedDRILock;
|
---|
100 | Bool drmSIGIOHandlerInstalled;
|
---|
101 | Bool wrapped;
|
---|
102 | int lockRefCount;
|
---|
103 | } DRIScreenPrivRec, *DRIScreenPrivPtr;
|
---|
104 |
|
---|
105 | #endif /* DRI_STRUCT_H */
|
---|