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

2012-01-10 Thread InKi Dae
2012/1/10 Rob Clark : > On Mon, Jan 9, 2012 at 7:34 PM, InKi Dae wrote: >> 2012/1/10 Rob Clark : >>> On Mon, Jan 9, 2012 at 4:10 AM, InKi Dae wrote: note : in case of sharing a buffer between v4l2 and drm driver, the memory info would be copied vb2_xx_buf to xx_gem or xx_gem to vb2

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

2012-01-10 Thread InKi Dae
2012/1/10 InKi Dae : > 2012/1/10 Semwal, Sumit : >> On Tue, Jan 10, 2012 at 7:44 AM, Rob Clark wrote: >>> On Mon, Jan 9, 2012 at 7:34 PM, InKi Dae wrote: 2012/1/10 Rob Clark : at least with no IOMMU, the memory information(containing physical memory address) would be copied to vb2_

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

2012-01-09 Thread InKi Dae
2012/1/10 Semwal, Sumit : > On Tue, Jan 10, 2012 at 7:44 AM, Rob Clark wrote: >> On Mon, Jan 9, 2012 at 7:34 PM, InKi Dae wrote: >>> 2012/1/10 Rob Clark : >>> at least with no IOMMU, the memory information(containing physical >>> memory address) would be copied to vb2_xx_buf object if drm gem >>>

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

2012-01-09 Thread Semwal, Sumit
On Tue, Jan 10, 2012 at 7:44 AM, Rob Clark wrote: > On Mon, Jan 9, 2012 at 7:34 PM, InKi Dae wrote: >> 2012/1/10 Rob Clark : >> at least with no IOMMU, the memory information(containing physical >> memory address) would be copied to vb2_xx_buf object if drm gem >> exported its own buffer and vb2

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

2012-01-09 Thread Rob Clark
On Mon, Jan 9, 2012 at 7:34 PM, InKi Dae wrote: > 2012/1/10 Rob Clark : >> On Mon, Jan 9, 2012 at 4:10 AM, InKi Dae wrote: >>> note : in case of sharing a buffer between v4l2 and drm driver, the >>> memory info would be copied vb2_xx_buf to xx_gem or xx_gem to >>> vb2_xx_buf through sg table. in

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

2012-01-09 Thread InKi Dae
2012/1/10 Rob Clark : > On Mon, Jan 9, 2012 at 4:10 AM, InKi Dae wrote: >> note : in case of sharing a buffer between v4l2 and drm driver, the >> memory info would be copied vb2_xx_buf to xx_gem or xx_gem to >> vb2_xx_buf through sg table. in this case, only memory info is used to >> share, not so

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

2012-01-09 Thread Daniel Vetter
On Mon, Jan 09, 2012 at 09:06:56PM +0900, InKi Dae wrote: > 2012/1/9 Daniel Vetter : > > On Mon, Jan 09, 2012 at 07:10:25PM +0900, InKi Dae wrote: > >> 2012/1/9 Daniel Vetter : > >> > On Mon, Jan 09, 2012 at 03:20:48PM +0900, InKi Dae wrote: > >> >> I has test dmabuf based drm gem module for exynos

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

2012-01-09 Thread Rob Clark
On Mon, Jan 9, 2012 at 4:10 AM, InKi Dae wrote: > note : in case of sharing a buffer between v4l2 and drm driver, the > memory info would be copied vb2_xx_buf to xx_gem or xx_gem to > vb2_xx_buf through sg table. in this case, only memory info is used to > share, not some objects. which v4l2/vb2

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

2012-01-09 Thread InKi Dae
2012/1/9 Daniel Vetter : > On Mon, Jan 09, 2012 at 07:10:25PM +0900, InKi Dae wrote: >> 2012/1/9 Daniel Vetter : >> > On Mon, Jan 09, 2012 at 03:20:48PM +0900, InKi Dae wrote: >> >> I has test dmabuf based drm gem module for exynos and I found one problem. >> >> you can refer to this test repositor

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

