Summary:
Without EGL_PLATFORM environment variable, eglInitialize() can be
failed because egl tried to load DRM platform instead of X11 platform and it
tried to handle XDisplay pointer as a gbm_device pointer as well.
The failure seems to be occured especially if the egl was built
with DRM platform as native platform.
This revision can prevent the failure by indicating proper egl platform using
EGL_PLATFORM environment variable, and additionally it will unset
EGL_PLATFORM environment value when the engine free its info.
@fix
Reviewers: gwanglim, seoz, jaehwan, cedric, raster
Subscribers: raster, cedric
Differential Revision: https://phab.enlightenment.org/D1844
module_open(Evas_Module *em)
{
static Eina_Bool xrm_inited = EINA_FALSE;
+ const char *platform_env = NULL;
if (!xrm_inited)
{
xrm_inited = EINA_TRUE;
// gl_current_surface_get is in gl generic
ORD(gl_current_context_get);
+ if (!(platform_env = getenv("EGL_PLATFORM")))
+ setenv("EGL_PLATFORM", "x11", 0);
+
gl_symbols();
+ if (!platform_env)
+ unsetenv("EGL_PLATFORM");
+
/* now advertise out own api */
em->functions = (void *)(&func);
return 1;