2 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2007-2008 Red Hat, Inc.
4 * (C) Copyright IBM Corporation 2004
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:
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
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.
28 * \file dri_interface.h
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.
35 * \author Kevin E. Martin <kevin@precisioninsight.com>
36 * \author Ian Romanick <idr@us.ibm.com>
37 * \author Kristian Høgsberg <krh@redhat.com>
40 #ifndef DRI_INTERFACE_H
41 #define DRI_INTERFACE_H
43 /* For archs with no drm.h */
44 #if !defined(__APPLE__) && !defined(__CYGWIN__)
47 typedef unsigned int drm_context_t
;
48 typedef unsigned int drm_drawable_t
;
49 typedef struct drm_clip_rect drm_clip_rect_t
;
53 * \name DRI interface structures
55 * The following structures define the interface between the GLX client
56 * side library and the DRI (direct rendering infrastructure).
59 typedef struct __DRIdisplayRec __DRIdisplay
;
60 typedef struct __DRIscreenRec __DRIscreen
;
61 typedef struct __DRIcontextRec __DRIcontext
;
62 typedef struct __DRIdrawableRec __DRIdrawable
;
63 typedef struct __DRIconfigRec __DRIconfig
;
64 typedef struct __DRIframebufferRec __DRIframebuffer
;
65 typedef struct __DRIversionRec __DRIversion
;
67 typedef struct __DRIcoreExtensionRec __DRIcoreExtension
;
68 typedef struct __DRIextensionRec __DRIextension
;
69 typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension
;
70 typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension
;
71 typedef struct __DRIallocateExtensionRec __DRIallocateExtension
;
72 typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension
;
73 typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension
;
74 typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension
;
75 typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension
;
76 typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension
;
77 typedef struct __DRIswrastExtensionRec __DRIswrastExtension
;
78 typedef struct __DRIbufferRec __DRIbuffer
;
79 typedef struct __DRIdri2ExtensionRec __DRIdri2Extension
;
80 typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension
;
81 typedef struct __DRI2flushExtensionRec __DRI2flushExtension
;
87 * Extension struct. Drivers 'inherit' from this struct by embedding
88 * it as the first element in the extension struct.
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.
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
105 struct __DRIextensionRec
{
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.
119 * Used by drivers to indicate support for setting the read drawable.
121 #define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
122 #define __DRI_READ_DRAWABLE_VERSION 1
125 * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
127 #define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
128 #define __DRI_COPY_SUB_BUFFER_VERSION 1
129 struct __DRIcopySubBufferExtensionRec
{
131 void (*copySubBuffer
)(__DRIdrawable
*drawable
, int x
, int y
, int w
, int h
);
135 * Used by drivers that implement the GLX_SGI_swap_control or
136 * GLX_MESA_swap_control extension.
138 #define __DRI_SWAP_CONTROL "DRI_SwapControl"
139 #define __DRI_SWAP_CONTROL_VERSION 1
140 struct __DRIswapControlExtensionRec
{
142 void (*setSwapInterval
)(__DRIdrawable
*drawable
, unsigned int inteval
);
143 unsigned int (*getSwapInterval
)(__DRIdrawable
*drawable
);
147 * Used by drivers that implement the GLX_MESA_allocate_memory.
149 #define __DRI_ALLOCATE "DRI_Allocate"
150 #define __DRI_ALLOCATE_VERSION 1
151 struct __DRIallocateExtensionRec
{
154 void *(*allocateMemory
)(__DRIscreen
*screen
, GLsizei size
,
155 GLfloat readfreq
, GLfloat writefreq
,
158 void (*freeMemory
)(__DRIscreen
*screen
, GLvoid
*pointer
);
160 GLuint (*memoryOffset
)(__DRIscreen
*screen
, const GLvoid
*pointer
);
164 * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
166 #define __DRI_FRAME_TRACKING "DRI_FrameTracking"
167 #define __DRI_FRAME_TRACKING_VERSION 1
168 struct __DRIframeTrackingExtensionRec
{
172 * Enable or disable frame usage tracking.
174 * \since Internal API version 20030317.
176 int (*frameTracking
)(__DRIdrawable
*drawable
, GLboolean enable
);
179 * Retrieve frame usage information.
181 * \since Internal API version 20030317.
183 int (*queryFrameTracking
)(__DRIdrawable
*drawable
,
184 int64_t * sbc
, int64_t * missedFrames
,
185 float * lastMissedUsage
, float * usage
);
190 * Used by drivers that implement the GLX_SGI_video_sync extension.
192 #define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
193 #define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
194 struct __DRImediaStreamCounterExtensionRec
{
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
203 int (*waitForMSC
)(__DRIdrawable
*drawable
,
204 int64_t target_msc
, int64_t divisor
, int64_t remainder
,
205 int64_t * msc
, int64_t * sbc
);
208 * Get the number of vertical refreshes since some point in time before
209 * this function was first called (i.e., system start up).
211 int (*getDrawableMSC
)(__DRIscreen
*screen
, __DRIdrawable
*drawable
,
216 #define __DRI_TEX_OFFSET "DRI_TexOffset"
217 #define __DRI_TEX_OFFSET_VERSION 1
218 struct __DRItexOffsetExtensionRec
{
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.
226 * For GLX_EXT_texture_from_pixmap with AIGLX.
228 void (*setTexOffset
)(__DRIcontext
*pDRICtx
, GLint texname
,
229 unsigned long long offset
, GLint depth
, GLuint pitch
);
233 #define __DRI_TEX_BUFFER "DRI_TexBuffer"
234 #define __DRI_TEX_BUFFER_VERSION 2
235 struct __DRItexBufferExtensionRec
{
239 * Method to override base texture image with the contents of a
242 * For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
243 * setTexBuffer2 in version 2 of this interface
245 void (*setTexBuffer
)(__DRIcontext
*pDRICtx
,
247 __DRIdrawable
*pDraw
);
250 * Method to override base texture image with the contents of a
251 * __DRIdrawable, including the required texture format attribute.
253 * For GLX_EXT_texture_from_pixmap with AIGLX.
255 void (*setTexBuffer2
)(__DRIcontext
*pDRICtx
,
258 __DRIdrawable
*pDraw
);
262 * Used by drivers that implement DRI2
264 #define __DRI2_FLUSH "DRI2_Flush"
265 #define __DRI2_FLUSH_VERSION 1
266 struct __DRI2flushExtensionRec
{
268 void (*flush
)(__DRIdrawable
*drawable
);
273 * XML document describing the configuration options supported by the
276 extern const char __driConfigOptions
[];
281 * The following extensions describe loader features that the DRI
282 * driver can make use of. Some of these are mandatory, such as the
283 * getDrawableInfo extension for DRI and the DRI Loader extensions for
284 * DRI2, while others are optional, and if present allow the driver to
285 * expose certain features. The loader pass in a NULL terminated
286 * array of these extensions to the driver in the createNewScreen
290 typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension
;
291 typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension
;
292 typedef struct __DRIdamageExtensionRec __DRIdamageExtension
;
293 typedef struct __DRIloaderExtensionRec __DRIloaderExtension
;
294 typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension
;
298 * Callback to getDrawableInfo protocol
300 #define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
301 #define __DRI_GET_DRAWABLE_INFO_VERSION 1
302 struct __DRIgetDrawableInfoExtensionRec
{
306 * This function is used to get information about the position, size, and
307 * clip rects of a drawable.
309 GLboolean (* getDrawableInfo
) ( __DRIdrawable
*drawable
,
310 unsigned int * index
, unsigned int * stamp
,
311 int * x
, int * y
, int * width
, int * height
,
312 int * numClipRects
, drm_clip_rect_t
** pClipRects
,
313 int * backX
, int * backY
,
314 int * numBackClipRects
, drm_clip_rect_t
** pBackClipRects
,
315 void *loaderPrivate
);
319 * Callback to get system time for media stream counter extensions.
321 #define __DRI_SYSTEM_TIME "DRI_SystemTime"
322 #define __DRI_SYSTEM_TIME_VERSION 1
323 struct __DRIsystemTimeExtensionRec
{
327 * Get the 64-bit unadjusted system time (UST).
329 int (*getUST
)(int64_t * ust
);
332 * Get the media stream counter (MSC) rate.
334 * Matching the definition in GLX_OML_sync_control, this function returns
335 * the rate of the "media stream counter". In practical terms, this is
336 * the frame refresh rate of the display.
338 GLboolean (*getMSCRate
)(__DRIdrawable
*draw
,
339 int32_t * numerator
, int32_t * denominator
,
340 void *loaderPrivate
);
346 #define __DRI_DAMAGE "DRI_Damage"
347 #define __DRI_DAMAGE_VERSION 1
348 struct __DRIdamageExtensionRec
{
352 * Reports areas of the given drawable which have been modified by the
355 * \param drawable which the drawing was done to.
356 * \param rects rectangles affected, with the drawable origin as the
358 * \param x X offset of the drawable within the screen (used in the
360 * \param y Y offset of the drawable within the screen.
361 * \param front_buffer boolean flag for whether the drawing to the
362 * drawable was actually done directly to the front buffer (instead
363 * of backing storage, for example)
364 * \param loaderPrivate the data passed in at createNewDrawable time
366 void (*reportDamage
)(__DRIdrawable
*draw
,
368 drm_clip_rect_t
*rects
, int num_rects
,
369 GLboolean front_buffer
,
370 void *loaderPrivate
);
373 #define __DRI_SWRAST_IMAGE_OP_DRAW 1
374 #define __DRI_SWRAST_IMAGE_OP_CLEAR 2
375 #define __DRI_SWRAST_IMAGE_OP_SWAP 3
378 * SWRast Loader extension.
380 #define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
381 #define __DRI_SWRAST_LOADER_VERSION 1
382 struct __DRIswrastLoaderExtensionRec
{
386 * Drawable position and size
388 void (*getDrawableInfo
)(__DRIdrawable
*drawable
,
389 int *x
, int *y
, int *width
, int *height
,
390 void *loaderPrivate
);
393 * Put image to drawable
395 void (*putImage
)(__DRIdrawable
*drawable
, int op
,
396 int x
, int y
, int width
, int height
, char *data
,
397 void *loaderPrivate
);
400 * Get image from drawable
402 void (*getImage
)(__DRIdrawable
*drawable
,
403 int x
, int y
, int width
, int height
, char *data
,
404 void *loaderPrivate
);
408 * The remaining extensions describe driver extensions, immediately
409 * available interfaces provided by the driver. To start using the
410 * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
411 * the extension you need in the array.
413 #define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
416 * Tokens for __DRIconfig attribs. A number of attributes defined by
417 * GLX or EGL standards are not in the table, as they must be provided
418 * by the loader. For example, FBConfig ID or visual ID, drawable type.
421 #define __DRI_ATTRIB_BUFFER_SIZE 1
422 #define __DRI_ATTRIB_LEVEL 2
423 #define __DRI_ATTRIB_RED_SIZE 3
424 #define __DRI_ATTRIB_GREEN_SIZE 4
425 #define __DRI_ATTRIB_BLUE_SIZE 5
426 #define __DRI_ATTRIB_LUMINANCE_SIZE 6
427 #define __DRI_ATTRIB_ALPHA_SIZE 7
428 #define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
429 #define __DRI_ATTRIB_DEPTH_SIZE 9
430 #define __DRI_ATTRIB_STENCIL_SIZE 10
431 #define __DRI_ATTRIB_ACCUM_RED_SIZE 11
432 #define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
433 #define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
434 #define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
435 #define __DRI_ATTRIB_SAMPLE_BUFFERS 15
436 #define __DRI_ATTRIB_SAMPLES 16
437 #define __DRI_ATTRIB_RENDER_TYPE 17
438 #define __DRI_ATTRIB_CONFIG_CAVEAT 18
439 #define __DRI_ATTRIB_CONFORMANT 19
440 #define __DRI_ATTRIB_DOUBLE_BUFFER 20
441 #define __DRI_ATTRIB_STEREO 21
442 #define __DRI_ATTRIB_AUX_BUFFERS 22
443 #define __DRI_ATTRIB_TRANSPARENT_TYPE 23
444 #define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
445 #define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
446 #define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
447 #define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
448 #define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
449 #define __DRI_ATTRIB_FLOAT_MODE 29
450 #define __DRI_ATTRIB_RED_MASK 30
451 #define __DRI_ATTRIB_GREEN_MASK 31
452 #define __DRI_ATTRIB_BLUE_MASK 32
453 #define __DRI_ATTRIB_ALPHA_MASK 33
454 #define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
455 #define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
456 #define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
457 #define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
458 #define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
459 #define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
460 #define __DRI_ATTRIB_SWAP_METHOD 40
461 #define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
462 #define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
463 #define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
464 #define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
465 #define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
466 #define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
467 #define __DRI_ATTRIB_YINVERTED 47
469 /* __DRI_ATTRIB_RENDER_TYPE */
470 #define __DRI_ATTRIB_RGBA_BIT 0x01
471 #define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
472 #define __DRI_ATTRIB_LUMINANCE_BIT 0x04
474 /* __DRI_ATTRIB_CONFIG_CAVEAT */
475 #define __DRI_ATTRIB_SLOW_BIT 0x01
476 #define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
478 /* __DRI_ATTRIB_TRANSPARENT_TYPE */
479 #define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
480 #define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
482 /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
483 #define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
484 #define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
485 #define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
488 * This extension defines the core DRI functionality.
490 #define __DRI_CORE "DRI_Core"
491 #define __DRI_CORE_VERSION 1
493 struct __DRIcoreExtensionRec
{
496 __DRIscreen
*(*createNewScreen
)(int screen
, int fd
,
497 unsigned int sarea_handle
,
498 const __DRIextension
**extensions
,
499 const __DRIconfig
***driverConfigs
,
500 void *loaderPrivate
);
502 void (*destroyScreen
)(__DRIscreen
*screen
);
504 const __DRIextension
**(*getExtensions
)(__DRIscreen
*screen
);
506 int (*getConfigAttrib
)(const __DRIconfig
*config
,
508 unsigned int *value
);
510 int (*indexConfigAttrib
)(const __DRIconfig
*config
, int index
,
511 unsigned int *attrib
, unsigned int *value
);
513 __DRIdrawable
*(*createNewDrawable
)(__DRIscreen
*screen
,
514 const __DRIconfig
*config
,
515 unsigned int drawable_id
,
517 void *loaderPrivate
);
519 void (*destroyDrawable
)(__DRIdrawable
*drawable
);
521 void (*swapBuffers
)(__DRIdrawable
*drawable
);
523 __DRIcontext
*(*createNewContext
)(__DRIscreen
*screen
,
524 const __DRIconfig
*config
,
525 __DRIcontext
*shared
,
526 void *loaderPrivate
);
528 int (*copyContext
)(__DRIcontext
*dest
,
532 void (*destroyContext
)(__DRIcontext
*context
);
534 int (*bindContext
)(__DRIcontext
*ctx
,
535 __DRIdrawable
*pdraw
,
536 __DRIdrawable
*pread
);
538 int (*unbindContext
)(__DRIcontext
*ctx
);
542 * Stored version of some component (i.e., server-side DRI module, kernel-side
546 * There are several data structures that explicitly store a major version,
547 * minor version, and patch level. These structures should be modified to
548 * have a \c __DRIversionRec instead.
550 struct __DRIversionRec
{
551 int major
; /**< Major version number. */
552 int minor
; /**< Minor version number. */
553 int patch
; /**< Patch-level. */
557 * Framebuffer information record. Used by libGL to communicate information
558 * about the framebuffer to the driver's \c __driCreateNewScreen function.
560 * In XFree86, most of this information is derrived from data returned by
561 * calling \c XF86DRIGetDeviceInfo.
563 * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
564 * __driUtilCreateNewScreen CallCreateNewScreen
566 * \bug This structure could be better named.
568 struct __DRIframebufferRec
{
569 unsigned char *base
; /**< Framebuffer base address in the CPU's
570 * address space. This value is calculated by
571 * calling \c drmMap on the framebuffer handle
572 * returned by \c XF86DRIGetDeviceInfo (or a
575 int size
; /**< Framebuffer size, in bytes. */
576 int stride
; /**< Number of bytes from one line to the next. */
577 int width
; /**< Pixel width of the framebuffer. */
578 int height
; /**< Pixel height of the framebuffer. */
579 int dev_priv_size
; /**< Size of the driver's dev-priv structure. */
580 void *dev_priv
; /**< Pointer to the driver's dev-priv structure. */
585 * This extension provides alternative screen, drawable and context
586 * constructors for legacy DRI functionality. This is used in
587 * conjunction with the core extension.
589 #define __DRI_LEGACY "DRI_Legacy"
590 #define __DRI_LEGACY_VERSION 1
592 struct __DRIlegacyExtensionRec
{
595 __DRIscreen
*(*createNewScreen
)(int screen
,
596 const __DRIversion
*ddx_version
,
597 const __DRIversion
*dri_version
,
598 const __DRIversion
*drm_version
,
599 const __DRIframebuffer
*frame_buffer
,
600 void *pSAREA
, int fd
,
601 const __DRIextension
**extensions
,
602 const __DRIconfig
***driver_configs
,
603 void *loaderPrivate
);
605 __DRIdrawable
*(*createNewDrawable
)(__DRIscreen
*screen
,
606 const __DRIconfig
*config
,
607 drm_drawable_t hwDrawable
,
608 int renderType
, const int *attrs
,
609 void *loaderPrivate
);
611 __DRIcontext
*(*createNewContext
)(__DRIscreen
*screen
,
612 const __DRIconfig
*config
,
614 __DRIcontext
*shared
,
615 drm_context_t hwContext
,
616 void *loaderPrivate
);
620 * This extension provides alternative screen, drawable and context
621 * constructors for swrast DRI functionality. This is used in
622 * conjunction with the core extension.
624 #define __DRI_SWRAST "DRI_SWRast"
625 #define __DRI_SWRAST_VERSION 1
627 struct __DRIswrastExtensionRec
{
630 __DRIscreen
*(*createNewScreen
)(int screen
,
631 const __DRIextension
**extensions
,
632 const __DRIconfig
***driver_configs
,
633 void *loaderPrivate
);
635 __DRIdrawable
*(*createNewDrawable
)(__DRIscreen
*screen
,
636 const __DRIconfig
*config
,
637 void *loaderPrivate
);
641 * DRI2 Loader extension.
643 #define __DRI_BUFFER_FRONT_LEFT 0
644 #define __DRI_BUFFER_BACK_LEFT 1
645 #define __DRI_BUFFER_FRONT_RIGHT 2
646 #define __DRI_BUFFER_BACK_RIGHT 3
647 #define __DRI_BUFFER_DEPTH 4
648 #define __DRI_BUFFER_STENCIL 5
649 #define __DRI_BUFFER_ACCUM 6
650 #define __DRI_BUFFER_FAKE_FRONT_LEFT 7
651 #define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
653 struct __DRIbufferRec
{
654 unsigned int attachment
;
661 #define __DRI_DRI2_LOADER "DRI_DRI2Loader"
662 #define __DRI_DRI2_LOADER_VERSION 1
663 struct __DRIdri2LoaderExtensionRec
{
666 __DRIbuffer
*(*getBuffers
)(__DRIdrawable
*driDrawable
,
667 int *width
, int *height
,
668 unsigned int *attachments
, int count
,
669 int *out_count
, void *loaderPrivate
);
673 * This extension provides alternative screen, drawable and context
674 * constructors for DRI2.
676 #define __DRI_DRI2 "DRI_DRI2"
677 #define __DRI_DRI2_VERSION 1
679 struct __DRIdri2ExtensionRec
{
682 __DRIscreen
*(*createNewScreen
)(int screen
, int fd
,
683 const __DRIextension
**extensions
,
684 const __DRIconfig
***driver_configs
,
685 void *loaderPrivate
);
687 __DRIdrawable
*(*createNewDrawable
)(__DRIscreen
*screen
,
688 const __DRIconfig
*config
,
689 void *loaderPrivate
);
691 __DRIcontext
*(*createNewContext
)(__DRIscreen
*screen
,
692 const __DRIconfig
*config
,
693 __DRIcontext
*shared
,
694 void *loaderPrivate
);