2012-01-09 Thread Daniel Vetter
On Mon, Jan 09, 2012 at 07:10:25PM +0900, InKi Dae wrote: > 2012/1/9 Daniel Vetter : > > On Mon, Jan 09, 2012 at 03:20:48PM +0900, InKi Dae wrote: > >> I has test dmabuf based drm gem module for exynos and I found one problem. > >> you can refer to this test repository: > >> http://git.infradead.or

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

2012-01-09 Thread InKi Dae
2012/1/9 Daniel Vetter : > On Mon, Jan 09, 2012 at 03:20:48PM +0900, InKi Dae wrote: >> I has test dmabuf based drm gem module for exynos and I found one problem. >> you can refer to this test repository: >> http://git.infradead.org/users/kmpark/linux-samsung/shortlog/refs/heads/exynos-drm-dmabuf >

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

2012-01-09 Thread Dave Airlie
On Mon, Jan 9, 2012 at 8:10 AM, Daniel Vetter wrote: > On Mon, Jan 09, 2012 at 03:20:48PM +0900, InKi Dae wrote: >> I has test dmabuf based drm gem module for exynos and I found one problem. >> you can refer to this test repository: >> http://git.infradead.org/users/kmpark/linux-samsung/shortlog/r

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

2012-01-09 Thread Daniel Vetter
On Mon, Jan 09, 2012 at 03:20:48PM +0900, InKi Dae wrote: > I has test dmabuf based drm gem module for exynos and I found one problem. > you can refer to this test repository: > http://git.infradead.org/users/kmpark/linux-samsung/shortlog/refs/heads/exynos-drm-dmabuf > > at this repository, I adde

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

2012-01-08 Thread InKi Dae
2011/12/2 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: > - different devices to 'attach' themselves to thi

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

2012-01-01 Thread Rob Clark
On Sun, Jan 1, 2012 at 2:53 PM, Sakari Ailus wrote: > Hi Arnd, > > On Tue, Dec 20, 2011 at 03:36:49PM +, Arnd Bergmann wrote: >> On Tuesday 20 December 2011, Sakari Ailus wrote: >> > (I'm jumping into the discussion in the middle, and might miss something >> > that has already been talked abou

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

2012-01-01 Thread Sakari Ailus
Hi Arnd, On Tue, Dec 20, 2011 at 03:36:49PM +, Arnd Bergmann wrote: > On Tuesday 20 December 2011, Sakari Ailus wrote: > > (I'm jumping into the discussion in the middle, and might miss something > > that has already been talked about. I still hope what I'm about to say is > > relevant. :-)) >

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

2011-12-23 Thread Rob Clark
On Fri, Dec 23, 2011 at 4:00 AM, Semwal, Sumit wrote: > On Wed, Dec 21, 2011 at 10:57 PM, Arnd Bergmann wrote: >> On Tuesday 20 December 2011, Daniel Vetter wrote: >>> > I'm thinking for a first version, we can get enough mileage out of it by >>> > saying: >>> > 1) only exporter can mmap to user

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

2011-12-23 Thread Semwal, Sumit
On Wed, Dec 21, 2011 at 10:57 PM, Arnd Bergmann wrote: > On Tuesday 20 December 2011, Daniel Vetter wrote: >> > I'm thinking for a first version, we can get enough mileage out of it by >> > saying: >> > 1) only exporter can mmap to userspace >> > 2) only importers that do not need CPU access to b

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

2011-12-21 Thread Daniel Vetter
On Wed, Dec 21, 2011 at 05:27:16PM +, Arnd Bergmann wrote: > On Tuesday 20 December 2011, Daniel Vetter wrote: > > It also sounds like that at least for proper userspace mmap support we'd > > need some dma api extensions on at least arm, and that might take a while > > ... > > I think it's act

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

