[Mesa-dev] [PATCH 1] wayland-egl: Add api to get window/pixmap attributes (enable libva over wayland)
Benjamin Franzke
benjaminfranzke at googlemail.com
Thu Feb 23 00:50:23 PST 2012
Hi,
Sorry for not responding earlier..
There are some objections from my side:
1. These functions only cover the driver-independent lookups.
But for the wl_egl_pixmap there was a need to access driver_private:
http://cgit.freedesktop.org/~bnf/libva/tree/va/wayland/va_wayland.c?h=wayland
Thats not covered by this patch, so the private header would still be needed.
Note: Of course thats a hack, as commented in the code.
I rather think of a drm-specific vfunc now, that allows set/get by drm name.
But having that in the public wayland-egl header is not an option,
since that
should be driver/platform independent.
So we need to share something just between mesa and libva somehow.
2. We dont like the wayland-egl.h much, if we could drop it easily, we
would do it.
So expanding it has always a bitter taste, and I'd like not to add
more stuff,
thats hard to drop later, if possible.
Unfortunately I dont have a better answer now, which is why the header
was copied over.
2012/2/23 Zhao, Halley <halley.zhao at intel.com>:
> 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
More information about the mesa-dev
mailing list