[Mesa-dev] Add wayland EGL platform
Kristian Høgsberg
krh at bitplanet.net
Fri Feb 4 09:34:17 PST 2011
On Fri, Feb 4, 2011 at 11:31 AM, Benjamin Franzke
<benjaminfranzke at googlemail.com> wrote:
> Hi Mesa List,
>
> This patch series add a egl wayland platform.
> A helper library was needed in order to provide native types
> for the egl routines.
> The types are used to cache wayland events but also to
> create an interface for the application, e.g. for resizing.
>
> The library header will be provided by wayland, as it defines
> what vendors have to implement.
> It is available here (and will be pushed to wayland)
> http://cgit.freedesktop.org/~bnf/wayland/diff/wayland/wayland-egl.h?h=wayland-egl
Just to expand on this a bit, libwayland-egl.so defines the Walyand
EGL native platform. It's an interface that's defined by a header
that's part of Wayland, but it's provided by the EGL driver vendor.
It's an abstraction that let's Wayland clients create native windows
and pixmaps without having to deal with drm extensions and details
such as gem names and shared drm EGL images. The libwayland-egl.so
implementation is free to talk to the Wayland compositor to look up
whatever Wayland interfaces it needs to implement its buffer sharing
mechanism, whether that's the current "drm" interface for sharing GEM
buffers, the "shm" interface for swrast or a custom/proprietary
protocol for sharing buffers (and cross process sync objects, if
necessary).
Also when working on the libwayland-egl.so interface we realized that
the native pixmap is really the natural, platform specific cross
process buffer. EGLImage was designed for cross-API, sharing not
cross process sharing (something that was pointed out to me several
times at the recent Khronos F2F). So at this point, I'm more inclined
to leave the buffer sharing details to the libwayland-egl.so
implementation in terms of native pixmaps (and windows, of course),
and then just create an EGLImage from wl_egl_pixmap for the cases when
we need an EGLImage. Of course, implementing an EGL window surface
also lets us encapsulate and share the throttling and flipping logic
in in the eglSwapBuffer implementation.
Kristian
More information about the mesa-dev
mailing list