2011-12-21 Thread Arnd Bergmann
On Tuesday 20 December 2011, Daniel Vetter wrote: > > I'm thinking for a first version, we can get enough mileage out of it by > > saying: > > 1) only exporter can mmap to userspace > > 2) only importers that do not need CPU access to buffer.. Ok, that sounds possible. The alternative to this wou

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

2011-12-20 Thread Daniel Vetter
On Tue, Dec 20, 2011 at 10:41:45AM -0600, Rob Clark wrote: > On Tue, Dec 20, 2011 at 9:41 AM, Arnd Bergmann wrote: > > On Monday 19 December 2011, Semwal, Sumit wrote: > >> I didn't see a consensus on whether dma_buf should enforce some form > >> of serialization within the API - so atleast for v1

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

2011-12-20 Thread Rob Clark
On Tue, Dec 20, 2011 at 9:41 AM, Arnd Bergmann wrote: > On Monday 19 December 2011, Semwal, Sumit wrote: >> I didn't see a consensus on whether dma_buf should enforce some form >> of serialization within the API - so atleast for v1 of dma-buf, I >> propose to 'not' impose a restriction, and we can

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

2011-12-20 Thread Arnd Bergmann
On Monday 19 December 2011, Semwal, Sumit wrote: > I didn't see a consensus on whether dma_buf should enforce some form > of serialization within the API - so atleast for v1 of dma-buf, I > propose to 'not' impose a restriction, and we can tackle it (add new > ops or enforce as design?) whenever we

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

2011-12-20 Thread Arnd Bergmann
On Tuesday 20 December 2011, Sakari Ailus wrote: > (I'm jumping into the discussion in the middle, and might miss something > that has already been talked about. I still hope what I'm about to say is > relevant. :-)) It certainly is relevant. > In subsystems such as V4L2 where drivers deal with s

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

2011-12-20 Thread Anca Emanuel
On Tue, Dec 20, 2011 at 4:05 AM, Robert Morell wrote: > > One of the goals of this project is to unify the fragmented space of the > ARM SoC memory managers so that each vendor doesn't implement their own, > and they can all be closer to mainline. That is a very good objective. > I fear that res

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

2011-12-20 Thread Sakari Ailus
Hi Arnd, On Fri, Dec 09, 2011 at 02:13:03PM +, Arnd Bergmann wrote: > On Thursday 08 December 2011, Daniel Vetter wrote: > > > c) only allowing streaming mappings, even if those are non-coherent > > > (requiring strict serialization between CPU (in-kernel) and dma users of > > > the buffer) >

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

2011-12-19 Thread Robert Morell
On Tue, Dec 13, 2011 at 07:10:02AM -0800, Arnd Bergmann wrote: > On Monday 12 December 2011, Robert Morell wrote: > > > > > > Doing a buffer sharing with something that is not GPL is not fun, as, if > > > any > > > issue rises there, it would be impossible to discover if the problem is > > > eit

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

2011-12-18 Thread Semwal, Sumit
Hi Arnd, Daniel, On Mon, Dec 12, 2011 at 10:18 PM, Arnd Bergmann wrote: > On Saturday 10 December 2011, Daniel Vetter wrote: >> If userspace (through some driver calls) >> tries to do stupid things, it'll just get garbage. See >> Message-ID: >> >> for my reasons why it think this is the right w

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

2011-12-13 Thread Arnd Bergmann
On Monday 12 December 2011, Robert Morell wrote: > > > > Doing a buffer sharing with something that is not GPL is not fun, as, if any > > issue rises there, it would be impossible to discover if the problem is > > either > > at the closed-source driver or at the open source one. At the time I was

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

2011-12-13 Thread Hans Verkuil
(I've been away for the past two weeks, so I'm only now catching up) On Thursday 08 December 2011 22:44:08 Daniel Vetter wrote: > On Wed, Dec 7, 2011 at 14:40, Arnd Bergmann wrote: > > On Wednesday 07 December 2011, Semwal, Sumit wrote: > >> Thanks for the excellent discussion - it indeed is ver

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

