diff options
author | Alan Hourihane <[email protected]> | 2008-09-26 12:18:16 +0100 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2008-09-26 12:18:16 +0100 |
commit | 192f45606a7c388862112b8d53a5983fb125fee3 (patch) | |
tree | 72b06da653eb375f40ec281e9d41ebbeceadd218 /src/egl/drivers/glx | |
parent | 8015f3ae3b96d93e8b1338b8254bcbead45bb91a (diff) |
egl: fudge with LIBGL_DRIVERS_PATH to pick up EGL specific DRI driver.
Diffstat (limited to 'src/egl/drivers/glx')
-rw-r--r-- | src/egl/drivers/glx/egl_glx.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 4274493a5b5..732d15cf115 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -545,6 +545,8 @@ _EGLDriver * _eglMain(_EGLDisplay *disp, const char *args) { struct GLX_egl_driver *GLX_drv = CALLOC_STRUCT(GLX_egl_driver); + char *env; + if (!GLX_drv) return NULL; @@ -565,10 +567,17 @@ _eglMain(_EGLDisplay *disp, const char *args) _eglLog(_EGL_DEBUG, "GLX: main(%s)", args); - /* set new DRI path to pick up EGL version (no mesa code), but don't - * override if one is already set. + /* set new DRI path to pick up EGL version (which doesn't contain any mesa + * code), but don't override if one is already set. */ - setenv("LIBGL_DRIVERS_PATH", DEFAULT_DRIVER_DIR"/egl", 0); + env = getenv("LIBGL_DRIVERS_PATH"); + if (env) { + if (!strstr(env, "egl")) { + sprintf(env, "%s/egl", env); + setenv("LIBGL_DRIVERS_PATH", env, 1); + } + } else + setenv("LIBGL_DRIVERS_PATH", DEFAULT_DRIVER_DIR"/egl", 0); return &GLX_drv->Base; } |