summaryrefslogtreecommitdiff
path: root/src/gallium/targets/egl/egl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets/egl/egl.c')
-rw-r--r--src/gallium/targets/egl/egl.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/gallium/targets/egl/egl.c b/src/gallium/targets/egl/egl.c
index 786d5d1105..61fe5069e9 100644
--- a/src/gallium/targets/egl/egl.c
+++ b/src/gallium/targets/egl/egl.c
@@ -100,9 +100,14 @@ load_st_module(struct st_module *stmod,
{
struct st_api *(*create_api)(void);
- _eglLog(_EGL_DEBUG, "searching for st module %s", name);
+ if (name) {
+ _eglLog(_EGL_DEBUG, "searching for st module %s", name);
+ stmod->name = loader_strdup(name);
+ }
+ else {
+ stmod->name = NULL;
+ }
- stmod->name = loader_strdup(name);
if (stmod->name)
_eglSearchPathForEach(dlopen_st_module_cb, (void *) stmod);
else
@@ -200,19 +205,7 @@ get_st_api_full(enum st_api_type api, enum st_profile_type profile)
switch (api) {
case ST_API_OPENGL:
symbol = ST_CREATE_OPENGL_SYMBOL;
- switch (profile) {
- case ST_PROFILE_OPENGL_ES1:
- names[count++] = "GLESv1_CM";
- names[count++] = "GL";
- break;
- case ST_PROFILE_OPENGL_ES2:
- names[count++] = "GLESv2";
- names[count++] = "GL";
- break;
- default:
- names[count++] = "GL";
- break;
- }
+ names[count++] = "GL";
break;
case ST_API_OPENVG:
symbol = ST_CREATE_OPENVG_SYMBOL;
@@ -232,6 +225,21 @@ get_st_api_full(enum st_api_type api, enum st_profile_type profile)
break;
}
+ /* try again with libGL.so loaded */
+ if (!stmod->stapi && api == ST_API_OPENGL) {
+ struct util_dl_library *glapi = util_dl_open("libGL" UTIL_DL_EXT);
+
+ if (glapi) {
+ _eglLog(_EGL_DEBUG, "retry with libGL" UTIL_DL_EXT " loaded");
+ /* skip the last name (which is NULL) */
+ for (i = 0; i < count - 1; i++) {
+ if (load_st_module(stmod, names[i], symbol))
+ break;
+ }
+ util_dl_close(glapi);
+ }
+ }
+
if (!stmod->stapi) {
EGLint level = (egl_g3d_loader.profile_masks[api]) ?
_EGL_WARNING : _EGL_DEBUG;