Get rid of GL/internal/glcore.h
[mesa.git] / include / GL / internal / dri_interface.h
index fa9b7c4bf2197ad09e6bbfd6c292e1cc8d1bcd0f..9ee039bd90b17ce7b623444c7db93096544f23b0 100644 (file)
@@ -74,7 +74,6 @@ typedef struct __DRIcoreExtensionRec          __DRIcoreExtension;
 typedef struct __DRIextensionRec               __DRIextension;
 typedef struct __DRIcopySubBufferExtensionRec  __DRIcopySubBufferExtension;
 typedef struct __DRIswapControlExtensionRec    __DRIswapControlExtension;
-typedef struct __DRIallocateExtensionRec       __DRIallocateExtension;
 typedef struct __DRIframeTrackingExtensionRec  __DRIframeTrackingExtension;
 typedef struct __DRImediaStreamCounterExtensionRec     __DRImediaStreamCounterExtension;
 typedef struct __DRItexOffsetExtensionRec      __DRItexOffsetExtension;
@@ -149,23 +148,6 @@ struct __DRIswapControlExtensionRec {
     unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
 };
 
-/**
- * Used by drivers that implement the GLX_MESA_allocate_memory.
- */
-#define __DRI_ALLOCATE "DRI_Allocate"
-#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);
-};
-
 /**
  * Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
  */
@@ -427,6 +409,26 @@ struct __DRIswrastLoaderExtensionRec {
                     char *data, void *loaderPrivate);
 };
 
+/**
+ * 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 "DRI_UseInvalidate"
+#define __DRI_USE_INVALIDATE_VERSION 1
+
+typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
+struct __DRIuseInvalidateExtensionRec {
+   __DRIextension base;
+};
+
 /**
  * The remaining extensions describe driver extensions, immediately
  * available interfaces provided by the driver.  To start using the
@@ -736,7 +738,11 @@ struct __DRIdri2LoaderExtensionRec {
  * constructors for DRI2.
  */
 #define __DRI_DRI2 "DRI_DRI2"
-#define __DRI_DRI2_VERSION 1
+#define __DRI_DRI2_VERSION 2
+
+#define __DRI_API_OPENGL       0
+#define __DRI_API_GLES         1
+#define __DRI_API_GLES2                2
 
 struct __DRIdri2ExtensionRec {
     __DRIextension base;
@@ -755,6 +761,14 @@ struct __DRIdri2ExtensionRec {
                                      __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);
 };
 
 
@@ -775,12 +789,23 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_FORMAT_XRGB8888     0x1002
 #define __DRI_IMAGE_FORMAT_ARGB8888     0x1003
 
+#define __DRI_IMAGE_USE_SHARE          0x0001
+#define __DRI_IMAGE_USE_SCANOUT                0x0002
+
+/**
+ * queryImage attributes
+ */
+
+#define __DRI_IMAGE_ATTRIB_STRIDE      0x2000
+#define __DRI_IMAGE_ATTRIB_HANDLE      0x2001
+#define __DRI_IMAGE_ATTRIB_NAME                0x2002
+
 typedef struct __DRIimageRec          __DRIimage;
 typedef struct __DRIimageExtensionRec __DRIimageExtension;
 struct __DRIimageExtensionRec {
     __DRIextension base;
 
-    __DRIimage *(*createImageFromName)(__DRIcontext *context,
+    __DRIimage *(*createImageFromName)(__DRIscreen *screen,
                                       int width, int height, int format,
                                       int name, int pitch,
                                       void *loaderPrivate);
@@ -790,8 +815,16 @@ struct __DRIimageExtensionRec {
                                               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);
 };
 
+
 /**
  * This extension must be implemented by the loader and passed to the
  * driver at screen creation time.  The EGLImage entry points in the
@@ -808,8 +841,22 @@ typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
 struct __DRIimageLookupExtensionRec {
     __DRIextension base;
 
-    __DRIimage *(*lookupEGLImage)(__DRIcontext *context, void *image,
+    __DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
                                  void *loaderPrivate);
 };
 
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
+#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);
+};
 #endif