[Mesa-dev] [PATCH 1] wayland-egl: Add api to get window/pixmap attributes (enable libva over wayland)

Zhao, Halley halley.zhao at intel.com
Wed Feb 22 18:38:40 PST 2012


Resend the patch, it is required to enable libva over wayland.

Ian/Eric:
Could you help to review this patch?

== patch description ==:
wl_egl_window/wl_egl_pixmap are implemented in mesa, however these drawables can also be update in video/camera modules.
An example is that libva also manage buffer object for it, so the attributes of the drawable should be accessed outside of mesa.
With this patch, we can remove the hack to copy wayland-egl-priv.h from mesa to libva.

Libva related changes are here for your reference: https://gitorious.org/libva-wayland/libva-wayland/commits/wayland
It bases on Benjamin's work to enable libva for wayland: http://cgit.freedesktop.org/~bnf/libva/log/?h=wayland

== patch details ==:

src/egl/wayland/wayland-egl/wayland-egl.c |   29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/egl/wayland/wayland-egl/wayland-egl.c b/src/egl/wayland/wayland-egl/wayland-egl.c
index e950b4a..b7efab8 100644
--- a/src/egl/wayland/wayland-egl/wayland-egl.c
+++ b/src/egl/wayland/wayland-egl/wayland-egl.c
@@ -81,3 +81,32 @@ wl_egl_pixmap_create_buffer(struct wl_egl_pixmap *egl_pixmap)
{
       return egl_pixmap->buffer;
}
+
+WL_EGL_EXPORT void
+wl_egl_window_get_size(struct wl_egl_window *egl_window,
+                                   int *width, int *height)
+{
+       if (width)
+                *width = egl_window->width;
+       if (height)
+                *height = egl_window->height;
+}
+
+WL_EGL_EXPORT struct wl_surface*
+wl_egl_window_get_surface(struct wl_egl_window *win)
+{
+    if (win)
+        return win->surface;
+    else
+        return NULL;
+}
+
+WL_EGL_EXPORT void
+wl_egl_pixmap_get_size(struct wl_egl_pixmap *egl_pixmap,
+                                   int *width, int *height)
+{
+       if (width)
+                *width = egl_pixmap->width;
+       if (height)
+                *height = egl_pixmap->height;
+}
--
1.7.5.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120223/edabc788/attachment.html>


More information about the mesa-dev mailing list