From 9a74746bd1f3bd28d4c4c7cba75e3245e1d25530 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 7 May 2020 21:49:25 +0200 Subject: [PATCH] EGL: sync headers with Khronos MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Taken from EGL-Registry commit 90b78b0662e2f0548cfd1926fb77bf628933541b. With this update EGL_WL_bind_wayland_display and EGL_WL_create_wayland_buffer_from_image are now in the registry, so we don't need to define them in eglmesaext.h anymore. The eglSwapBufferWithDamage* functions now take a const rects argument. The eglapi.c function signature is updated accordingly. Signed-off-by: Simon Ser Acked-by: Marek Olšák Reviewed-by: Eric Engestrom Part-of: --- include/EGL/egl.h | 4 +- include/EGL/eglext.h | 52 +++++++- include/EGL/eglmesaext.h | 37 ------ src/egl/generate/egl.xml | 259 ++++++++++++++++++++++++++++++++++++--- src/egl/main/eglapi.c | 6 +- 5 files changed, 292 insertions(+), 66 deletions(-) diff --git a/include/EGL/egl.h b/include/EGL/egl.h index 40c04df4a5e..959f175d721 100644 --- a/include/EGL/egl.h +++ b/include/EGL/egl.h @@ -33,7 +33,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** -** Khronos $Git commit SHA1: cb927ca98d $ on $Git commit date: 2019-08-08 01:05:38 -0700 $ +** Khronos $Git commit SHA1: b5409265f3 $ on $Git commit date: 2020-02-20 08:24:34 -0800 $ */ #include @@ -42,7 +42,7 @@ extern "C" { #define EGL_EGL_PROTOTYPES 1 #endif -/* Generated on date 20190808 */ +/* Generated on date 20200220 */ /* Generated C header for: * API: egl diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h index 4e9c0dcf997..a1e5e946899 100644 --- a/include/EGL/eglext.h +++ b/include/EGL/eglext.h @@ -33,12 +33,12 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** -** Khronos $Git commit SHA1: cb927ca98d $ on $Git commit date: 2019-08-08 01:05:38 -0700 $ +** Khronos $Git commit SHA1: b5409265f3 $ on $Git commit date: 2020-02-20 08:24:34 -0800 $ */ #include -#define EGL_EGLEXT_VERSION 20190808 +#define EGL_EGLEXT_VERSION 20200220 /* Generated C header for: * API: egl @@ -443,9 +443,9 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, #ifndef EGL_KHR_swap_buffers_with_damage #define EGL_KHR_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #endif #endif /* EGL_KHR_swap_buffers_with_damage */ @@ -598,6 +598,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu #define EGL_FIXED_SIZE_ANGLE 0x3201 #endif /* EGL_ANGLE_window_fixed_size */ +#ifndef EGL_ARM_image_format +#define EGL_ARM_image_format 1 +#define EGL_COLOR_COMPONENT_TYPE_UNSIGNED_INTEGER_ARM 0x3287 +#define EGL_COLOR_COMPONENT_TYPE_INTEGER_ARM 0x3288 +#endif /* EGL_ARM_image_format */ + #ifndef EGL_ARM_implicit_external_sync #define EGL_ARM_implicit_external_sync 1 #define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A @@ -917,9 +923,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 -typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects); #endif #endif /* EGL_EXT_swap_buffers_with_damage */ @@ -1362,6 +1368,40 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); #define EGL_NATIVE_SURFACE_TIZEN 0x32A1 #endif /* EGL_TIZEN_image_native_surface */ +#ifndef EGL_WL_bind_wayland_display +#define EGL_WL_bind_wayland_display 1 +#define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC +#define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC +#define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC +struct wl_display; +struct wl_resource; +#define EGL_WAYLAND_BUFFER_WL 0x31D5 +#define EGL_WAYLAND_PLANE_WL 0x31D6 +#define EGL_TEXTURE_Y_U_V_WL 0x31D7 +#define EGL_TEXTURE_Y_UV_WL 0x31D8 +#define EGL_TEXTURE_Y_XUXV_WL 0x31D9 +#define EGL_TEXTURE_EXTERNAL_WL 0x31DA +#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB +typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); +EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); +#endif +#endif /* EGL_WL_bind_wayland_display */ + +#ifndef EGL_WL_create_wayland_buffer_from_image +#define EGL_WL_create_wayland_buffer_from_image 1 +#define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC +struct wl_buffer; +typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image); +#endif +#endif /* EGL_WL_create_wayland_buffer_from_image */ + #ifdef __cplusplus } #endif diff --git a/include/EGL/eglmesaext.h b/include/EGL/eglmesaext.h index fe5c7d91658..f0395a8a58c 100644 --- a/include/EGL/eglmesaext.h +++ b/include/EGL/eglmesaext.h @@ -34,43 +34,6 @@ extern "C" { #include -#ifndef EGL_WL_bind_wayland_display -#define EGL_WL_bind_wayland_display 1 - -#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */ -#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */ - -#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB /* eglQueryWaylandBufferWL attribute */ - -#define EGL_TEXTURE_Y_U_V_WL 0x31D7 -#define EGL_TEXTURE_Y_UV_WL 0x31D8 -#define EGL_TEXTURE_Y_XUXV_WL 0x31D9 -#define EGL_TEXTURE_EXTERNAL_WL 0x31DA - -struct wl_display; -struct wl_resource; -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); -EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); -EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); -#endif -typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); - -#endif - -#ifndef EGL_WL_create_wayland_buffer_from_image -#define EGL_WL_create_wayland_buffer_from_image 1 - -struct wl_buffer; -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); -#endif -typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); - -#endif - /* remnant of EGL_NOK_swap_region kept for compatibility because of a non-standard type name */ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects); diff --git a/src/egl/generate/egl.xml b/src/egl/generate/egl.xml index 10e34242089..d354a1ee7aa 100644 --- a/src/egl/generate/egl.xml +++ b/src/egl/generate/egl.xml @@ -49,6 +49,9 @@ struct AHardwareBuffer; + struct wl_buffer; + struct wl_display; + struct wl_resource; @@ -89,7 +92,13 @@ EGLint iHeight; EGLint iStride; }; + typedef void ( *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); + #define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC + #define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC + #define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC + #define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC @@ -468,8 +477,20 @@ - - + + + + + + + + + + + + + + @@ -536,8 +557,23 @@ - - + + + + + + + + + + + + + + + + + @@ -554,11 +590,27 @@ - + + + + + + + + + + + + @@ -617,7 +669,9 @@ - + + + @@ -690,7 +744,9 @@ - + + + @@ -705,8 +761,23 @@ - - + + + + + + + + + + + + + + + + + @@ -714,8 +785,10 @@ - - + + + + @@ -804,7 +877,20 @@ - + + + + + + + + + + + + + + @@ -834,8 +920,54 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -897,6 +1029,13 @@ + + + + + + + - - + + @@ -1691,14 +1830,14 @@ EGLBoolean eglSwapBuffersWithDamageEXT EGLDisplay dpy EGLSurface surface - EGLint *rects + const EGLint *rects EGLint n_rects EGLBoolean eglSwapBuffersWithDamageKHR EGLDisplay dpy EGLSurface surface - EGLint *rects + const EGLint *rects EGLint n_rects @@ -1795,6 +1934,28 @@ EGLint external_win_id EGLint policy + + EGLBoolean eglBindWaylandDisplayWL + EGLDisplay dpy + struct wl_display *display + + + EGLBoolean eglUnbindWaylandDisplayWL + EGLDisplay dpy + struct wl_display *display + + + EGLBoolean eglQueryWaylandBufferWL + EGLDisplay dpy + struct wl_resource *buffer + EGLint attribute + EGLint *value + + + struct wl_buffer *eglCreateWaylandBufferFromImageWL + EGLDisplay dpy + EGLImageKHR image + @@ -2139,6 +2300,7 @@ + @@ -2940,6 +3102,11 @@ + + + + + @@ -2980,6 +3147,12 @@ + + + + + + @@ -3097,6 +3270,11 @@ + + + + + @@ -3141,5 +3319,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 47640fdde71..85bd05723c8 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -1357,7 +1357,7 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) static EGLBoolean _eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf, - EGLint *rects, EGLint n_rects) + const EGLint *rects, EGLint n_rects) { _EGLContext *ctx = _eglGetCurrentContext(); _EGLDriver *drv; @@ -1392,7 +1392,7 @@ _eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf, static EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, - EGLint *rects, EGLint n_rects) + const EGLint *rects, EGLint n_rects) { _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLSurface *surf = _eglLookupSurface(surface, disp); @@ -1402,7 +1402,7 @@ eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface, static EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface surface, - EGLint *rects, EGLint n_rects) + const EGLint *rects, EGLint n_rects) { _EGLDisplay *disp = _eglLockDisplay(dpy); _EGLSurface *surf = _eglLookupSurface(surface, disp); -- 2.30.2