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 <jens@tungstengraphics.com>
|
---|
31 | *
|
---|
32 | */
|
---|
33 |
|
---|
34 | #ifndef DRI_STRUCT_H
|
---|
35 | #define DRI_STRUCT_H
|
---|
36 |
|
---|
37 | #include "xf86drm.h"
|
---|
38 | #include "xf86Crtc.h"
|
---|
39 |
|
---|
40 |
|
---|
41 | #define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \
|
---|
42 | dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey))
|
---|
43 | #define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \
|
---|
44 | dixLookupPrivate(&(pPix)->devPrivates, DRIWindowPrivKey))
|
---|
45 |
|
---|
46 | typedef struct _DRIDrawablePrivRec
|
---|
47 | {
|
---|
48 | drm_drawable_t hwDrawable;
|
---|
49 | int drawableIndex;
|
---|
50 | ScreenPtr pScreen;
|
---|
51 | int refCount;
|
---|
52 | int nrects;
|
---|
53 | } DRIDrawablePrivRec, *DRIDrawablePrivPtr;
|
---|
54 |
|
---|
55 | struct _DRIContextPrivRec
|
---|
56 | {
|
---|
57 | drm_context_t hwContext;
|
---|
58 | ScreenPtr pScreen;
|
---|
59 | Bool valid3D;
|
---|
60 | DRIContextFlags flags;
|
---|
61 | void** pContextStore;
|
---|
62 | };
|
---|
63 |
|
---|
64 | #define DRI_SCREEN_PRIV(pScreen) ((DRIScreenPrivPtr) \
|
---|
65 | dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey))
|
---|
66 |
|
---|
67 | #define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
|
---|
68 | dixLookupPrivate(&screenInfo.screens[screenIndex]->devPrivates, \
|
---|
69 | DRIScreenPrivKey))
|
---|
70 |
|
---|
71 | #define DRI_ENT_PRIV(pScrn) \
|
---|
72 | ((DRIEntPrivIndex < 0) ? \
|
---|
73 | NULL: \
|
---|
74 | ((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \
|
---|
75 | DRIEntPrivIndex)->ptr)))
|
---|
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_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 | int nrWindowsVisible;
|
---|
91 | int nrWalked;
|
---|
92 | drm_clip_rect_t private_buffer_rect; /* management of private buffers */
|
---|
93 | DrawablePtr fullscreen; /* pointer to fullscreen drawable */
|
---|
94 | drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
|
---|
95 | DRIWrappedFuncsRec wrap;
|
---|
96 | DestroyWindowProcPtr DestroyWindow;
|
---|
97 | DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
|
---|
98 | DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
|
---|
99 | Bool createDummyCtx;
|
---|
100 | Bool createDummyCtxPriv;
|
---|
101 | Bool grabbedDRILock;
|
---|
102 | Bool drmSIGIOHandlerInstalled;
|
---|
103 | Bool wrapped;
|
---|
104 | Bool windowsTouched;
|
---|
105 | int lockRefCount;
|
---|
106 | drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */
|
---|
107 | XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */
|
---|
108 | int* pLockRefCount;
|
---|
109 | int* pLockingContext;
|
---|
110 | xf86_crtc_notify_proc_ptr xf86_crtc_notify;
|
---|
111 | } DRIScreenPrivRec, *DRIScreenPrivPtr;
|
---|
112 |
|
---|
113 |
|
---|
114 | typedef struct _DRIEntPrivRec {
|
---|
115 | int drmFD;
|
---|
116 | Bool drmOpened;
|
---|
117 | Bool sAreaGrabbed;
|
---|
118 | drm_handle_t hLSAREA;
|
---|
119 | XF86DRILSAREAPtr pLSAREA;
|
---|
120 | unsigned long sAreaSize;
|
---|
121 | int lockRefCount;
|
---|
122 | int lockingContext;
|
---|
123 | ScreenPtr resOwner;
|
---|
124 | Bool keepFDOpen;
|
---|
125 | int refCount;
|
---|
126 | } DRIEntPrivRec, *DRIEntPrivPtr;
|
---|
127 |
|
---|
128 | #endif /* DRI_STRUCT_H */
|
---|