summaryrefslogtreecommitdiff
path: root/src/egl/main/egldriver.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 14:50:33 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 14:50:33 -0600
commite3805cad0d15ed25ce8f6c5a1f1ea913e5d0986a (patch)
tree644f0a12d1142269f63fc541f6aa3d41ac255a6a /src/egl/main/egldriver.c
parent6b9b49127e575ecfae08a78b991e89cb484150a4 (diff)
egl: new eglGetProcAddress() code
The idea is to pass the call down to the device driver where an API-specific query can be made. Untested.
Diffstat (limited to 'src/egl/main/egldriver.c')
-rw-r--r--src/egl/main/egldriver.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index 681be47202..80fa49b7ab 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -30,8 +30,8 @@
#endif
-const char *DefaultDriverName = ":0";
-const char *SysFS = "/sys/class";
+static const char *DefaultDriverName = ":0";
+static const char *SysFS = "/sys/class";
@@ -72,6 +72,9 @@ _eglChooseDRMDriver(int card)
/**
+ * XXX this function is totally subject change!!!
+ *
+ *
* Determine/return the name of the driver to use for the given _EGLDisplay.
*
* Try to be clever and determine if nativeDisplay is an Xlib Display
@@ -92,6 +95,8 @@ _eglChooseDriver(_EGLDisplay *dpy)
const char *displayString = (const char *) dpy->NativeDisplay;
const char *driverName = NULL;
+ (void) DefaultDriverName;
+
/* First, if the EGL_DRIVER env var is set, use that */
driverName = getenv("EGL_DRIVER");
if (driverName)
@@ -139,6 +144,8 @@ _eglChooseDriver(_EGLDisplay *dpy)
driverName = _weglChooseDriver(dpy);
#elif defined(_EGL_PLATFORM_WINCE)
/* XXX to do */
+#else
+ driverName = DefaultDriverName;
#endif
}
@@ -195,6 +202,8 @@ _eglOpenDriver(_EGLDisplay *dpy, const char *driverName, const char *args)
/* update the global notion of supported APIs */
_eglGlobal.ClientAPIsMask |= drv->ClientAPIsMask;
+ _eglSaveDriver(drv);
+
return drv;
}
@@ -218,6 +227,16 @@ _eglCloseDriver(_EGLDriver *drv, EGLDisplay dpy)
/**
+ * Save the given driver pointer in the list of all known drivers.
+ */
+void
+_eglSaveDriver(_EGLDriver *drv)
+{
+ _eglGlobal.Drivers[ _eglGlobal.NumDrivers++ ] = drv;
+}
+
+
+/**
* Given a display handle, return the _EGLDriver for that display.
*/
_EGLDriver *