aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/media/video/cx18/cx18-driver.h2
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c4
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c2
-rw-r--r--drivers/media/video/cx18/cx18-queue.c16
-rw-r--r--drivers/media/video/cx18/cx18-streams.c6
5 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h
index c6a1e907f63a..0b182fa2ad0b 100644
--- a/drivers/media/video/cx18/cx18-driver.h
+++ b/drivers/media/video/cx18/cx18-driver.h
@@ -285,7 +285,7 @@ struct cx18_buffer {
285 285
286struct cx18_queue { 286struct cx18_queue {
287 struct list_head list; 287 struct list_head list;
288 atomic_t buffers; 288 atomic_t depth;
289 u32 bytesused; 289 u32 bytesused;
290 spinlock_t lock; 290 spinlock_t lock;
291}; 291};
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 04d9c2508b86..e4a3faebff46 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -229,7 +229,7 @@ static struct cx18_buffer *cx18_get_buffer(struct cx18_stream *s, int non_block,
229 prepare_to_wait(&s->waitq, &wait, TASK_INTERRUPTIBLE); 229 prepare_to_wait(&s->waitq, &wait, TASK_INTERRUPTIBLE);
230 /* New buffers might have become available before we were added 230 /* New buffers might have become available before we were added
231 to the waitqueue */ 231 to the waitqueue */
232 if (!atomic_read(&s->q_full.buffers)) 232 if (!atomic_read(&s->q_full.depth))
233 schedule(); 233 schedule();
234 finish_wait(&s->waitq, &wait); 234 finish_wait(&s->waitq, &wait);
235 if (signal_pending(current)) { 235 if (signal_pending(current)) {
@@ -543,7 +543,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
543 CX18_DEBUG_HI_FILE("Encoder poll\n"); 543 CX18_DEBUG_HI_FILE("Encoder poll\n");
544 poll_wait(filp, &s->waitq, wait); 544 poll_wait(filp, &s->waitq, wait);
545 545
546 if (atomic_read(&s->q_full.buffers)) 546 if (atomic_read(&s->q_full.depth))
547 return POLLIN | POLLRDNORM; 547 return POLLIN | POLLRDNORM;
548 if (eof) 548 if (eof)
549 return POLLHUP; 549 return POLLHUP;
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index fc76e4d6ffa7..6539b031b4eb 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -910,7 +910,7 @@ static int cx18_log_status(struct file *file, void *fh)
910 continue; 910 continue;
911 CX18_INFO("Stream %s: status 0x%04lx, %d%% of %d KiB (%d buffers) in use\n", 911 CX18_INFO("Stream %s: status 0x%04lx, %d%% of %d KiB (%d buffers) in use\n",
912 s->name, s->s_flags, 912 s->name, s->s_flags,
913 atomic_read(&s->q_full.buffers) * 100 / s->buffers, 913 atomic_read(&s->q_full.depth) * 100 / s->buffers,
914 (s->buffers * s->buf_size) / 1024, s->buffers); 914 (s->buffers * s->buf_size) / 1024, s->buffers);
915 } 915 }
916 CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n", 916 CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n",
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);
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 7df513a2dba8..10228c5ca5a0 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -470,8 +470,8 @@ void _cx18_stream_load_fw_queue(struct cx18_stream *s)
470 struct cx18_queue *q; 470 struct cx18_queue *q;
471 struct cx18_buffer *buf; 471 struct cx18_buffer *buf;
472 472
473 if (atomic_read(&s->q_free.buffers) == 0 || 473 if (atomic_read(&s->q_free.depth) == 0 ||
474 atomic_read(&s->q_busy.buffers) >= CX18_MAX_FW_MDLS_PER_STREAM) 474 atomic_read(&s->q_busy.depth) >= CX18_MAX_FW_MDLS_PER_STREAM)
475 return; 475 return;
476 476
477 /* Move from q_free to q_busy notifying the firmware, until the limit */ 477 /* Move from q_free to q_busy notifying the firmware, until the limit */
@@ -480,7 +480,7 @@ void _cx18_stream_load_fw_queue(struct cx18_stream *s)
480 if (buf == NULL) 480 if (buf == NULL)
481 break; 481 break;
482 q = _cx18_stream_put_buf_fw(s, buf); 482 q = _cx18_stream_put_buf_fw(s, buf);
483 } while (atomic_read(&s->q_busy.buffers) < CX18_MAX_FW_MDLS_PER_STREAM 483 } while (atomic_read(&s->q_busy.depth) < CX18_MAX_FW_MDLS_PER_STREAM
484 && q == &s->q_busy); 484 && q == &s->q_busy);
485} 485}
486 486