linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, pawel@osciak.com,
	m.szyprowski@samsung.com, Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv4 PATCH 01/15] videobuf2-core.h: improve documentation
Date: Mon, 27 Oct 2014 02:07:58 +0200	[thread overview]
Message-ID: <2367286.uK648OTWkn@avalon> (raw)
In-Reply-To: <1414063302-26903-2-git-send-email-hverkuil@xs4all.nl>

Hi Hans,

Thank you for the patch.

On Thursday 23 October 2014 13:21:28 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Document that drivers can access/modify the buffer contents in buf_prepare
> and buf_finish. That was not clearly stated before.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  include/media/videobuf2-core.h | 32 +++++++++++++++++---------------
>  1 file changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index 6ef2d01..70ace7c 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -270,22 +270,24 @@ struct vb2_buffer {
>   *			queue setup from completing successfully; optional.
>   * @buf_prepare:	called every time the buffer is queued from userspace
>   *			and from the VIDIOC_PREPARE_BUF ioctl; drivers may
> - *			perform any initialization required before each hardware
> - *			operation in this callback; drivers that support
> - *			VIDIOC_CREATE_BUFS must also validate the buffer size;
> - *			if an error is returned, the buffer will not be queued
> - *			in driver; optional.
> + *			perform any initialization required before each
> + *			hardware operation in this callback; drivers can
> + *			access/modify the buffer here as it is still synced for
> + *			the CPU; drivers that support VIDIOC_CREATE_BUFS must
> + *			also validate the buffer size; if an error is returned,
> + *			the buffer will not be queued in driver; optional.
>   * @buf_finish:		called before every dequeue of the buffer back to
> - *			userspace; drivers may perform any operations required
> - *			before userspace accesses the buffer; optional. The
> - *			buffer state can be one of the following: DONE and
> - *			ERROR occur while streaming is in progress, and the
> - *			PREPARED state occurs when the queue has been canceled
> - *			and all pending buffers are being returned to their
> - *			default DEQUEUED state. Typically you only have to do
> - *			something if the state is VB2_BUF_STATE_DONE, since in
> - *			all other cases the buffer contents will be ignored
> - *			anyway.
> + *			userspace; the buffer is synced for the CPU, so drivers
> + *			can access/modify the buffer contents; drivers may
> + *			perform any operations required before userspace
> + *			accesses the buffer; optional. The buffer state can be
> + *			one of the following: DONE and ERROR occur while
> + *			streaming is in progress, and the PREPARED state occurs
> + *			when the queue has been canceled and all pending
> + *			buffers are being returned to their default DEQUEUED
> + *			state. Typically you only have to do something if the
> + *			state is VB2_BUF_STATE_DONE, since in all other cases
> + *			the buffer contents will be ignored anyway.
>   * @buf_cleanup:	called once before the buffer is freed; drivers may
>   *			perform any additional cleanup; optional.
>   * @start_streaming:	called once to enter 'streaming' state; the driver 
may

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-10-27  0:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 11:21 [RFCv4 PATCH 00/15] vb2: improve dma-sg, expbuf Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 01/15] videobuf2-core.h: improve documentation Hans Verkuil
2014-10-27  0:07   ` Laurent Pinchart [this message]
2014-10-23 11:21 ` [RFCv4 PATCH 02/15] vb2-dma-sg: add allocation context to dma-sg Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 03/15] vb2-dma-sg: move dma_(un)map_sg here Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 04/15] vb2-dma-sg: add dmabuf import support Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 05/15] vb2-dma-sg: add get_dmabuf Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 06/15] vb2-vmalloc: add get_dmabuf support Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 07/15] vb2: replace 'write' by 'dma_dir' Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 08/15] vivid: enable vb2_expbuf support Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 09/15] mem2mem_testdev: support expbuf Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 10/15] vb2: use dma_map_sg_attrs to prevent unnecessary sync Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 11/15] vb2: add begin/end_cpu_access functions Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 12/15] videobuf2-dvb.c: convert to vb2_plane_begin_cpu_access() Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 13/15] v4l: convert vb2_plane_vaddr to vb2_plane_begin_cpu_access Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 14/15] vb2: drop the unused vb2_plane_vaddr function Hans Verkuil
2014-10-23 11:21 ` [RFCv4 PATCH 15/15] vb2: update the buf_prepare/finish documentation Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2367286.uK648OTWkn@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).