From: Alan Hourihane Date: Fri, 26 Sep 2008 11:18:16 +0000 (+0100) Subject: egl: fudge with LIBGL_DRIVERS_PATH to pick up EGL specific DRI driver. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=192f45606a7c388862112b8d53a5983fb125fee3;p=mesa.git egl: fudge with LIBGL_DRIVERS_PATH to pick up EGL specific DRI driver. --- 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; }