aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-queue.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-11-04 21:13:58 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:51 -0500
commitc37b11bf17b66b960b217c35283aa9c55eacb292 (patch)
treee2e805142e89e059342bacdb208a115d5757fcfe /drivers/media/video/cx18/cx18-queue.c
parentf0076e60b5a61072b671b597ed2cc210f1b3cbf1 (diff)
V4L/DVB (13427): cx18: Rename struct cx18_queue.buffers to struct cx18_queue.depth
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-queue.c')
-rw-r--r--drivers/media/video/cx18/cx18-queue.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c
index 9061ff3eac6f..bc4c5e4a6c03 100644
--- a/drivers/media/video/cx18/cx18-queue.c
+++ b/drivers/media/video/cx18/cx18-queue.c
@@ -38,7 +38,7 @@ void cx18_buf_swap(struct cx18_buffer *buf)
38void cx18_queue_init(struct cx18_queue *q) 38void cx18_queue_init(struct cx18_queue *q)
39{ 39{
40 INIT_LIST_HEAD(&q->list); 40 INIT_LIST_HEAD(&q->list);
41 atomic_set(&q->buffers, 0); 41 atomic_set(&q->depth, 0);
42 q->bytesused = 0; 42 q->bytesused = 0;
43} 43}
44 44
@@ -55,7 +55,7 @@ struct cx18_queue *_cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf,
55 55
56 /* q_busy is restricted to a max buffer count imposed by firmware */ 56 /* q_busy is restricted to a max buffer count imposed by firmware */
57 if (q == &s->q_busy && 57 if (q == &s->q_busy &&
58 atomic_read(&q->buffers) >= CX18_MAX_FW_MDLS_PER_STREAM) 58 atomic_read(&q->depth) >= CX18_MAX_FW_MDLS_PER_STREAM)
59 q = &s->q_free; 59 q = &s->q_free;
60 60
61 spin_lock(&q->lock); 61 spin_lock(&q->lock);
@@ -65,7 +65,7 @@ struct cx18_queue *_cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf,
65 else 65 else
66 list_add_tail(&buf->list, &q->list); /* FIFO */ 66 list_add_tail(&buf->list, &q->list); /* FIFO */
67 q->bytesused += buf->bytesused - buf->readpos; 67 q->bytesused += buf->bytesused - buf->readpos;
68 atomic_inc(&q->buffers); 68 atomic_inc(&q->depth);
69 69
70 spin_unlock(&q->lock); 70 spin_unlock(&q->lock);
71 return q; 71 return q;
@@ -81,7 +81,7 @@ struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q)
81 list_del_init(&buf->list); 81 list_del_init(&buf->list);
82 q->bytesused -= buf->bytesused - buf->readpos; 82 q->bytesused -= buf->bytesused - buf->readpos;
83 buf->skipped = 0; 83 buf->skipped = 0;
84 atomic_dec(&q->buffers); 84 atomic_dec(&q->depth);
85 } 85 }
86 spin_unlock(&q->lock); 86 spin_unlock(&q->lock);
87 return buf; 87 return buf;
@@ -113,7 +113,7 @@ struct cx18_buffer *cx18_queue_get_buf(struct cx18_stream *s, u32 id,
113 */ 113 */
114 if (buf->id != id) { 114 if (buf->id != id) {
115 buf->skipped++; 115 buf->skipped++;
116 if (buf->skipped >= atomic_read(&s->q_busy.buffers)-1) { 116 if (buf->skipped >= atomic_read(&s->q_busy.depth)-1) {
117 /* buffer must have fallen out of rotation */ 117 /* buffer must have fallen out of rotation */
118 CX18_WARN("Skipped %s, buffer %d, %d " 118 CX18_WARN("Skipped %s, buffer %d, %d "
119 "times - it must have dropped out of " 119 "times - it must have dropped out of "
@@ -121,7 +121,7 @@ struct cx18_buffer *cx18_queue_get_buf(struct cx18_stream *s, u32 id,
121 buf->skipped); 121 buf->skipped);
122 /* Sweep it up to put it back into rotation */ 122 /* Sweep it up to put it back into rotation */
123 list_move_tail(&buf->list, &sweep_up); 123 list_move_tail(&buf->list, &sweep_up);
124 atomic_dec(&s->q_busy.buffers); 124 atomic_dec(&s->q_busy.depth);
125 } 125 }
126 continue; 126 continue;
127 } 127 }
@@ -130,7 +130,7 @@ struct cx18_buffer *cx18_queue_get_buf(struct cx18_stream *s, u32 id,
130 * will have to put it back on a queue later. 130 * will have to put it back on a queue later.
131 */ 131 */
132 list_del_init(&buf->list); 132 list_del_init(&buf->list);
133 atomic_dec(&s->q_busy.buffers); 133 atomic_dec(&s->q_busy.depth);
134 ret = buf; 134 ret = buf;
135 break; 135 break;
136 } 136 }
@@ -170,7 +170,7 @@ static void cx18_queue_flush(struct cx18_stream *s, struct cx18_queue *q)
170 buf = list_first_entry(&q->list, struct cx18_buffer, list); 170 buf = list_first_entry(&q->list, struct cx18_buffer, list);
171 list_move_tail(&buf->list, &s->q_free.list); 171 list_move_tail(&buf->list, &s->q_free.list);
172 buf->bytesused = buf->readpos = buf->b_flags = buf->skipped = 0; 172 buf->bytesused = buf->readpos = buf->b_flags = buf->skipped = 0;
173 atomic_inc(&s->q_free.buffers); 173 atomic_inc(&s->q_free.depth);
174 } 174 }
175 cx18_queue_init(q); 175 cx18_queue_init(q);
176 spin_unlock(&q->lock); 176 spin_unlock(&q->lock);