From: Hans Verkuil <hverkuil@xs4all.nl>
To: linux-media <linux-media@vger.kernel.org>,
Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Pawel Osciak <pawel@osciak.com>
Subject: Re: [PATCH] vb2: fix multiplanar read() with non-zero data_offset
Date: Fri, 25 Jul 2014 11:15:50 +0200 [thread overview]
Message-ID: <53D22046.2000903@xs4all.nl> (raw)
In-Reply-To: <53D21ED1.1040003@xs4all.nl>
On 07/25/14 11:09, Hans Verkuil wrote:
> If this is a multiplanar buf_type and the plane we want to read has a
> non-zero data_offset, then that data_offset was not taken into account.
>
> Note that read() or write() for formats with more than one plane is currently
> not allowed, hence the use of 'planes[0]' since this is only relevant for a
> single-plane format.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Forgot, sorry.
>
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index c359006..0e3d927 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -2959,6 +2959,12 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
> buf->queued = 0;
> buf->size = read ? vb2_get_plane_payload(q->bufs[index], 0)
> : vb2_plane_size(q->bufs[index], 0);
> + /* Compensate for data_offset on read in the multiplanar case. */
> + if (is_multiplanar && read &&
> + fileio->b.m.planes[0].data_offset < buf->size) {
> + buf->pos = fileio->b.m.planes[0].data_offset;
> + buf->size -= buf->pos;
> + }
> } else {
> buf = &fileio->bufs[index];
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2014-07-25 9:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 9:09 [PATCH] vb2: fix multiplanar read() with non-zero data_offset Hans Verkuil
2014-07-25 9:15 ` Hans Verkuil [this message]
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=53D22046.2000903@xs4all.nl \
--to=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.