All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2 0/2] Introduce DMA buffer sharing mechanism
@ 2011-12-02  8:57 ` Sumit Semwal
  0 siblings, 0 replies; 198+ messages in thread
From: Sumit Semwal @ 2011-12-02  8:57 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-mm, linaro-mm-sig,
	dri-devel, linux-media
  Cc: linux, arnd, jesse.barker, m.szyprowski, rob, daniel,
	t.stanislaws, Sumit Semwal

Hello Everyone,

This is RFC v2 for DMA buffer sharing mechanism - changes from v1 are in the
changelog below.

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 an attempt to define 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. [1]

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
   'export' operation.
- 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 map_dma_buf and
   unmap_dma_buf operations.

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 <arnd@arndb.de>, Rob Clark <rob@ti.com> and
Daniel Vetter <daniel@ffwll.ch>.

The implementation is inspired from proof-of-concept patch-set from
Tomasz Stanislawski <t.stanislaws@samsung.com>, who demonstrated buffer sharing
between two v4l2 devices. [2]

References:
[1]: https://wiki.linaro.org/OfficeofCTO/MemoryManagement
[2]: http://lwn.net/Articles/454389

Patchset based on top of 3.2-rc3, the current version can be found at

http://git.linaro.org/gitweb?p=people/sumitsemwal/linux-3.x.git
Branch: dma-buf-upstr-v2

Earlier version at: https://lkml.org/lkml/2011/10/11/92

Best regards,
~Sumit Semwal

History:

v2:
- Review comments incorporated:
   - from Tomasz Stanislawski [https://lkml.org/lkml/2011/10/14/136]
     - kzalloc moved out of critical section
     - corrected some in-code comments

   - from Dave Airlie [https://lkml.org/lkml/2011/11/25/123]

   - from Daniel Vetter and Rob Clark [https://lkml.org/lkml/2011/11/26/53]
     - use struct sg_table in place of struct scatterlist
     - rename {get,put}_scatterlist to {map,unmap}_dma_buf
     - add new wrapper APIs dma_buf_{map,unmap}_attachment for ease of users
     
- documentation updates as per review comments from Randy Dunlap
     [https://lkml.org/lkml/2011/10/12/439]

v1: original

Sumit Semwal (2):
  dma-buf: Introduce dma buffer sharing mechanism
  dma-buf: Documentation for buffer sharing framework

 Documentation/dma-buf-sharing.txt |  223 ++++++++++++++++++++++++++++
 drivers/base/Kconfig              |   10 ++
 drivers/base/Makefile             |    1 +
 drivers/base/dma-buf.c            |  290 +++++++++++++++++++++++++++++++++++++
 include/linux/dma-buf.h           |  176 ++++++++++++++++++++++
 5 files changed, 700 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

-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 198+ messages in thread

end of thread, other threads:[~2012-01-11  1:08 UTC | newest]

Thread overview: 198+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02  8:57 [RFC v2 0/2] Introduce DMA buffer sharing mechanism Sumit Semwal
2011-12-02  8:57 ` Sumit Semwal
2011-12-02  8:57 ` Sumit Semwal
2011-12-02  8:57 ` [RFC v2 1/2] dma-buf: Introduce dma " Sumit Semwal
2011-12-02  8:57   ` Sumit Semwal
2011-12-02 17:11   ` Konrad Rzeszutek Wilk
2011-12-02 17:11     ` Konrad Rzeszutek Wilk
2011-12-02 17:11     ` Konrad Rzeszutek Wilk
2011-12-05  9:48     ` Semwal, Sumit
2011-12-05  9:48       ` Semwal, Sumit
2011-12-05  9:48       ` Semwal, Sumit
2011-12-05 17:18   ` Arnd Bergmann
2011-12-05 17:18     ` Arnd Bergmann
2011-12-05 17:18     ` Arnd Bergmann
2011-12-05 18:55     ` Daniel Vetter
2011-12-05 18:55       ` Daniel Vetter
2011-12-05 18:55       ` Daniel Vetter
2011-12-05 19:29       ` Arnd Bergmann
2011-12-05 19:29         ` Arnd Bergmann
2011-12-05 19:29         ` Arnd Bergmann
2011-12-05 20:58         ` Daniel Vetter
2011-12-05 20:58           ` Daniel Vetter
2011-12-05 20:58           ` Daniel Vetter
2011-12-05 22:04           ` Arnd Bergmann
2011-12-05 22:04             ` Arnd Bergmann
2011-12-05 22:04             ` Arnd Bergmann
2011-12-05 22:33             ` Daniel Vetter
2011-12-05 22:33               ` Daniel Vetter
2011-12-05 22:33               ` Daniel Vetter
2011-12-05 20:46     ` Rob Clark
2011-12-05 20:46       ` Rob Clark
2011-12-05 20:46       ` Rob Clark
2011-12-05 21:23       ` Daniel Vetter
2011-12-05 21:23         ` Daniel Vetter
2011-12-05 21:23         ` Daniel Vetter
2011-12-05 22:11         ` Rob Clark
2011-12-05 22:11           ` Rob Clark
2011-12-05 22:11           ` Rob Clark
2011-12-05 22:33           ` Daniel Vetter
2011-12-05 22:33             ` Daniel Vetter
2011-12-05 22:33             ` Daniel Vetter
2011-12-06 13:16           ` Arnd Bergmann
2011-12-06 13:16             ` Arnd Bergmann
2011-12-06 13:16             ` Arnd Bergmann
2011-12-06 15:28             ` Daniel Vetter
2011-12-06 15:28               ` Daniel Vetter
2011-12-06 15:28               ` Daniel Vetter
2011-12-07 13:27           ` Semwal, Sumit
2011-12-07 13:27             ` Semwal, Sumit
2011-12-07 13:27             ` Semwal, Sumit
2011-12-07 13:40             ` Arnd Bergmann
2011-12-07 13:40               ` Arnd Bergmann
2011-12-07 13:40               ` Arnd Bergmann
2011-12-08 21:44               ` [Linaro-mm-sig] " Daniel Vetter
2011-12-08 21:44                 ` Daniel Vetter
2011-12-08 21:44                 ` Daniel Vetter
2011-12-09 14:13                 ` Arnd Bergmann
2011-12-09 14:13                   ` Arnd Bergmann
2011-12-09 14:13                   ` Arnd Bergmann
2011-12-09 14:24                   ` Alan Cox
2011-12-09 14:24                     ` Alan Cox
2011-12-09 14:24                     ` Alan Cox
2011-12-10  4:01                     ` Daniel Vetter
2011-12-10  4:01                       ` Daniel Vetter
2011-12-10  4:01                       ` Daniel Vetter
2011-12-12 16:48                       ` Arnd Bergmann
2011-12-12 16:48                         ` Arnd Bergmann
2011-12-12 16:48                         ` Arnd Bergmann
2011-12-19  6:16                         ` Semwal, Sumit
2011-12-19  6:16                           ` Semwal, Sumit
2011-12-19  6:16                           ` Semwal, Sumit
2011-12-20 15:41                           ` Arnd Bergmann
2011-12-20 15:41                             ` Arnd Bergmann
2011-12-20 15:41                             ` Arnd Bergmann
2011-12-20 16:41                             ` Rob Clark
2011-12-20 16:41                               ` Rob Clark
2011-12-20 16:41                               ` Rob Clark
2011-12-20 17:14                               ` Daniel Vetter
2011-12-20 17:14                                 ` Daniel Vetter
2011-12-20 17:14                                 ` Daniel Vetter
2011-12-20 17:14                                 ` Daniel Vetter
2011-12-21 17:27                                 ` Arnd Bergmann
2011-12-21 17:27                                   ` Arnd Bergmann
2011-12-21 17:27                                   ` Arnd Bergmann
2011-12-21 19:04                                   ` Daniel Vetter
2011-12-21 19:04                                     ` Daniel Vetter
2011-12-21 19:04                                     ` Daniel Vetter
2011-12-23 10:00                                   ` Semwal, Sumit
2011-12-23 10:00                                     ` Semwal, Sumit
2011-12-23 10:00                                     ` Semwal, Sumit
2011-12-23 17:10                                     ` Rob Clark
2011-12-23 17:10                                       ` Rob Clark
2011-12-23 17:10                                       ` Rob Clark
2011-12-20  9:03                   ` Sakari Ailus
2011-12-20  9:03                     ` Sakari Ailus
2011-12-20  9:03                     ` Sakari Ailus
2011-12-20 15:36                     ` Arnd Bergmann
2011-12-20 15:36                       ` Arnd Bergmann
2011-12-20 15:36                       ` Arnd Bergmann
2012-01-01 20:53                       ` Sakari Ailus
2012-01-01 20:53                         ` Sakari Ailus
2012-01-01 20:53                         ` Sakari Ailus
2012-01-01 23:12                         ` Rob Clark
2012-01-01 23:12                           ` Rob Clark
2012-01-01 23:12                           ` Rob Clark
2011-12-13 13:33                 ` Hans Verkuil
2011-12-13 13:33                   ` Hans Verkuil
2011-12-13 13:33                   ` Hans Verkuil
2011-12-05 22:09       ` Arnd Bergmann
2011-12-05 22:09         ` Arnd Bergmann
2011-12-05 22:09         ` Arnd Bergmann
2011-12-05 22:09         ` Arnd Bergmann
2011-12-05 22:15         ` Rob Clark
2011-12-05 22:15           ` Rob Clark
2011-12-05 22:15           ` Rob Clark
2011-12-05 22:35         ` Rob Clark
2011-12-05 22:35           ` Rob Clark
2011-12-05 22:35           ` Rob Clark
2011-12-07  6:35     ` Semwal, Sumit
2011-12-07  6:35       ` Semwal, Sumit
2011-12-07  6:35       ` Semwal, Sumit
2011-12-07 10:11       ` Arnd Bergmann
2011-12-07 10:11         ` Arnd Bergmann
2011-12-07 10:11         ` Arnd Bergmann
2011-12-07 11:02         ` Semwal, Sumit
2011-12-07 11:02           ` Semwal, Sumit
2011-12-07 11:02           ` Semwal, Sumit
2011-12-07 11:34           ` Arnd Bergmann
2011-12-07 11:34             ` Arnd Bergmann
2011-12-07 11:34             ` Arnd Bergmann
2011-12-09 22:50     ` [Linaro-mm-sig] " Robert Morell
2011-12-09 22:50       ` Robert Morell
2011-12-09 22:50       ` Robert Morell
2011-12-09 22:50       ` Robert Morell
2011-12-10 11:13       ` Mauro Carvalho Chehab
2011-12-10 11:13         ` Mauro Carvalho Chehab
2011-12-10 11:13         ` Mauro Carvalho Chehab
2011-12-10 11:13         ` Mauro Carvalho Chehab
2011-12-12 22:44         ` Robert Morell
2011-12-12 22:44           ` Robert Morell
2011-12-12 22:44           ` Robert Morell
2011-12-12 22:44           ` Robert Morell
2011-12-13 15:10           ` Arnd Bergmann
2011-12-13 15:10             ` Arnd Bergmann
2011-12-13 15:10             ` Arnd Bergmann
2011-12-13 15:10             ` Arnd Bergmann
2011-12-20  2:05             ` Robert Morell
2011-12-20  2:05               ` Robert Morell
2011-12-20  2:05               ` Robert Morell
2011-12-20  2:05               ` Robert Morell
2011-12-20 14:29               ` Anca Emanuel
2011-12-20 14:29                 ` Anca Emanuel
2011-12-20 14:29                 ` Anca Emanuel
2011-12-20 14:29                 ` Anca Emanuel
2012-01-09  6:20   ` InKi Dae
2012-01-09  6:20     ` InKi Dae
2012-01-09  6:20     ` InKi Dae
2012-01-09  8:10     ` Daniel Vetter
2012-01-09  8:10       ` Daniel Vetter
2012-01-09  8:10       ` Daniel Vetter
2012-01-09  8:11       ` [Linaro-mm-sig] " Dave Airlie
2012-01-09  8:11         ` Dave Airlie
2012-01-09  8:11         ` Dave Airlie
2012-01-09 10:10       ` InKi Dae
2012-01-09 10:10         ` InKi Dae
2012-01-09 10:10         ` InKi Dae
2012-01-09 10:27         ` Daniel Vetter
2012-01-09 10:27           ` Daniel Vetter
2012-01-09 10:27           ` Daniel Vetter
2012-01-09 12:06           ` InKi Dae
2012-01-09 12:06             ` InKi Dae
2012-01-09 12:06             ` InKi Dae
2012-01-09 16:02             ` Daniel Vetter
2012-01-09 16:02               ` Daniel Vetter
2012-01-09 16:02               ` Daniel Vetter
2012-01-09 15:17         ` Rob Clark
2012-01-09 15:17           ` Rob Clark
2012-01-09 15:17           ` Rob Clark
2012-01-10  1:34           ` InKi Dae
2012-01-10  1:34             ` InKi Dae
2012-01-10  1:34             ` InKi Dae
2012-01-10  2:14             ` Rob Clark
2012-01-10  2:14               ` Rob Clark
2012-01-10  2:14               ` Rob Clark
2012-01-10  6:09               ` Semwal, Sumit
2012-01-10  6:09                 ` Semwal, Sumit
2012-01-10  6:09                 ` Semwal, Sumit
2012-01-10  7:28                 ` InKi Dae
2012-01-10  7:28                   ` InKi Dae
2012-01-10  7:28                   ` InKi Dae
2012-01-10  9:19                   ` InKi Dae
2012-01-10  9:19                     ` InKi Dae
2012-01-10  9:19                     ` InKi Dae
2012-01-11  1:08               ` InKi Dae
2012-01-11  1:08                 ` InKi Dae
2012-01-11  1:08                 ` InKi Dae
2011-12-02  8:57 ` [RFC v2 2/2] dma-buf: Documentation for buffer sharing framework Sumit Semwal
2011-12-02  8:57   ` Sumit Semwal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.