forked from enlightenment/efl
evas/gl_x11: set EGL_PLATFORM environment variable
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
This commit is contained in:
parent
3cd2801be7
commit
c964c72366
|
@ -2727,6 +2727,7 @@ static int
|
||||||
module_open(Evas_Module *em)
|
module_open(Evas_Module *em)
|
||||||
{
|
{
|
||||||
static Eina_Bool xrm_inited = EINA_FALSE;
|
static Eina_Bool xrm_inited = EINA_FALSE;
|
||||||
|
const char *platform_env = NULL;
|
||||||
if (!xrm_inited)
|
if (!xrm_inited)
|
||||||
{
|
{
|
||||||
xrm_inited = EINA_TRUE;
|
xrm_inited = EINA_TRUE;
|
||||||
|
@ -2767,8 +2768,14 @@ module_open(Evas_Module *em)
|
||||||
// gl_current_surface_get is in gl generic
|
// gl_current_surface_get is in gl generic
|
||||||
ORD(gl_current_context_get);
|
ORD(gl_current_context_get);
|
||||||
|
|
||||||
|
if (!(platform_env = getenv("EGL_PLATFORM")))
|
||||||
|
setenv("EGL_PLATFORM", "x11", 0);
|
||||||
|
|
||||||
gl_symbols();
|
gl_symbols();
|
||||||
|
|
||||||
|
if (!platform_env)
|
||||||
|
unsetenv("EGL_PLATFORM");
|
||||||
|
|
||||||
/* now advertise out own api */
|
/* now advertise out own api */
|
||||||
em->functions = (void *)(&func);
|
em->functions = (void *)(&func);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue