diff options
author | Chia-I Wu <[email protected]> | 2011-01-12 17:49:43 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-01-12 18:10:15 +0800 |
commit | 1e4f412242391000eea3fd28452865c3d27f987d (patch) | |
tree | 2d724bca9ececcdda7626da228e5ac3a72652521 /src/egl/main | |
parent | 4924cb9036cfe0f435a4a09db6f86d59a3a132d8 (diff) |
egl: When EGL_DRIVER is set, do not add other drivers.
Setting EGL_DRIVER forces the driver to be loaded, as documented. There
should be no fallbacks.
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/egldriver.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index b7c3de3e38e..0f2e40abf57 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -432,7 +432,7 @@ _eglGetSearchPath(void) * * The user driver is specified by EGL_DRIVER. */ -static void +static EGLBoolean _eglAddUserDriver(void) { const char *search_path = _eglGetSearchPath(); @@ -463,7 +463,11 @@ _eglAddUserDriver(void) mod->BuiltIn = _eglBuiltInDrivers[i].main; } } + + return EGL_TRUE; } + + return EGL_FALSE; } @@ -507,10 +511,14 @@ _eglAddDrivers(void) if (_eglModules) return EGL_TRUE; - /* the order here decides the priorities of the drivers */ - _eglAddUserDriver(); - _eglAddGalliumDriver(); - _eglAddBuiltInDrivers(); + if (!_eglAddUserDriver()) { + /* + * Add other drivers only when EGL_DRIVER is not set. The order here + * decides the priorities. + */ + _eglAddGalliumDriver(); + _eglAddBuiltInDrivers(); + } return (_eglModules != NULL); } @@ -535,6 +543,7 @@ _eglMatchDriver(_EGLDisplay *dpy, EGLBoolean use_probe) if (!_eglAddDrivers()) { _eglUnlockMutex(&_eglModuleMutex); + _eglLog(_EGL_WARNING, "failed to find any driver"); return EGL_FALSE; } |