From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCHv2 3/9] v4l: add buffer exporting via dmabuf Date: Thu, 02 Aug 2012 23:50:31 +0200 Message-ID: <1530169.bCmcyqEdys@avalon> References: <1339684349-28882-1-git-send-email-t.stanislaws@samsung.com> <201208020956.45291.remi@remlab.net> <201208020908.18512.hverkuil@xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <201208020908.18512.hverkuil@xs4all.nl> Sender: linux-media-owner@vger.kernel.org To: Hans Verkuil Cc: =?ISO-8859-1?Q?R=E9mi?= Denis-Courmont , Tomasz Stanislawski , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@redhat.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, sumit.semwal@ti.com, daeinki@gmail.com, daniel.vetter@ffwll.ch, robdclark@gmail.com, pawel@osciak.com, linaro-mm-sig@lists.linaro.org, subashrp@gmail.com, mchehab@redhat.com, g.liakhovetski@gmx.de List-Id: dri-devel@lists.freedesktop.org Hi Hans, On Thursday 02 August 2012 09:08:18 Hans Verkuil wrote: > On Thu August 2 2012 08:56:43 R=E9mi Denis-Courmont wrote: > > Le jeudi 2 ao=FBt 2012 09:35:58 Hans Verkuil, vous avez =E9crit : > > > On Wed August 1 2012 22:49:57 R=E9mi Denis-Courmont wrote: > > > > > What about using the CREATE_BUFS ioctl to add new MMAP buffer= s at > > > > > runtime ? > > > >=20 > > > > Does CREATE_BUFS always work while already streaming has alread= y > > > > started? If it depends on the driver, it's kinda helpless. > > >=20 > > > Yes, it does. It's one of the reasons it exists in the first plac= e. But > > > there are currently only a handful of drivers that implement it. = I hope > > > that as more and more drivers are converted to vb2 that the avail= ability > > > of create_bufs will increase. > >=20 > > That's contradictory. If most drivers do not support it, then it wo= n't > > work during streaming. >=20 > IF create_bufs is implemented in the driver, THEN you can use it duri= ng > streaming. I.e., it will never return EBUSY as an error due to the fa= ct > that streaming is in progress. >=20 > Obviously it won't work if the driver didn't implement it in the firs= t > place. > > > > > What's the guaranteed minimum buffer count? It seems in any cas= e, MMAP > > > > has a hard limit of 32 buffers (at least videobuf2 has), though= one > > > > might argue this should be more than enough. > > >=20 > > > Minimum or maximum? The maximum is 32, that's hardcoded in the V4= L2 > > > core. Although drivers may force a lower maximum if they want. I = have no > > > idea whether there are drivers that do that. There probably are. > >=20 > > The smallest of the maxima of all drivers. >=20 > I've no idea. Most will probably abide by the 32 maximum, but without > analyzing all drivers I can't guarantee it. >=20 > > > The minimum is usually between 1 and 3, depending on hardware > > > limitations. > >=20 > > And that's clearly insufficient without memory copy to userspace bu= ffers. > >=20 > > It does not seem to me that CREATE_BUFS+MMAP is a useful replacemen= t for > > REQBUFS+USERBUF then. >=20 > Just to put your mind at rest: USERPTR mode will *not* disappear or b= e > deprecated in any way. It's been there for a long time, it's in heavy= use, > it's easy to use and it will not be turned into a second class citize= n, > because it isn't. Just because there is a new dmabuf mode available d= oesn't > mean that everything should be done as a mmap+dmabuf thing. I disagree with this. Not everything should obviously be done with MMAP= +=20 DMABUF, but for buffer sharing between devices, we should encourage=20 application developers to use DMABUF instead of USERPTR. --=20 Regards, Laurent Pinchart