aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorSarah Sharp <[email protected]>2014-05-06 12:10:57 -0700
committerChad Versace <[email protected]>2014-05-20 15:19:48 -0700
commitc524f3ef9155caba6cd4f9fc72485426b1da76fd (patch)
tree38b7c54d136949079e9c82477b2aa1d374ab7b99 /src/egl/main
parentf6e50994e12f1135748a51bf6380dc04bd5f4907 (diff)
egl: Add EGL_CHROMIUM_sync_control extension.
Chromium defined a new GL extension (that isn't registered with Khronos). We need to add an EGL extension for it, so we can migrate ChromeOS on Intel systems to use EGL instead of GLX. http://git.chromium.org/gitweb/?p=chromium/src/third_party/khronos.git;a=commitdiff;h=27cbfdab35c601f70aa150581ad1448d0401f447 The EGL_CHROMIUM_sync_control extension is similar to the GLX extension OML_sync_control, but only defines one function, eglGetSyncValuesCHROMIUM, which is equivalent to glXGetSyncValuesOML. http://www.opengl.org/registry/specs/OML/glx_sync_control.txt Signed-off-by: Sarah Sharp <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Jamey Sharp <[email protected]> Cc: Ian Romanick <[email protected]> Cc: Stéphane Marchesin <[email protected]>
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglapi.c23
-rw-r--r--src/egl/main/eglapi.h3
-rw-r--r--src/egl/main/egldisplay.h2
-rw-r--r--src/egl/main/eglmisc.c2
4 files changed, 30 insertions, 0 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 219d8e61715..27d08027924 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -1086,6 +1086,7 @@ eglGetProcAddress(const char *procname)
{ "eglGetPlatformDisplayEXT", (_EGLProc) eglGetPlatformDisplayEXT },
{ "eglCreatePlatformWindowSurfaceEXT", (_EGLProc) eglCreatePlatformWindowSurfaceEXT },
{ "eglCreatePlatformPixmapSurfaceEXT", (_EGLProc) eglCreatePlatformPixmapSurfaceEXT },
+ { "eglGetSyncValuesCHROMIUM", (_EGLProc) eglGetSyncValuesCHROMIUM },
{ NULL, NULL }
};
EGLint i;
@@ -1751,3 +1752,25 @@ eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface,
RETURN_EGL_EVAL(disp, ret);
}
+
+EGLBoolean EGLAPIENTRY
+eglGetSyncValuesCHROMIUM(EGLDisplay display, EGLSurface surface,
+ EGLuint64KHR *ust, EGLuint64KHR *msc,
+ EGLuint64KHR *sbc)
+{
+ _EGLDisplay *disp = _eglLockDisplay(display);
+ _EGLSurface *surf = _eglLookupSurface(surface, disp);
+ _EGLDriver *drv;
+ EGLBoolean ret;
+
+ _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
+ if (!disp->Extensions.CHROMIUM_sync_control)
+ RETURN_EGL_EVAL(disp, EGL_FALSE);
+
+ if (!ust || !msc || !sbc)
+ RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE);
+
+ ret = drv->API.GetSyncValuesCHROMIUM(disp, surf, ust, msc, sbc);
+
+ RETURN_EGL_EVAL(disp, ret);
+}
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index f20ce5b701b..cb01cab0c00 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -139,6 +139,8 @@ typedef EGLint (*QueryBufferAge_t)(_EGLDriver *drv,
typedef EGLBoolean (*SwapBuffersWithDamageEXT_t) (_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, const EGLint *rects, EGLint n_rects);
#endif
+typedef EGLBoolean (*GetSyncValuesCHROMIUM_t) (_EGLDisplay *dpy, _EGLSurface *surface, EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc);
+
/**
* The API dispatcher jumps through these functions
*/
@@ -225,6 +227,7 @@ struct _egl_api
PostSubBufferNV_t PostSubBufferNV;
QueryBufferAge_t QueryBufferAge;
+ GetSyncValuesCHROMIUM_t GetSyncValuesCHROMIUM;
};
#endif /* EGLAPI_INCLUDED */
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 970c21a9289..13b95327bc1 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -113,6 +113,8 @@ struct _egl_extensions
EGLBoolean ANDROID_image_native_buffer;
+ EGLBoolean CHROMIUM_sync_control;
+
EGLBoolean NV_post_sub_buffer;
EGLBoolean EXT_create_context_robustness;
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index 65669d8830f..388e4b51b7a 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -117,6 +117,8 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
+ _EGL_CHECK_EXTENSION(CHROMIUM_sync_control);
+
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
_EGL_CHECK_EXTENSION(EXT_buffer_age);
_EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);