raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=adc14650491fc3c20fc95b7e34e54a55fa50c05c

commit adc14650491fc3c20fc95b7e34e54a55fa50c05c
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Nov 2 11:36:21 2014 +0900

    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.
---
 src/modules/evas/engines/gl_x11/evas_engine.c | 11 +++++++----
 src/modules/evas/engines/gl_x11/evas_x_main.c | 12 ------------
 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 a9f03eb..31b5fa5 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)
         ret = __glXMakeContextCurrent(eng_get_ob(re)->info->info.display, 0, 
NULL);
         if (!ret)
           {
-             ERR("glXMakeCurrent() failed!");
+             ERR("glXMakeContextCurrent() failed!");
              glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY);
              return 0;
           }
@@ -298,7 +298,8 @@ evgl_eng_make_current(void *data, void *surface, void 
*context, int flush)
                                         sfc, ctx);
         if (!ret)
           {
-             ERR("glXMakeCurrent() failed. Ret: %d! Context: %p Surface: %p", 
ret, (void*)ctx, (void*)sfc);
+             ERR("glXMakeContextCurrent() failed. Ret: %d! Context: %p 
Surface: %p",
+                 ret, (void *)ctx, (void *)sfc);
              glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY);
              return 0;
           }
@@ -1572,7 +1573,8 @@ eng_preload_make_current(void *data, void *doit)
 #else
         if (!__glXMakeContextCurrent(ob->info->info.display, ob->glxwin, 
ob->context))
           {
-             ERR("glXMakeCurrent(%p, 0x%x, %p) failed", 
ob->info->info.display, (unsigned int)ob->win, (void *)ob->context);
+             ERR("glXMakeContextCurrent(%p, %p, %p) failed",
+                 ob->info->info.display, (void *)ob->win, (void *)ob->context);
              GLERR(__FUNCTION__, __FILE__, __LINE__, "");
              return EINA_FALSE;
           }
@@ -1586,7 +1588,8 @@ eng_preload_make_current(void *data, void *doit)
 #else
         if (!__glXMakeContextCurrent(ob->info->info.display, 0, NULL))
           {
-             ERR("glXMakeCurrent(%p, None, NULL) failed", 
ob->info->info.display);
+             ERR("glXMakeContextCurrent(%p, None, NULL) failed",
+                 ob->info->info.display);
              GLERR(__FUNCTION__, __FILE__, __LINE__, "");
              return EINA_FALSE;
           }
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 1fe24e6..0cf01f9 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)
         _evas_gl_x11_rgba_vi = NULL;
      }
 #else
-   if (!__glXMakeContextCurrent(gw->disp, 0, gw->context))
-     ERR("glXMakeContextCurrent() failed!");
    glXDestroyWindow(gw->disp, gw->glxwin);
    if (ref == 0)
      {
         GLXContext rgbactx = _tls_rgba_context_get();
-        if (!gw->glxwin)
-          {
-             if (glXGetCurrentContext() == gw->context)
-               glXMakeCurrent(gw->disp, 0, NULL);
-          }
         if (context) glXDestroyContext(gw->disp, context);
         if (rgbactx) glXDestroyContext(gw->disp, rgbactx);
         free(_evas_gl_x11_vi);
@@ -497,11 +490,6 @@ eng_window_free(Outbuf *gw)
         _evas_gl_x11_vi = NULL;
         _evas_gl_x11_rgba_vi = NULL;
      }
-   else if (!gw->glxwin)
-     {
-        if (glXGetCurrentDrawable() == gw->win)
-          glXMakeCurrent(gw->disp, 0, gw->context);
-     }
 #endif
    free(gw);
 }

-- 


Reply via email to