v4l2bufferpool: request the maximum number of buffers for DMABUF
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 20 Nov 2019 14:32:29 +0000 (15:32 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 8 Apr 2020 16:37:30 +0000 (16:37 +0000)
commit94e323c10f2d7fa85bf63f357d203ca5305800c6
tree859080cf4187f8ac157bf1dafdf2e1deea8fe61b
parent00539e127758a93ea62a30b84c840bfcc002d53b
v4l2bufferpool: request the maximum number of buffers for DMABUF

There are often only two buffers queued in the kernel so no new buffers are
requested.

With every qbuf, the kernel receives a new DMABUF for the specified index.
This most likely differs from the last DMABUF and the old cached entry is
released. This results in a lot of map/unmap overhead if the kernel driver
needs a mapping for the buffer.

With a larger queue, it's quite likely, that both old and new DMABUFs are
also mapped for another index. So the map/unmap is skipped, because the
mapping is reference counted.

The corresponding allocated buffers don't contain any actual memory, so
allocating them is quite cheep. So the log message is updated to clarify
this.
sys/v4l2/gstv4l2bufferpool.c