From: Brian Paul Date: Fri, 30 May 2008 17:46:43 +0000 (-0600) Subject: egl: check for EGL_DRIVER env var to override normal driver selection process X-Git-Tag: 062012170305~17580^2~390^2~1431 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=834aa8cfbc25622256889624ee1768c10224feb2;p=profile%2Fivi%2Fmesa.git egl: check for EGL_DRIVER env var to override normal driver selection process --- 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);