forked from enlightenment/efl
evas/gl_drm: Fix compilation with mesa 10.6.3 on Debian
Thanks @aerodynamik for the report. Fixes T2616
This commit is contained in:
parent
8f9eb82991
commit
8310b0dec7
|
@ -5,6 +5,11 @@ static Outbuf *_evas_gl_drm_window = NULL;
|
||||||
static EGLContext context = EGL_NO_CONTEXT;
|
static EGLContext context = EGL_NO_CONTEXT;
|
||||||
static int win_count = 0;
|
static int win_count = 0;
|
||||||
|
|
||||||
|
#ifdef EGL_MESA_platform_gbm
|
||||||
|
static PFNEGLGETPLATFORMDISPLAYEXTPROC dlsym_eglGetPlatformDisplayEXT = NULL;
|
||||||
|
static PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC dlsym_eglCreatePlatformWindowSurfaceEXT = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_outbuf_gbm_surface_destroy(Outbuf *ob)
|
_evas_outbuf_gbm_surface_destroy(Outbuf *ob)
|
||||||
{
|
{
|
||||||
|
@ -147,6 +152,23 @@ _evas_outbuf_make_current(void *data, void *doit)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_evas_outbuf_init(void)
|
||||||
|
{
|
||||||
|
static int _init = 0;
|
||||||
|
if (_init) return EINA_TRUE;
|
||||||
|
#ifdef EGL_MESA_platform_gbm
|
||||||
|
dlsym_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
|
||||||
|
eglGetProcAddress("eglGetPlatformDisplayEXT");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(dlsym_eglGetPlatformDisplayEXT, EINA_FALSE);
|
||||||
|
dlsym_eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)
|
||||||
|
eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(dlsym_eglCreatePlatformWindowSurfaceEXT, EINA_FALSE);
|
||||||
|
#endif
|
||||||
|
_init = 1;
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_evas_outbuf_egl_setup(Outbuf *ob)
|
_evas_outbuf_egl_setup(Outbuf *ob)
|
||||||
{
|
{
|
||||||
|
@ -158,6 +180,12 @@ _evas_outbuf_egl_setup(Outbuf *ob)
|
||||||
const GLubyte *vendor, *renderer, *version, *glslversion;
|
const GLubyte *vendor, *renderer, *version, *glslversion;
|
||||||
Eina_Bool blacklist = EINA_FALSE;
|
Eina_Bool blacklist = EINA_FALSE;
|
||||||
|
|
||||||
|
if (!_evas_outbuf_init())
|
||||||
|
{
|
||||||
|
ERR("Could not initialize engine!");
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* setup gbm egl surface */
|
/* setup gbm egl surface */
|
||||||
ctx_attr[0] = EGL_CONTEXT_CLIENT_VERSION;
|
ctx_attr[0] = EGL_CONTEXT_CLIENT_VERSION;
|
||||||
ctx_attr[1] = 2;
|
ctx_attr[1] = 2;
|
||||||
|
@ -189,7 +217,7 @@ _evas_outbuf_egl_setup(Outbuf *ob)
|
||||||
|
|
||||||
#ifdef EGL_MESA_platform_gbm
|
#ifdef EGL_MESA_platform_gbm
|
||||||
ob->egl.disp =
|
ob->egl.disp =
|
||||||
eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, ob->info->info.gbm, NULL);
|
dlsym_eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, ob->info->info.gbm, NULL);
|
||||||
#else
|
#else
|
||||||
ob->egl.disp = eglGetDisplay((EGLNativeDisplayType)ob->info->info.gbm);
|
ob->egl.disp = eglGetDisplay((EGLNativeDisplayType)ob->info->info.gbm);
|
||||||
#endif
|
#endif
|
||||||
|
@ -255,7 +283,7 @@ _evas_outbuf_egl_setup(Outbuf *ob)
|
||||||
|
|
||||||
#ifdef EGL_MESA_platform_gbm
|
#ifdef EGL_MESA_platform_gbm
|
||||||
ob->egl.surface[0] =
|
ob->egl.surface[0] =
|
||||||
eglCreatePlatformWindowSurfaceEXT(ob->egl.disp, ob->egl.config,
|
dlsym_eglCreatePlatformWindowSurfaceEXT(ob->egl.disp, ob->egl.config,
|
||||||
ob->surface, NULL);
|
ob->surface, NULL);
|
||||||
#else
|
#else
|
||||||
ob->egl.surface[0] =
|
ob->egl.surface[0] =
|
||||||
|
|
Loading…
Reference in New Issue