|| ||Sumit Semwal <firstname.lastname@example.org> |
<email@example.com>, <firstname.lastname@example.org> |
|| ||[RFC 0/2] Introduce dma buffer sharing mechanism |
|| ||Tue, 11 Oct 2011 14:53:51 +0530|
|| ||<email@example.com>, <firstname.lastname@example.org>,
<email@example.com>, <firstname.lastname@example.org>, <email@example.com>,
Sumit Semwal <firstname.lastname@example.org>|
|| ||Article, Thread
Various subsystems - V4L2, GPU-accessors, DRI to name a few - have felt the
need to have a common mechanism to share memory buffers across different
devices - ARM, video hardware, GPU.
This need comes forth from a variety of use cases including cameras, image
processing, video recorders, sound processing, DMA engines, GPU and display
buffers, and others.
This RFC is the first attempt in defining such a buffer sharing mechanism- it is
the result of discussions from a couple of memory-management mini-summits held
by Linaro to understand and address common needs around memory management. 
A new dma_buf buffer object is added, with operations and API to allow easy
sharing of this buffer object across devices.
The framework allows:
- a new buffer-object to be created with fixed size.
- different devices to 'attach' themselves to this buffer, to facilitate
backing storage negotiation, using dma_buf_attach() API.
- association of a file pointer with each user-buffer and associated
allocator-defined operations on that buffer. This operation is called the
- this exported buffer-object to be shared with the other entity by asking for
its 'file-descriptor (fd)', and sharing the fd across.
- a received fd to get the buffer object back, where it can be accessed using
the associated exporter-defined operations.
- the exporter and user to share the scatterlist using get_scatterlist and
Documentation present in the patch-set gives more details.
This is based on design suggestions from many people at the mini-summits,
most notably from Arnd Bergmann <email@example.com>, Rob Clark <firstname.lastname@example.org> and
Daniel Vetter <email@example.com>.
The implementation is inspired from proof-of-concept patch-set from
Tomasz Stanislawski <firstname.lastname@example.org>, who demonstrated buffer sharing
between two v4l2 devices. 
Sumit Semwal (2):
dma-buf: Introduce dma buffer sharing mechanism
dma-buf: Documentation for buffer sharing framework
Documentation/dma-buf-sharing.txt | 210 ++++++++++++++++++++++++++++++++
drivers/base/Kconfig | 10 ++
drivers/base/Makefile | 1 +
drivers/base/dma-buf.c | 242 +++++++++++++++++++++++++++++++++++++
include/linux/dma-buf.h | 162 +++++++++++++++++++++++++
5 files changed, 625 insertions(+), 0 deletions(-)
create mode 100644 Documentation/dma-buf-sharing.txt
create mode 100644 drivers/base/dma-buf.c
create mode 100644 include/linux/dma-buf.h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/