diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-02-21 16:22:34 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-03-01 17:23:50 -0500 |
commit | 6b369c4c7cd8a52f99bbff2a57fb316b33a87495 (patch) | |
tree | 6a1110f5246f86a2ba3a46e244b2a34629d323fe /src/egl/main | |
parent | 654adaabc979acb082c0006cdfabfbacfed53084 (diff) |
egl: Add EGL_WL_bind_wayland_display
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/Makefile | 3 | ||||
-rw-r--r-- | src/egl/main/eglapi.c | 44 | ||||
-rw-r--r-- | src/egl/main/eglapi.h | 11 | ||||
-rw-r--r-- | src/egl/main/egldisplay.h | 2 | ||||
-rw-r--r-- | src/egl/main/eglmisc.c | 2 |
5 files changed, 62 insertions, 0 deletions
diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile index a5b9299502..820788d696 100644 --- a/src/egl/main/Makefile +++ b/src/egl/main/Makefile @@ -58,6 +58,9 @@ LOCAL_LIBS = ifeq ($(filter dri2, $(EGL_DRIVERS_DIRS)),dri2) LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2 LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a +ifneq ($(findstring wayland, $(EGL_PLATFORMS)),) +LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a +endif EGL_LIB_DEPS += $(XCB_DRI2_LIBS) $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS) endif ifeq ($(filter glx, $(EGL_DRIVERS_DIRS)),glx) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 4e64ce6f71..19dfd57426 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -914,6 +914,10 @@ eglGetProcAddress(const char *procname) { "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA }, { "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA }, #endif +#ifdef EGL_WL_bind_display + { "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL }, + { "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL }, +#endif { NULL, NULL } }; EGLint i; @@ -1491,3 +1495,43 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image, } #endif + +#ifdef EGL_WL_bind_wayland_display +struct wl_display; + +EGLBoolean EGLAPIENTRY +eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) +{ + _EGLDisplay *disp = _eglLockDisplay(dpy); + _EGLDriver *drv; + EGLBoolean ret; + + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); + assert(disp->Extensions.WL_bind_wayland_display); + + if (!display) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); + + ret = drv->API.BindWaylandDisplayWL(drv, disp, display); + + RETURN_EGL_EVAL(disp, ret); +} + +EGLBoolean EGLAPIENTRY +eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) +{ + _EGLDisplay *disp = _eglLockDisplay(dpy); + _EGLDriver *drv; + EGLBoolean ret; + + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); + assert(disp->Extensions.WL_bind_wayland_display); + + if (!display) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); + + ret = drv->API.UnbindWaylandDisplayWL(drv, disp, display); + + RETURN_EGL_EVAL(disp, ret); +} +#endif diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h index 01492082f6..c9913f10a1 100644 --- a/src/egl/main/eglapi.h +++ b/src/egl/main/eglapi.h @@ -95,6 +95,12 @@ typedef _EGLImage *(*CreateDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, c typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *name, EGLint *handle, EGLint *stride); #endif +#ifdef EGL_WL_bind_wayland_display +struct wl_display; +typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display); +typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display); +#endif + /** * The API dispatcher jumps through these functions */ @@ -169,6 +175,11 @@ struct _egl_api CreateDRMImageMESA_t CreateDRMImageMESA; ExportDRMImageMESA_t ExportDRMImageMESA; #endif + +#ifdef EGL_WL_bind_wayland_display + BindWaylandDisplayWL_t BindWaylandDisplayWL; + UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL; +#endif }; #endif /* EGLAPI_INCLUDED */ diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index ce035eb2ef..97ae2b01ba 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -58,6 +58,8 @@ struct _egl_extensions EGLBoolean MESA_drm_display; EGLBoolean MESA_drm_image; + EGLBoolean WL_bind_wayland_display; + EGLBoolean KHR_image_base; EGLBoolean KHR_image_pixmap; EGLBoolean KHR_vg_parent_image; diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c index f8ba5f33eb..6bb2498eef 100644 --- a/src/egl/main/eglmisc.c +++ b/src/egl/main/eglmisc.c @@ -89,6 +89,8 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy) _EGL_CHECK_EXTENSION(MESA_drm_display); _EGL_CHECK_EXTENSION(MESA_drm_image); + _EGL_CHECK_EXTENSION(WL_bind_wayland_display); + _EGL_CHECK_EXTENSION(KHR_image_base); _EGL_CHECK_EXTENSION(KHR_image_pixmap); if (dpy->Extensions.KHR_image_base && dpy->Extensions.KHR_image_pixmap) |