summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglapi.c25
-rw-r--r--src/egl/main/eglapi.h8
-rw-r--r--src/egl/main/egldisplay.h1
-rw-r--r--src/egl/main/eglmisc.c1
4 files changed, 35 insertions, 0 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 66f96de4140..9ac2ef44698 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -973,6 +973,9 @@ eglGetProcAddress(const char *procname)
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
{ "eglQueryWaylandBufferWL", (_EGLProc) eglQueryWaylandBufferWL },
#endif
+#ifdef EGL_WL_create_wayland_buffer_from_image
+ { "eglCreateWaylandBufferFromImageWL", (_EGLProc) eglCreateWaylandBufferFromImageWL },
+#endif
{ "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV },
#ifdef EGL_EXT_swap_buffers_with_damage
{ "eglSwapBuffersWithDamageEXT", (_EGLProc) eglSwapBuffersWithDamageEXT },
@@ -1601,6 +1604,28 @@ eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer,
}
#endif
+#ifdef EGL_WL_create_wayland_buffer_from_image
+struct wl_buffer * EGLAPIENTRY
+eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image)
+{
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ _EGLImage *img;
+ _EGLDriver *drv;
+ struct wl_buffer *ret;
+
+ _EGL_CHECK_DISPLAY(disp, NULL, drv);
+ assert(disp->Extensions.WL_create_wayland_buffer_from_image);
+
+ img = _eglLookupImage(image, disp);
+
+ if (!img)
+ RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, NULL);
+
+ ret = drv->API.CreateWaylandBufferFromImageWL(drv, disp, img);
+
+ RETURN_EGL_EVAL(disp, ret);
+}
+#endif
EGLBoolean EGLAPIENTRY
eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface,
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index 4a4f9765219..05803449a2e 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -126,6 +126,10 @@ typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *dis
typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif
+#ifdef EGL_WL_create_wayland_buffer_from_image
+typedef struct wl_buffer * (*CreateWaylandBufferFromImageWL_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img);
+#endif
+
typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height);
typedef EGLint (*QueryBufferAge_t)(_EGLDriver *drv,
@@ -210,6 +214,10 @@ struct _egl_api
QueryWaylandBufferWL_t QueryWaylandBufferWL;
#endif
+#ifdef EGL_WL_create_wayland_buffer_from_image
+ CreateWaylandBufferFromImageWL_t CreateWaylandBufferFromImageWL;
+#endif
+
#ifdef EGL_EXT_swap_buffers_with_damage
SwapBuffersWithDamageEXT_t SwapBuffersWithDamageEXT;
#endif /* EGL_EXT_swap_buffers_with_damage */
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index fefd19c47b2..b95b2f79852 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -91,6 +91,7 @@ struct _egl_extensions
EGLBoolean MESA_drm_image;
EGLBoolean WL_bind_wayland_display;
+ EGLBoolean WL_create_wayland_buffer_from_image;
EGLBoolean KHR_image_base;
EGLBoolean KHR_image_pixmap;
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index 2decc1b778d..cff61669dc8 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -92,6 +92,7 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(MESA_drm_image);
_EGL_CHECK_EXTENSION(WL_bind_wayland_display);
+ _EGL_CHECK_EXTENSION(WL_create_wayland_buffer_from_image);
_EGL_CHECK_EXTENSION(KHR_image_base);
_EGL_CHECK_EXTENSION(KHR_image_pixmap);