summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldisplay.c
diff options
context:
space:
mode:
authorPlamena Manolova <[email protected]>2016-05-31 17:32:38 +0100
committerBen Widawsky <[email protected]>2016-06-02 07:45:19 -0700
commite8b38ca202fbe8c281aeb81a4b64256983f185e0 (patch)
treeeed7a8c2ea5648885e73aa0aed70b92d9c2a4e69 /src/egl/main/egldisplay.c
parent17f4c723eb5a503d747d643936e4fd689a5f4946 (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r--src/egl/main/egldisplay.c5
1 files changed, 5 insertions, 0 deletions
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;