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: Wed, 01 Aug 2012 13:35:03 +0200 Message-ID: <1390726.ZQ58TDe5fq@avalon> References: <1339684349-28882-1-git-send-email-t.stanislaws@samsung.com> <1376487.cHbjGZJEZg@avalon> <60c9f6aa1a35c476f6d3493aa24438ad@chewa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <60c9f6aa1a35c476f6d3493aa24438ad@chewa.net> Sender: linux-media-owner@vger.kernel.org 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 List-Id: dri-devel@lists.freedesktop.org Hi R=E9mi, On Wednesday 01 August 2012 10:37:02 R=E9mi Denis-Courmont wrote: > On Tue, 31 Jul 2012 23:52:35 +0200, Laurent Pinchart wrote: > >> I want to receive the video buffers in user space for processing. > >> Typically "processing" is software encoding or conversion. That's = what > >> virtually any V4L application does on the desktop... > >=20 > > But what prevents you from using MMAP ? >=20 > As I wrote several times earlier, MMAP uses fixed number of buffers. = In > some tightly controlled media pipeline with low latency, it might wor= k. Sorry about making you repeat. > But in general, the V4L element in the pipeline does not know how fas= t the > downstream element(s) will consume the buffers. Thus it has to copy f= rom > the MMAP buffers into anonymous user memory pending processing. Then = any > dequeued buffer can be requeued as soon as possible. In theory, it mi= ght > also be that, even though the latency is known, the number of require= d > buffers exceeds the maximum MMAP buffers count of the V4L device. Eit= her > way, user space ends up doing memory copy from MMAP to custom buffers= =2E >=20 > This problem does not exist with USERBUF - the V4L2 element can simpl= y > allocate a new buffer for each dequeued buffer. What about using the CREATE_BUFS ioctl to add new MMAP buffers at runti= me ? > By the way, this was already discussed a few months ago for the exact= same > DMABUF patch series... --=20 Regards, Laurent Pinchart