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