From e8b38ca202fbe8c281aeb81a4b64256983f185e0 Mon Sep 17 00:00:00 2001 From: Plamena Manolova Date: Tue, 31 May 2016 17:32:38 +0100 Subject: egl: Check if API is supported when using eglBindAPI. According to the EGL specifications before binding an API we must check whether it's supported first. If not eglBindAPI should return EGL_FALSE and generate a EGL_BAD_PARAMETER error. Signed-off-by: Plamena Manolova Reviewed-by: Brian Paul --- src/egl/main/egldisplay.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/egl/main/egldisplay.c') diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index f6db03ab50c..907a60747d0 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -240,6 +240,7 @@ _EGLDisplay * _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) { _EGLDisplay *dpy; + _EGLThreadInfo *thread = _eglGetCurrentThread(); if (plat == _EGL_INVALID_PLATFORM) return NULL; @@ -265,9 +266,13 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy) /* add to the display list */ dpy->Next = _eglGlobal.DisplayList; _eglGlobal.DisplayList = dpy; + dpy->ThreadList = NULL; } } + thread->Next = dpy->ThreadList; + dpy->ThreadList = thread; + mtx_unlock(_eglGlobal.Mutex); return dpy; -- cgit v1.2.3