[PATCH v4 0/3] Add support of dmabuf in wayland/weston

Rob Clark robdclark at gmail.com
Fri Jan 10 06:58:34 PST 2014


I suspect that this is somehow on the same level as wl_drm (which is
in mesa, not wayland).  The difference here is that since you can
share buffers with various things (video codecs, cameras, etc), ie.
things beyond just the gpu, it makes sense to put the protocol in some
sort of common place rather than duplicating it in 20 places.  Perhaps
the thing to do is start creating some proto trees
(git://.../wayland/drmproto ?) for things like this which need a
common home but yet don't belong in wayland.git?

BR,
-R

On Tue, Jan 7, 2014 at 12:57 PM, Jasper St. Pierre
<jstpierre at mecheye.net> wrote:
> Sorry if this was discussed before, but any reason this is being put in
> Wayland, and in the "wl_" namespace? DMA-BUF is a private Linux kernel
> feature that's really semi-stable, not used by all drivers, and I'd hate for
> it to bit-rot and tell people not to use it, the same way wl_shell went.
> Having it only in the weston source tree, and in a private "dmabuf"
> namespace seems like it should be enough for now.
>
> On Tue, Jan 7, 2014 at 12:41 PM, <benjamin.gaignard at linaro.org> wrote:
>>
>> From: Benjamin Gaignard <benjamin.gaignard at linaro.org>
>>
>> The goal of this serie of patches is to add a way to use
>> dmabuf file descriptor inside wayland and weston.
>>
>> In a context where there is no Mesa EGL (and so no wl_drm protocol)
>> wl_dmabuf
>> could be used as an alternative to shm to share buffers between hardware
>> devices. If your hardware device (video decoder, renderer, etc...) need
>> physical contiguous memory (obviously don't have MMU) wl_dmabuf may save
>> the cost of one copy compare to shm.
>>
>> shm case:
>> videodecoder --(copy into shm_buffer)--> weston(+pixman) --> HW renderer
>>
>> dmabuf case:
>> videodecoder --(directly write in dmabuf buffer)--> weston(+pixman) --> HW
>> renderer
>>
>> The server is responsible to send its supported pixel formats and the
>> device
>> name to be used by the client to allocate buffers.
>>
>> While mmap() call on dmabuf file descriptor result isn't guaranty on all
>> architectures both server and client should take care of it before
>> accessing
>> to buffer data to avoid segfault.
>>
>> This series of patches include wayland and weston modifications.
>> An example of how use wl_dmabuf is provided in
>> weston/clients/simple-dmabuf.c
>>
>> === Wayland ===
>> Benjamin Gaignard (1):
>>   Add wl_dmabuf protocol
>>
>>  protocol/Makefile.am        |    6 +-
>>  protocol/wayland-dmabuf.xml |  128 ++++++++++++++++++++++++
>>  src/Makefile.am             |   12 ++-
>>  src/wayland-dmabuf.c        |  231
>> +++++++++++++++++++++++++++++++++++++++++++
>>  src/wayland-dmabuf.h        |  123 +++++++++++++++++++++++
>>  5 files changed, 496 insertions(+), 4 deletions(-)
>>  create mode 100644 protocol/wayland-dmabuf.xml
>>  create mode 100644 src/wayland-dmabuf.c
>>  create mode 100644 src/wayland-dmabuf.h
>>
>> === Weston ===
>> Benjamin Gaignard (2):
>>   compositor-drm: allow to be a wl_dmabuf server
>>   add simple-dmabuf client
>>
>>  clients/Makefile.am     |   11 ++
>>  clients/simple-dmabuf.c |  469
>> +++++++++++++++++++++++++++++++++++++++++++++++
>>  configure.ac            |    5 +
>>  src/compositor-drm.c    |   83 ++++++++-
>>  src/compositor.c        |    4 +-
>>  src/compositor.h        |    2 +
>>  src/pixman-renderer.c   |   93 +++++++---
>>  7 files changed, 637 insertions(+), 30 deletions(-)
>>  create mode 100644 clients/simple-dmabuf.c
>>
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>
>
>
> --
>   Jasper
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>


More information about the wayland-devel mailing list