diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2014-11-26 18:25:44 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-23 05:58:09 -0500 |
commit | 5fb3f55504d5d9b6ca97131091707afd351fe1dc (patch) | |
tree | 66fe3c88b717d7235e21dc0fac7dabff00de91ab | |
parent | 9587a3fc4333efd9cfd56a0754cabf76bdcdb3b0 (diff) |
[media] media: usb: uvc: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and wait_finish()
callbacks from vb2_ops and instead uses the the helpers
vb2_ops_wait_prepare/finish() provided by the vb2 core, the lock member
of the queue needs to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/uvc/uvc_queue.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index cc960723b926..10c554e7655c 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c | |||
@@ -143,20 +143,6 @@ static void uvc_buffer_finish(struct vb2_buffer *vb) | |||
143 | uvc_video_clock_update(stream, &vb->v4l2_buf, buf); | 143 | uvc_video_clock_update(stream, &vb->v4l2_buf, buf); |
144 | } | 144 | } |
145 | 145 | ||
146 | static void uvc_wait_prepare(struct vb2_queue *vq) | ||
147 | { | ||
148 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); | ||
149 | |||
150 | mutex_unlock(&queue->mutex); | ||
151 | } | ||
152 | |||
153 | static void uvc_wait_finish(struct vb2_queue *vq) | ||
154 | { | ||
155 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); | ||
156 | |||
157 | mutex_lock(&queue->mutex); | ||
158 | } | ||
159 | |||
160 | static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) | 146 | static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) |
161 | { | 147 | { |
162 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); | 148 | struct uvc_video_queue *queue = vb2_get_drv_priv(vq); |
@@ -195,8 +181,8 @@ static struct vb2_ops uvc_queue_qops = { | |||
195 | .buf_prepare = uvc_buffer_prepare, | 181 | .buf_prepare = uvc_buffer_prepare, |
196 | .buf_queue = uvc_buffer_queue, | 182 | .buf_queue = uvc_buffer_queue, |
197 | .buf_finish = uvc_buffer_finish, | 183 | .buf_finish = uvc_buffer_finish, |
198 | .wait_prepare = uvc_wait_prepare, | 184 | .wait_prepare = vb2_ops_wait_prepare, |
199 | .wait_finish = uvc_wait_finish, | 185 | .wait_finish = vb2_ops_wait_finish, |
200 | .start_streaming = uvc_start_streaming, | 186 | .start_streaming = uvc_start_streaming, |
201 | .stop_streaming = uvc_stop_streaming, | 187 | .stop_streaming = uvc_stop_streaming, |
202 | }; | 188 | }; |
@@ -214,6 +200,7 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, | |||
214 | queue->queue.mem_ops = &vb2_vmalloc_memops; | 200 | queue->queue.mem_ops = &vb2_vmalloc_memops; |
215 | queue->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC | 201 | queue->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC |
216 | | V4L2_BUF_FLAG_TSTAMP_SRC_SOE; | 202 | | V4L2_BUF_FLAG_TSTAMP_SRC_SOE; |
203 | queue->queue.lock = &queue->mutex; | ||
217 | ret = vb2_queue_init(&queue->queue); | 204 | ret = vb2_queue_init(&queue->queue); |
218 | if (ret) | 205 | if (ret) |
219 | return ret; | 206 | return ret; |