aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-02-06 03:46:11 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 05:56:40 -0400
commit6ea3b980f058d9dbc79ba88c652d581fa2d00792 (patch)
tree89959aeb1d157de2bfd877f3ccb6dc6fae2d7964
parent256f3162c17595b3fde1c4f18389719e8a2952f5 (diff)
[media] vb2: rename queued_count to owned_by_drv_count
'queued_count' is a bit vague since it is not clear to which queue it refers to: the vb2 internal list of buffers or the driver-owned list of buffers. Rename to make it explicit. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c10
-rw-r--r--include/media/videobuf2-core.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 6c33b788ecd7..ef29a220c6e2 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1084,7 +1084,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
1084 spin_lock_irqsave(&q->done_lock, flags); 1084 spin_lock_irqsave(&q->done_lock, flags);
1085 vb->state = state; 1085 vb->state = state;
1086 list_add_tail(&vb->done_entry, &q->done_list); 1086 list_add_tail(&vb->done_entry, &q->done_list);
1087 atomic_dec(&q->queued_count); 1087 atomic_dec(&q->owned_by_drv_count);
1088 spin_unlock_irqrestore(&q->done_lock, flags); 1088 spin_unlock_irqrestore(&q->done_lock, flags);
1089 1089
1090 /* Inform any processes that may be waiting for buffers */ 1090 /* Inform any processes that may be waiting for buffers */
@@ -1437,7 +1437,7 @@ static void __enqueue_in_driver(struct vb2_buffer *vb)
1437 unsigned int plane; 1437 unsigned int plane;
1438 1438
1439 vb->state = VB2_BUF_STATE_ACTIVE; 1439 vb->state = VB2_BUF_STATE_ACTIVE;
1440 atomic_inc(&q->queued_count); 1440 atomic_inc(&q->owned_by_drv_count);
1441 1441
1442 /* sync buffers */ 1442 /* sync buffers */
1443 for (plane = 0; plane < vb->num_planes; ++plane) 1443 for (plane = 0; plane < vb->num_planes; ++plane)
@@ -1593,7 +1593,7 @@ static int vb2_start_streaming(struct vb2_queue *q)
1593 int ret; 1593 int ret;
1594 1594
1595 /* Tell the driver to start streaming */ 1595 /* Tell the driver to start streaming */
1596 ret = call_qop(q, start_streaming, q, atomic_read(&q->queued_count)); 1596 ret = call_qop(q, start_streaming, q, atomic_read(&q->owned_by_drv_count));
1597 if (ret) 1597 if (ret)
1598 fail_qop(q, start_streaming); 1598 fail_qop(q, start_streaming);
1599 1599
@@ -1826,7 +1826,7 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q)
1826 } 1826 }
1827 1827
1828 if (!q->retry_start_streaming) 1828 if (!q->retry_start_streaming)
1829 wait_event(q->done_wq, !atomic_read(&q->queued_count)); 1829 wait_event(q->done_wq, !atomic_read(&q->owned_by_drv_count));
1830 return 0; 1830 return 0;
1831} 1831}
1832EXPORT_SYMBOL_GPL(vb2_wait_for_all_buffers); 1832EXPORT_SYMBOL_GPL(vb2_wait_for_all_buffers);
@@ -1958,7 +1958,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
1958 * has not already dequeued before initiating cancel. 1958 * has not already dequeued before initiating cancel.
1959 */ 1959 */
1960 INIT_LIST_HEAD(&q->done_list); 1960 INIT_LIST_HEAD(&q->done_list);
1961 atomic_set(&q->queued_count, 0); 1961 atomic_set(&q->owned_by_drv_count, 0);
1962 wake_up_all(&q->done_wq); 1962 wake_up_all(&q->done_wq);
1963 1963
1964 /* 1964 /*
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index b852b39cc6dc..36e3e8e2d457 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -361,7 +361,7 @@ struct v4l2_fh;
361 * @bufs: videobuf buffer structures 361 * @bufs: videobuf buffer structures
362 * @num_buffers: number of allocated/used buffers 362 * @num_buffers: number of allocated/used buffers
363 * @queued_list: list of buffers currently queued from userspace 363 * @queued_list: list of buffers currently queued from userspace
364 * @queued_count: number of buffers owned by the driver 364 * @owned_by_drv_count: number of buffers owned by the driver
365 * @done_list: list of buffers ready to be dequeued to userspace 365 * @done_list: list of buffers ready to be dequeued to userspace
366 * @done_lock: lock to protect done_list list 366 * @done_lock: lock to protect done_list list
367 * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued 367 * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued
@@ -393,7 +393,7 @@ struct vb2_queue {
393 393
394 struct list_head queued_list; 394 struct list_head queued_list;
395 395
396 atomic_t queued_count; 396 atomic_t owned_by_drv_count;
397 struct list_head done_list; 397 struct list_head done_list;
398 spinlock_t done_lock; 398 spinlock_t done_lock;
399 wait_queue_head_t done_wq; 399 wait_queue_head_t done_wq;