aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-19 05:08:58 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:42 -0400
commit1aa32c2ffd146dddd76babf842e998502f1b993a (patch)
treed19c6b10cc00211bc4144db68c528fcb6f95fffc /drivers/media/video/ivtv/ivtv-fileops.c
parent313e91e824c0c595dec3740c0c87f55eea6bdb3f (diff)
V4L/DVB (6055): ivtv: improve debug messages
- add FILE debug flag for open/close/read/write/poll. - show cmd for encoder/decoder command ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 076b0089a2b0..846e9bfa41f0 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -409,7 +409,7 @@ static ssize_t ivtv_read_pos(struct ivtv_stream *s, char __user *ubuf, size_t co
409 ssize_t rc = count ? ivtv_read(s, ubuf, count, non_block) : 0; 409 ssize_t rc = count ? ivtv_read(s, ubuf, count, non_block) : 0;
410 struct ivtv *itv = s->itv; 410 struct ivtv *itv = s->itv;
411 411
412 IVTV_DEBUG_HI_INFO("read %zd from %s, got %zd\n", count, s->name, rc); 412 IVTV_DEBUG_HI_FILE("read %zd from %s, got %zd\n", count, s->name, rc);
413 if (rc > 0) 413 if (rc > 0)
414 pos += rc; 414 pos += rc;
415 return rc; 415 return rc;
@@ -500,7 +500,7 @@ ssize_t ivtv_v4l2_read(struct file * filp, char __user *buf, size_t count, loff_
500 struct ivtv_stream *s = &itv->streams[id->type]; 500 struct ivtv_stream *s = &itv->streams[id->type];
501 int rc; 501 int rc;
502 502
503 IVTV_DEBUG_HI_IOCTL("read %zd bytes from %s\n", count, s->name); 503 IVTV_DEBUG_HI_FILE("read %zd bytes from %s\n", count, s->name);
504 504
505 rc = ivtv_start_capture(id); 505 rc = ivtv_start_capture(id);
506 if (rc) 506 if (rc)
@@ -538,7 +538,7 @@ ssize_t ivtv_v4l2_write(struct file *filp, const char __user *user_buf, size_t c
538 int rc; 538 int rc;
539 DEFINE_WAIT(wait); 539 DEFINE_WAIT(wait);
540 540
541 IVTV_DEBUG_HI_IOCTL("write %zd bytes to %s\n", count, s->name); 541 IVTV_DEBUG_HI_FILE("write %zd bytes to %s\n", count, s->name);
542 542
543 if (s->type != IVTV_DEC_STREAM_TYPE_MPG && 543 if (s->type != IVTV_DEC_STREAM_TYPE_MPG &&
544 s->type != IVTV_DEC_STREAM_TYPE_YUV && 544 s->type != IVTV_DEC_STREAM_TYPE_YUV &&
@@ -646,7 +646,7 @@ retry:
646 to transfer the rest. */ 646 to transfer the rest. */
647 if (count && !(filp->f_flags & O_NONBLOCK)) 647 if (count && !(filp->f_flags & O_NONBLOCK))
648 goto retry; 648 goto retry;
649 IVTV_DEBUG_HI_INFO("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused); 649 IVTV_DEBUG_HI_FILE("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused);
650 return bytes_written; 650 return bytes_written;
651} 651}
652 652
@@ -658,6 +658,7 @@ unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
658 int res = 0; 658 int res = 0;
659 659
660 /* add stream's waitq to the poll list */ 660 /* add stream's waitq to the poll list */
661 IVTV_DEBUG_HI_FILE("Decoder poll\n");
661 poll_wait(filp, &s->waitq, wait); 662 poll_wait(filp, &s->waitq, wait);
662 663
663 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags); 664 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
@@ -687,9 +688,11 @@ unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait)
687 s->name, rc); 688 s->name, rc);
688 return POLLERR; 689 return POLLERR;
689 } 690 }
691 IVTV_DEBUG_FILE("Encoder poll started capture\n");
690 } 692 }
691 693
692 /* add stream's waitq to the poll list */ 694 /* add stream's waitq to the poll list */
695 IVTV_DEBUG_HI_FILE("Encoder poll\n");
693 poll_wait(filp, &s->waitq, wait); 696 poll_wait(filp, &s->waitq, wait);
694 697
695 if (eof || s->q_full.length) 698 if (eof || s->q_full.length)
@@ -702,7 +705,7 @@ void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end)
702 struct ivtv *itv = id->itv; 705 struct ivtv *itv = id->itv;
703 struct ivtv_stream *s = &itv->streams[id->type]; 706 struct ivtv_stream *s = &itv->streams[id->type];
704 707
705 IVTV_DEBUG_IOCTL("close() of %s\n", s->name); 708 IVTV_DEBUG_FILE("close() of %s\n", s->name);
706 709
707 /* 'Unclaim' this stream */ 710 /* 'Unclaim' this stream */
708 711
@@ -740,7 +743,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts)
740 struct ivtv *itv = id->itv; 743 struct ivtv *itv = id->itv;
741 struct ivtv_stream *s = &itv->streams[id->type]; 744 struct ivtv_stream *s = &itv->streams[id->type];
742 745
743 IVTV_DEBUG_IOCTL("close() of %s\n", s->name); 746 IVTV_DEBUG_FILE("close() of %s\n", s->name);
744 747
745 /* Stop decoding */ 748 /* Stop decoding */
746 if (test_bit(IVTV_F_S_STREAMING, &s->s_flags)) { 749 if (test_bit(IVTV_F_S_STREAMING, &s->s_flags)) {
@@ -772,7 +775,7 @@ int ivtv_v4l2_close(struct inode *inode, struct file *filp)
772 struct ivtv *itv = id->itv; 775 struct ivtv *itv = id->itv;
773 struct ivtv_stream *s = &itv->streams[id->type]; 776 struct ivtv_stream *s = &itv->streams[id->type];
774 777
775 IVTV_DEBUG_IOCTL("close() of %s\n", s->name); 778 IVTV_DEBUG_FILE("close %s\n", s->name);
776 779
777 v4l2_prio_close(&itv->prio, &id->prio); 780 v4l2_prio_close(&itv->prio, &id->prio);
778 781
@@ -855,6 +858,7 @@ int ivtv_v4l2_open(struct inode *inode, struct file *filp)
855 IVTV_ERR("Failed to initialize on minor %d\n", minor); 858 IVTV_ERR("Failed to initialize on minor %d\n", minor);
856 return -ENXIO; 859 return -ENXIO;
857 } 860 }
861 IVTV_DEBUG_FILE("open %s\n", s->name);
858 862
859 if (y == IVTV_DEC_STREAM_TYPE_MPG && 863 if (y == IVTV_DEC_STREAM_TYPE_MPG &&
860 test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags)) 864 test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags))