Re: [REVIEWv2 PATCH 06/15] vb2: add note that buf_finish can be called with !vb2_is_streaming()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

Thank you for the patch.

On Tuesday 25 February 2014 13:52:46 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@xxxxxxxxx>
> 
> Drivers need to be aware that buf_finish can be called when there is no
> streaming going on, so make a note of that.
> 
> Also add a bunch of missing periods at the end of sentences.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>
> Acked-by: Pawel Osciak <pawel@xxxxxxxxxx>
> ---
>  include/media/videobuf2-core.h | 44 ++++++++++++++++++++-------------------
>  1 file changed, 23 insertions(+), 21 deletions(-)
> 
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index f443ce0..82b7f0f 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h

[snip]

>   * @buf_finish:		called before every dequeue of the buffer back to
>   *			userspace; drivers may perform any operations required
> - *			before userspace accesses the buffer; optional
> + *			before userspace accesses the buffer; optional. Note:
> + *			this op can be called as well when vb2_is_streaming()
> + *			returns false!

Based on patch 05/15 several drivers assumed that buf_finish is only be called 
when the buffer is to be dequeued to userspace, and performed operations such 
as decompressing the image (yuck...), updating buffer fields such as the 
timestamp, ... If I understand the problem correctly, those operations are 
just a waste of CPU cycles if the buffer will not be returned to userspace, 
hence the driver changes in patch 05/15.

I would document that explicitly here to tell driver developers that 
buf_finish will be called for every buffer that has been queued, and that 
operations related to updating the buffer for userspace can be skipped if the 
queue isn't streaming.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux