[media] vb2: rename queued_count to owned_by_drv_count
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 6 Feb 2014 08:46:11 +0000 (05:46 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 11 Mar 2014 09:56:40 +0000 (06:56 -0300)
'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>
drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h

index 6c33b788ecd7f94a27eff173f4b6f5ab485e69f0..ef29a220c6e220749c44f316d2c3e48d63625ace 100644 (file)
@@ -1084,7 +1084,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
        spin_lock_irqsave(&q->done_lock, flags);
        vb->state = state;
        list_add_tail(&vb->done_entry, &q->done_list);
-       atomic_dec(&q->queued_count);
+       atomic_dec(&q->owned_by_drv_count);
        spin_unlock_irqrestore(&q->done_lock, flags);
 
        /* Inform any processes that may be waiting for buffers */
@@ -1437,7 +1437,7 @@ static void __enqueue_in_driver(struct vb2_buffer *vb)
        unsigned int plane;
 
        vb->state = VB2_BUF_STATE_ACTIVE;
-       atomic_inc(&q->queued_count);
+       atomic_inc(&q->owned_by_drv_count);
 
        /* sync buffers */
        for (plane = 0; plane < vb->num_planes; ++plane)
@@ -1593,7 +1593,7 @@ static int vb2_start_streaming(struct vb2_queue *q)
        int ret;
 
        /* Tell the driver to start streaming */
-       ret = call_qop(q, start_streaming, q, atomic_read(&q->queued_count));
+       ret = call_qop(q, start_streaming, q, atomic_read(&q->owned_by_drv_count));
        if (ret)
                fail_qop(q, start_streaming);
 
@@ -1826,7 +1826,7 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q)
        }
 
        if (!q->retry_start_streaming)
-               wait_event(q->done_wq, !atomic_read(&q->queued_count));
+               wait_event(q->done_wq, !atomic_read(&q->owned_by_drv_count));
        return 0;
 }
 EXPORT_SYMBOL_GPL(vb2_wait_for_all_buffers);
@@ -1958,7 +1958,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
         * has not already dequeued before initiating cancel.
         */
        INIT_LIST_HEAD(&q->done_list);
-       atomic_set(&q->queued_count, 0);
+       atomic_set(&q->owned_by_drv_count, 0);
        wake_up_all(&q->done_wq);
 
        /*
index b852b39cc6dcfc57700c44a9373a9c79b5459b0c..36e3e8e2d457603f64820873f07b4f2db9f472bc 100644 (file)
@@ -361,7 +361,7 @@ struct v4l2_fh;
  * @bufs:      videobuf buffer structures
  * @num_buffers: number of allocated/used buffers
  * @queued_list: list of buffers currently queued from userspace
- * @queued_count: number of buffers owned by the driver
+ * @owned_by_drv_count: number of buffers owned by the driver
  * @done_list: list of buffers ready to be dequeued to userspace
  * @done_lock: lock to protect done_list list
  * @done_wq:   waitqueue for processes waiting for buffers ready to be dequeued
@@ -393,7 +393,7 @@ struct vb2_queue {
 
        struct list_head                queued_list;
 
-       atomic_t                        queued_count;
+       atomic_t                        owned_by_drv_count;
        struct list_head                done_list;
        spinlock_t                      done_lock;
        wait_queue_head_t               done_wq;