summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-02 11:36:21 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-02 11:36:21 +0900
commitadc14650491fc3c20fc95b7e34e54a55fa50c05c (patch)
tree8938c5407723328d7d0cc9e3c4c7947a7ea5772a
parent6eb76b9eb962c5a10457bf52b78d810d9dc7d224 (diff)
clean up glx context code to remove legacy and avoid server segv
this cleans oyt a few bits o9f old glx context handling code that are no longer used as well as avoids causing server-side to crash on tryng to set a "none" glxwindow as current. this is what cases the nvidia server-side crashes.
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c11
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c12
2 files changed, 7 insertions, 16 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index a9f03eb146..31b5fa5abe 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -274,7 +274,7 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
274 ret = __glXMakeContextCurrent(eng_get_ob(re)->info->info.display, 0, NULL); 274 ret = __glXMakeContextCurrent(eng_get_ob(re)->info->info.display, 0, NULL);
275 if (!ret) 275 if (!ret)
276 { 276 {
277 ERR("glXMakeCurrent() failed!"); 277 ERR("glXMakeContextCurrent() failed!");
278 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY); 278 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY);
279 return 0; 279 return 0;
280 } 280 }
@@ -298,7 +298,8 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
298 sfc, ctx); 298 sfc, ctx);
299 if (!ret) 299 if (!ret)
300 { 300 {
301 ERR("glXMakeCurrent() failed. Ret: %d! Context: %p Surface: %p", ret, (void*)ctx, (void*)sfc); 301 ERR("glXMakeContextCurrent() failed. Ret: %d! Context: %p Surface: %p",
302 ret, (void *)ctx, (void *)sfc);
302 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY); 303 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY);
303 return 0; 304 return 0;
304 } 305 }
@@ -1572,7 +1573,8 @@ eng_preload_make_current(void *data, void *doit)
1572#else 1573#else
1573 if (!__glXMakeContextCurrent(ob->info->info.display, ob->glxwin, ob->context)) 1574 if (!__glXMakeContextCurrent(ob->info->info.display, ob->glxwin, ob->context))
1574 { 1575 {
1575 ERR("glXMakeCurrent(%p, 0x%x, %p) failed", ob->info->info.display, (unsigned int)ob->win, (void *)ob->context); 1576 ERR("glXMakeContextCurrent(%p, %p, %p) failed",
1577 ob->info->info.display, (void *)ob->win, (void *)ob->context);
1576 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 1578 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1577 return EINA_FALSE; 1579 return EINA_FALSE;
1578 } 1580 }
@@ -1586,7 +1588,8 @@ eng_preload_make_current(void *data, void *doit)
1586#else 1588#else
1587 if (!__glXMakeContextCurrent(ob->info->info.display, 0, NULL)) 1589 if (!__glXMakeContextCurrent(ob->info->info.display, 0, NULL))
1588 { 1590 {
1589 ERR("glXMakeCurrent(%p, None, NULL) failed", ob->info->info.display); 1591 ERR("glXMakeContextCurrent(%p, None, NULL) failed",
1592 ob->info->info.display);
1590 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 1593 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1591 return EINA_FALSE; 1594 return EINA_FALSE;
1592 } 1595 }
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 1fe24e6acf..0cf01f9abb 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -475,17 +475,10 @@ eng_window_free(Outbuf *gw)
475 _evas_gl_x11_rgba_vi = NULL; 475 _evas_gl_x11_rgba_vi = NULL;
476 } 476 }
477#else 477#else
478 if (!__glXMakeContextCurrent(gw->disp, 0, gw->context))
479 ERR("glXMakeContextCurrent() failed!");
480 glXDestroyWindow(gw->disp, gw->glxwin); 478 glXDestroyWindow(gw->disp, gw->glxwin);
481 if (ref == 0) 479 if (ref == 0)
482 { 480 {
483 GLXContext rgbactx = _tls_rgba_context_get(); 481 GLXContext rgbactx = _tls_rgba_context_get();
484 if (!gw->glxwin)
485 {
486 if (glXGetCurrentContext() == gw->context)
487 glXMakeCurrent(gw->disp, 0, NULL);
488 }
489 if (context) glXDestroyContext(gw->disp, context); 482 if (context) glXDestroyContext(gw->disp, context);
490 if (rgbactx) glXDestroyContext(gw->disp, rgbactx); 483 if (rgbactx) glXDestroyContext(gw->disp, rgbactx);
491 free(_evas_gl_x11_vi); 484 free(_evas_gl_x11_vi);
@@ -497,11 +490,6 @@ eng_window_free(Outbuf *gw)
497 _evas_gl_x11_vi = NULL; 490 _evas_gl_x11_vi = NULL;
498 _evas_gl_x11_rgba_vi = NULL; 491 _evas_gl_x11_rgba_vi = NULL;
499 } 492 }
500 else if (!gw->glxwin)
501 {
502 if (glXGetCurrentDrawable() == gw->win)
503 glXMakeCurrent(gw->disp, 0, gw->context);
504 }
505#endif 493#endif
506 free(gw); 494 free(gw);
507} 495}