Skylane - implementation of Wayland in Rust
Kristian Høgsberg
hoegsberg at gmail.com
Thu May 4 20:40:24 UTC 2017
On Thu, May 4, 2017 at 8:59 AM, Wojciech Kluczka
<wojciech.kluczka at gmail.com> wrote:
> Hello,
>
> This was supposed to be only a short announcement of Skylane -
> implementation of Wayland in Rust - but it was pointed to me that one can
> not use hardware acceleration without original libwayland so I have to also
> ask some questions.
>
> On client side there's not much to worry about (as far as I could see) but
> server has to use mesa extension which adds global object to display,
> relying on concrete implementation.
> - I can guess but was the reason to make such dependence?
The idea is that the EGL driver, Mesa or any other driver, could
implement the Wayland server side extension with whatever protocol
necessary. Mesa uses wl_drm, but other drivers can use a different
protocol or a shared-memory section or such. The EGL extension
provides a high-enough level of abstraction that a wide range of
drivers should be able to implement it. If you want an EGL driver to
talk to Wayland, you need the driver and the server to share a C
implementation of the protocol library.
> - Would that be feasible to add another more generic extension providing
> data needed to create wl_drm global by server instead of implicitly adding
> it in mesa?
Not sure what you have in mind here, but...
> - I didn't look at details of implementation. Probably not, but would it be
> feasible to provide wl_drm global without any extension, using only
> available drm/gbm API?
Yes, you don't need to use the EGL extension. You can implement wl_drm
or the dma-buf extension directly in your rust based compositor. Then
use
https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt
to import the dma buf fd as an EGLImage.
Kristian
> In many places Wayland (not only Weston) is referred as "reference
> implementation" so I didn't really expect such obstacles.
>
> I guess questions like "why new implementation?" or "why not bindings?" will
> appear, so here are some words in advance. There is one project aiming to
> create Rust bindings, but at the time I started there was no support for
> server side (I don't know how about now) and whole think was about adding
> another complicated abstraction layer dumping straightforwardness (and
> performance). On the other hand Rust provides great support for
> multi-threading so it would be wasteful to impose on users how they create
> wayland thread. Removing that what left is creating sockets, dispatching and
> generating some marshaling code. Not much. And without using libwayland this
> can be clean and slick.
>
> For interested ones, links to skylane and perceptia (window manager /
> compositor in Rust using it):
> https://github.com/perceptia/skylane
> https://github.com/perceptia/perceptia
>
> Best regards,
> Wojciech Kluczka
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
More information about the wayland-devel
mailing list