linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv1 PATCH 6/6] DocBook: various updates w.r.t. v4l2_buffer and multiplanar.
Date: Fri, 21 Sep 2012 18:37:31 +0200	[thread overview]
Message-ID: <505C97CB.40709@samsung.com> (raw)
In-Reply-To: <499780c9daeee902db65382be3bdf481d205e99c.1348064901.git.hans.verkuil@cisco.com>

On 09/19/2012 04:37 PM, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Clarify the behavior of v4l2_buffer in the multiplanar case,
> including fixing a false statement: you can't set m.planes to NULL
> when calling DQBUF.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

I'm not sure what was main argument for not requiring applications to 
pass the planes array in to VIDIOC_DQBUF. Maybe, to avoid copying the 
planes array so performance is improved when applications don't need 
all information from struct v4l2_plane after each DQBUF. So I'm not 
sure about DQBUF. But improving querybuf sounds like a reasonable thing 
to do. So far num_planes have had to be passed in by applications, as 
returned from S_FMT/G_FMT. There seems to be no way to verify how many
planes are valid based on VIDIOC_QUERYBUF output.

Anyway, both changes shouldn't be a big deal for existing applications. 
They should just make sure the pointer to the planes array is passed, 
which most probably already do. I'm OK with this change, it shouldn't 
be a big issue for applications using s5p drivers. 

> ---
>  Documentation/DocBook/media/v4l/io.xml              |    6 ++++--
>  Documentation/DocBook/media/v4l/vidioc-qbuf.xml     |    3 +--
>  Documentation/DocBook/media/v4l/vidioc-querybuf.xml |   11 +++++++----
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml
> index 1885cc0..c6d39fe 100644
> --- a/Documentation/DocBook/media/v4l/io.xml
> +++ b/Documentation/DocBook/media/v4l/io.xml
> @@ -677,8 +677,10 @@ memory, set by the application. See <xref linkend="userp" /> for details.
>  	    <entry><structfield>length</structfield></entry>
>  	    <entry></entry>
>  	    <entry>Size of the buffer (not the payload) in bytes for the
> -	    single-planar API. For the multi-planar API should contain the
> -	    number of elements in the <structfield>planes</structfield> array.
> +	    single-planar API. For the multi-planar API the application sets
> +	    this to the number of elements in the <structfield>planes</structfield>
> +	    array. The driver will fill in the actual number of valid elements in
> +	    that array.
>  	    </entry>
>  	  </row>
>  	  <row>
> diff --git a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> index 6a821a6..2d37abe 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-qbuf.xml
> @@ -121,8 +121,7 @@ remaining fields or returns an error code. The driver may also set
>  field. It indicates a non-critical (recoverable) streaming error. In such case
>  the application may continue as normal, but should be aware that data in the
>  dequeued buffer might be corrupted. When using the multi-planar API, the
> -planes array does not have to be passed; the <structfield>m.planes</structfield>
> -member must be set to NULL in that case.</para>
> +planes array must be passed in as well.</para>
>  
>      <para>By default <constant>VIDIOC_DQBUF</constant> blocks when no
>  buffer is in the outgoing queue. When the
> diff --git a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml
> index 6e414d7..a597155 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-querybuf.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-querybuf.xml
> @@ -48,8 +48,8 @@
>    <refsect1>
>      <title>Description</title>
>  
> -    <para>This ioctl is part of the <link linkend="mmap">memory
> -mapping</link> I/O method. It can be used to query the status of a
> +    <para>This ioctl is part of the <link linkend="mmap">streaming
> +</link> I/O method. It can be used to query the status of a
>  buffer at any time after buffers have been allocated with the
>  &VIDIOC-REQBUFS; ioctl.</para>
>  
> @@ -71,6 +71,7 @@ the structure.</para>
>  
>      <para>In the <structfield>flags</structfield> field the
>  <constant>V4L2_BUF_FLAG_MAPPED</constant>,
> +<constant>V4L2_BUF_FLAG_PREPARED</constant>,
>  <constant>V4L2_BUF_FLAG_QUEUED</constant> and
>  <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
>  <structfield>memory</structfield> field will be set to the current
> @@ -79,8 +80,10 @@ contains the offset of the buffer from the start of the device memory,
>  the <structfield>length</structfield> field its size. For the multi-planar API,
>  fields <structfield>m.mem_offset</structfield> and
>  <structfield>length</structfield> in the <structfield>m.planes</structfield>
> -array elements will be used instead. The driver may or may not set the remaining
> -fields and flags, they are meaningless in this context.</para>
> +array elements will be used instead and the <structfield>length</structfield>
> +field of &v4l2-buffer; is set to the number of filled-in array elements.
> +The driver may or may not set the remaining fields and flags, they are
> +meaningless in this context.</para>
>  
>      <para>The <structname>v4l2_buffer</structname> structure is
>      specified in <xref linkend="buffer" />.</para>

Regards,
Sylwester

  reply	other threads:[~2012-09-21 16:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 14:37 [RFCv1 PATCH 0/6] vb2 & multiplanar fixes/changes Hans Verkuil
2012-09-19 14:37 ` [RFCv1 PATCH 1/6] videobuf2-core: move num_planes from vb2_buffer to vb2_queue Hans Verkuil
2012-09-19 14:37   ` [RFCv1 PATCH 2/6] videobuf2-core: use vb2_queue in __verify_planes_array Hans Verkuil
2012-09-19 16:55     ` Sylwester Nawrocki
2012-09-19 14:37   ` [RFCv1 PATCH 3/6] videobuf2-core: move plane verification out of __fill_v4l2_buffer Hans Verkuil
2012-09-19 16:55     ` Sylwester Nawrocki
2012-09-20  6:28       ` Hans Verkuil
2012-09-19 14:37   ` [RFCv1 PATCH 4/6] videobuf2-core: fill in length field for multiplanar buffers Hans Verkuil
2012-09-21  9:54     ` Hans Verkuil
2012-09-21 16:13     ` Sylwester Nawrocki
2012-09-21 16:23       ` Hans Verkuil
2012-09-21 16:47         ` Sylwester Nawrocki
2012-09-21 16:54           ` Hans Verkuil
2012-09-24 13:52             ` Hans Verkuil
2012-09-19 14:37   ` [RFCv1 PATCH 5/6] v4l2-ioctl,c: handle PREPARE_BUF like QUERYBUF Hans Verkuil
2012-09-19 14:37   ` [RFCv1 PATCH 6/6] DocBook: various updates w.r.t. v4l2_buffer and multiplanar Hans Verkuil
2012-09-21 16:37     ` Sylwester Nawrocki [this message]
2012-09-19 15:18   ` [RFCv1 PATCH 1/6] videobuf2-core: move num_planes from vb2_buffer to vb2_queue Sylwester Nawrocki
2012-09-19 15:28     ` Hans Verkuil
2012-09-19 16:54       ` Sylwester Nawrocki

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=505C97CB.40709@samsung.com \
    --to=s.nawrocki@samsung.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).