From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from perceval.ideasonboard.com ([95.142.166.194]:50954 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753131Ab2HBVlZ convert rfc822-to-8bit (ORCPT ); Thu, 2 Aug 2012 17:41:25 -0400 From: Laurent Pinchart To: =?ISO-8859-1?Q?R=E9mi?= Denis-Courmont Cc: Hans Verkuil , 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 Subject: Re: [PATCHv2 3/9] v4l: add buffer exporting via dmabuf Date: Thu, 02 Aug 2012 23:41:31 +0200 Message-ID: <191994915.iXxuxlMUSc@avalon> In-Reply-To: <201208020956.45291.remi@remlab.net> References: <1339684349-28882-1-git-send-email-t.stanislaws@samsung.com> <201208020835.58332.hverkuil@xs4all.nl> <201208020956.45291.remi@remlab.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-media-owner@vger.kernel.org List-ID: Hi Rémi, On Thursday 02 August 2012 09:56:43 Rémi Denis-Courmont wrote: > Le jeudi 2 août 2012 09:35:58 Hans Verkuil, vous avez écrit : > > On Wed August 1 2012 22:49:57 Rémi Denis-Courmont wrote: > > > > What about using the CREATE_BUFS ioctl to add new MMAP buffers at > > > > runtime ? > > > > > > Does CREATE_BUFS always work while already streaming has already > > > started? > > > If it depends on the driver, it's kinda helpless. > > > > Yes, it does. It's one of the reasons it exists in the first place. 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 availability > > of create_bufs will increase. > > That's contradictory. If most drivers do not support it, then it won't work > during streaming. > > > > What's the guaranteed minimum buffer count? It seems in any case, MMAP > > > has a hard limit of 32 buffers (at least videobuf2 has), though one > > > might argue this should be more than enough. > > > > Minimum or maximum? The maximum is 32, that's hardcoded in the V4L2 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. > > The smallest of the maxima of all drivers. > > > The minimum is usually between 1 and 3, depending on hardware limitations. > > And that's clearly insufficient without memory copy to userspace buffers. That's the minimum number of buffers *required* by the hardware. You can add up to 32 buffers, I'm not aware of any driver that would prevent that. > It does not seem to me that CREATE_BUFS+MMAP is a useful replacement for > REQBUFS+USERBUF then. -- Regards, Laurent Pinchart