2011-12-12 Thread Robert Morell
On Sat, Dec 10, 2011 at 03:13:06AM -0800, Mauro Carvalho Chehab wrote: > On 09-12-2011 20:50, Robert Morell wrote: > > On Mon, Dec 05, 2011 at 09:18:48AM -0800, Arnd Bergmann wrote: > >> On Friday 02 December 2011, Sumit Semwal wrote: > >>> This is the first step in defining a dma buffer sharing me

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

2011-12-12 Thread Arnd Bergmann
On Saturday 10 December 2011, Daniel Vetter wrote: > If userspace (through some driver calls) > tries to do stupid things, it'll just get garbage. See > Message-ID: > > for my reasons why it think this is the right way to go forward. So in > essence I'm really interested in the reasons why you wa

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

2011-12-10 Thread Mauro Carvalho Chehab
On 09-12-2011 20:50, Robert Morell wrote: On Mon, Dec 05, 2011 at 09:18:48AM -0800, Arnd Bergmann wrote: On Friday 02 December 2011, Sumit Semwal wrote: This is the first step in defining a dma buffer sharing mechanism. [...] + return dmabuf; +} +EXPORT_SYMBOL(dma_buf_export); I a

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

2011-12-09 Thread Daniel Vetter
On Fri, Dec 9, 2011 at 15:24, Alan Cox wrote: >> I still don't think that's possible. Please explain how you expect >> to change the semantics of the streaming mapping API to allow multiple >> mappers without having explicit serialization points that are visible >> to all users. For simplicity, le

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

2011-12-09 Thread Robert Morell
On Mon, Dec 05, 2011 at 09:18:48AM -0800, Arnd Bergmann wrote: > On Friday 02 December 2011, Sumit Semwal wrote: > > This is the first step in defining a dma buffer sharing mechanism. > [...] > > > + return dmabuf; > > +} > > +EXPORT_SYMBOL(dma_buf_export); > > I agree with Konrad, this should

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

2011-12-09 Thread Alan Cox
> I still don't think that's possible. Please explain how you expect > to change the semantics of the streaming mapping API to allow multiple > mappers without having explicit serialization points that are visible > to all users. For simplicity, let's assume a cache coherent system I would agree.

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

2011-12-09 Thread Arnd Bergmann
On Thursday 08 December 2011, Daniel Vetter wrote: > > c) only allowing streaming mappings, even if those are non-coherent > > (requiring strict serialization between CPU (in-kernel) and dma users of > > the buffer) > > I think only allowing streaming access makes the most sense: > - I don't see m

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

2011-12-08 Thread Daniel Vetter
On Wed, Dec 7, 2011 at 14:40, Arnd Bergmann wrote: > On Wednesday 07 December 2011, Semwal, Sumit wrote: >> Thanks for the excellent discussion - it indeed is very good learning >> for the relatively-inexperienced me :) >> >> So, for the purpose of dma-buf framework, could I summarize the >> follo

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

2011-12-07 Thread Arnd Bergmann
On Wednesday 07 December 2011, Semwal, Sumit wrote: > Thanks for the excellent discussion - it indeed is very good learning > for the relatively-inexperienced me :) > > So, for the purpose of dma-buf framework, could I summarize the > following and rework accordingly?: > 1. remove mmap() dma_buf_o

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

2011-12-07 Thread Semwal, Sumit
Hi Daniel, Rob, On Tue, Dec 6, 2011 at 3:41 AM, Rob Clark wrote: > On Mon, Dec 5, 2011 at 3:23 PM, Daniel Vetter wrote: >> On Mon, Dec 05, 2011 at 02:46:47PM -0600, Rob Clark wrote: >>> On Mon, Dec 5, 2011 at 11:18 AM, Arnd Bergmann wrote: >>> > In the patch 2, you have a section about migrati

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

