egl: Enable EGL_EXT_client_extensions
authorChad Versace <chad.versace@linux.intel.com>
Fri, 11 Oct 2013 23:04:55 +0000 (16:04 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 26 Nov 2013 20:50:29 +0000 (12:50 -0800)
Insert two fields into _egl_global to hold the client extensions and
statically initialize them:
    ClientExtensions // a struct of bools
    ClientExtensionString

Post-patch, Mesa supports exactly one client extension,
EGL_EXT_client_extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/egl/main/eglapi.c
src/egl/main/eglglobals.c
src/egl/main/eglglobals.h

index 2d8653f04cb174cf79c90aa0eb39617230ccddac..66f96de41408615921ac79961d0e312119d0a582 100644 (file)
@@ -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);
 
index f53f078d7109828cc2aa207b8ebdb3a006d37050..5c2fddfbf9ee9420c1df57d5f78373fcde2af405 100644 (file)
@@ -47,6 +47,14 @@ struct _egl_global _eglGlobal =
       _eglUnloadDrivers, /* always called last */
       _eglFiniDisplay
    },
+
+   /* ClientExtensions */
+   {
+      true /* EGL_EXT_client_extensions */
+   },
+
+   /* ClientExtensionsString */
+   "EGL_EXT_client_extensions"
 };
 
 
index b40e30e22515f2f18480e7f23618cf5ba4e5a400..63428f7f45a222137887dbd1a47c031060abf23c 100644 (file)
@@ -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;
+
+   const char *ClientExtensionString;
 };