[Mesa-dev] [PATCH 2/2] egl: Enable EGL_EXT_client_extensions
Ian Romanick
idr at freedesktop.org
Wed Nov 20 11:39:42 PST 2013
On 10/11/2013 07:08 PM, Chad Versace wrote:
> Insert two fields into _egl_global to hold the client extensions:
>
> _egl_global::ClientExtensions /*struct of bools*/
> _egl_global::ClientExtensionString
>
> Post-patch, Mesa supports exactly one client extension,
> EGL_EXT_client_extensions. So let's keep things simple by statically
> initializing the _egl_global::ClientExtension* fields.
>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
> src/egl/main/eglapi.c | 8 +++++++-
> src/egl/main/eglglobals.c | 7 +++++++
> src/egl/main/eglglobals.h | 7 +++++++
> 3 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
> index 2d8653f..66f96de 100644
> --- a/src/egl/main/eglapi.c
> +++ b/src/egl/main/eglapi.c
> @@ -87,6 +87,7 @@
> #include <stdlib.h>
> #include <string.h>
>
> +#include "eglglobals.h"
> #include "eglcontext.h"
> #include "egldisplay.h"
> #include "egltypedefs.h"
> @@ -354,10 +355,15 @@ eglTerminate(EGLDisplay dpy)
> const char * EGLAPIENTRY
> eglQueryString(EGLDisplay dpy, EGLint name)
> {
> - _EGLDisplay *disp = _eglLockDisplay(dpy);
> + _EGLDisplay *disp;
> _EGLDriver *drv;
> const char *ret;
>
> + if (dpy == EGL_NO_DISPLAY && name == EGL_EXTENSIONS) {
> + RETURN_EGL_SUCCESS(NULL, _eglGlobal.ClientExtensionString);
> + }
> +
> + disp = _eglLockDisplay(dpy);
> _EGL_CHECK_DISPLAY(disp, NULL, drv);
> ret = drv->API.QueryString(drv, disp, name);
>
> diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
> index c39b2ce..a75a90b 100644
> --- a/src/egl/main/eglglobals.c
> +++ b/src/egl/main/eglglobals.c
> @@ -48,6 +48,13 @@ struct _egl_global _eglGlobal =
> _eglUnloadDrivers, /* always called last */
> _eglFiniDisplay
> },
> +
> + /* ClientExtensions */
> + {
> + true /* EGL_EXT_client_extensions */
> + },
> +
> + "EGL_EXT_client_extensions" /* ClientExtensionsString */
> };
>
>
> diff --git a/src/egl/main/eglglobals.h b/src/egl/main/eglglobals.h
> index b40e30e..63428f7 100644
> --- a/src/egl/main/eglglobals.h
> +++ b/src/egl/main/eglglobals.h
> @@ -31,6 +31,7 @@
> #ifndef EGLGLOBALS_INCLUDED
> #define EGLGLOBALS_INCLUDED
>
> +#include <stdbool.h>
>
> #include "egltypedefs.h"
> #include "eglmutex.h"
> @@ -48,6 +49,12 @@ struct _egl_global
>
> EGLint NumAtExitCalls;
> void (*AtExitCalls[10])(void);
> +
> + struct _egl_client_extensions {
> + bool EXT_client_extensions;
> + } ClientExtensions;
This field is never used... do we actually need it?
> +
> + const char *ClientExtensionString;
> };
>
>
More information about the mesa-dev
mailing list