2011-12-07 Thread Arnd Bergmann
On Wednesday 07 December 2011, Semwal, Sumit wrote: > Right; that would be ideal, but we may not be able to ask each user to > do so - especially when the sharing part might be interspersed in > existing buffer handling code. So for now, I would like to keep it as > it-is. Ok, fair enough. It cert

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

2011-12-07 Thread Semwal, Sumit
On Wed, Dec 7, 2011 at 3:41 PM, Arnd Bergmann wrote: > On Wednesday 07 December 2011, Semwal, Sumit wrote: >> > >> > Do you have a use case for making the interface compile-time disabled? >> > I had assumed that any code using it would make no sense if it's not >> > available so you don't actually

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

2011-12-07 Thread Arnd Bergmann
On Wednesday 07 December 2011, Semwal, Sumit wrote: > > > > Do you have a use case for making the interface compile-time disabled? > > I had assumed that any code using it would make no sense if it's not > > available so you don't actually need this. > > Ok. Though if we keep the interface compile-

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

2011-12-06 Thread Semwal, Sumit
Hi Arnd, Thanks for your review! On Mon, Dec 5, 2011 at 10:48 PM, Arnd Bergmann wrote: > On Friday 02 December 2011, Sumit Semwal wrote: >> This is the first step in defining a dma buffer sharing mechanism. > > This looks very nice, but there are a few things I don't understand yet > and a bunch

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

