Add EGL_EXT_image_implicit_sync_control extension
diff --git a/api/EGL/egl.h b/api/EGL/egl.h
index 42db1b6..7f4cc3b 100644
--- a/api/EGL/egl.h
+++ b/api/EGL/egl.h
@@ -38,7 +38,7 @@
 
 #include <EGL/eglplatform.h>
 
-/* Generated on date 20170621 */
+/* Generated on date 20170622 */
 
 /* Generated C header for:
  * API: egl
diff --git a/api/EGL/eglext.h b/api/EGL/eglext.h
index c2a76a2..cb6c7b6 100644
--- a/api/EGL/eglext.h
+++ b/api/EGL/eglext.h
@@ -38,7 +38,7 @@
 
 #include <EGL/eglplatform.h>
 
-#define EGL_EGLEXT_VERSION 20170621
+#define EGL_EGLEXT_VERSION 20170622
 
 /* Generated C header for:
  * API: egl
@@ -718,6 +718,13 @@
 #endif
 #endif /* EGL_EXT_image_dma_buf_import_modifiers */
 
+#ifndef EGL_EXT_image_implicit_sync_control
+#define EGL_EXT_image_implicit_sync_control 1
+#define EGL_IMPORT_SYNC_TYPE_EXT          0x3470
+#define EGL_IMPORT_IMPLICIT_SYNC_EXT      0x3471
+#define EGL_IMPORT_EXPLICIT_SYNC_EXT      0x3472
+#endif /* EGL_EXT_image_implicit_sync_control */
+
 #ifndef EGL_EXT_multiview_window
 #define EGL_EXT_multiview_window 1
 #define EGL_MULTIVIEW_VIEW_COUNT_EXT      0x3134
diff --git a/api/egl.xml b/api/egl.xml
index 9c3445b..7877812 100644
--- a/api/egl.xml
+++ b/api/egl.xml
@@ -860,6 +860,12 @@
         <unused start="0x3464" end="0x346F"/>
     </enums>
 
+    <enums namespace="EGL" start="0x3470" end="0x347F" vendor="EXT" comment="Reserved for Daniel Stone (PR 14)">
+	<enum value="0x3470" name="EGL_IMPORT_SYNC_TYPE_EXT"/>
+	<enum value="0x3471" name="EGL_IMPORT_IMPLICIT_SYNC_EXT"/>
+	<enum value="0x3472" name="EGL_IMPORT_EXPLICIT_SYNC_EXT"/>
+    </enums>
+
 <!-- Please remember that new enumerant allocations must be obtained by
      request to the Khronos API registrar (see comments at the top of this
      file) File requests in the Khronos Bugzilla, EGL project, Registry
@@ -869,8 +875,8 @@
 
 <!-- Reservable for future use. To generate a new range, allocate multiples
      of 16 starting at the lowest available point in this block. -->
-    <enums namespace="EGL" start="0x3470" end="0x3FFF" vendor="KHR" comment="Reserved for future use">
-            <unused start="0x3470" end="0x3FFF"/>
+    <enums namespace="EGL" start="0x3480" end="0x3FFF" vendor="KHR" comment="Reserved for future use">
+            <unused start="0x3480" end="0x3FFF"/>
     </enums>
 
     <enums namespace="EGL" start="0x8F70" end="0x8F7F" vendor="HI" comment="For Mark Callow, Khronos bug 4055. Shared with GL.">
@@ -2957,5 +2963,12 @@
                 <enum name="EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT"/>
             </require>
         </extension>
+        <extension name="EGL_EXT_image_implicit_sync_control" supported="egl">
+	    <require>
+	        <enum name="EGL_IMPORT_SYNC_TYPE_EXT"/>
+		<enum name="EGL_IMPORT_IMPLICIT_SYNC_EXT"/>
+		<enum name="EGL_IMPORT_EXPLICIT_SYNC_EXT"/>
+	    </require>
+	</extension>
     </extensions>
 </registry>
