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

benjamin.gaignard at linaro.org benjamin.gaignard at linaro.org
Tue Jan 7 09:41:41 PST 2014


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



More information about the wayland-devel mailing list