From: Benjamin Gaignard benjamin.gaignard@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.
=== Wayland === Benjamin Gaignard (1): Add wl_dmabuf protocol
protocol/Makefile.am | 6 +- protocol/wayland-dmabuf.xml | 133 +++++++++++++++++++++ src/Makefile.am | 12 +- src/wayland-dmabuf.c | 279 +++++++++++++++++++++++++++++++++++++++++++ src/wayland-dmabuf.h | 136 +++++++++++++++++++++ 5 files changed, 562 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 (1): compositor-drm: allow to be a wl_dmabuf server
src/compositor-drm.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++-- src/compositor.c | 4 +- src/compositor.h | 2 + src/pixman-renderer.c | 86 ++++++++++++++++++------- 4 files changed, 230 insertions(+), 30 deletions(-)