[RFC PATCH 0/2] [media] vb2: defer part of vb2_buffer_done() and move dma-buf unmap from DQBUF
From: Javier Martinez Canillas
Date: Wed Aug 17 2016 - 14:29:24 EST
Hello,
This patch series attempt to do the dma-buf unmap as soon as possible, once
the driver has finished using the buffer. Instead of waiting until DQBUF to
do the unmap.
Patch #1 splits vb2_buffer_done() and moves part of its logic to a workqueue
to avoid calling the vb2 .finish mem ops. Since doing a buffer sync can take
a lot of time so isn't suitable for interrupt context. This was suggested by
Hans Verkuil on a previous patch [0].
Patch #2 then moves the dma-buf unmap out of DQBUF to vb2_done_work() now that
this is executed in process context since the dmabuf unmap operation can sleep.
[0]: https://lkml.org/lkml/2016/8/13/36
Best regards,
Javier
Javier Martinez Canillas (2):
[media] vb2: defer sync buffers from vb2_buffer_done() with a
workqueue
[media] vb2: move dma-buf unmap from __vb2_dqbuf() to vb2_done_work()
drivers/media/v4l2-core/videobuf2-core.c | 114 ++++++++++++++++++++-----------
include/media/videobuf2-core.h | 5 ++
2 files changed, 79 insertions(+), 40 deletions(-)
--
2.5.5