2 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
4 * Copyright 2010 George Sapountzis <gsapountzis@gmail.com>
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 * Binding of the DRI interface (dri_interface.h) for DRISW.
28 * The DRISW structs are 'base classes' of the corresponding DRI1 / DRI2 (DRM)
29 * structs. The bindings for SW and DRM can be unified by making the DRM structs
30 * 'sub-classes' of the SW structs, either proper or with field re-ordering.
32 * The code can also be unified but that requires cluttering the common code
33 * with ifdef's and guarding with (__DRIscreen::fd >= 0) for DRM.
39 #include "main/mtypes.h"
42 #include <GL/internal/dri_interface.h>
43 typedef struct _drmLock drmLock;
49 extern const __DRIcoreExtension driCoreExtension;
50 extern const __DRIswrastExtension driSWRastExtension;
54 * Driver callback functions
56 struct __DriverAPIRec {
57 const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
59 void (*DestroyScreen)(__DRIscreen *driScrnPriv);
61 GLboolean (*CreateContext)(gl_api glapi,
62 const struct gl_config *glVis,
63 __DRIcontext *driContextPriv,
64 void *sharedContextPrivate);
66 void (*DestroyContext)(__DRIcontext *driContextPriv);
68 GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
69 __DRIdrawable *driDrawPriv,
70 const struct gl_config *glVis,
71 GLboolean pixmapBuffer);
73 void (*DestroyBuffer)(__DRIdrawable *driDrawPriv);
75 void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
77 GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
78 __DRIdrawable *driDrawPriv,
79 __DRIdrawable *driReadPriv);
81 GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
84 extern const struct __DriverAPIRec driDriverAPI;
90 struct __DRIscreenRec {
97 const __DRIextension **extensions;
99 const __DRIswrastLoaderExtension *swrast_loader;
102 struct __DRIcontextRec {
108 __DRIdrawable *driDrawablePriv;
110 __DRIdrawable *driReadablePriv;
112 __DRIscreen *driScreenPriv;
115 struct __DRIdrawableRec {
121 __DRIcontext *driContextPriv;
123 __DRIscreen *driScreenPriv;
128 unsigned int lastStamp;
134 #endif /* _DRISW_UTIL_H */