summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 12:06:52 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 12:06:52 -0300
commit22add3caf635d41daa1988b08a8f343ed9823318 (patch)
treed43fdf579d12cfd4d74b638b79dc8e2ec7ad9f99 /linux/drivers/media/video
parent0f126d6b111a068bc911b3d01ff561818c073345 (diff)
downloadmediapointer-dvb-s2-22add3caf635d41daa1988b08a8f343ed9823318.tar.gz
mediapointer-dvb-s2-22add3caf635d41daa1988b08a8f343ed9823318.tar.bz2
em28xx: Fills the entire buffer, before getting another one
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index 0eff246dc..53e460cf9 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -157,6 +157,8 @@ static inline void buffer_filled(struct em28xx *dev,
buf->vb.field_count++;
do_gettimeofday(&buf->vb.ts);
+ dev->isoc_ctl.buf = NULL;
+
list_del(&buf->vb.queue);
wake_up(&buf->vb.done);
}
@@ -288,6 +290,14 @@ static inline int get_next_buf(struct em28xx_dmaqueue *dma_q,
struct em28xx_buffer **buf)
{
struct em28xx *dev = container_of(dma_q, struct em28xx, vidq);
+#if 0
+ char *outp;
+#endif
+
+ /* If the previous buffer were not filled yet, continue */
+ *buf = dev->isoc_ctl.buf;
+ if (*buf)
+ return 1;
if (list_empty(&dma_q->active)) {
em28xx_isocdbg("No active queue to serve\n");
@@ -296,6 +306,14 @@ static inline int get_next_buf(struct em28xx_dmaqueue *dma_q,
*buf = list_entry(dma_q->active.next, struct em28xx_buffer, vb.queue);
+#if 0
+ /* Cleans up buffer - Usefull for testing for frame continuity */
+ outp = videobuf_to_vmalloc(&(*buf)->vb);
+ memset(outp, 0, (*buf)->vb.size);
+#endif
+
+ dev->isoc_ctl.buf = *buf;
+
return 1;
}
@@ -323,13 +341,9 @@ static inline int em28xx_isoc_copy(struct urb *urb)
return 0;
}
- buf = dev->isoc_ctl.buf;
-
- if (!buf) {
- rc = get_next_buf(dma_q, &buf);
- if (rc <= 0)
- return rc;
- }
+ rc = get_next_buf(dma_q, &buf);
+ if (rc <= 0)
+ return rc;
outp = videobuf_to_vmalloc(&buf->vb);
@@ -371,7 +385,6 @@ static inline int em28xx_isoc_copy(struct urb *urb)
rc = get_next_buf(dma_q, &buf);
if (rc <= 0)
return rc;
-
outp = videobuf_to_vmalloc(&buf->vb);
}
@@ -440,7 +453,6 @@ static void em28xx_uninit_isoc(struct em28xx *dev)
em28xx_isocdbg("em28xx: called em28xx_uninit_isoc\n");
dev->isoc_ctl.nfields = -1;
- dev->isoc_ctl.buf = NULL;
for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {
urb = dev->isoc_ctl.urb[i];
if (urb) {
@@ -502,6 +514,7 @@ static int em28xx_prepare_isoc(struct em28xx *dev, int max_packets,
}
dev->isoc_ctl.max_pkt_size = dev->max_pkt_size;
+ dev->isoc_ctl.buf = NULL;
sb_size = max_packets * dev->isoc_ctl.max_pkt_size;