[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-12-01 Thread Semwal, Sumit
Hi Dave, Daniel, Rob, > > On Sun, Nov 27, 2011 at 12:29 PM, Rob Clark wrote: >> >> On Sat, Nov 26, 2011 at 8:00 AM, Daniel Vetter wrote: >> > On Fri, Nov 25, 2011 at 17:28, Dave Airlie wrote: >> >> I've rebuilt my PRIME interface on top of dmabuf to see how it would >> >> work, >> >> >> >> I've

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-12-01 Thread Semwal, Sumit
Hi Dave, Daniel, Rob, On Sun, Nov 27, 2011 at 12:29 PM, Rob Clark wrote: > On Sat, Nov 26, 2011 at 8:00 AM, Daniel Vetter wrote: > > On Fri, Nov 25, 2011 at 17:28, Dave Airlie wrote: > >> I've rebuilt my PRIME interface on top of dmabuf to see how it would > work, > >> > >> I've got primed

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-30 Thread Semwal, Sumit
Hi Dave, Daniel, Rob, On Sun, Nov 27, 2011 at 12:29 PM, Rob Clark robdcl...@gmail.com wrote: On Sat, Nov 26, 2011 at 8:00 AM, Daniel Vetter dan...@ffwll.ch wrote: On Fri, Nov 25, 2011 at 17:28, Dave Airlie airl...@gmail.com wrote: I've rebuilt my PRIME interface on top of dmabuf to see how

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-30 Thread Semwal, Sumit
Hi Dave, Daniel, Rob, On Sun, Nov 27, 2011 at 12:29 PM, Rob Clark robdcl...@gmail.com wrote: On Sat, Nov 26, 2011 at 8:00 AM, Daniel Vetter dan...@ffwll.ch wrote: On Fri, Nov 25, 2011 at 17:28, Dave Airlie airl...@gmail.com wrote: I've rebuilt my PRIME interface on top of dmabuf to see how

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-27 Thread Rob Clark
On Sat, Nov 26, 2011 at 8:00 AM, Daniel Vetter wrote: > On Fri, Nov 25, 2011 at 17:28, Dave Airlie wrote: >> I've rebuilt my PRIME interface on top of dmabuf to see how it would work, >> >> I've got primed gears running again on top, but I expect all my object >> lifetime and memory ownership

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-26 Thread Daniel Vetter
On Fri, Nov 25, 2011 at 17:28, Dave Airlie wrote: > I've rebuilt my PRIME interface on top of dmabuf to see how it would work, > > I've got primed gears running again on top, but I expect all my object > lifetime and memory ownership rules need fixing up (i.e. leaks like a > sieve). > >

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-26 Thread Daniel Vetter
On Fri, Nov 25, 2011 at 17:28, Dave Airlie airl...@gmail.com wrote: I've rebuilt my PRIME interface on top of dmabuf to see how it would work, I've got primed gears running again on top, but I expect all my object lifetime and memory ownership rules need fixing up (i.e. leaks like a sieve).

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-26 Thread Rob Clark
On Sat, Nov 26, 2011 at 8:00 AM, Daniel Vetter dan...@ffwll.ch wrote: On Fri, Nov 25, 2011 at 17:28, Dave Airlie airl...@gmail.com wrote: I've rebuilt my PRIME interface on top of dmabuf to see how it would work, I've got primed gears running again on top, but I expect all my object lifetime

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Daniel Vetter
On Fri, Nov 25, 2011 at 02:13:22PM +, Dave Airlie wrote: > On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal wrote: > > This is the first step in defining a dma buffer sharing mechanism. > > > > A new buffer object dma_buf is added, with operations and API to allow easy > > sharing of this

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Dave Airlie
I've rebuilt my PRIME interface on top of dmabuf to see how it would work, I've got primed gears running again on top, but I expect all my object lifetime and memory ownership rules need fixing up (i.e. leaks like a sieve). http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-prime-dmabuf has

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Dave Airlie
> +struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct device *dev) > +{ > + ? ? ? struct dma_buf_attachment *attach; > + ? ? ? int ret; > + > + ? ? ? BUG_ON(!dmabuf || !dev); > + > + ? ? ? mutex_lock(>lock); > + > + ? ? ?

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Dave Airlie
On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal wrote: > This is the first step in defining a dma buffer sharing mechanism. > > A new buffer object dma_buf is added, with operations and API to allow easy > sharing of this buffer object across devices. > > The framework allows: > - a new

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Dave Airlie
On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal sumit.sem...@ti.com wrote: This is the first step in defining a dma buffer sharing mechanism. A new buffer object dma_buf is added, with operations and API to allow easy sharing of this buffer object across devices. The framework allows: - a

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Daniel Vetter
On Fri, Nov 25, 2011 at 02:13:22PM +, Dave Airlie wrote: On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal sumit.sem...@ti.com wrote: This is the first step in defining a dma buffer sharing mechanism. A new buffer object dma_buf is added, with operations and API to allow easy sharing of

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Dave Airlie
+struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, +                                               struct device *dev) +{ +       struct dma_buf_attachment *attach; +       int ret; + +       BUG_ON(!dmabuf || !dev); + +       mutex_lock(dmabuf-lock); + +       attach =

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-25 Thread Dave Airlie
I've rebuilt my PRIME interface on top of dmabuf to see how it would work, I've got primed gears running again on top, but I expect all my object lifetime and memory ownership rules need fixing up (i.e. leaks like a sieve). http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-prime-dmabuf has

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-08 Thread Clark, Rob
On Thu, Nov 3, 2011 at 3:04 AM, Marek Szyprowski wrote: > Hello, > > I'm sorry for a late reply, but after Kernel Summit/ELC I have some comments. > > On Friday, October 14, 2011 5:35 PM Daniel Vetter wrote: > >> On Fri, Oct 14, 2011 at 12:00:58PM +0200, Tomasz Stanislawski wrote: >> > >+/** >> >

Re: [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-08 Thread Clark, Rob
On Thu, Nov 3, 2011 at 3:04 AM, Marek Szyprowski m.szyprow...@samsung.com wrote: Hello, I'm sorry for a late reply, but after Kernel Summit/ELC I have some comments. On Friday, October 14, 2011 5:35 PM Daniel Vetter wrote: On Fri, Oct 14, 2011 at 12:00:58PM +0200, Tomasz Stanislawski wrote:

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-03 Thread Marek Szyprowski
Hello, I'm sorry for a late reply, but after Kernel Summit/ELC I have some comments. On Friday, October 14, 2011 5:35 PM Daniel Vetter wrote: > On Fri, Oct 14, 2011 at 12:00:58PM +0200, Tomasz Stanislawski wrote: > > >+/** > > >+ * struct dma_buf_ops - operations possible on struct dma_buf > >

RE: [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-11-03 Thread Marek Szyprowski
Hello, I'm sorry for a late reply, but after Kernel Summit/ELC I have some comments. On Friday, October 14, 2011 5:35 PM Daniel Vetter wrote: On Fri, Oct 14, 2011 at 12:00:58PM +0200, Tomasz Stanislawski wrote: +/** + * struct dma_buf_ops - operations possible on struct dma_buf + *

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Sumit Semwal
On 14 October 2011 15:30, Tomasz Stanislawski wrote: > Hi Mr. Sumit Semwal, Hello Mr. Tomasz Stanislawski :), > Thank you for taking care of the framework for buffer sharing. > The support of buffer sharing in V4L2, both exporting and importing was > posted in shrbuf proof-of-concept patch. It

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Daniel Vetter
On Fri, Oct 14, 2011 at 12:00:58PM +0200, Tomasz Stanislawski wrote: > >+/** > >+ * struct dma_buf_ops - operations possible on struct dma_buf > >+ * @create: creates a struct dma_buf of a fixed size. Actual allocation > >+ * does not happen here. > > The 'create' ops is not present in

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Tomasz Stanislawski
Hi Mr. Sumit Semwal, Thank you for taking care of the framework for buffer sharing. The support of buffer sharing in V4L2, both exporting and importing was posted in shrbuf proof-of-concept patch. It should be easy to port it to dmabuf.

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Rob Clark
On Fri, Oct 14, 2011 at 5:00 AM, Tomasz Stanislawski wrote: >> + * @attach: allows different devices to 'attach' themselves to the given >> + * ? ? ? ? buffer. It might return -EBUSY to signal that backing storage >> + * ? ? ? ? is already allocated and incompatible with the requirements >> + * ?

Re: [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Tomasz Stanislawski
Hi Mr. Sumit Semwal, Thank you for taking care of the framework for buffer sharing. The support of buffer sharing in V4L2, both exporting and importing was posted in shrbuf proof-of-concept patch. It should be easy to port it to dmabuf.

Re: [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Sumit Semwal
On 14 October 2011 15:30, Tomasz Stanislawski t.stanisl...@samsung.com wrote: Hi Mr. Sumit Semwal, Hello Mr. Tomasz Stanislawski :), Thank you for taking care of the framework for buffer sharing. The support of buffer sharing in V4L2, both exporting and importing was posted in shrbuf

Re: [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Daniel Vetter
On Fri, Oct 14, 2011 at 12:00:58PM +0200, Tomasz Stanislawski wrote: +/** + * struct dma_buf_ops - operations possible on struct dma_buf + * @create: creates a struct dma_buf of a fixed size. Actual allocation + * does not happen here. The 'create' ops is not present in dma_buf_ops.

Re: [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-14 Thread Rob Clark
On Fri, Oct 14, 2011 at 5:00 AM, Tomasz Stanislawski t.stanisl...@samsung.com wrote: + * @attach: allows different devices to 'attach' themselves to the given + *         buffer. It might return -EBUSY to signal that backing storage + *         is already allocated and incompatible with the

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Daniel Vetter
On Wed, Oct 12, 2011 at 03:34:54PM +0100, Dave Airlie wrote: > On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark wrote: > > On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie wrote: > >>> But then we'd need a different set of accessors for every different > >>> drm/v4l/etc driver, wouldn't we? > >> > >> Not

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark wrote: > On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie wrote: >>> But then we'd need a different set of accessors for every different >>> drm/v4l/etc driver, wouldn't we? >> >> Not any more different than you need for this, you just have a new >>

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
> But then we'd need a different set of accessors for every different > drm/v4l/etc driver, wouldn't we? Not any more different than you need for this, you just have a new interface that you request a sw object from, then mmap that object, and underneath it knows who owns it in the kernel. mmap

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
> > well, the mmap is actually implemented by the buffer allocator > (v4l/drm).. although not sure if this was the point Then why not use the correct interface? doing some sort of not-quite generic interface isn't really helping anyone except adding an ABI that we have to support. If someone

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal wrote: > This is the first step in defining a dma buffer sharing mechanism. > > A new buffer object dma_buf is added, with operations and API to allow easy > sharing of this buffer object across devices. > > The framework allows: > - a new

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 9:34 AM, Dave Airlie wrote: > On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark wrote: >> On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie wrote: But then we'd need a different set of accessors for every different drm/v4l/etc driver, wouldn't we? >>> >>> Not any more

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie wrote: >> But then we'd need a different set of accessors for every different >> drm/v4l/etc driver, wouldn't we? > > Not any more different than you need for this, you just have a new > interface that you request a sw object from, > then mmap that

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 8:35 AM, Dave Airlie wrote: >> >> well, the mmap is actually implemented by the buffer allocator >> (v4l/drm).. although not sure if this was the point > > Then why not use the correct interface? doing some sort of not-quite > generic interface isn't really helping anyone

[Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 7:41 AM, Dave Airlie wrote: > On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal wrote: >> This is the first step in defining a dma buffer sharing mechanism. >> >> A new buffer object dma_buf is added, with operations and API to allow easy >> sharing of this buffer object

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal sumit.sem...@ti.com wrote: This is the first step in defining a dma buffer sharing mechanism. A new buffer object dma_buf is added, with operations and API to allow easy sharing of this buffer object across devices. The framework allows: - a

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 7:41 AM, Dave Airlie airl...@gmail.com wrote: On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal sumit.sem...@ti.com wrote: This is the first step in defining a dma buffer sharing mechanism. A new buffer object dma_buf is added, with operations and API to allow easy

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
well, the mmap is actually implemented by the buffer allocator (v4l/drm).. although not sure if this was the point Then why not use the correct interface? doing some sort of not-quite generic interface isn't really helping anyone except adding an ABI that we have to support. If someone wants

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 8:35 AM, Dave Airlie airl...@gmail.com wrote: well, the mmap is actually implemented by the buffer allocator (v4l/drm).. although not sure if this was the point Then why not use the correct interface? doing some sort of not-quite generic interface isn't really helping

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
But then we'd need a different set of accessors for every different drm/v4l/etc driver, wouldn't we? Not any more different than you need for this, you just have a new interface that you request a sw object from, then mmap that object, and underneath it knows who owns it in the kernel. mmap

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie airl...@gmail.com wrote: But then we'd need a different set of accessors for every different drm/v4l/etc driver, wouldn't we? Not any more different than you need for this, you just have a new interface that you request a sw object from, then mmap

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Dave Airlie
On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark robdcl...@gmail.com wrote: On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie airl...@gmail.com wrote: But then we'd need a different set of accessors for every different drm/v4l/etc driver, wouldn't we? Not any more different than you need for this, you

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Daniel Vetter
On Wed, Oct 12, 2011 at 03:34:54PM +0100, Dave Airlie wrote: On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark robdcl...@gmail.com wrote: On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie airl...@gmail.com wrote: But then we'd need a different set of accessors for every different drm/v4l/etc driver,

Re: [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-12 Thread Rob Clark
On Wed, Oct 12, 2011 at 9:34 AM, Dave Airlie airl...@gmail.com wrote: On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark robdcl...@gmail.com wrote: On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie airl...@gmail.com wrote: But then we'd need a different set of accessors for every different drm/v4l/etc

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-11 Thread Sumit Semwal
This is the first step in defining a dma buffer sharing mechanism. A new buffer object dma_buf 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'

[RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism

2011-10-11 Thread Sumit Semwal
This is the first step in defining a dma buffer sharing mechanism. A new buffer object dma_buf 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'