<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[113816] trunk/dports/x11/xorg-server/files/dri/GL/internal/dri_interface.h</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/113816">113816</a></dd>
<dt>Author</dt> <dd>jeremyhu@macports.org</dd>
<dt>Date</dt> <dd>2013-11-24 01:25:16 -0800 (Sun, 24 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>xorg-server: Update dri_interface.h</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsx11xorgserverfilesdriGLinternaldri_interfaceh">trunk/dports/x11/xorg-server/files/dri/GL/internal/dri_interface.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsx11xorgserverfilesdriGLinternaldri_interfaceh"></a>
<div class="modfile"><h4>Modified: trunk/dports/x11/xorg-server/files/dri/GL/internal/dri_interface.h (113815 => 113816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/x11/xorg-server/files/dri/GL/internal/dri_interface.h        2013-11-24 08:57:52 UTC (rev 113815)
+++ trunk/dports/x11/xorg-server/files/dri/GL/internal/dri_interface.h        2013-11-24 09:25:16 UTC (rev 113816)
</span><span class="lines">@@ -40,8 +40,14 @@
</span><span class="cx"> #ifndef DRI_INTERFACE_H
</span><span class="cx"> #define DRI_INTERFACE_H
</span><span class="cx"> 
</span><del>-/* Make this something other than __APPLE__ for other arcs with no drm.h */
-#ifndef __APPLE__
</del><ins>+/* For archs with no drm.h */
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
</ins><span class="cx"> #include &lt;drm.h&gt;
</span><span class="cx"> #else
</span><span class="cx"> typedef unsigned int drm_context_t;
</span><span class="lines">@@ -68,13 +74,18 @@
</span><span class="cx"> typedef struct __DRIextensionRec                __DRIextension;
</span><span class="cx"> typedef struct __DRIcopySubBufferExtensionRec        __DRIcopySubBufferExtension;
</span><span class="cx"> typedef struct __DRIswapControlExtensionRec        __DRIswapControlExtension;
</span><del>-typedef struct __DRIallocateExtensionRec        __DRIallocateExtension;
</del><span class="cx"> typedef struct __DRIframeTrackingExtensionRec        __DRIframeTrackingExtension;
</span><span class="cx"> typedef struct __DRImediaStreamCounterExtensionRec        __DRImediaStreamCounterExtension;
</span><span class="cx"> typedef struct __DRItexOffsetExtensionRec        __DRItexOffsetExtension;
</span><span class="cx"> typedef struct __DRItexBufferExtensionRec        __DRItexBufferExtension;
</span><span class="cx"> typedef struct __DRIlegacyExtensionRec                __DRIlegacyExtension;
</span><span class="cx"> typedef struct __DRIswrastExtensionRec                __DRIswrastExtension;
</span><ins>+typedef struct __DRIbufferRec                        __DRIbuffer;
+typedef struct __DRIdri2ExtensionRec                __DRIdri2Extension;
+typedef struct __DRIdri2LoaderExtensionRec        __DRIdri2LoaderExtension;
+typedef struct __DRI2flushExtensionRec        __DRI2flushExtension;
+typedef struct __DRI2throttleExtensionRec        __DRI2throttleExtension;
+
</ins><span class="cx"> /*@}*/
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -139,23 +150,6 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Used by drivers that implement the GLX_MESA_allocate_memory.
- */
-#define __DRI_ALLOCATE &quot;DRI_Allocate&quot;
-#define __DRI_ALLOCATE_VERSION 1
-struct __DRIallocateExtensionRec {
-    __DRIextension base;
-
-    void *(*allocateMemory)(__DRIscreen *screen, GLsizei size,
-                            GLfloat readfreq, GLfloat writefreq,
-                            GLfloat priority);
-   
-    void (*freeMemory)(__DRIscreen *screen, GLvoid *pointer);
-   
-    GLuint (*memoryOffset)(__DRIscreen *screen, const GLvoid *pointer);
-};
-
-/**
</del><span class="cx">  * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
</span><span class="cx">  */
</span><span class="cx"> #define __DRI_FRAME_TRACKING &quot;DRI_FrameTracking&quot;
</span><span class="lines">@@ -225,8 +219,15 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+/* Valid values for format in the setTexBuffer2 function below.  These
+ * values match the GLX tokens for compatibility reasons, but we
+ * define them here since the DRI interface can't depend on GLX. */
+#define __DRI_TEXTURE_FORMAT_NONE        0x20D8
+#define __DRI_TEXTURE_FORMAT_RGB         0x20D9
+#define __DRI_TEXTURE_FORMAT_RGBA        0x20DA
+
</ins><span class="cx"> #define __DRI_TEX_BUFFER &quot;DRI_TexBuffer&quot;
</span><del>-#define __DRI_TEX_BUFFER_VERSION 1
</del><ins>+#define __DRI_TEX_BUFFER_VERSION 2
</ins><span class="cx"> struct __DRItexBufferExtensionRec {
</span><span class="cx">     __DRIextension base;
</span><span class="cx"> 
</span><span class="lines">@@ -234,15 +235,102 @@
</span><span class="cx">      * Method to override base texture image with the contents of a
</span><span class="cx">      * __DRIdrawable. 
</span><span class="cx">      *
</span><del>-     * For GLX_EXT_texture_from_pixmap with AIGLX.
</del><ins>+     * For GLX_EXT_texture_from_pixmap with AIGLX.  Deprecated in favor of
+     * setTexBuffer2 in version 2 of this interface
</ins><span class="cx">      */
</span><span class="cx">     void (*setTexBuffer)(__DRIcontext *pDRICtx,
</span><span class="cx">                          GLint target,
</span><span class="cx">                          __DRIdrawable *pDraw);
</span><ins>+
+    /**
+     * Method to override base texture image with the contents of a
+     * __DRIdrawable, including the required texture format attribute.
+     *
+     * For GLX_EXT_texture_from_pixmap with AIGLX.
+     */
+    void (*setTexBuffer2)(__DRIcontext *pDRICtx,
+                          GLint target,
+                          GLint format,
+                          __DRIdrawable *pDraw);
+    /**
+     * Method to release texture buffer in case some special platform
+     * need this.
+     *
+     * For GLX_EXT_texture_from_pixmap with AIGLX.
+     */
+    void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
+                        GLint target,
+                        __DRIdrawable *pDraw);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+/**
+ * Used by drivers that implement DRI2
+ */
+#define __DRI2_FLUSH &quot;DRI2_Flush&quot;
+#define __DRI2_FLUSH_VERSION 4
</ins><span class="cx"> 
</span><ins>+#define __DRI2_FLUSH_DRAWABLE (1 &lt;&lt; 0) /* the drawable should be flushed. */
+#define __DRI2_FLUSH_CONTEXT  (1 &lt;&lt; 1) /* glFlush should be called */
+
+enum __DRI2throttleReason {
+   __DRI2_THROTTLE_SWAPBUFFER,
+   __DRI2_THROTTLE_COPYSUBBUFFER,
+   __DRI2_THROTTLE_FLUSHFRONT
+};
+
+struct __DRI2flushExtensionRec {
+    __DRIextension base;
+    void (*flush)(__DRIdrawable *drawable);
+
+    /**
+     * Ask the driver to call getBuffers/getBuffersWithFormat before
+     * it starts rendering again.
+     *
+     * \param drawable the drawable to invalidate
+     *
+     * \since 3
+     */
+    void (*invalidate)(__DRIdrawable *drawable);
+
+    /**
+     * This function reduces the number of flushes in the driver by combining
+     * several operations into one call.
+     *
+     * It can:
+     * - throttle
+     * - flush a drawable
+     * - flush a context
+     *
+     * \param context           the context
+     * \param drawable          the drawable to flush
+     * \param flags             a combination of _DRI2_FLUSH_xxx flags
+     * \param throttle_reason   the reason for throttling, 0 = no throttling
+     *
+     * \since 4
+     */
+    void (*flush_with_flags)(__DRIcontext *ctx,
+                             __DRIdrawable *drawable,
+                             unsigned flags,
+                             enum __DRI2throttleReason throttle_reason);
+};
+
+
</ins><span class="cx"> /**
</span><ins>+ * Extension that the driver uses to request
+ * throttle callbacks.
+ */
+
+#define __DRI2_THROTTLE &quot;DRI2_Throttle&quot;
+#define __DRI2_THROTTLE_VERSION 1
+
+struct __DRI2throttleExtensionRec {
+   __DRIextension base;
+   void (*throttle)(__DRIcontext *ctx,
+                    __DRIdrawable *drawable,
+                    enum __DRI2throttleReason reason);
+};
+
+/**
</ins><span class="cx">  * XML document describing the configuration options supported by the
</span><span class="cx">  * driver.
</span><span class="cx">  */
</span><span class="lines">@@ -343,29 +431,6 @@
</span><span class="cx">                          void *loaderPrivate);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-/**
- * DRI2 Loader extension.  This extension describes the basic
- * functionality the loader needs to provide for the DRI driver.
- */
-#define __DRI_LOADER &quot;DRI_Loader&quot;
-#define __DRI_LOADER_VERSION 1
-struct __DRIloaderExtensionRec {
-    __DRIextension base;
-
-    /**
-     * Ping the windowing system to get it to reemit info for the
-     * specified drawable in the DRI2 event buffer.
-     *
-     * \param draw the drawable for which to request info
-     * \param tail the new event buffer tail pointer
-     */
-    void (*reemitDrawableInfo)(__DRIdrawable *draw, unsigned int *tail,
-                               void *loaderPrivate);
-
-    void (*postDamage)(__DRIdrawable *draw, struct drm_clip_rect *rects,
-                       int num_rects, void *loaderPrivate);
-};
-
</del><span class="cx"> #define __DRI_SWRAST_IMAGE_OP_DRAW        1
</span><span class="cx"> #define __DRI_SWRAST_IMAGE_OP_CLEAR        2
</span><span class="cx"> #define __DRI_SWRAST_IMAGE_OP_SWAP        3
</span><span class="lines">@@ -389,18 +454,38 @@
</span><span class="cx">      * Put image to drawable
</span><span class="cx">      */
</span><span class="cx">     void (*putImage)(__DRIdrawable *drawable, int op,
</span><del>-                     int x, int y, int width, int height, char *data,
-                     void *loaderPrivate);
</del><ins>+                     int x, int y, int width, int height,
+                     char *data, void *loaderPrivate);
</ins><span class="cx"> 
</span><span class="cx">     /**
</span><del>-     * Get image from drawable
</del><ins>+     * Get image from readable
</ins><span class="cx">      */
</span><del>-    void (*getImage)(__DRIdrawable *drawable,
-                     int x, int y, int width, int height, char *data,
-                     void *loaderPrivate);
</del><ins>+    void (*getImage)(__DRIdrawable *readable,
+                     int x, int y, int width, int height,
+                     char *data, void *loaderPrivate);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Invalidate loader extension.  The presence of this extension
+ * indicates to the DRI driver that the loader will call invalidate in
+ * the __DRI2_FLUSH extension, whenever the needs to query for new
+ * buffers.  This means that the DRI driver can drop the polling in
+ * glViewport().
+ *
+ * The extension doesn't provide any functionality, it's only use to
+ * indicate to the driver that it can use the new semantics.  A DRI
+ * driver can use this to switch between the different semantics or
+ * just refuse to initialize if this extension isn't present.
+ */
+#define __DRI_USE_INVALIDATE &quot;DRI_UseInvalidate&quot;
+#define __DRI_USE_INVALIDATE_VERSION 1
+
+typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
+struct __DRIuseInvalidateExtensionRec {
+   __DRIextension base;
+};
+
+/**
</ins><span class="cx">  * The remaining extensions describe driver extensions, immediately
</span><span class="cx">  * available interfaces provided by the driver.  To start using the
</span><span class="cx">  * driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
</span><span class="lines">@@ -461,6 +546,7 @@
</span><span class="cx"> #define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE        45
</span><span class="cx"> #define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS        46
</span><span class="cx"> #define __DRI_ATTRIB_YINVERTED                        47
</span><ins>+#define __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE        48
</ins><span class="cx"> 
</span><span class="cx"> /* __DRI_ATTRIB_RENDER_TYPE */
</span><span class="cx"> #define __DRI_ATTRIB_RGBA_BIT                        0x01        
</span><span class="lines">@@ -618,7 +704,7 @@
</span><span class="cx">  * conjunction with the core extension.
</span><span class="cx">  */
</span><span class="cx"> #define __DRI_SWRAST &quot;DRI_SWRast&quot;
</span><del>-#define __DRI_SWRAST_VERSION 1
</del><ins>+#define __DRI_SWRAST_VERSION 3
</ins><span class="cx"> 
</span><span class="cx"> struct __DRIswrastExtensionRec {
</span><span class="cx">     __DRIextension base;
</span><span class="lines">@@ -631,6 +717,471 @@
</span><span class="cx">     __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
</span><span class="cx">                                         const __DRIconfig *config,
</span><span class="cx">                                         void *loaderPrivate);
</span><ins>+
+   /* Since version 2 */
+   __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+                                           int api,
+                                           const __DRIconfig *config,
+                                           __DRIcontext *shared,
+                                           void *data);
+
+   /**
+    * Create a context for a particular API with a set of attributes
+    *
+    * \since version 3
+    *
+    * \sa __DRIdri2ExtensionRec::createContextAttribs
+    */
+   __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+                                         int api,
+                                         const __DRIconfig *config,
+                                         __DRIcontext *shared,
+                                         unsigned num_attribs,
+                                         const uint32_t *attribs,
+                                         unsigned *error,
+                                         void *loaderPrivate);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+/**
+ * DRI2 Loader extension.
+ */
+#define __DRI_BUFFER_FRONT_LEFT                0
+#define __DRI_BUFFER_BACK_LEFT                1
+#define __DRI_BUFFER_FRONT_RIGHT        2
+#define __DRI_BUFFER_BACK_RIGHT                3
+#define __DRI_BUFFER_DEPTH                4
+#define __DRI_BUFFER_STENCIL                5
+#define __DRI_BUFFER_ACCUM                6
+#define __DRI_BUFFER_FAKE_FRONT_LEFT        7
+#define __DRI_BUFFER_FAKE_FRONT_RIGHT        8
+#define __DRI_BUFFER_DEPTH_STENCIL        9  /**&lt; Only available with DRI2 1.1 */
+#define __DRI_BUFFER_HIZ                10
+
+/* Inofficial and for internal use. Increase when adding a new buffer token. */
+#define __DRI_BUFFER_COUNT                11
+
+struct __DRIbufferRec {
+    unsigned int attachment;
+    unsigned int name;
+    unsigned int pitch;
+    unsigned int cpp;
+    unsigned int flags;
+};
+
+#define __DRI_DRI2_LOADER &quot;DRI_DRI2Loader&quot;
+#define __DRI_DRI2_LOADER_VERSION 3
+struct __DRIdri2LoaderExtensionRec {
+    __DRIextension base;
+
+    __DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
+                               int *width, int *height,
+                               unsigned int *attachments, int count,
+                               int *out_count, void *loaderPrivate);
+
+    /**
+     * Flush pending front-buffer rendering
+     *
+     * Any rendering that has been performed to the
+     * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
+     * \c __DRI_BUFFER_FRONT_LEFT.
+     *
+     * \param driDrawable    Drawable whose front-buffer is to be flushed
+     * \param loaderPrivate  Loader's private data that was previously passed
+     *                       into __DRIdri2ExtensionRec::createNewDrawable
+     */
+    void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
+
+
+    /**
+     * Get list of buffers from the server
+     *
+     * Gets a list of buffer for the specified set of attachments.  Unlike
+     * \c ::getBuffers, this function takes a list of attachments paired with
+     * opaque \c unsigned \c int value describing the format of the buffer.
+     * It is the responsibility of the caller to know what the service that
+     * allocates the buffers will expect to receive for the format.
+     *
+     * \param driDrawable    Drawable whose buffers are being queried.
+     * \param width          Output where the width of the buffers is stored.
+     * \param height         Output where the height of the buffers is stored.
+     * \param attachments    List of pairs of attachment ID and opaque format
+     *                       requested for the drawable.
+     * \param count          Number of attachment / format pairs stored in
+     *                       \c attachments.
+     * \param loaderPrivate  Loader's private data that was previously passed
+     *                       into __DRIdri2ExtensionRec::createNewDrawable.
+     */
+    __DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
+                                         int *width, int *height,
+                                         unsigned int *attachments, int count,
+                                         int *out_count, void *loaderPrivate);
+};
+
+/**
+ * This extension provides alternative screen, drawable and context
+ * constructors for DRI2.
+ */
+#define __DRI_DRI2 &quot;DRI_DRI2&quot;
+#define __DRI_DRI2_VERSION 3
+
+#define __DRI_API_OPENGL        0        /**&lt; OpenGL compatibility profile */
+#define __DRI_API_GLES                1        /**&lt; OpenGL ES 1.x */
+#define __DRI_API_GLES2                2        /**&lt; OpenGL ES 2.x */
+#define __DRI_API_OPENGL_CORE        3        /**&lt; OpenGL 3.2+ core profile */
+#define __DRI_API_GLES3                4        /**&lt; OpenGL ES 3.x */
+
+#define __DRI_CTX_ATTRIB_MAJOR_VERSION                0
+#define __DRI_CTX_ATTRIB_MINOR_VERSION                1
+#define __DRI_CTX_ATTRIB_FLAGS                        2
+
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_ATTRIB_RESET_STRATEGY                3
+
+#define __DRI_CTX_FLAG_DEBUG                        0x00000001
+#define __DRI_CTX_FLAG_FORWARD_COMPATIBLE        0x00000002
+
+/**
+ * \requires __DRI2_ROBUSTNESS.
+ */
+#define __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS        0x00000004
+
+/**
+ * \name Context reset strategies.
+ */
+/*@{*/
+#define __DRI_CTX_RESET_NO_NOTIFICATION                0
+#define __DRI_CTX_RESET_LOSE_CONTEXT                1
+/*@}*/
+
+/**
+ * \name Reasons that __DRIdri2Extension::createContextAttribs might fail
+ */
+/*@{*/
+/** Success! */
+#define __DRI_CTX_ERROR_SUCCESS                        0
+
+/** Memory allocation failure */
+#define __DRI_CTX_ERROR_NO_MEMORY                1
+
+/** Client requested an API (e.g., OpenGL ES 2.0) that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_API                        2
+
+/** Client requested an API version that the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_VERSION                3
+
+/** Client requested a flag or combination of flags the driver can't do. */
+#define __DRI_CTX_ERROR_BAD_FLAG                4
+
+/** Client requested an attribute the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE        5
+
+/** Client requested a flag the driver doesn't understand. */
+#define __DRI_CTX_ERROR_UNKNOWN_FLAG                6
+/*@}*/
+
+struct __DRIdri2ExtensionRec {
+    __DRIextension base;
+
+    __DRIscreen *(*createNewScreen)(int screen, int fd,
+                                    const __DRIextension **extensions,
+                                    const __DRIconfig ***driver_configs,
+                                    void *loaderPrivate);
+
+    __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
+                                        const __DRIconfig *config,
+                                        void *loaderPrivate);
+
+    __DRIcontext *(*createNewContext)(__DRIscreen *screen,
+                                      const __DRIconfig *config,
+                                      __DRIcontext *shared,
+                                      void *loaderPrivate);
+
+   /* Since version 2 */
+   unsigned int (*getAPIMask)(__DRIscreen *screen);
+
+   __DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
+                                           int api,
+                                           const __DRIconfig *config,
+                                           __DRIcontext *shared,
+                                           void *data);
+
+   __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+                                  unsigned int attachment,
+                                  unsigned int format,
+                                  int width,
+                                  int height);
+   void (*releaseBuffer)(__DRIscreen *screen,
+                         __DRIbuffer *buffer);
+
+   /**
+    * Create a context for a particular API with a set of attributes
+    *
+    * \since version 3
+    *
+    * \sa __DRIswrastExtensionRec::createContextAttribs
+    */
+   __DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
+                                         int api,
+                                         const __DRIconfig *config,
+                                         __DRIcontext *shared,
+                                         unsigned num_attribs,
+                                         const uint32_t *attribs,
+                                         unsigned *error,
+                                         void *loaderPrivate);
+};
+
+
+/**
+ * This extension provides functionality to enable various EGLImage
+ * extensions.
+ */
+#define __DRI_IMAGE &quot;DRI_IMAGE&quot;
+#define __DRI_IMAGE_VERSION 7
+
+/**
+ * These formats correspond to the similarly named MESA_FORMAT_*
+ * tokens, except in the native endian of the CPU.  For example, on
+ * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
+ * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
+ *
+ * __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
+ * by the driver (YUV planar formats) but serve as a base image for
+ * creating sub-images for the different planes within the image.
+ *
+ * R8, GR88 and NONE should not be used with createImageFormName or
+ * createImage, and are returned by query from sub images created with
+ * createImageFromNames (NONE, see above) and fromPlane (R8 &amp; GR88).
+ */
+#define __DRI_IMAGE_FORMAT_RGB565       0x1001
+#define __DRI_IMAGE_FORMAT_XRGB8888     0x1002
+#define __DRI_IMAGE_FORMAT_ARGB8888     0x1003
+#define __DRI_IMAGE_FORMAT_ABGR8888     0x1004
+#define __DRI_IMAGE_FORMAT_XBGR8888     0x1005
+#define __DRI_IMAGE_FORMAT_R8           0x1006 /* Since version 5 */
+#define __DRI_IMAGE_FORMAT_GR88         0x1007
+#define __DRI_IMAGE_FORMAT_NONE         0x1008
+
+#define __DRI_IMAGE_USE_SHARE                0x0001
+#define __DRI_IMAGE_USE_SCANOUT                0x0002
+#define __DRI_IMAGE_USE_CURSOR                0x0004 /* Depricated */
+
+
+/**
+ * Four CC formats that matches with WL_DRM_FORMAT_* from wayland_drm.h
+ * and GBM_FORMAT_* from gbm.h, used with createImageFromNames.
+ *
+ * \since 5
+ */
+
+#define __DRI_IMAGE_FOURCC_RGB565        0x36314752
+#define __DRI_IMAGE_FOURCC_ARGB8888        0x34325241
+#define __DRI_IMAGE_FOURCC_XRGB8888        0x34325258
+#define __DRI_IMAGE_FOURCC_ABGR8888        0x34324241
+#define __DRI_IMAGE_FOURCC_XBGR8888        0x34324258
+#define __DRI_IMAGE_FOURCC_YUV410        0x39565559
+#define __DRI_IMAGE_FOURCC_YUV411        0x31315559
+#define __DRI_IMAGE_FOURCC_YUV420        0x32315559
+#define __DRI_IMAGE_FOURCC_YUV422        0x36315559
+#define __DRI_IMAGE_FOURCC_YUV444        0x34325559
+#define __DRI_IMAGE_FOURCC_NV12                0x3231564e
+#define __DRI_IMAGE_FOURCC_NV16                0x3631564e
+#define __DRI_IMAGE_FOURCC_YUYV                0x56595559
+
+
+/**
+ * Queryable on images created by createImageFromNames.
+ *
+ * RGB and RGBA are may be usable directly as images but its still
+ * recommended to call fromPlanar with plane == 0.
+ *
+ * Y_U_V, Y_UV and Y_XUXV all requires call to fromPlanar to create
+ * usable sub-images, sampling from images return raw YUV data and
+ * color conversion needs to be done in the shader.
+ *
+ * \since 5
+ */
+
+#define __DRI_IMAGE_COMPONENTS_RGB        0x3001
+#define __DRI_IMAGE_COMPONENTS_RGBA        0x3002
+#define __DRI_IMAGE_COMPONENTS_Y_U_V        0x3003
+#define __DRI_IMAGE_COMPONENTS_Y_UV        0x3004
+#define __DRI_IMAGE_COMPONENTS_Y_XUXV        0x3005
+
+
+/**
+ * queryImage attributes
+ */
+
+#define __DRI_IMAGE_ATTRIB_STRIDE        0x2000
+#define __DRI_IMAGE_ATTRIB_HANDLE        0x2001
+#define __DRI_IMAGE_ATTRIB_NAME                0x2002
+#define __DRI_IMAGE_ATTRIB_FORMAT        0x2003 /* available in versions 3+ */
+#define __DRI_IMAGE_ATTRIB_WIDTH        0x2004 /* available in versions 4+ */
+#define __DRI_IMAGE_ATTRIB_HEIGHT        0x2005
+#define __DRI_IMAGE_ATTRIB_COMPONENTS        0x2006 /* available in versions 5+ */
+#define __DRI_IMAGE_ATTRIB_FD           0x2007 /* available in versions
+                                                * 7+. Each query will return a
+                                                * new fd. */
+
+/**
+ * \name Reasons that __DRIimageExtensionRec::createImageFromTexture might fail
+ */
+/*@{*/
+/** Success! */
+#define __DRI_IMAGE_ERROR_SUCCESS       0
+
+/** Memory allocation failure */
+#define __DRI_IMAGE_ERROR_BAD_ALLOC     1
+
+/** Client requested an invalid attribute for a texture object  */
+#define __DRI_IMAGE_ERROR_BAD_MATCH     2
+
+/** Client requested an invalid texture object */
+#define __DRI_IMAGE_ERROR_BAD_PARAMETER 3
+/*@}*/
+
+typedef struct __DRIimageRec          __DRIimage;
+typedef struct __DRIimageExtensionRec __DRIimageExtension;
+struct __DRIimageExtensionRec {
+    __DRIextension base;
+
+    __DRIimage *(*createImageFromName)(__DRIscreen *screen,
+                                       int width, int height, int format,
+                                       int name, int pitch,
+                                       void *loaderPrivate);
+
+    __DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
+                                               int renderbuffer,
+                                               void *loaderPrivate);
+
+    void (*destroyImage)(__DRIimage *image);
+
+    __DRIimage *(*createImage)(__DRIscreen *screen,
+                               int width, int height, int format,
+                               unsigned int use,
+                               void *loaderPrivate);
+
+   GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
+
+   /**
+    * The new __DRIimage will share the content with the old one, see dup(2).
+    */
+   __DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
+
+   /**
+    * Validate that a __DRIimage can be used a certain way.
+    *
+    * \since 2
+    */
+   GLboolean (*validateUsage)(__DRIimage *image, unsigned int use);
+
+   /**
+    * Unlike createImageFromName __DRI_IMAGE_FORMAT is not but instead
+    * __DRI_IMAGE_FOURCC and strides are in bytes not pixels. Stride is
+    * also per block and not per pixel (for non-RGB, see gallium blocks).
+    *
+    * \since 5
+    */
+   __DRIimage *(*createImageFromNames)(__DRIscreen *screen,
+                                       int width, int height, int fourcc,
+                                       int *names, int num_names,
+                                       int *strides, int *offsets,
+                                       void *loaderPrivate);
+
+   /**
+    * Create an image out of a sub-region of a parent image.  This
+    * entry point lets us create individual __DRIimages for different
+    * planes in a planar buffer (typically yuv), for example.  While a
+    * sub-image shares the underlying buffer object with the parent
+    * image and other sibling sub-images, the life times of parent and
+    * sub-images are not dependent.  Destroying the parent or a
+    * sub-image doesn't affect other images.  The underlying buffer
+    * object is free when no __DRIimage remains that references it.
+    *
+    * Sub-images may overlap, but rendering to overlapping sub-images
+    * is undefined.
+    *
+    * \since 5
+    */
+    __DRIimage *(*fromPlanar)(__DRIimage *image, int plane,
+                              void *loaderPrivate);
+
+    /**
+     * Create image from texture.
+     *
+     * \since 6
+     */
+   __DRIimage *(*createImageFromTexture)(__DRIcontext *context,
+                                         int target,
+                                         unsigned texture,
+                                         int depth,
+                                         int level,
+                                         unsigned *error,
+                                         void *loaderPrivate);
+   /**
+    * Like createImageFromNames, but takes a prime fd instead.
+    *
+    * \since 7
+    */
+   __DRIimage *(*createImageFromFds)(__DRIscreen *screen,
+                                     int width, int height, int fourcc,
+                                     int *fds, int num_fds,
+                                     int *strides, int *offsets,
+                                     void *loaderPrivate);
+};
+
+
+/**
+ * This extension must be implemented by the loader and passed to the
+ * driver at screen creation time.  The EGLImage entry points in the
+ * various client APIs take opaque EGLImage handles and use this
+ * extension to map them to a __DRIimage.  At version 1, this
+ * extensions allows mapping EGLImage pointers to __DRIimage pointers,
+ * but future versions could support other EGLImage-like, opaque types
+ * with new lookup functions.
+ */
+#define __DRI_IMAGE_LOOKUP &quot;DRI_IMAGE_LOOKUP&quot;
+#define __DRI_IMAGE_LOOKUP_VERSION 1
+
+typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
+struct __DRIimageLookupExtensionRec {
+    __DRIextension base;
+
+    __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
+                                  void *loaderPrivate);
+};
+
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY &quot;DRI_CONFIG_QUERY&quot;
+#define __DRI2_CONFIG_QUERY_VERSION 1
+
+typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
+struct __DRI2configQueryExtensionRec {
+   __DRIextension base;
+
+   int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
+   int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
+   int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
+};
+
+/**
+ * Robust context driver extension.
+ *
+ * Existence of this extension means the driver can accept the
+ * \c __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
+ * \c __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in
+ * \c __DRIdri2ExtensionRec::createContextAttribs.
+ */
+#define __DRI2_ROBUSTNESS &quot;DRI_Robustness&quot;
+#define __DRI2_ROBUSTNESS_VERSION 1
+
+typedef struct __DRIrobustnessExtensionRec __DRIrobustnessExtension;
+struct __DRIrobustnessExtensionRec {
+   __DRIextension base;
+};
+
</ins><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>