diff --git a/extensions/EXT/EGL_EXT_image_implicit_sync_control.txt b/extensions/EXT/EGL_EXT_image_implicit_sync_control.txt
new file mode 100644
index 0000000..c362b3d
--- /dev/null
+++ b/extensions/EXT/EGL_EXT_image_implicit_sync_control.txt
@@ -0,0 +1,127 @@
+Name
+
+    EXT_image_implicit_sync_control
+
+Name Strings
+
+    EGL_EXT_image_implicit_sync_control
+
+Contributors
+
+    Daniel Stone, Collabora Ltd.
+
+Contacts
+
+    Daniel Stone (daniels 'at' collabora 'dot' com)
+
+Status
+
+    Complete
+
+Version
+
+    Version 1, May 15, 2017
+
+Number
+
+    EGL Extension #120
+
+Dependencies
+
+    EGL 1.2 is required.
+
+    EGL_KHR_image_base and EGL_EXT_image_dma_buf_import are required.
+
+    The EGL implementation must be running on a Linux kernel supporting implicit
+    synchronization, as the usage is defined in the
+    EGL_ARM_implicit_external_sync extension, but does not require that extension.
+
+    This extension is written against the wording of the EGL 1.2 Specification.
+
+Overview
+
+    This extension allows a client to selectively use implicit or explicit
+    synchronization mechanisms when addressing externally-imported EGLImages.
+    A new token is added to EGLImage creation which allows the client to select
+    whether a platform's implicit synchronization will be in use for a buffer
+    imported into EGLImage.
+
+    Heterogeneous systems (supporting multiple APIs, mixed legacy/updated
+    clients, etc) already supporting implicit synchronization, may not be able
+    to change to explict synchronization in a single switch. This extension
+    allows synchronization to be controlled on a per-buffer basis, so explicit
+    synchronization can be enabled for a complete pipeline which supports it,
+    or implicit synchronization used otherwise.
+
+New Types
+
+    None
+
+New Procedures and Functions
+
+    None
+
+New Tokens
+
+    Accepted as an attribute in the <attrib_list> parameter of
+    eglCreateImageKHR:
+
+	EGL_IMPORT_SYNC_TYPE_EXT           0x3470
+
+    Accepted as the value for the EGL_IMPORT_SYNC_TYPE_EXT attribute:
+
+        EGL_IMPORT_IMPLICIT_SYNC_EXT       0x3471
+        EGL_IMPORT_EXPLICIT_SYNC_EXT       0x3472
+
+New Types
+
+    None.
+
+Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation)
+
+    Add to section 2.5.1 "EGLImage Specification" (as defined by the
+    EGL_KHR_image_base specification), in the description of
+    eglCreateImageKHR:
+
+    Add the following to Table bbb (Legal attributes for eglCreateImageKHR
+    <attr_list> parameter), Section 2.5.1 (EGLImage Specification)
+
+      +-----------------------------+-------------------------+---------------------------+---------------+
+      | Attribute                   | Description             | Valid <target>s           | Default Value |
+      +-----------------------------+-------------------------+---------------------------+---------------+
+      | EGL_IMPORT_SYNC_TYPE_EXT    | The type of             | EGL_LINUX_DMA_BUF_EXT     | EGL_IMPORT_   |
+      |                             | synchronization to      |                           | IMPLICT_SYNC_ |
+      |                             | apply to previously     |                           | EXT           |
+      |                             | submitted rendering on  |                           |               |
+      |                             | the platform buffer     |                           |               |
+      +-----------------------------+-------------------------+---------------------------+---------------+
+      Table bbb. Legal attributes for eglCreateImageKHR <attrib_list> parameter
+
+    ...
+
+
+    Add to section 2.5.1 "EGLImage Specification" (as defined by the
+    EGL_KHR_image_base specification), in the description of
+    eglCreateImageKHR:
+
+    The behaviour of the imported buffer with regard to commands previously
+    submitted (including via other APIs and from other clients) is controlled
+    by the EGL_IMPORT_SYNC_TYPE_EXT attribute. If the default value of
+    implicit synchronization is used, the platform may synchronize any access
+    to the imported buffer, against accesses previously made (including by
+    other clients or APIs) to that same buffer. If explicit synchronization
+    is specified, the platform will not synchronize access to that buffer
+    against other accesses; the client must use another synchronization
+    mechanism if it wishes to order its accesses with respect to others.
+
+    Add to the list of error conditions for eglCreateImageKHR:
+
+       * If <attrib_list> contains the EGL_IMPORT_SYNC_TYPE_EXT name, but the
+         value is not one of EGL_IMPORT_IMPLICIT_SYNC_EXT or
+	 EGL_IMPORT_EXPLICIT_SYNC_EXT, EGL_BAD_PARAMETER is generated.
+
+
+Revision History
+
+#1 (Daniel Stone, May 15, 2017)
+   - Initial revision.
diff --git a/index.php b/index.php
index 830614b..d605cf1 100644
--- a/index.php
+++ b/index.php
@@ -315,6 +315,7 @@
 <li value=118> <a href="extensions/EXT/EGL_EXT_gl_colorspace_display_p3.txt">EGL_EXT_gl_colorspace_display_p3_linear</a>
 </li>
 <li value=119> <a href="extensions/EXT/EGL_EXT_gl_colorspace_scrgb.txt">EGL_EXT_gl_colorspace_scrgb (non-linear)</a>
+<li value=120> <a href="extensions/EXT/EXT_image_implicit_sync_control.txt">EGL_EXT_image_implicit_sync_control</a>
 </li>
 </ol>
 
diff --git a/registry.tcl b/registry.tcl
index e56894d..3d5d68d 100644
--- a/registry.tcl
+++ b/registry.tcl
@@ -624,4 +624,9 @@
     flags       public
     filename    extensions/EXT/EGL_EXT_gl_colorspace_scrgb.txt
 }
-# Next free extension number: 119
+extension EGL_EXT_image_implicit_sync_control {
+    number      120
+    flags       public
+    filename    extensions/EXT/EGL_EXT_image_implicit_sync_control.txt
+}
+# Next free extension number: 121