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 4/6] videobuf2-core: fill in length field for multiplanar buffers.
Date: Fri, 21 Sep 2012 18:13:20 +0200 [thread overview]
Message-ID: <505C9220.9070007@samsung.com> (raw)
In-Reply-To: <bbbf815b74d00312a07be07ad4f336a3792fd0d3.1348064901.git.hans.verkuil@cisco.com>
Hi Hans,
On 09/19/2012 04:37 PM, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> length should be set to num_planes in __fill_v4l2_buffer(). That way the
> caller knows how many planes there are in the buffer.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
I think this would break VIDIOC_CREATE_BUFS. We need per buffer num_planes.
Consider a use case where device is streaming with 2-planar pixel format
and we invoke VIDIOC_CREATE_BUFS with single-planar format. On a single
queue there will be buffers with different number of planes. The number of
planes information must be attached to a buffer, otherwise VIDIOC_QUERYBUF
won't work.
> ---
> drivers/media/v4l2-core/videobuf2-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index 929cc99..bbfe022 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -348,6 +348,7 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b)
> * Fill in plane-related data if userspace provided an array
> * for it. The memory and size is verified above.
> */
> + b->length = q->num_planes;
> memcpy(b->m.planes, vb->v4l2_planes,
> b->length * sizeof(struct v4l2_plane));
> } else {
Regards,
Sylwester
next prev parent reply other threads:[~2012-09-21 16:13 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 [this message]
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
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=505C9220.9070007@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.