jpeg pushed a commit to branch master.

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

commit 38aa72d1394402f76e71ea51e3a94c19d34d0178
Author: Jean-Philippe Andre <[email protected]>
Date:   Mon Sep 22 16:23:52 2014 +0900

    Evas GL: Fix sigsegv with recent Nvidia EGL driver
    
    Welp, glGetString() crashes if called before eglInit... And this
    piece of code is now useless because "safe native" mode is not
    used anymore (safe_native is never read).
    
    Remove all safe native-related code.
---
 src/modules/evas/engines/gl_x11/evas_engine.c      | 19 -------------------
 src/modules/evas/engines/gl_x11/evas_x_main.c      | 13 -------------
 src/modules/evas/engines/wayland_egl/evas_engine.c | 18 ------------------
 3 files changed, 50 deletions(-)

diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c 
b/src/modules/evas/engines/gl_x11/evas_engine.c
index 0fe42b7..73905c0 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -22,8 +22,6 @@
 
 #define EVAS_GL_UPDATE_TILE_SIZE 16
 
-static int safe_native = -1;
-
 typedef struct _Render_Engine               Render_Engine;
 
 struct _Render_Engine
@@ -1073,23 +1071,6 @@ eng_setup(Evas *eo_e, void *in)
           }
      }
 
-   if (safe_native == -1)
-     {
-        s = getenv("EVAS_GL_SAFE_NATIVE");
-        safe_native = 0;
-        if (s) safe_native = atoi(s);
-        else
-          {
-             s = (const char *)glGetString(GL_RENDERER);
-             if (s)
-               {
-                  if (strstr(s, "PowerVR SGX 540") ||
-                      strstr(s, "Mali-400 MP"))
-                    safe_native = 1;
-               }
-          }
-     }
-
    // Set this env var to dump files every frame
    // Or set the global var in gdb to 1|0 to turn it on and off
    if (getenv("EVAS_GL_SWAP_BUFFER_DEBUG_ALWAYS"))
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 e06e21f..7530f1d 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -1174,19 +1174,6 @@ eng_outbuf_push_updated_region(Outbuf *ob, RGBA_Image 
*update EINA_UNUSED,
    if (!_re_wincheck(ob)) return;
    ob->draw.drew = 1;
    glsym_evas_gl_common_context_flush(ob->gl_context);
-#ifdef GL_GLES
-   // this is needed to make sure all previous rendering is flushed to
-   // buffers/surfaces
-   // previous rendering should be done and swapped
-//xx   if (!safe_native) eglWaitNative(EGL_CORE_NATIVE_ENGINE);
-//   if (eglGetError() != EGL_SUCCESS)
-//     {
-//        printf("Error:  eglWaitNative(EGL_CORE_NATIVE_ENGINE) fail.\n");
-//     }
-#else
-   // previous rendering should be done and swapped
-//xx   if (!safe_native) glXWaitX();
-#endif
 }
 
 void
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c 
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 6e5b971..1e33f80 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -76,7 +76,6 @@ void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b)  
= NULL;
 unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const 
EGLint *d, EGLint c) = NULL;
 
 /* local variables */
-static int safe_native = -1;
 static Eina_Bool initted = EINA_FALSE;
 static int gl_wins = 0;
 static Evas_Func func, pfunc;
@@ -565,23 +564,6 @@ eng_setup(Evas *evas, void *info)
           }
      }
 
-   if (safe_native == -1)
-     {
-        s = getenv("EVAS_GL_SAFE_NATIVE");
-        safe_native = 0;
-        if (s) safe_native = atoi(s);
-        else
-          {
-             s = (const char *)glGetString(GL_RENDERER);
-             if (s)
-               {
-                  if (strstr(s, "PowerVR SGX 540") ||
-                      strstr(s, "Mali-400 MP"))
-                    safe_native = 1;
-               }
-          }
-     }
-
    if (!(re = epd->engine.data.output))
      {
         Render_Engine_Merge_Mode merge = MERGE_BOUNDING;

-- 


Reply via email to