2011-12-06 Thread Daniel Vetter
On Tue, Dec 06, 2011 at 01:16:58PM +, Arnd Bergmann wrote: > On Monday 05 December 2011, Rob Clark wrote: > > > On the topic of a coherency model for dmabuf, I think we need to look at > > > dma_buf_attachment_map/unmap (and also the mmap variants cpu_start and > > > cpu_finish or whatever they

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

2011-12-06 Thread Arnd Bergmann
On Monday 05 December 2011, Rob Clark wrote: > > On the topic of a coherency model for dmabuf, I think we need to look at > > dma_buf_attachment_map/unmap (and also the mmap variants cpu_start and > > cpu_finish or whatever they might get called) as barriers: > > > > So after a dma_buf_map, all pre

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

2011-12-05 Thread Rob Clark
On Mon, Dec 5, 2011 at 4:09 PM, Arnd Bergmann wrote: > On Monday 05 December 2011 14:46:47 Rob Clark wrote: >> I sort of preferred having the DMABUF shim because that lets you pass >> a buffer around userspace without the receiving code knowing about a >> device specific API.  But the problem I ev

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

2011-12-05 Thread Daniel Vetter
On Mon, Dec 05, 2011 at 11:04:09PM +0100, Arnd Bergmann wrote: > On Monday 05 December 2011 21:58:39 Daniel Vetter wrote: > > On Mon, Dec 05, 2011 at 08:29:49PM +0100, Arnd Bergmann wrote: > > > ... > > > > Thanks a lot for this excellent overview. I think at least for the first > > version of dmab

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

2011-12-05 Thread Daniel Vetter
On Mon, Dec 05, 2011 at 04:11:46PM -0600, Rob Clark wrote: > On Mon, Dec 5, 2011 at 3:23 PM, Daniel Vetter wrote: > > On Mon, Dec 05, 2011 at 02:46:47PM -0600, Rob Clark wrote: > >> I sort of preferred having the DMABUF shim because that lets you pass > >> a buffer around userspace without the rec

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

2011-12-05 Thread Rob Clark
On Mon, Dec 5, 2011 at 4:09 PM, Arnd Bergmann wrote: >> >> https://github.com/robclark/kernel-omap4/commits/dmabuf > > Ok, thanks. I think it would be good to post these for reference > in v3, with a clear indication that they are not being submitted > for discussion/inclusion yet. btw, don't loo

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

2011-12-05 Thread Rob Clark
On Mon, Dec 5, 2011 at 3:23 PM, Daniel Vetter wrote: > On Mon, Dec 05, 2011 at 02:46:47PM -0600, Rob Clark wrote: >> On Mon, Dec 5, 2011 at 11:18 AM, Arnd Bergmann wrote: >> > In the patch 2, you have a section about migration that mentions that >> > it is possible to export a buffer that can be

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

2011-12-05 Thread Arnd Bergmann
On Monday 05 December 2011 14:46:47 Rob Clark wrote: > On Mon, Dec 5, 2011 at 11:18 AM, Arnd Bergmann wrote: > > On Friday 02 December 2011, Sumit Semwal wrote: > >> This is the first step in defining a dma buffer sharing mechanism. > > > > This looks very nice, but there are a few things I don't

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

2011-12-05 Thread Arnd Bergmann
On Monday 05 December 2011 21:58:39 Daniel Vetter wrote: > On Mon, Dec 05, 2011 at 08:29:49PM +0100, Arnd Bergmann wrote: > > ... > > Thanks a lot for this excellent overview. I think at least for the first > version of dmabuf we should drop the sync_* interfaces and simply require > users to brac

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

2011-12-05 Thread Daniel Vetter
On Mon, Dec 05, 2011 at 02:46:47PM -0600, Rob Clark wrote: > On Mon, Dec 5, 2011 at 11:18 AM, Arnd Bergmann wrote: > > In the patch 2, you have a section about migration that mentions that > > it is possible to export a buffer that can be migrated after it > > is already mapped into one user drive

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

2011-12-05 Thread Daniel Vetter
On Mon, Dec 05, 2011 at 08:29:49PM +0100, Arnd Bergmann wrote: > On Monday 05 December 2011 19:55:44 Daniel Vetter wrote: > > > The only way to solve this that I can think of right now is to > > > mandate that the mappings are all coherent (i.e. noncachable > > > on noncoherent architectures like A

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

2011-12-05 Thread Rob Clark
On Mon, Dec 5, 2011 at 11:18 AM, Arnd Bergmann wrote: > On Friday 02 December 2011, Sumit Semwal wrote: >> This is the first step in defining a dma buffer sharing mechanism. > > This looks very nice, but there are a few things I don't understand yet > and a bunch of trivial comments I have about t

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

2011-12-05 Thread Arnd Bergmann
On Monday 05 December 2011 19:55:44 Daniel Vetter wrote: > > The only way to solve this that I can think of right now is to > > mandate that the mappings are all coherent (i.e. noncachable > > on noncoherent architectures like ARM). If you do that, you no > > longer need the sync_sg_for_* calls. >

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

2011-12-05 Thread Daniel Vetter
On Mon, Dec 05, 2011 at 05:18:48PM +, Arnd Bergmann wrote: > On Friday 02 December 2011, Sumit Semwal wrote: > > + /* allow allocator to take care of cache ops */ > > + void (*sync_sg_for_cpu) (struct dma_buf *, struct device *); > > + void (*sync_sg_for_device)(struct dma_buf *, struct d

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

2011-12-05 Thread Arnd Bergmann
On Friday 02 December 2011, Sumit Semwal wrote: > This is the first step in defining a dma buffer sharing mechanism. This looks very nice, but there are a few things I don't understand yet and a bunch of trivial comments I have about things I spotted. Do you have prototype exporter and consumer d

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

2011-12-05 Thread Semwal, Sumit
Hi Konrad, On Fri, Dec 2, 2011 at 10:41 PM, Konrad Rzeszutek Wilk wrote: > On Fri, Dec 02, 2011 at 02:27:31PM +0530, Sumit Semwal wrote: >> This is the first step in defining a dma buffer sharing mechanism. >> >> >> [1]: https://wiki.linaro.org/OfficeofCTO/MemoryManagement >> [2]: http://lwn.net

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

2011-12-03 Thread Konrad Rzeszutek Wilk
On Fri, Dec 02, 2011 at 02:27:31PM +0530, 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: > - differen

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

2011-12-02 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: - different devices to 'attach' themselves to this buffer, to facilitate backing sto