aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videobuf-core.c
diff options
context:
space:
mode:
authorBrandon Philips <brandon@ifup.org>2007-11-06 18:02:36 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:02:11 -0500
commit0fc0686e64d21a6abded96af2b1a895dfa8b2530 (patch)
tree6c7a696c13bccb98e9b4a95e995b7992605ed419 /drivers/media/video/videobuf-core.c
parent1414becf15da1701b0c45e9c82b1f120cb676a36 (diff)
V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g s/STATE_PREPARED/VIDEOBUF_PREPARED/g s/STATE_QUEUED/VIDEOBUF_QUEUED/g s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g s/STATE_DONE/VIDEOBUF_DONE/g s/STATE_ERROR/VIDEOBUF_ERROR/g s/STATE_IDLE/VIDEOBUF_IDLE/g Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/videobuf-core.c')
-rw-r--r--drivers/media/video/videobuf-core.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
index c8a5cb57963..26d1a500173 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -68,14 +68,14 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr)
68 68
69 MAGIC_CHECK(vb->magic,MAGIC_BUFFER); 69 MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
70 add_wait_queue(&vb->done, &wait); 70 add_wait_queue(&vb->done, &wait);
71 while (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) { 71 while (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) {
72 if (non_blocking) { 72 if (non_blocking) {
73 retval = -EAGAIN; 73 retval = -EAGAIN;
74 break; 74 break;
75 } 75 }
76 set_current_state(intr ? TASK_INTERRUPTIBLE 76 set_current_state(intr ? TASK_INTERRUPTIBLE
77 : TASK_UNINTERRUPTIBLE); 77 : TASK_UNINTERRUPTIBLE);
78 if (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) 78 if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED)
79 schedule(); 79 schedule();
80 set_current_state(TASK_RUNNING); 80 set_current_state(TASK_RUNNING);
81 if (intr && signal_pending(current)) { 81 if (intr && signal_pending(current)) {
@@ -167,11 +167,11 @@ int videobuf_queue_is_busy(struct videobuf_queue *q)
167 dprintk(1,"busy: buffer #%d mapped\n",i); 167 dprintk(1,"busy: buffer #%d mapped\n",i);
168 return 1; 168 return 1;
169 } 169 }
170 if (q->bufs[i]->state == STATE_QUEUED) { 170 if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
171 dprintk(1,"busy: buffer #%d queued\n",i); 171 dprintk(1,"busy: buffer #%d queued\n",i);
172 return 1; 172 return 1;
173 } 173 }
174 if (q->bufs[i]->state == STATE_ACTIVE) { 174 if (q->bufs[i]->state == VIDEOBUF_ACTIVE) {
175 dprintk(1,"busy: buffer #%d avtive\n",i); 175 dprintk(1,"busy: buffer #%d avtive\n",i);
176 return 1; 176 return 1;
177 } 177 }
@@ -191,9 +191,9 @@ void videobuf_queue_cancel(struct videobuf_queue *q)
191 for (i = 0; i < VIDEO_MAX_FRAME; i++) { 191 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
192 if (NULL == q->bufs[i]) 192 if (NULL == q->bufs[i])
193 continue; 193 continue;
194 if (q->bufs[i]->state == STATE_QUEUED) { 194 if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
195 list_del(&q->bufs[i]->queue); 195 list_del(&q->bufs[i]->queue);
196 q->bufs[i]->state = STATE_ERROR; 196 q->bufs[i]->state = VIDEOBUF_ERROR;
197 } 197 }
198 } 198 }
199 if (q->irqlock) 199 if (q->irqlock)
@@ -259,17 +259,17 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b,
259 b->flags |= V4L2_BUF_FLAG_MAPPED; 259 b->flags |= V4L2_BUF_FLAG_MAPPED;
260 260
261 switch (vb->state) { 261 switch (vb->state) {
262 case STATE_PREPARED: 262 case VIDEOBUF_PREPARED:
263 case STATE_QUEUED: 263 case VIDEOBUF_QUEUED:
264 case STATE_ACTIVE: 264 case VIDEOBUF_ACTIVE:
265 b->flags |= V4L2_BUF_FLAG_QUEUED; 265 b->flags |= V4L2_BUF_FLAG_QUEUED;
266 break; 266 break;
267 case STATE_DONE: 267 case VIDEOBUF_DONE:
268 case STATE_ERROR: 268 case VIDEOBUF_ERROR:
269 b->flags |= V4L2_BUF_FLAG_DONE; 269 b->flags |= V4L2_BUF_FLAG_DONE;
270 break; 270 break;
271 case STATE_NEEDS_INIT: 271 case VIDEOBUF_NEEDS_INIT:
272 case STATE_IDLE: 272 case VIDEOBUF_IDLE:
273 /* nothing */ 273 /* nothing */
274 break; 274 break;
275 } 275 }
@@ -498,7 +498,7 @@ int videobuf_qbuf(struct videobuf_queue *q,
498 dprintk(1,"qbuf: memory type is wrong.\n"); 498 dprintk(1,"qbuf: memory type is wrong.\n");
499 goto done; 499 goto done;
500 } 500 }
501 if (buf->state != STATE_NEEDS_INIT && buf->state != STATE_IDLE) { 501 if (buf->state != VIDEOBUF_NEEDS_INIT && buf->state != VIDEOBUF_IDLE) {
502 dprintk(1,"qbuf: buffer is already queued or active.\n"); 502 dprintk(1,"qbuf: buffer is already queued or active.\n");
503 goto done; 503 goto done;
504 } 504 }
@@ -525,7 +525,7 @@ int videobuf_qbuf(struct videobuf_queue *q,
525 dprintk(1,"qbuf: buffer length is not enough\n"); 525 dprintk(1,"qbuf: buffer length is not enough\n");
526 goto done; 526 goto done;
527 } 527 }
528 if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) 528 if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
529 q->ops->buf_release(q,buf); 529 q->ops->buf_release(q,buf);
530 buf->baddr = b->m.userptr; 530 buf->baddr = b->m.userptr;
531 break; 531 break;
@@ -595,16 +595,16 @@ int videobuf_dqbuf(struct videobuf_queue *q,
595 goto done; 595 goto done;
596 } 596 }
597 switch (buf->state) { 597 switch (buf->state) {
598 case STATE_ERROR: 598 case VIDEOBUF_ERROR:
599 dprintk(1,"dqbuf: state is error\n"); 599 dprintk(1,"dqbuf: state is error\n");
600 retval = -EIO; 600 retval = -EIO;
601 CALL(q,sync,q, buf); 601 CALL(q,sync,q, buf);
602 buf->state = STATE_IDLE; 602 buf->state = VIDEOBUF_IDLE;
603 break; 603 break;
604 case STATE_DONE: 604 case VIDEOBUF_DONE:
605 dprintk(1,"dqbuf: state is done\n"); 605 dprintk(1,"dqbuf: state is done\n");
606 CALL(q,sync,q, buf); 606 CALL(q,sync,q, buf);
607 buf->state = STATE_IDLE; 607 buf->state = VIDEOBUF_IDLE;
608 break; 608 break;
609 default: 609 default:
610 dprintk(1,"dqbuf: state invalid\n"); 610 dprintk(1,"dqbuf: state invalid\n");
@@ -637,7 +637,7 @@ int videobuf_streamon(struct videobuf_queue *q)
637 if (q->irqlock) 637 if (q->irqlock)
638 spin_lock_irqsave(q->irqlock,flags); 638 spin_lock_irqsave(q->irqlock,flags);
639 list_for_each_entry(buf, &q->stream, stream) 639 list_for_each_entry(buf, &q->stream, stream)
640 if (buf->state == STATE_PREPARED) 640 if (buf->state == VIDEOBUF_PREPARED)
641 q->ops->buf_queue(q,buf); 641 q->ops->buf_queue(q,buf);
642 if (q->irqlock) 642 if (q->irqlock)
643 spin_unlock_irqrestore(q->irqlock,flags); 643 spin_unlock_irqrestore(q->irqlock,flags);
@@ -704,7 +704,7 @@ static ssize_t videobuf_read_zerocopy(struct videobuf_queue *q,
704 retval = videobuf_waiton(q->read_buf,0,0); 704 retval = videobuf_waiton(q->read_buf,0,0);
705 if (0 == retval) { 705 if (0 == retval) {
706 CALL(q,sync,q,q->read_buf); 706 CALL(q,sync,q,q->read_buf);
707 if (STATE_ERROR == q->read_buf->state) 707 if (VIDEOBUF_ERROR == q->read_buf->state)
708 retval = -EIO; 708 retval = -EIO;
709 else 709 else
710 retval = q->read_buf->size; 710 retval = q->read_buf->size;
@@ -778,7 +778,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
778 778
779 CALL(q,sync,q,q->read_buf); 779 CALL(q,sync,q,q->read_buf);
780 780
781 if (STATE_ERROR == q->read_buf->state) { 781 if (VIDEOBUF_ERROR == q->read_buf->state) {
782 /* catch I/O errors */ 782 /* catch I/O errors */
783 q->ops->buf_release(q,q->read_buf); 783 q->ops->buf_release(q,q->read_buf);
784 kfree(q->read_buf); 784 kfree(q->read_buf);
@@ -931,7 +931,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q,
931 break; 931 break;
932 } 932 }
933 933
934 if (q->read_buf->state == STATE_DONE) { 934 if (q->read_buf->state == VIDEOBUF_DONE) {
935 rc = CALL (q,copy_stream, q, data + retval, count, 935 rc = CALL (q,copy_stream, q, data + retval, count,
936 retval, vbihack, nonblocking); 936 retval, vbihack, nonblocking);
937 if (rc < 0) { 937 if (rc < 0) {
@@ -999,8 +999,8 @@ unsigned int videobuf_poll_stream(struct file *file,
999 999
1000 if (0 == rc) { 1000 if (0 == rc) {
1001 poll_wait(file, &buf->done, wait); 1001 poll_wait(file, &buf->done, wait);
1002 if (buf->state == STATE_DONE || 1002 if (buf->state == VIDEOBUF_DONE ||
1003 buf->state == STATE_ERROR) 1003 buf->state == VIDEOBUF_ERROR)
1004 rc = POLLIN|POLLRDNORM; 1004 rc = POLLIN|POLLRDNORM;
1005 } 1005 }
1006 mutex_unlock(&q->lock); 1006 mutex_unlock(&q->lock);