[Mesa-dev] [PATCH 1] wayland-egl: Add api to get window/pixmap attributes

Zhao, Halley halley.zhao at intel.com
Mon Feb 20 01:44:31 PST 2012

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

Libva related changes are here for your reference: https://gitorious.org/libva-wayland/libva-wayland/commits/wayland

From: mesa-dev-bounces+halley.zhao=intel.com at lists.freedesktop.org [mailto:mesa-dev-bounces+halley.zhao=intel.com at lists.freedesktop.org] On Behalf Of Zhao, Halley
Sent: Friday, February 17, 2012 5:22 PM
To: mesa-dev at lists.freedesktop.org
Subject: [Mesa-dev] [PATCH 1] wayland-egl: Add api to get window/pixmap attributes

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.
See Benjamin's work to enable libva for wayland: http://cgit.freedesktop.org/~bnf/libva/log/?h=wayland (I ported it to latest wayland api).

With this patch, we can remove the hack to copy wayland-egl-priv.h from mesa to libva.

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_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_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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120220/bcc00ce8/attachment.htm>

More information about the mesa-dev mailing list