[PATCHv2 3/9] v4l: add buffer exporting via dmabuf

Rémi Denis-Courmont remi at remlab.net
Wed Aug 1 01:37:02 PDT 2012


On Tue, 31 Jul 2012 23:52:35 +0200, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> 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...
> 
> But what prevents you from using MMAP ?

As I wrote several times earlier, MMAP uses fixed number of buffers. In
some tightly controlled media pipeline with low latency, it might work.

But in general, the V4L element in the pipeline does not know how fast the
downstream element(s) will consume the buffers. Thus it has to copy from
the MMAP buffers into anonymous user memory pending processing. Then any
dequeued buffer can be requeued as soon as possible. In theory, it might
also be that, even though the latency is known, the number of required
buffers exceeds the maximum MMAP buffers count of the V4L device. Either
way, user space ends up doing memory copy from MMAP to custom buffers.

This problem does not exist with USERBUF - the V4L2 element can simply
allocate a new buffer for each dequeued buffer.

By the way, this was already discussed a few months ago for the exact same
DMABUF patch series...

-- 
Rémi Denis-Courmont
Sent from my collocated server


More information about the dri-devel mailing list