aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-03 16:32:39 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-03 17:32:14 +0900
commit19eb7b727fbf35620a13fb65b50d3056a484360e (patch)
tree4b4e5c6437c0432d8a08bdeecf4471fb85c6defa
parentgl_x11: Minor code refactor around eglCreateImage (diff)
downloadefl-19eb7b727fbf35620a13fb65b50d3.tar.gz
glx: Fix black windows in E on nvidia
This fixes calls to glXCreatePixmap that would consistently fail on nvidia >= 360. It seems glXCreatePixmapEXT was used instead of glXCreatePixmap, and that function always returned 0. One could assume always using the non-EXT version of the function should be preferred. Unfortunately, doing so for all the other functions brings back the black windows. I'm taking a very careful approach by doing this only for drivers >= 360. Fixes https://phab.enlightenment.org/T3030 @fix
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c14
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.h3
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c3
3 files changed, 17 insertions, 3 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 7a9f943a55..f5d783dbe8 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1330,13 +1330,15 @@ gl_symbols(void)
}
void
-eng_gl_symbols(void)
+eng_gl_symbols(Eina_Bool noext_glXCreatePixmap)
{
static int done = 0;
if (done) return;
#ifdef GL_GLES
+ (void) noext_glXCreatePixmap;
+
#define FINDSYM(dst, sym, typ) \
if (glsym_eglGetProcAddress) { \
if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \
@@ -1374,6 +1376,16 @@ eng_gl_symbols(void)
glsym_evas_gl_symbols((void*)glsym_glXGetProcAddress);
+ if (noext_glXCreatePixmap)
+ {
+ /* Note for nvidia >= 360:
+ * glXBindTexImage{EXT,ARB} should be preferred over glXBindTexImage
+ * glXCreatePixmap should be preferred over glXCreatePixmap{EXT,ARB}
+ */
+ FINDSYM(glsym_glXCreatePixmap, "glXCreatePixmap", glsym_func_xid);
+ FINDSYM(glsym_glXDestroyPixmap, "glXDestroyPixmap", glsym_func_void);
+ }
+
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageEXT", glsym_func_void);
FINDSYM(glsym_glXBindTexImage, "glXBindTexImageARB", glsym_func_void);
FINDSYM(glsym_glXBindTexImage, "glXBindTexImage", glsym_func_void);
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.h b/src/modules/evas/engines/gl_x11/evas_engine.h
index f84313b16f..5ecdd594a4 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.h
+++ b/src/modules/evas/engines/gl_x11/evas_engine.h
@@ -76,6 +76,7 @@ struct _Outbuf
unsigned char msaa;
#ifndef GL_GLES
Eina_Bool loose_binding : 1;
+ Eina_Bool noext_glXCreatePixmap : 1;
#endif
} detected;
@@ -199,7 +200,7 @@ Evas_Engine_GL_Context *eng_outbuf_gl_context_get(Outbuf *ob);
void *eng_outbuf_egl_display_get(Outbuf *ob);
Eina_Bool eng_preload_make_current(void *data, void *doit);
-void eng_gl_symbols(void);
+void eng_gl_symbols(Eina_Bool noext_glXCreatePixmap);
static inline int
_re_wincheck(Outbuf *ob)
diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c
index f5e2edf7ce..9e03851538 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -542,6 +542,7 @@ try_gles2:
// ALSO as of some nvidia driver version loose binding is
// probably not needed
if (v1 < 195) gw->detected.loose_binding = 1;
+ if (v1 >= 360) gw->detected.noext_glXCreatePixmap = 1;
}
}
else
@@ -557,7 +558,7 @@ try_gles2:
gw->detected.msaa = val;
#endif
- eng_gl_symbols();
+ eng_gl_symbols(gw->detected.noext_glXCreatePixmap);
gw->gl_context = glsym_evas_gl_common_context_new();
if (!gw->gl_context)
{