1
/**************************************************************************
3
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
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:
14
The above copyright notice and this permission notice (including the
15
next paragraph) shall be included in all copies or substantial portions
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.
26
**************************************************************************/
30
* Jens Owen <jens@tungstengraphics.com>
40
#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \
41
dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey))
42
#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \
43
dixLookupPrivate(&(pPix)->devPrivates, DRIWindowPrivKey))
45
typedef struct _DRIDrawablePrivRec
47
drm_drawable_t hwDrawable;
52
} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
54
struct _DRIContextPrivRec
56
drm_context_t hwContext;
59
DRIContextFlags flags;
63
#define DRI_SCREEN_PRIV(pScreen) ((DRIScreenPrivPtr) \
64
dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey))
66
#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
67
dixLookupPrivate(&screenInfo.screens[screenIndex]->devPrivates, \
70
#define DRI_ENT_PRIV(pScrn) \
71
((DRIEntPrivIndex < 0) ? \
73
((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \
74
DRIEntPrivIndex)->ptr)))
76
typedef struct _DRIScreenPrivRec
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_context_t myContext; /* DDX Driver's context */
83
DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
84
DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
85
void** hiddenContextStore; /* hidden X context */
86
void** partial3DContextStore; /* parital 3D context */
87
DRIInfoPtr pDriverInfo;
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
DestroyWindowProcPtr DestroyWindow;
96
DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
97
DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
99
Bool createDummyCtxPriv;
101
Bool drmSIGIOHandlerInstalled;
105
drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */
106
XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */
108
int* pLockingContext;
109
} DRIScreenPrivRec, *DRIScreenPrivPtr;
112
typedef struct _DRIEntPrivRec {
116
drm_handle_t hLSAREA;
117
XF86DRILSAREAPtr pLSAREA;
118
unsigned long sAreaSize;
124
} DRIEntPrivRec, *DRIEntPrivPtr;
126
#endif /* DRI_STRUCT_H */