summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 11:46:43 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-30 11:47:09 -0600
commit834aa8cfbc25622256889624ee1768c10224feb2 (patch)
treee442b70d88d439915b2f7b0f8e75de1de7e40e80 /src/egl/main
parent80ed996803cf198cc498f1b9cc952ab2662c946f (diff)
downloadexternal_mesa3d-834aa8cfbc25622256889624ee1768c10224feb2.zip
external_mesa3d-834aa8cfbc25622256889624ee1768c10224feb2.tar.gz
external_mesa3d-834aa8cfbc25622256889624ee1768c10224feb2.tar.bz2
egl: check for EGL_DRIVER env var to override normal driver selection process
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/egldriver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index 3284293..e155f5f 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -92,14 +92,21 @@ _eglChooseDriver(_EGLDisplay *dpy)
const char *displayString = (const char *) dpy->NativeDisplay;
const char *driverName = NULL;
+ /* First, if the EGL_DRIVER env var is set, use that */
+ driverName = getenv("EGL_DRIVER");
+ if (driverName)
+ return _eglstrdup(driverName);
+
+
if (!displayString) {
/* choose a default */
displayString = DefaultDriverName;
}
/* extract default DriverArgs = whatever follows ':' */
- if (displayString[0] == '!' ||
- displayString[0] == ':') {
+ if (displayString &&
+ (displayString[0] == '!' ||
+ displayString[0] == ':')) {
const char *args = strchr(displayString, ':');
if (args)
dpy->DriverArgs = _eglstrdup(args + 1);