replace eglWaitSyncANDROID by eglWaitSyncKHR

Change-Id: I22f1b3588011c88389e249f738f1e6915cc97e72
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 630eb7c..1ce75ea 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -55,10 +55,10 @@
 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 @@
             // 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 9ac7ac0..6c505ed 100644
--- a/opengl/include/EGL/eglext.h
+++ b/opengl/include/EGL/eglext.h
@@ -558,14 +558,6 @@
 #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 c1f2b2e..50b08b0 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -85,7 +85,7 @@
         "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 @@
     { "eglGetSystemTimeNV",
             (__eglMustCastToProperFunctionPointerType)&eglGetSystemTimeNV },
 
-    // EGL_ANDROID_wait_sync
-    { "eglWaitSyncANDROID",
-            (__eglMustCastToProperFunctionPointerType)&eglWaitSyncANDROID },
+    // EGL_KHR_wait_sync
+    { "eglWaitSyncKHR",
+            (__eglMustCastToProperFunctionPointerType)&eglWaitSyncKHR },
 
     // EGL_ANDROID_presentation_time
     { "eglPresentationTimeANDROID",
@@ -1364,6 +1364,22 @@
 }
 
 // ----------------------------------------------------------------------------
+// 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 @@
     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 612c232..70d0e52 100644
--- a/opengl/libs/EGL/egl_entries.in
+++ b/opengl/libs/EGL/egl_entries.in
@@ -59,12 +59,27 @@
 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 */