From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <m.chehab@samsung.com>,
kernel@pengutronix.de
Subject: Re: [PATCH] [media] uvcvideo: Enable VIDIOC_CREATE_BUFS
Date: Fri, 31 Jan 2014 01:51:47 +0100 [thread overview]
Message-ID: <1474634.xnVfC2yuQa@avalon> (raw)
In-Reply-To: <1391012032-19600-1-git-send-email-p.zabel@pengutronix.de>
Hi Philipp,
Thank you for the patch.
On Wednesday 29 January 2014 17:13:52 Philipp Zabel wrote:
> This patch enables the ioctl to create additional buffers
> on the videobuf2 capture queue.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This looks good to me. I've applied the patch to my tree and will send a pull
request for v3.15.
> ---
> drivers/media/usb/uvc/uvc_queue.c | 11 +++++++++++
> drivers/media/usb/uvc/uvc_v4l2.c | 10 ++++++++++
> drivers/media/usb/uvc/uvcvideo.h | 2 ++
> 3 files changed, 23 insertions(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_queue.c
> b/drivers/media/usb/uvc/uvc_queue.c index cd962be..7efb157 100644
> --- a/drivers/media/usb/uvc/uvc_queue.c
> +++ b/drivers/media/usb/uvc/uvc_queue.c
> @@ -196,6 +196,17 @@ int uvc_query_buffer(struct uvc_video_queue *queue,
> struct v4l2_buffer *buf) return ret;
> }
>
> +int uvc_create_buffers(struct uvc_video_queue *queue, struct
> v4l2_create_buffers *cb) +{
> + int ret;
> +
> + mutex_lock(&queue->mutex);
> + ret = vb2_create_bufs(&queue->queue, cb);
> + mutex_unlock(&queue->mutex);
> +
> + return ret;
> +}
> +
> int uvc_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer
> *buf) {
> int ret;
> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c
> b/drivers/media/usb/uvc/uvc_v4l2.c index 3afff92..fa58131 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -1000,6 +1000,16 @@ static long uvc_v4l2_do_ioctl(struct file *file,
> unsigned int cmd, void *arg) return uvc_query_buffer(&stream->queue, buf);
> }
>
> + case VIDIOC_CREATE_BUFS:
> + {
> + struct v4l2_create_buffers *cb = arg;
> +
> + if (!uvc_has_privileges(handle))
> + return -EBUSY;
> +
> + return uvc_create_buffers(&stream->queue, cb);
> + }
> +
> case VIDIOC_QBUF:
> if (!uvc_has_privileges(handle))
> return -EBUSY;
> diff --git a/drivers/media/usb/uvc/uvcvideo.h
> b/drivers/media/usb/uvc/uvcvideo.h index 9e35982..a28da0f 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -616,6 +616,8 @@ extern int uvc_alloc_buffers(struct uvc_video_queue
> *queue, extern void uvc_free_buffers(struct uvc_video_queue *queue);
> extern int uvc_query_buffer(struct uvc_video_queue *queue,
> struct v4l2_buffer *v4l2_buf);
> +extern int uvc_create_buffers(struct uvc_video_queue *queue,
> + struct v4l2_create_buffers *v4l2_cb);
> extern int uvc_queue_buffer(struct uvc_video_queue *queue,
> struct v4l2_buffer *v4l2_buf);
> extern int uvc_dequeue_buffer(struct uvc_video_queue *queue,
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-01-31 0:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-29 16:13 [PATCH] [media] uvcvideo: Enable VIDIOC_CREATE_BUFS Philipp Zabel
2014-01-31 0:51 ` Laurent Pinchart [this message]
2014-01-31 8:43 ` Hans Verkuil
2014-02-02 10:21 ` Laurent Pinchart
2014-02-02 13:04 ` Philipp Zabel
2014-02-03 9:03 ` Hans Verkuil
2014-02-04 22:11 ` Laurent Pinchart
2014-02-04 23:04 ` Sylwester Nawrocki
2014-02-05 7:57 ` Hans Verkuil
2014-02-05 8:57 ` Hans Verkuil
2014-02-06 16:45 ` Laurent Pinchart
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=1474634.xnVfC2yuQa@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=p.zabel@pengutronix.de \
/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