summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
authorKyle Brenneman <kbrenneman@nvidia.com>2016-09-12 17:40:29 -0400
committerAdam Jackson <ajax@redhat.com>2016-09-14 11:45:58 -0400
commit9a992038e722b6ea8362db1dfcf2dd5a78888391 (patch)
tree4ac57be7af876d8c62105ce9862917b0bc634ec9 /src/egl/main/eglapi.c
parent58338c6b650d85a2484f50c0941cb3e2947fab8e (diff)
downloadexternal_mesa3d-9a992038e722b6ea8362db1dfcf2dd5a78888391.zip
external_mesa3d-9a992038e722b6ea8362db1dfcf2dd5a78888391.tar.gz
external_mesa3d-9a992038e722b6ea8362db1dfcf2dd5a78888391.tar.bz2
egl: Lock the display in _eglCreateSync's callers
Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r--src/egl/main/eglapi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index ba4826a..58d18f1 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1384,11 +1384,10 @@ eglDestroyImage(EGLDisplay dpy, EGLImage image)
static EGLSync
-_eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list,
+_eglCreateSync(_EGLDisplay *disp, EGLenum type, const EGLint *attrib_list,
const EGLAttrib *attrib_list64, EGLBoolean is64,
EGLenum invalid_type_error)
{
- _EGLDisplay *disp = _eglLockDisplay(dpy);
_EGLContext *ctx = _eglGetCurrentContext();
_EGLDriver *drv;
_EGLSync *sync;
@@ -1400,7 +1399,7 @@ _eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list,
RETURN_EGL_EVAL(disp, EGL_NO_SYNC_KHR);
/* return an error if the client API doesn't support GL_OES_EGL_sync */
- if (!ctx || ctx->Resource.Display != dpy ||
+ if (!ctx || ctx->Resource.Display != disp ||
ctx->ClientAPI != EGL_OPENGL_ES_API)
RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SYNC_KHR);
@@ -1431,7 +1430,8 @@ _eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list,
static EGLSync EGLAPIENTRY
eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
{
- return _eglCreateSync(dpy, type, attrib_list, NULL, EGL_FALSE,
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ return _eglCreateSync(disp, type, attrib_list, NULL, EGL_FALSE,
EGL_BAD_ATTRIBUTE);
}
@@ -1439,7 +1439,8 @@ eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
static EGLSync EGLAPIENTRY
eglCreateSync64KHR(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list)
{
- return _eglCreateSync(dpy, type, NULL, attrib_list, EGL_TRUE,
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ return _eglCreateSync(disp, type, NULL, attrib_list, EGL_TRUE,
EGL_BAD_ATTRIBUTE);
}
@@ -1447,7 +1448,8 @@ eglCreateSync64KHR(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list)
EGLSync EGLAPIENTRY
eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list)
{
- return _eglCreateSync(dpy, type, NULL, attrib_list, EGL_TRUE,
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ return _eglCreateSync(disp, type, NULL, attrib_list, EGL_TRUE,
EGL_BAD_PARAMETER);
}