egl: inline eglSwapInterval() fallback
[mesa.git] / src / egl / main / eglglobals.h
index 63428f7f45a222137887dbd1a47c031060abf23c..fc3b6bd62a775a3ed735cd15bae98aea3e5ec39f 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2008 VMware, Inc.
  * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
  * Copyright 2010-2011 LunarG, Inc.
  * All Rights Reserved.
 #define EGLGLOBALS_INCLUDED
 
 #include <stdbool.h>
+#include "c11/threads.h"
 
 #include "egltypedefs.h"
-#include "eglmutex.h"
 
+enum
+{
+    _EGL_DEBUG_BIT_CRITICAL = 0x1,
+    _EGL_DEBUG_BIT_ERROR = 0x2,
+    _EGL_DEBUG_BIT_WARN = 0x4,
+    _EGL_DEBUG_BIT_INFO = 0x8,
+};
 
 /**
  * Global library data
  */
 struct _egl_global
 {
-   _EGLMutex *Mutex;
+   mtx_t *Mutex;
 
    /* the list of all displays */
    _EGLDisplay *DisplayList;
 
+   _EGLDevice *DeviceList;
+
    EGLint NumAtExitCalls;
    void (*AtExitCalls[10])(void);
 
-   struct _egl_client_extensions {
-      bool EXT_client_extensions;
-   } ClientExtensions;
-
+   /*
+    * Under libglvnd, the client extension string has to be split into two
+    * strings, one for platform extensions, and one for everything else.
+    * For a non-glvnd build create a concatenated one.
+    */
+#if USE_LIBGLVND
+   const char *ClientOnlyExtensionString;
+   const char *PlatformExtensionString;
+#else
    const char *ClientExtensionString;
+#endif
+
+   EGLDEBUGPROCKHR debugCallback;
+   unsigned int debugTypesEnabled;
 };
 
 
@@ -64,5 +82,16 @@ extern struct _egl_global _eglGlobal;
 extern void
 _eglAddAtExitCall(void (*func)(void));
 
+static inline unsigned int DebugBitFromType(EGLenum type)
+{
+   assert(type >= EGL_DEBUG_MSG_CRITICAL_KHR && type <= EGL_DEBUG_MSG_INFO_KHR);
+   return (1 << (type - EGL_DEBUG_MSG_CRITICAL_KHR));
+}
+
+/**
+ * Perform validity checks on a generic pointer.
+ */
+extern EGLBoolean
+_eglPointerIsDereferencable(void *p);
 
 #endif /* EGLGLOBALS_INCLUDED */