From 331841b96b92646c93c87627c03f77b892f711cd Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Thu, 6 Sep 2012 14:52:00 -0700 Subject: EGL: add the native_fence_sync extension This change adds support for the EGL_ANDROID_native_fence_sync extension to the Android EGL layer. It also fixes a couple minor issues with the extension spec. Change-Id: Ic8829d21f37b701f33aa9c72c3d25e88e03fa3cd --- opengl/libs/EGL/eglApi.cpp | 16 +++++++++++++++- opengl/libs/EGL/egl_display.cpp | 1 + opengl/libs/EGL/egl_entries.in | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'opengl/libs/EGL') diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 1bc4eb7..014ac61 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -652,6 +652,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) // These extensions should not be exposed to applications. They're used // internally by the Android EGL layer. if (!strcmp(procname, "eglSetBlobCacheFuncsANDROID") || + !strcmp(procname, "eglDupNativeFenceFDANDROID") || !strcmp(procname, "eglHibernateProcessIMG") || !strcmp(procname, "eglAwakenProcessIMG")) { return NULL; @@ -1190,7 +1191,20 @@ EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, // ANDROID extensions // ---------------------------------------------------------------------------- -/* ANDROID extensions entry-point go here */ +EGLint eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync) +{ + clearError(); + + const egl_display_ptr dp = validate_display(dpy); + if (!dp) return EGL_NO_NATIVE_FENCE_FD_ANDROID; + + EGLint result = EGL_NO_NATIVE_FENCE_FD_ANDROID; + egl_connection_t* const cnx = &gEGLImpl; + if (cnx->dso && cnx->egl.eglDupNativeFenceFDANDROID) { + result = cnx->egl.eglDupNativeFenceFDANDROID(dp->disp.dpy, sync); + } + return result; +} // ---------------------------------------------------------------------------- // NVIDIA extensions diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp index 80072ab..371df43 100644 --- a/opengl/libs/EGL/egl_display.cpp +++ b/opengl/libs/EGL/egl_display.cpp @@ -59,6 +59,7 @@ static char const * const sExtensionString = // extensions not exposed to applications but used by the ANDROID system // "EGL_ANDROID_recordable " // mandatory // "EGL_ANDROID_blob_cache " // strongly recommended +// "EGL_ANDROID_native_fence_sync " // strongly recommended // "EGL_IMG_hibernate_process " // optional extern void initEglTraceLevel(); diff --git a/opengl/libs/EGL/egl_entries.in b/opengl/libs/EGL/egl_entries.in index 9feb716..4cbd55f 100644 --- a/opengl/libs/EGL/egl_entries.in +++ b/opengl/libs/EGL/egl_entries.in @@ -62,6 +62,7 @@ EGL_ENTRY(EGLBoolean, eglGetSyncAttribKHR, EGLDisplay, EGLSyncKHR, EGLint, EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface) +EGL_ENTRY(EGLint, eglDupNativeFenceFDANDROID, EGLDisplay, EGLSyncKHR) /* NVIDIA extensions */ -- cgit v1.1