Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 3 | * Copyright 2007-2008 Red Hat, Inc. |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 4 | * (C) Copyright IBM Corporation 2004 |
| 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 "Software"), |
| 9 | * to deal in the Software without restriction, including without limitation |
| 10 | * on the rights to use, copy, modify, merge, publish, distribute, sub |
| 11 | * license, and/or sell copies of the Software, and to permit persons to whom |
| 12 | * the Software is furnished to do so, subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice (including the next |
| 15 | * paragraph) shall be included in all copies or substantial portions of the |
| 16 | * Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
| 21 | * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, |
| 22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | */ |
| 26 | |
| 27 | /** |
| 28 | * \file dri_interface.h |
| 29 | * |
| 30 | * This file contains all the types and functions that define the interface |
| 31 | * between a DRI driver and driver loader. Currently, the most common driver |
| 32 | * loader is the XFree86 libGL.so. However, other loaders do exist, and in |
| 33 | * the future the server-side libglx.a will also be a loader. |
| 34 | * |
| 35 | * \author Kevin E. Martin <kevin@precisioninsight.com> |
| 36 | * \author Ian Romanick <idr@us.ibm.com> |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 37 | * \author Kristian Høgsberg <krh@redhat.com> |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 38 | */ |
| 39 | |
Keith Whitwell | 74d563c | 2004-04-29 12:23:39 +0000 | [diff] [blame] | 40 | #ifndef DRI_INTERFACE_H |
| 41 | #define DRI_INTERFACE_H |
| 42 | |
Jon Turney | 8e75998 | 2008-12-17 18:01:16 -0700 | [diff] [blame] | 43 | /* For archs with no drm.h */ |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 44 | #if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__) |
Ian Romanick | fabe2b9 | 2004-06-01 16:38:56 +0000 | [diff] [blame] | 45 | #include <drm.h> |
Jeremy Huddleston | 01ac454 | 2008-08-08 02:19:52 -0700 | [diff] [blame] | 46 | #else |
| 47 | typedef unsigned int drm_context_t; |
| 48 | typedef unsigned int drm_drawable_t; |
| 49 | typedef struct drm_clip_rect drm_clip_rect_t; |
| 50 | #endif |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * \name DRI interface structures |
| 54 | * |
| 55 | * The following structures define the interface between the GLX client |
| 56 | * side library and the DRI (direct rendering infrastructure). |
| 57 | */ |
| 58 | /*@{*/ |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 59 | typedef struct __DRIdisplayRec __DRIdisplay; |
| 60 | typedef struct __DRIscreenRec __DRIscreen; |
| 61 | typedef struct __DRIcontextRec __DRIcontext; |
| 62 | typedef struct __DRIdrawableRec __DRIdrawable; |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 63 | typedef struct __DRIconfigRec __DRIconfig; |
Kristian Høgsberg | 4a22ae8 | 2007-01-07 08:12:01 -0500 | [diff] [blame] | 64 | typedef struct __DRIframebufferRec __DRIframebuffer; |
| 65 | typedef struct __DRIversionRec __DRIversion; |
Kristian Høgsberg | f616a26 | 2007-05-15 12:31:31 -0400 | [diff] [blame] | 66 | |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 67 | typedef struct __DRIcoreExtensionRec __DRIcoreExtension; |
Kristian Høgsberg | 78a6aa5 | 2007-05-16 14:10:29 -0400 | [diff] [blame] | 68 | typedef struct __DRIextensionRec __DRIextension; |
Kristian Høgsberg | ac3e838 | 2007-05-15 15:17:30 -0400 | [diff] [blame] | 69 | typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension; |
Kristian Høgsberg | efaf90b | 2007-05-15 16:09:44 -0400 | [diff] [blame] | 70 | typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension; |
Kristian Høgsberg | 78a6aa5 | 2007-05-16 14:10:29 -0400 | [diff] [blame] | 71 | typedef struct __DRIallocateExtensionRec __DRIallocateExtension; |
Kristian Høgsberg | a7a0a2b | 2007-05-16 15:50:40 -0400 | [diff] [blame] | 72 | typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension; |
Kristian Høgsberg | 106a6f2 | 2007-05-16 18:13:41 -0400 | [diff] [blame] | 73 | typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension; |
Kristian Høgsberg | f29f0ae | 2007-05-22 12:26:02 -0400 | [diff] [blame] | 74 | typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension; |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 75 | typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension; |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 76 | typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension; |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 77 | typedef struct __DRIswrastExtensionRec __DRIswrastExtension; |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 78 | typedef struct __DRIbufferRec __DRIbuffer; |
| 79 | typedef struct __DRIdri2ExtensionRec __DRIdri2Extension; |
| 80 | typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension; |
Alan Hourihane | 6556245 | 2009-02-19 18:39:08 +0000 | [diff] [blame] | 81 | typedef struct __DRI2flushExtensionRec __DRI2flushExtension; |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 82 | |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 83 | /*@}*/ |
| 84 | |
| 85 | |
| 86 | /** |
Kristian Høgsberg | f616a26 | 2007-05-15 12:31:31 -0400 | [diff] [blame] | 87 | * Extension struct. Drivers 'inherit' from this struct by embedding |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 88 | * it as the first element in the extension struct. |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 89 | * |
| 90 | * We never break API in for a DRI extension. If we need to change |
| 91 | * the way things work in a non-backwards compatible manner, we |
| 92 | * introduce a new extension. During a transition period, we can |
| 93 | * leave both the old and the new extension in the driver, which |
| 94 | * allows us to move to the new interface without having to update the |
| 95 | * loader(s) in lock step. |
| 96 | * |
| 97 | * However, we can add entry points to an extension over time as long |
| 98 | * as we don't break the old ones. As we add entry points to an |
| 99 | * extension, we increase the version number. The corresponding |
| 100 | * #define can be used to guard code that accesses the new entry |
| 101 | * points at compile time and the version field in the extension |
| 102 | * struct can be used at run-time to determine how to use the |
| 103 | * extension. |
Kristian Høgsberg | f616a26 | 2007-05-15 12:31:31 -0400 | [diff] [blame] | 104 | */ |
| 105 | struct __DRIextensionRec { |
| 106 | const char *name; |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 107 | int version; |
Kristian Høgsberg | f616a26 | 2007-05-15 12:31:31 -0400 | [diff] [blame] | 108 | }; |
| 109 | |
Kristian Høgsberg | ac3e838 | 2007-05-15 15:17:30 -0400 | [diff] [blame] | 110 | /** |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 111 | * The first set of extension are the screen extensions, returned by |
| 112 | * __DRIcore::getExtensions(). This entry point will return a list of |
| 113 | * extensions and the loader can use the ones it knows about by |
| 114 | * casting them to more specific extensions and advertising any GLX |
| 115 | * extensions the DRI extensions enables. |
| 116 | */ |
| 117 | |
| 118 | /** |
Kristian Høgsberg | f968f67 | 2007-05-17 14:39:06 -0400 | [diff] [blame] | 119 | * Used by drivers to indicate support for setting the read drawable. |
| 120 | */ |
| 121 | #define __DRI_READ_DRAWABLE "DRI_ReadDrawable" |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 122 | #define __DRI_READ_DRAWABLE_VERSION 1 |
Kristian Høgsberg | f968f67 | 2007-05-17 14:39:06 -0400 | [diff] [blame] | 123 | |
| 124 | /** |
Kristian Høgsberg | ac3e838 | 2007-05-15 15:17:30 -0400 | [diff] [blame] | 125 | * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension. |
| 126 | */ |
| 127 | #define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer" |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 128 | #define __DRI_COPY_SUB_BUFFER_VERSION 1 |
Kristian Høgsberg | ac3e838 | 2007-05-15 15:17:30 -0400 | [diff] [blame] | 129 | struct __DRIcopySubBufferExtensionRec { |
| 130 | __DRIextension base; |
| 131 | void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h); |
| 132 | }; |
| 133 | |
Kristian Høgsberg | efaf90b | 2007-05-15 16:09:44 -0400 | [diff] [blame] | 134 | /** |
| 135 | * Used by drivers that implement the GLX_SGI_swap_control or |
| 136 | * GLX_MESA_swap_control extension. |
| 137 | */ |
| 138 | #define __DRI_SWAP_CONTROL "DRI_SwapControl" |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 139 | #define __DRI_SWAP_CONTROL_VERSION 1 |
Kristian Høgsberg | efaf90b | 2007-05-15 16:09:44 -0400 | [diff] [blame] | 140 | struct __DRIswapControlExtensionRec { |
| 141 | __DRIextension base; |
| 142 | void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval); |
| 143 | unsigned int (*getSwapInterval)(__DRIdrawable *drawable); |
| 144 | }; |
Kristian Høgsberg | f616a26 | 2007-05-15 12:31:31 -0400 | [diff] [blame] | 145 | |
| 146 | /** |
Kristian Høgsberg | 78a6aa5 | 2007-05-16 14:10:29 -0400 | [diff] [blame] | 147 | * Used by drivers that implement the GLX_MESA_allocate_memory. |
| 148 | */ |
| 149 | #define __DRI_ALLOCATE "DRI_Allocate" |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 150 | #define __DRI_ALLOCATE_VERSION 1 |
Kristian Høgsberg | 78a6aa5 | 2007-05-16 14:10:29 -0400 | [diff] [blame] | 151 | struct __DRIallocateExtensionRec { |
| 152 | __DRIextension base; |
| 153 | |
| 154 | void *(*allocateMemory)(__DRIscreen *screen, GLsizei size, |
| 155 | GLfloat readfreq, GLfloat writefreq, |
| 156 | GLfloat priority); |
| 157 | |
| 158 | void (*freeMemory)(__DRIscreen *screen, GLvoid *pointer); |
| 159 | |
| 160 | GLuint (*memoryOffset)(__DRIscreen *screen, const GLvoid *pointer); |
| 161 | }; |
| 162 | |
| 163 | /** |
Kristian Høgsberg | a7a0a2b | 2007-05-16 15:50:40 -0400 | [diff] [blame] | 164 | * Used by drivers that implement the GLX_MESA_swap_frame_usage extension. |
| 165 | */ |
| 166 | #define __DRI_FRAME_TRACKING "DRI_FrameTracking" |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 167 | #define __DRI_FRAME_TRACKING_VERSION 1 |
Kristian Høgsberg | a7a0a2b | 2007-05-16 15:50:40 -0400 | [diff] [blame] | 168 | struct __DRIframeTrackingExtensionRec { |
| 169 | __DRIextension base; |
| 170 | |
| 171 | /** |
| 172 | * Enable or disable frame usage tracking. |
| 173 | * |
| 174 | * \since Internal API version 20030317. |
| 175 | */ |
| 176 | int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable); |
| 177 | |
| 178 | /** |
| 179 | * Retrieve frame usage information. |
| 180 | * |
| 181 | * \since Internal API version 20030317. |
| 182 | */ |
| 183 | int (*queryFrameTracking)(__DRIdrawable *drawable, |
| 184 | int64_t * sbc, int64_t * missedFrames, |
| 185 | float * lastMissedUsage, float * usage); |
| 186 | }; |
| 187 | |
Kristian Høgsberg | 106a6f2 | 2007-05-16 18:13:41 -0400 | [diff] [blame] | 188 | |
| 189 | /** |
| 190 | * Used by drivers that implement the GLX_SGI_video_sync extension. |
| 191 | */ |
| 192 | #define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter" |
Kristian Høgsberg | 6e8d21d | 2008-02-25 16:14:37 -0500 | [diff] [blame] | 193 | #define __DRI_MEDIA_STREAM_COUNTER_VERSION 1 |
Kristian Høgsberg | 106a6f2 | 2007-05-16 18:13:41 -0400 | [diff] [blame] | 194 | struct __DRImediaStreamCounterExtensionRec { |
| 195 | __DRIextension base; |
| 196 | |
| 197 | /** |
Kristian Høgsberg | 106a6f2 | 2007-05-16 18:13:41 -0400 | [diff] [blame] | 198 | * Wait for the MSC to equal target_msc, or, if that has already passed, |
| 199 | * the next time (MSC % divisor) is equal to remainder. If divisor is |
| 200 | * zero, the function will return as soon as MSC is greater than or equal |
| 201 | * to target_msc. |
| 202 | */ |
| 203 | int (*waitForMSC)(__DRIdrawable *drawable, |
| 204 | int64_t target_msc, int64_t divisor, int64_t remainder, |
| 205 | int64_t * msc, int64_t * sbc); |
Jesse Barnes | 38fdb47 | 2007-10-29 11:56:31 -0700 | [diff] [blame] | 206 | |
| 207 | /** |
Jesse Barnes | 38fdb47 | 2007-10-29 11:56:31 -0700 | [diff] [blame] | 208 | * Get the number of vertical refreshes since some point in time before |
| 209 | * this function was first called (i.e., system start up). |
Jesse Barnes | 38fdb47 | 2007-10-29 11:56:31 -0700 | [diff] [blame] | 210 | */ |
Kristian Høgsberg | 6e8d21d | 2008-02-25 16:14:37 -0500 | [diff] [blame] | 211 | int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable, |
Jesse Barnes | 38fdb47 | 2007-10-29 11:56:31 -0700 | [diff] [blame] | 212 | int64_t *msc); |
Kristian Høgsberg | 106a6f2 | 2007-05-16 18:13:41 -0400 | [diff] [blame] | 213 | }; |
| 214 | |
| 215 | |
Kristian Høgsberg | f29f0ae | 2007-05-22 12:26:02 -0400 | [diff] [blame] | 216 | #define __DRI_TEX_OFFSET "DRI_TexOffset" |
Kristian Høgsberg | ccff0cb | 2007-06-07 19:35:54 -0400 | [diff] [blame] | 217 | #define __DRI_TEX_OFFSET_VERSION 1 |
Kristian Høgsberg | f29f0ae | 2007-05-22 12:26:02 -0400 | [diff] [blame] | 218 | struct __DRItexOffsetExtensionRec { |
| 219 | __DRIextension base; |
| 220 | |
| 221 | /** |
| 222 | * Method to override base texture image with a driver specific 'offset'. |
| 223 | * The depth passed in allows e.g. to ignore the alpha channel of texture |
| 224 | * images where the non-alpha components don't occupy a whole texel. |
| 225 | * |
| 226 | * For GLX_EXT_texture_from_pixmap with AIGLX. |
| 227 | */ |
| 228 | void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname, |
| 229 | unsigned long long offset, GLint depth, GLuint pitch); |
| 230 | }; |
| 231 | |
| 232 | |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 233 | #define __DRI_TEX_BUFFER "DRI_TexBuffer" |
Eric Anholt | 66175aa | 2009-03-18 12:07:09 -0700 | [diff] [blame] | 234 | #define __DRI_TEX_BUFFER_VERSION 2 |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 235 | struct __DRItexBufferExtensionRec { |
| 236 | __DRIextension base; |
| 237 | |
| 238 | /** |
Kristian Høgsberg | dcbe215 | 2008-03-09 21:28:04 -0400 | [diff] [blame] | 239 | * Method to override base texture image with the contents of a |
| 240 | * __DRIdrawable. |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 241 | * |
Eric Anholt | 66175aa | 2009-03-18 12:07:09 -0700 | [diff] [blame] | 242 | * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of |
| 243 | * setTexBuffer2 in version 2 of this interface |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 244 | */ |
| 245 | void (*setTexBuffer)(__DRIcontext *pDRICtx, |
Kristian Høgsberg | dcbe215 | 2008-03-09 21:28:04 -0400 | [diff] [blame] | 246 | GLint target, |
| 247 | __DRIdrawable *pDraw); |
Eric Anholt | 66175aa | 2009-03-18 12:07:09 -0700 | [diff] [blame] | 248 | |
| 249 | /** |
| 250 | * Method to override base texture image with the contents of a |
| 251 | * __DRIdrawable, including the required texture format attribute. |
| 252 | * |
| 253 | * For GLX_EXT_texture_from_pixmap with AIGLX. |
| 254 | */ |
| 255 | void (*setTexBuffer2)(__DRIcontext *pDRICtx, |
| 256 | GLint target, |
| 257 | GLint format, |
| 258 | __DRIdrawable *pDraw); |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 259 | }; |
| 260 | |
Alan Hourihane | 6556245 | 2009-02-19 18:39:08 +0000 | [diff] [blame] | 261 | /** |
| 262 | * Used by drivers that implement DRI2 |
| 263 | */ |
| 264 | #define __DRI2_FLUSH "DRI2_Flush" |
Jesse Barnes | a35f6bb | 2009-07-17 03:30:29 -0400 | [diff] [blame^] | 265 | #define __DRI2_FLUSH_VERSION 2 |
Alan Hourihane | 6556245 | 2009-02-19 18:39:08 +0000 | [diff] [blame] | 266 | struct __DRI2flushExtensionRec { |
| 267 | __DRIextension base; |
| 268 | void (*flush)(__DRIdrawable *drawable); |
Jesse Barnes | a35f6bb | 2009-07-17 03:30:29 -0400 | [diff] [blame^] | 269 | |
| 270 | /** |
| 271 | * Flush all rendering queue in the driver to the drm and |
| 272 | * invalidate all buffers. The driver will call out to |
| 273 | * getBuffers/getBuffersWithFormat before it starts rendering |
| 274 | * again. |
| 275 | * |
| 276 | * \param drawable the drawable to flush and invalidate |
| 277 | * |
| 278 | * \since 2 |
| 279 | */ |
| 280 | void (*flushInvalidate)(__DRIdrawable *drawable); |
Alan Hourihane | 6556245 | 2009-02-19 18:39:08 +0000 | [diff] [blame] | 281 | }; |
| 282 | |
Kristian Høgsberg | 6d48779 | 2008-02-14 22:12:51 -0500 | [diff] [blame] | 283 | |
Kristian Høgsberg | a7a0a2b | 2007-05-16 15:50:40 -0400 | [diff] [blame] | 284 | /** |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 285 | * XML document describing the configuration options supported by the |
| 286 | * driver. |
| 287 | */ |
| 288 | extern const char __driConfigOptions[]; |
| 289 | |
| 290 | /*@}*/ |
| 291 | |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 292 | /** |
| 293 | * The following extensions describe loader features that the DRI |
| 294 | * driver can make use of. Some of these are mandatory, such as the |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 295 | * getDrawableInfo extension for DRI and the DRI Loader extensions for |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 296 | * DRI2, while others are optional, and if present allow the driver to |
| 297 | * expose certain features. The loader pass in a NULL terminated |
| 298 | * array of these extensions to the driver in the createNewScreen |
| 299 | * constructor. |
| 300 | */ |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 301 | |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 302 | typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension; |
| 303 | typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension; |
| 304 | typedef struct __DRIdamageExtensionRec __DRIdamageExtension; |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 305 | typedef struct __DRIloaderExtensionRec __DRIloaderExtension; |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 306 | typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension; |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 307 | |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 308 | |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 309 | /** |
| 310 | * Callback to getDrawableInfo protocol |
| 311 | */ |
| 312 | #define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo" |
| 313 | #define __DRI_GET_DRAWABLE_INFO_VERSION 1 |
| 314 | struct __DRIgetDrawableInfoExtensionRec { |
| 315 | __DRIextension base; |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 316 | |
| 317 | /** |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 318 | * This function is used to get information about the position, size, and |
| 319 | * clip rects of a drawable. |
| 320 | */ |
Kristian Høgsberg | 4ff95e7 | 2007-05-10 17:14:38 -0400 | [diff] [blame] | 321 | GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable, |
Kristian Høgsberg | aceccda | 2007-05-10 15:52:22 -0400 | [diff] [blame] | 322 | unsigned int * index, unsigned int * stamp, |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 323 | int * x, int * y, int * width, int * height, |
| 324 | int * numClipRects, drm_clip_rect_t ** pClipRects, |
| 325 | int * backX, int * backY, |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 326 | int * numBackClipRects, drm_clip_rect_t ** pBackClipRects, |
| 327 | void *loaderPrivate); |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 328 | }; |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 329 | |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 330 | /** |
| 331 | * Callback to get system time for media stream counter extensions. |
| 332 | */ |
| 333 | #define __DRI_SYSTEM_TIME "DRI_SystemTime" |
| 334 | #define __DRI_SYSTEM_TIME_VERSION 1 |
| 335 | struct __DRIsystemTimeExtensionRec { |
| 336 | __DRIextension base; |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 337 | |
| 338 | /** |
Ian Romanick | 5f1ba3e | 2005-07-26 02:44:01 +0000 | [diff] [blame] | 339 | * Get the 64-bit unadjusted system time (UST). |
| 340 | */ |
| 341 | int (*getUST)(int64_t * ust); |
| 342 | |
| 343 | /** |
| 344 | * Get the media stream counter (MSC) rate. |
| 345 | * |
| 346 | * Matching the definition in GLX_OML_sync_control, this function returns |
| 347 | * the rate of the "media stream counter". In practical terms, this is |
| 348 | * the frame refresh rate of the display. |
| 349 | */ |
Kristian Høgsberg | aceccda | 2007-05-10 15:52:22 -0400 | [diff] [blame] | 350 | GLboolean (*getMSCRate)(__DRIdrawable *draw, |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 351 | int32_t * numerator, int32_t * denominator, |
| 352 | void *loaderPrivate); |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 353 | }; |
| 354 | |
| 355 | /** |
| 356 | * Damage reporting |
| 357 | */ |
| 358 | #define __DRI_DAMAGE "DRI_Damage" |
| 359 | #define __DRI_DAMAGE_VERSION 1 |
| 360 | struct __DRIdamageExtensionRec { |
| 361 | __DRIextension base; |
Eric Anholt | c2b185c | 2007-01-05 18:19:58 -0800 | [diff] [blame] | 362 | |
| 363 | /** |
| 364 | * Reports areas of the given drawable which have been modified by the |
| 365 | * driver. |
| 366 | * |
| 367 | * \param drawable which the drawing was done to. |
| 368 | * \param rects rectangles affected, with the drawable origin as the |
| 369 | * origin. |
| 370 | * \param x X offset of the drawable within the screen (used in the |
| 371 | * front_buffer case) |
| 372 | * \param y Y offset of the drawable within the screen. |
| 373 | * \param front_buffer boolean flag for whether the drawing to the |
| 374 | * drawable was actually done directly to the front buffer (instead |
| 375 | * of backing storage, for example) |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 376 | * \param loaderPrivate the data passed in at createNewDrawable time |
Eric Anholt | c2b185c | 2007-01-05 18:19:58 -0800 | [diff] [blame] | 377 | */ |
Kristian Høgsberg | aceccda | 2007-05-10 15:52:22 -0400 | [diff] [blame] | 378 | void (*reportDamage)(__DRIdrawable *draw, |
Eric Anholt | c2b185c | 2007-01-05 18:19:58 -0800 | [diff] [blame] | 379 | int x, int y, |
| 380 | drm_clip_rect_t *rects, int num_rects, |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 381 | GLboolean front_buffer, |
| 382 | void *loaderPrivate); |
Kristian Høgsberg | 6cb3f5c | 2008-02-28 10:32:28 -0500 | [diff] [blame] | 383 | }; |
| 384 | |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 385 | #define __DRI_SWRAST_IMAGE_OP_DRAW 1 |
| 386 | #define __DRI_SWRAST_IMAGE_OP_CLEAR 2 |
| 387 | #define __DRI_SWRAST_IMAGE_OP_SWAP 3 |
| 388 | |
| 389 | /** |
| 390 | * SWRast Loader extension. |
| 391 | */ |
| 392 | #define __DRI_SWRAST_LOADER "DRI_SWRastLoader" |
| 393 | #define __DRI_SWRAST_LOADER_VERSION 1 |
| 394 | struct __DRIswrastLoaderExtensionRec { |
| 395 | __DRIextension base; |
| 396 | |
| 397 | /* |
| 398 | * Drawable position and size |
| 399 | */ |
| 400 | void (*getDrawableInfo)(__DRIdrawable *drawable, |
| 401 | int *x, int *y, int *width, int *height, |
| 402 | void *loaderPrivate); |
| 403 | |
| 404 | /** |
| 405 | * Put image to drawable |
| 406 | */ |
| 407 | void (*putImage)(__DRIdrawable *drawable, int op, |
| 408 | int x, int y, int width, int height, char *data, |
| 409 | void *loaderPrivate); |
| 410 | |
| 411 | /** |
| 412 | * Get image from drawable |
| 413 | */ |
| 414 | void (*getImage)(__DRIdrawable *drawable, |
| 415 | int x, int y, int width, int height, char *data, |
| 416 | void *loaderPrivate); |
| 417 | }; |
| 418 | |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 419 | /** |
| 420 | * The remaining extensions describe driver extensions, immediately |
| 421 | * available interfaces provided by the driver. To start using the |
| 422 | * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for |
| 423 | * the extension you need in the array. |
| 424 | */ |
| 425 | #define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions" |
| 426 | |
| 427 | /** |
| 428 | * Tokens for __DRIconfig attribs. A number of attributes defined by |
| 429 | * GLX or EGL standards are not in the table, as they must be provided |
| 430 | * by the loader. For example, FBConfig ID or visual ID, drawable type. |
| 431 | */ |
| 432 | |
| 433 | #define __DRI_ATTRIB_BUFFER_SIZE 1 |
| 434 | #define __DRI_ATTRIB_LEVEL 2 |
| 435 | #define __DRI_ATTRIB_RED_SIZE 3 |
| 436 | #define __DRI_ATTRIB_GREEN_SIZE 4 |
| 437 | #define __DRI_ATTRIB_BLUE_SIZE 5 |
| 438 | #define __DRI_ATTRIB_LUMINANCE_SIZE 6 |
| 439 | #define __DRI_ATTRIB_ALPHA_SIZE 7 |
| 440 | #define __DRI_ATTRIB_ALPHA_MASK_SIZE 8 |
| 441 | #define __DRI_ATTRIB_DEPTH_SIZE 9 |
| 442 | #define __DRI_ATTRIB_STENCIL_SIZE 10 |
| 443 | #define __DRI_ATTRIB_ACCUM_RED_SIZE 11 |
| 444 | #define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12 |
| 445 | #define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13 |
| 446 | #define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14 |
| 447 | #define __DRI_ATTRIB_SAMPLE_BUFFERS 15 |
| 448 | #define __DRI_ATTRIB_SAMPLES 16 |
| 449 | #define __DRI_ATTRIB_RENDER_TYPE 17 |
| 450 | #define __DRI_ATTRIB_CONFIG_CAVEAT 18 |
| 451 | #define __DRI_ATTRIB_CONFORMANT 19 |
| 452 | #define __DRI_ATTRIB_DOUBLE_BUFFER 20 |
| 453 | #define __DRI_ATTRIB_STEREO 21 |
| 454 | #define __DRI_ATTRIB_AUX_BUFFERS 22 |
| 455 | #define __DRI_ATTRIB_TRANSPARENT_TYPE 23 |
| 456 | #define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24 |
| 457 | #define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25 |
| 458 | #define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26 |
| 459 | #define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27 |
| 460 | #define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28 |
| 461 | #define __DRI_ATTRIB_FLOAT_MODE 29 |
| 462 | #define __DRI_ATTRIB_RED_MASK 30 |
| 463 | #define __DRI_ATTRIB_GREEN_MASK 31 |
| 464 | #define __DRI_ATTRIB_BLUE_MASK 32 |
| 465 | #define __DRI_ATTRIB_ALPHA_MASK 33 |
| 466 | #define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34 |
| 467 | #define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35 |
| 468 | #define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36 |
| 469 | #define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37 |
| 470 | #define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38 |
| 471 | #define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39 |
| 472 | #define __DRI_ATTRIB_SWAP_METHOD 40 |
| 473 | #define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41 |
| 474 | #define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42 |
| 475 | #define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43 |
| 476 | #define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44 |
| 477 | #define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45 |
| 478 | #define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46 |
| 479 | #define __DRI_ATTRIB_YINVERTED 47 |
| 480 | |
| 481 | /* __DRI_ATTRIB_RENDER_TYPE */ |
| 482 | #define __DRI_ATTRIB_RGBA_BIT 0x01 |
| 483 | #define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02 |
| 484 | #define __DRI_ATTRIB_LUMINANCE_BIT 0x04 |
| 485 | |
| 486 | /* __DRI_ATTRIB_CONFIG_CAVEAT */ |
| 487 | #define __DRI_ATTRIB_SLOW_BIT 0x01 |
| 488 | #define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02 |
| 489 | |
| 490 | /* __DRI_ATTRIB_TRANSPARENT_TYPE */ |
| 491 | #define __DRI_ATTRIB_TRANSPARENT_RGB 0x00 |
| 492 | #define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01 |
| 493 | |
| 494 | /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */ |
| 495 | #define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01 |
| 496 | #define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02 |
| 497 | #define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04 |
| 498 | |
| 499 | /** |
| 500 | * This extension defines the core DRI functionality. |
| 501 | */ |
| 502 | #define __DRI_CORE "DRI_Core" |
| 503 | #define __DRI_CORE_VERSION 1 |
| 504 | |
| 505 | struct __DRIcoreExtensionRec { |
| 506 | __DRIextension base; |
| 507 | |
| 508 | __DRIscreen *(*createNewScreen)(int screen, int fd, |
| 509 | unsigned int sarea_handle, |
| 510 | const __DRIextension **extensions, |
| 511 | const __DRIconfig ***driverConfigs, |
| 512 | void *loaderPrivate); |
| 513 | |
| 514 | void (*destroyScreen)(__DRIscreen *screen); |
| 515 | |
| 516 | const __DRIextension **(*getExtensions)(__DRIscreen *screen); |
| 517 | |
| 518 | int (*getConfigAttrib)(const __DRIconfig *config, |
| 519 | unsigned int attrib, |
| 520 | unsigned int *value); |
| 521 | |
| 522 | int (*indexConfigAttrib)(const __DRIconfig *config, int index, |
| 523 | unsigned int *attrib, unsigned int *value); |
| 524 | |
| 525 | __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, |
| 526 | const __DRIconfig *config, |
| 527 | unsigned int drawable_id, |
| 528 | unsigned int head, |
| 529 | void *loaderPrivate); |
| 530 | |
| 531 | void (*destroyDrawable)(__DRIdrawable *drawable); |
| 532 | |
| 533 | void (*swapBuffers)(__DRIdrawable *drawable); |
| 534 | |
| 535 | __DRIcontext *(*createNewContext)(__DRIscreen *screen, |
| 536 | const __DRIconfig *config, |
| 537 | __DRIcontext *shared, |
| 538 | void *loaderPrivate); |
| 539 | |
| 540 | int (*copyContext)(__DRIcontext *dest, |
| 541 | __DRIcontext *src, |
| 542 | unsigned long mask); |
| 543 | |
| 544 | void (*destroyContext)(__DRIcontext *context); |
| 545 | |
| 546 | int (*bindContext)(__DRIcontext *ctx, |
| 547 | __DRIdrawable *pdraw, |
| 548 | __DRIdrawable *pread); |
| 549 | |
| 550 | int (*unbindContext)(__DRIcontext *ctx); |
| 551 | }; |
| 552 | |
| 553 | /** |
| 554 | * Stored version of some component (i.e., server-side DRI module, kernel-side |
| 555 | * DRM, etc.). |
| 556 | * |
| 557 | * \todo |
| 558 | * There are several data structures that explicitly store a major version, |
| 559 | * minor version, and patch level. These structures should be modified to |
| 560 | * have a \c __DRIversionRec instead. |
| 561 | */ |
| 562 | struct __DRIversionRec { |
| 563 | int major; /**< Major version number. */ |
| 564 | int minor; /**< Minor version number. */ |
| 565 | int patch; /**< Patch-level. */ |
| 566 | }; |
| 567 | |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 568 | /** |
| 569 | * Framebuffer information record. Used by libGL to communicate information |
| 570 | * about the framebuffer to the driver's \c __driCreateNewScreen function. |
| 571 | * |
| 572 | * In XFree86, most of this information is derrived from data returned by |
| 573 | * calling \c XF86DRIGetDeviceInfo. |
| 574 | * |
| 575 | * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen |
| 576 | * __driUtilCreateNewScreen CallCreateNewScreen |
| 577 | * |
| 578 | * \bug This structure could be better named. |
| 579 | */ |
| 580 | struct __DRIframebufferRec { |
| 581 | unsigned char *base; /**< Framebuffer base address in the CPU's |
| 582 | * address space. This value is calculated by |
| 583 | * calling \c drmMap on the framebuffer handle |
| 584 | * returned by \c XF86DRIGetDeviceInfo (or a |
| 585 | * similar function). |
| 586 | */ |
| 587 | int size; /**< Framebuffer size, in bytes. */ |
| 588 | int stride; /**< Number of bytes from one line to the next. */ |
| 589 | int width; /**< Pixel width of the framebuffer. */ |
| 590 | int height; /**< Pixel height of the framebuffer. */ |
| 591 | int dev_priv_size; /**< Size of the driver's dev-priv structure. */ |
| 592 | void *dev_priv; /**< Pointer to the driver's dev-priv structure. */ |
| 593 | }; |
| 594 | |
| 595 | |
| 596 | /** |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 597 | * This extension provides alternative screen, drawable and context |
| 598 | * constructors for legacy DRI functionality. This is used in |
| 599 | * conjunction with the core extension. |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 600 | */ |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 601 | #define __DRI_LEGACY "DRI_Legacy" |
| 602 | #define __DRI_LEGACY_VERSION 1 |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 603 | |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 604 | struct __DRIlegacyExtensionRec { |
| 605 | __DRIextension base; |
Kristian Høgsberg | f616a26 | 2007-05-15 12:31:31 -0400 | [diff] [blame] | 606 | |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 607 | __DRIscreen *(*createNewScreen)(int screen, |
| 608 | const __DRIversion *ddx_version, |
| 609 | const __DRIversion *dri_version, |
| 610 | const __DRIversion *drm_version, |
| 611 | const __DRIframebuffer *frame_buffer, |
| 612 | void *pSAREA, int fd, |
| 613 | const __DRIextension **extensions, |
| 614 | const __DRIconfig ***driver_configs, |
| 615 | void *loaderPrivate); |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 616 | |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 617 | __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, |
| 618 | const __DRIconfig *config, |
| 619 | drm_drawable_t hwDrawable, |
| 620 | int renderType, const int *attrs, |
| 621 | void *loaderPrivate); |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 622 | |
Kristian Høgsberg | e82dd8c | 2008-03-26 19:26:59 -0400 | [diff] [blame] | 623 | __DRIcontext *(*createNewContext)(__DRIscreen *screen, |
| 624 | const __DRIconfig *config, |
| 625 | int render_type, |
| 626 | __DRIcontext *shared, |
| 627 | drm_context_t hwContext, |
| 628 | void *loaderPrivate); |
Brian Paul | 192c988 | 2004-03-22 23:31:29 +0000 | [diff] [blame] | 629 | }; |
Keith Whitwell | 74d563c | 2004-04-29 12:23:39 +0000 | [diff] [blame] | 630 | |
George Sapountzis | 280bf89 | 2008-05-11 14:43:40 +0300 | [diff] [blame] | 631 | /** |
| 632 | * This extension provides alternative screen, drawable and context |
| 633 | * constructors for swrast DRI functionality. This is used in |
| 634 | * conjunction with the core extension. |
| 635 | */ |
| 636 | #define __DRI_SWRAST "DRI_SWRast" |
| 637 | #define __DRI_SWRAST_VERSION 1 |
| 638 | |
| 639 | struct __DRIswrastExtensionRec { |
| 640 | __DRIextension base; |
| 641 | |
| 642 | __DRIscreen *(*createNewScreen)(int screen, |
| 643 | const __DRIextension **extensions, |
| 644 | const __DRIconfig ***driver_configs, |
| 645 | void *loaderPrivate); |
| 646 | |
| 647 | __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, |
| 648 | const __DRIconfig *config, |
| 649 | void *loaderPrivate); |
| 650 | }; |
| 651 | |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 652 | /** |
| 653 | * DRI2 Loader extension. |
| 654 | */ |
| 655 | #define __DRI_BUFFER_FRONT_LEFT 0 |
| 656 | #define __DRI_BUFFER_BACK_LEFT 1 |
| 657 | #define __DRI_BUFFER_FRONT_RIGHT 2 |
| 658 | #define __DRI_BUFFER_BACK_RIGHT 3 |
| 659 | #define __DRI_BUFFER_DEPTH 4 |
| 660 | #define __DRI_BUFFER_STENCIL 5 |
| 661 | #define __DRI_BUFFER_ACCUM 6 |
Alan Hourihane | 396711b | 2009-01-19 15:40:30 +0000 | [diff] [blame] | 662 | #define __DRI_BUFFER_FAKE_FRONT_LEFT 7 |
| 663 | #define __DRI_BUFFER_FAKE_FRONT_RIGHT 8 |
Ian Romanick | dbf87f2 | 2009-04-20 20:55:56 -0700 | [diff] [blame] | 664 | #define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */ |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 665 | |
| 666 | struct __DRIbufferRec { |
| 667 | unsigned int attachment; |
| 668 | unsigned int name; |
| 669 | unsigned int pitch; |
| 670 | unsigned int cpp; |
| 671 | unsigned int flags; |
| 672 | }; |
| 673 | |
| 674 | #define __DRI_DRI2_LOADER "DRI_DRI2Loader" |
Ian Romanick | dbf87f2 | 2009-04-20 20:55:56 -0700 | [diff] [blame] | 675 | #define __DRI_DRI2_LOADER_VERSION 3 |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 676 | struct __DRIdri2LoaderExtensionRec { |
| 677 | __DRIextension base; |
| 678 | |
| 679 | __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable, |
| 680 | int *width, int *height, |
| 681 | unsigned int *attachments, int count, |
| 682 | int *out_count, void *loaderPrivate); |
Ian Romanick | 82634ee | 2009-04-06 12:44:18 -0700 | [diff] [blame] | 683 | |
| 684 | /** |
| 685 | * Flush pending front-buffer rendering |
| 686 | * |
| 687 | * Any rendering that has been performed to the |
| 688 | * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the |
| 689 | * \c __DRI_BUFFER_FRONT_LEFT. |
| 690 | * |
| 691 | * \param driDrawable Drawable whose front-buffer is to be flushed |
| 692 | * \param loaderPrivate Loader's private data that was previously passed |
| 693 | * into __DRIdri2ExtensionRec::createNewDrawable |
| 694 | */ |
| 695 | void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate); |
Ian Romanick | dbf87f2 | 2009-04-20 20:55:56 -0700 | [diff] [blame] | 696 | |
| 697 | |
| 698 | /** |
| 699 | * Get list of buffers from the server |
| 700 | * |
| 701 | * Gets a list of buffer for the specified set of attachments. Unlike |
| 702 | * \c ::getBuffers, this function takes a list of attachments paired with |
| 703 | * opaque \c unsigned \c int value describing the format of the buffer. |
| 704 | * It is the responsibility of the caller to know what the service that |
| 705 | * allocates the buffers will expect to receive for the format. |
| 706 | * |
| 707 | * \param driDrawable Drawable whose buffers are being queried. |
| 708 | * \param width Output where the width of the buffers is stored. |
| 709 | * \param height Output where the height of the buffers is stored. |
| 710 | * \param attachments List of pairs of attachment ID and opaque format |
| 711 | * requested for the drawable. |
| 712 | * \param count Number of attachment / format pairs stored in |
| 713 | * \c attachments. |
| 714 | * \param loaderPrivate Loader's private data that was previously passed |
| 715 | * into __DRIdri2ExtensionRec::createNewDrawable. |
| 716 | */ |
| 717 | __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable, |
| 718 | int *width, int *height, |
| 719 | unsigned int *attachments, int count, |
| 720 | int *out_count, void *loaderPrivate); |
Kristian Høgsberg | f56b569 | 2008-08-13 11:46:25 -0400 | [diff] [blame] | 721 | }; |
| 722 | |
| 723 | /** |
| 724 | * This extension provides alternative screen, drawable and context |
| 725 | * constructors for DRI2. |
| 726 | */ |
| 727 | #define __DRI_DRI2 "DRI_DRI2" |
| 728 | #define __DRI_DRI2_VERSION 1 |
| 729 | |
| 730 | struct __DRIdri2ExtensionRec { |
| 731 | __DRIextension base; |
| 732 | |
| 733 | __DRIscreen *(*createNewScreen)(int screen, int fd, |
| 734 | const __DRIextension **extensions, |
| 735 | const __DRIconfig ***driver_configs, |
| 736 | void *loaderPrivate); |
| 737 | |
| 738 | __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, |
| 739 | const __DRIconfig *config, |
| 740 | void *loaderPrivate); |
| 741 | |
| 742 | __DRIcontext *(*createNewContext)(__DRIscreen *screen, |
| 743 | const __DRIconfig *config, |
| 744 | __DRIcontext *shared, |
| 745 | void *loaderPrivate); |
| 746 | |
| 747 | }; |
| 748 | |
Keith Whitwell | 74d563c | 2004-04-29 12:23:39 +0000 | [diff] [blame] | 749 | #endif |