[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 gea

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 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

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 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 gea

[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 rul

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 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 rul

[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). > > http://cgi

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 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). > > http://cgi

[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 buffer

[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 t

[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); > + > + ? ?

[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 buffer-obje

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 t

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); > + > +    

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 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

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 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 buffer-obje

[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 a

[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 >> interfac

[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 j

[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 want

[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 buffer-obje

[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 diffe

[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 obje

[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 e

[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 acro

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 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 diffe

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 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 a

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 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 >> interfac

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 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 obje

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 j

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 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 e

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 want

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 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 acro

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 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 buffer-obje