From e6a33570b73aa56c87818d7f67a122d4427b7841 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 5 Jul 2012 16:43:04 -0400 Subject: egl: Add EGL_WAYLAND_PLANE_WL attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This lets us specify the plane to create the image for for multiplanar wl_buffers. Signed-off-by: Kristian Høgsberg --- src/egl/main/eglapi.c | 20 ++++++++++++++++++++ src/egl/main/eglapi.h | 2 ++ src/egl/main/eglimage.c | 5 +++++ src/egl/main/eglimage.h | 3 +++ 4 files changed, 30 insertions(+) (limited to 'src/egl/main') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index b27aac16748..ffc404cc2d7 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -940,6 +940,7 @@ eglGetProcAddress(const char *procname) #ifdef EGL_WL_bind_wayland_display { "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL }, { "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL }, + { "eglQueryWaylandBufferWL", (_EGLProc) eglQueryWaylandBufferWL }, #endif { "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV }, { NULL, NULL } @@ -1540,6 +1541,25 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) RETURN_EGL_EVAL(disp, ret); } + +EGLBoolean EGLAPIENTRY +eglQueryWaylandBufferWL(EGLDisplay dpy,struct wl_buffer *buffer, + EGLint attribute, EGLint *value) +{ + _EGLDisplay *disp = _eglLockDisplay(dpy); + _EGLDriver *drv; + EGLBoolean ret; + + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); + assert(disp->Extensions.WL_bind_wayland_display); + + if (!buffer) + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); + + ret = drv->API.QueryWaylandBufferWL(drv, disp, buffer, attribute, value); + + RETURN_EGL_EVAL(disp, ret); +} #endif diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h index 14085cb4d83..ec3ad7ec973 100644 --- a/src/egl/main/eglapi.h +++ b/src/egl/main/eglapi.h @@ -123,6 +123,7 @@ typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _ 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); +typedef EGLBoolean (*QueryWaylandBufferWL_t)(_EGLDriver *drv, _EGLDisplay *displ, struct wl_buffer *buffer, EGLint attribute, EGLint *value); #endif typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height); @@ -199,6 +200,7 @@ struct _egl_api #ifdef EGL_WL_bind_wayland_display BindWaylandDisplayWL_t BindWaylandDisplayWL; UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL; + QueryWaylandBufferWL_t QueryWaylandBufferWL; #endif PostSubBufferNV_t PostSubBufferNV; diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c index 1174d0aef1f..bfae709bb3c 100644 --- a/src/egl/main/eglimage.c +++ b/src/egl/main/eglimage.c @@ -88,6 +88,11 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy, attrs->DRMBufferStrideMESA = val; break; + /* EGL_WL_bind_wayland_display */ + case EGL_WAYLAND_PLANE_WL: + attrs->PlaneWL = val; + break; + default: /* unknown attrs are ignored */ break; diff --git a/src/egl/main/eglimage.h b/src/egl/main/eglimage.h index acb36aaeb18..9cc86d58b2d 100644 --- a/src/egl/main/eglimage.h +++ b/src/egl/main/eglimage.h @@ -50,6 +50,9 @@ struct _egl_image_attribs EGLint DRMBufferFormatMESA; EGLint DRMBufferUseMESA; EGLint DRMBufferStrideMESA; + + /* EGL_WL_bind_wayland_display */ + EGLint PlaneWL; }; /** -- cgit v1.2.3