diff options
author | marha <marha@users.sourceforge.net> | 2010-11-29 22:05:53 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-11-29 22:05:53 +0000 |
commit | fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7 (patch) | |
tree | fa1ba494685a71e28a096990a8707680c7cb378b /gl/internal/dri_interface.h | |
parent | ae340911c1ba1f98b418bd8f1a487fa4d79491b0 (diff) | |
parent | 6fda93be42ace9eeab0e82ceebb6798961c9105c (diff) | |
download | vcxsrv-fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7.tar.gz vcxsrv-fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7.tar.bz2 vcxsrv-fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7.zip |
svn merge ^/branches/released .
Diffstat (limited to 'gl/internal/dri_interface.h')
-rw-r--r-- | gl/internal/dri_interface.h | 109 |
1 files changed, 81 insertions, 28 deletions
diff --git a/gl/internal/dri_interface.h b/gl/internal/dri_interface.h index ea0139016..9f5d45a6b 100644 --- a/gl/internal/dri_interface.h +++ b/gl/internal/dri_interface.h @@ -41,7 +41,13 @@ #define DRI_INTERFACE_H /* For archs with no drm.h */ -#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__) && !defined(_MSC_VER) +#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(_MSC_VER) +#ifndef __NOT_HAVE_DRM_H +#define __NOT_HAVE_DRM_H +#endif +#endif + +#ifndef __NOT_HAVE_DRM_H #include <drm.h> #else typedef unsigned int drm_context_t; @@ -68,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; @@ -144,23 +149,6 @@ struct __DRIswapControlExtensionRec { }; /** - * 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. */ #define __DRI_FRAME_TRACKING "DRI_FrameTracking" @@ -412,15 +400,35 @@ struct __DRIswrastLoaderExtensionRec { * Put image to drawable */ void (*putImage)(__DRIdrawable *drawable, int op, - int x, int y, int width, int height, char *data, - void *loaderPrivate); + int x, int y, int width, int height, + char *data, void *loaderPrivate); /** - * Get image from drawable + * Get image from readable */ - void (*getImage)(__DRIdrawable *drawable, - int x, int y, int width, int height, char *data, - void *loaderPrivate); + void (*getImage)(__DRIdrawable *readable, + int x, int y, int width, int height, + 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; }; /** @@ -732,7 +740,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; @@ -751,6 +763,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); }; @@ -771,12 +791,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); @@ -786,8 +817,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 @@ -804,8 +843,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 |