summaryrefslogtreecommitdiff
path: root/src
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 /src
parent444ab8fb175d2387513efb5256cc4c3bd4844702 (diff)
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 T3030 @fix
Diffstat (limited to 'src')
-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)
1330} 1330}
1331 1331
1332void 1332void
1333eng_gl_symbols(void) 1333eng_gl_symbols(Eina_Bool noext_glXCreatePixmap)
1334{ 1334{
1335 static int done = 0; 1335 static int done = 0;
1336 1336
1337 if (done) return; 1337 if (done) return;
1338 1338
1339#ifdef GL_GLES 1339#ifdef GL_GLES
1340 (void) noext_glXCreatePixmap;
1341
1340#define FINDSYM(dst, sym, typ) \ 1342#define FINDSYM(dst, sym, typ) \
1341 if (glsym_eglGetProcAddress) { \ 1343 if (glsym_eglGetProcAddress) { \
1342 if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \ 1344 if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \
@@ -1374,6 +1376,16 @@ eng_gl_symbols(void)
1374 1376
1375 glsym_evas_gl_symbols((void*)glsym_glXGetProcAddress); 1377 glsym_evas_gl_symbols((void*)glsym_glXGetProcAddress);
1376 1378
1379 if (noext_glXCreatePixmap)
1380 {
1381 /* Note for nvidia >= 360:
1382 * glXBindTexImage{EXT,ARB} should be preferred over glXBindTexImage
1383 * glXCreatePixmap should be preferred over glXCreatePixmap{EXT,ARB}
1384 */
1385 FINDSYM(glsym_glXCreatePixmap, "glXCreatePixmap", glsym_func_xid);
1386 FINDSYM(glsym_glXDestroyPixmap, "glXDestroyPixmap", glsym_func_void);
1387 }
1388
1377 FINDSYM(glsym_glXBindTexImage, "glXBindTexImageEXT", glsym_func_void); 1389 FINDSYM(glsym_glXBindTexImage, "glXBindTexImageEXT", glsym_func_void);
1378 FINDSYM(glsym_glXBindTexImage, "glXBindTexImageARB", glsym_func_void); 1390 FINDSYM(glsym_glXBindTexImage, "glXBindTexImageARB", glsym_func_void);
1379 FINDSYM(glsym_glXBindTexImage, "glXBindTexImage", glsym_func_void); 1391 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
76 unsigned char msaa; 76 unsigned char msaa;
77#ifndef GL_GLES 77#ifndef GL_GLES
78 Eina_Bool loose_binding : 1; 78 Eina_Bool loose_binding : 1;
79 Eina_Bool noext_glXCreatePixmap : 1;
79#endif 80#endif
80 } detected; 81 } detected;
81 82
@@ -199,7 +200,7 @@ Evas_Engine_GL_Context *eng_outbuf_gl_context_get(Outbuf *ob);
199void *eng_outbuf_egl_display_get(Outbuf *ob); 200void *eng_outbuf_egl_display_get(Outbuf *ob);
200 201
201Eina_Bool eng_preload_make_current(void *data, void *doit); 202Eina_Bool eng_preload_make_current(void *data, void *doit);
202void eng_gl_symbols(void); 203void eng_gl_symbols(Eina_Bool noext_glXCreatePixmap);
203 204
204static inline int 205static inline int
205_re_wincheck(Outbuf *ob) 206_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:
542 // ALSO as of some nvidia driver version loose binding is 542 // ALSO as of some nvidia driver version loose binding is
543 // probably not needed 543 // probably not needed
544 if (v1 < 195) gw->detected.loose_binding = 1; 544 if (v1 < 195) gw->detected.loose_binding = 1;
545 if (v1 >= 360) gw->detected.noext_glXCreatePixmap = 1;
545 } 546 }
546 } 547 }
547 else 548 else
@@ -557,7 +558,7 @@ try_gles2:
557 gw->detected.msaa = val; 558 gw->detected.msaa = val;
558#endif 559#endif
559 560
560 eng_gl_symbols(); 561 eng_gl_symbols(gw->detected.noext_glXCreatePixmap);
561 gw->gl_context = glsym_evas_gl_common_context_new(); 562 gw->gl_context = glsym_evas_gl_common_context_new();
562 if (!gw->gl_context) 563 if (!gw->gl_context)
563 { 564 {