From 2bb716871cf8bfadfff1193ed798da3bffc1f8ec Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 27 Mar 2013 17:32:41 -0700 Subject: [PATCH] replace eglWaitSyncANDROID by eglWaitSyncKHR Change-Id: I22f1b3588011c88389e249f738f1e6915cc97e72 --- libs/gui/GLConsumer.cpp | 6 +++--- opengl/include/EGL/eglext.h | 8 ------- opengl/libs/EGL/eglApi.cpp | 39 +++++++++++++++++----------------- opengl/libs/EGL/egl_entries.in | 17 ++++++++++++++- 4 files changed, 39 insertions(+), 31 deletions(-) diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp index 630eb7c04..1ce75eaae 100644 --- a/libs/gui/GLConsumer.cpp +++ b/libs/gui/GLConsumer.cpp @@ -55,10 +55,10 @@ const bool GLConsumer::sUseNativeFenceSync = true; const bool GLConsumer::sUseNativeFenceSync = false; #endif -// This compile option makes GLConsumer use the EGL_ANDROID_sync_wait +// This compile option makes GLConsumer use the EGL_KHR_wait_sync // extension to insert server-side waits into the GLES command stream. This // feature requires the EGL_ANDROID_native_fence_sync and -// EGL_ANDROID_wait_sync extensions. +// EGL_KHR_wait_sync extensions. #ifdef USE_WAIT_SYNC static const bool useWaitSync = true; #else @@ -848,7 +848,7 @@ status_t GLConsumer::doGLFenceWaitLocked() const { // XXX: The spec draft is inconsistent as to whether this should // return an EGLint or void. Ignore the return value for now, as // it's not strictly needed. - eglWaitSyncANDROID(dpy, sync, 0); + eglWaitSyncKHR(dpy, sync, 0); EGLint eglErr = eglGetError(); eglDestroySyncKHR(dpy, sync); if (eglErr != EGL_SUCCESS) { diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h index 9ac7ac070..6c505ed0d 100644 --- a/opengl/include/EGL/eglext.h +++ b/opengl/include/EGL/eglext.h @@ -558,14 +558,6 @@ typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, #define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 #endif -#ifndef EGL_ANDROID_wait_sync -#define EGL_ANDROID_wait_sync -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLint EGLAPIENTRY eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif -typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCANDROID) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); -#endif - #ifndef EGL_ANDROID_presentation_time #define EGL_ANDROID_presentation_time 1 typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index c1f2b2e14..50b08b071 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -85,7 +85,7 @@ extern char const * const gExtensionString = "EGL_EXT_create_context_robustness " "EGL_NV_system_time " "EGL_ANDROID_image_native_buffer " // mandatory - "EGL_ANDROID_wait_sync " // strongly recommended + "EGL_KHR_wait_sync " // strongly recommended "EGL_ANDROID_presentation_time " ; @@ -133,9 +133,9 @@ static const extention_map_t sExtensionMap[] = { { "eglGetSystemTimeNV", (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeNV }, - // EGL_ANDROID_wait_sync - { "eglWaitSyncANDROID", - (__eglMustCastToProperFunctionPointerType)&eglWaitSyncANDROID }, + // EGL_KHR_wait_sync + { "eglWaitSyncKHR", + (__eglMustCastToProperFunctionPointerType)&eglWaitSyncKHR }, // EGL_ANDROID_presentation_time { "eglPresentationTimeANDROID", @@ -1363,6 +1363,22 @@ EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, return result; } +// ---------------------------------------------------------------------------- +// EGL_EGLEXT_VERSION 15 +// ---------------------------------------------------------------------------- + +EGLint eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) { + clearError(); + const egl_display_ptr dp = validate_display(dpy); + if (!dp) return EGL_FALSE; + EGLint result = EGL_FALSE; + egl_connection_t* const cnx = &gEGLImpl; + if (cnx->dso && cnx->egl.eglWaitSyncKHR) { + result = cnx->egl.eglWaitSyncKHR(dp->disp.dpy, sync, flags); + } + return result; +} + // ---------------------------------------------------------------------------- // ANDROID extensions // ---------------------------------------------------------------------------- @@ -1382,21 +1398,6 @@ EGLint eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSyncKHR sync) return result; } -EGLint eglWaitSyncANDROID(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) -{ - clearError(); - - const egl_display_ptr dp = validate_display(dpy); - if (!dp) return EGL_NO_NATIVE_FENCE_FD_ANDROID; - - EGLint result = EGL_FALSE; - egl_connection_t* const cnx = &gEGLImpl; - if (cnx->dso && cnx->egl.eglWaitSyncANDROID) { - result = cnx->egl.eglWaitSyncANDROID(dp->disp.dpy, sync, flags); - } - return result; -} - EGLBoolean eglPresentationTimeANDROID(EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time) { diff --git a/opengl/libs/EGL/egl_entries.in b/opengl/libs/EGL/egl_entries.in index 612c232b0..70d0e52fd 100644 --- a/opengl/libs/EGL/egl_entries.in +++ b/opengl/libs/EGL/egl_entries.in @@ -59,12 +59,27 @@ EGL_ENTRY(EGLint, eglClientWaitSyncKHR, EGLDisplay, EGLSyncKHR, EGLint, EGL_ENTRY(EGLBoolean, eglSignalSyncKHR, EGLDisplay, EGLSyncKHR, EGLenum) EGL_ENTRY(EGLBoolean, eglGetSyncAttribKHR, EGLDisplay, EGLSyncKHR, EGLint, EGLint *) +/* EGL_EGLEXT_VERSION 15 */ + +// EGL_ENTRY(EGLStreamKHR, eglCreateStreamKHR, EGLDisplay, const EGLint *) +// EGL_ENTRY(EGLBoolean, eglDestroyStreamKHR, EGLDisplay, EGLStreamKHR) +// EGL_ENTRY(EGLBoolean, eglStreamAttribKHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLint) +// EGL_ENTRY(EGLBoolean, eglQueryStreamKHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLint *) +// EGL_ENTRY(EGLBoolean, eglQueryStreamu64KHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLuint64KHR *) +// EGL_ENTRY(EGLBoolean, eglStreamConsumerGLTextureExternalKHR, EGLDisplay, EGLStreamKHR) +// EGL_ENTRY(EGLBoolean, eglStreamConsumerAcquireKHR, EGLDisplay, EGLStreamKHR) +// EGL_ENTRY(EGLBoolean, eglStreamConsumerReleaseKHR, EGLDisplay, EGLStreamKHR) +// EGL_ENTRY(EGLSurface, eglCreateStreamProducerSurfaceKHR, EGLDisplay, EGLConfig, EGLStreamKHR, const EGLint *) +// EGL_ENTRY(EGLBoolean, eglQueryStreamTimeKHR, EGLDisplay, EGLStreamKHR, EGLenum, EGLTimeKHR*) +// EGL_ENTRY(EGLNativeFileDescriptorKHR, eglGetStreamFileDescriptorKHR, EGLDisplay, EGLStreamKHR) +// EGL_ENTRY(EGLStreamKHR, eglCreateStreamFromFileDescriptorKHR, EGLDisplay, EGLNativeFileDescriptorKHR) +EGL_ENTRY(EGLint, eglWaitSyncKHR, EGLDisplay, EGLSyncKHR, EGLint) + /* ANDROID extensions */ EGL_ENTRY(EGLBoolean, eglSetSwapRectangleANDROID, EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) EGL_ENTRY(EGLClientBuffer, eglGetRenderBufferANDROID, EGLDisplay, EGLSurface) EGL_ENTRY(EGLint, eglDupNativeFenceFDANDROID, EGLDisplay, EGLSyncKHR) -EGL_ENTRY(EGLint, eglWaitSyncANDROID, EGLDisplay, EGLSyncKHR, EGLint) /* NVIDIA extensions */