Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92646
b: refs/heads/master
c: cb78472
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Apr 24, 2008
1 parent a93e27f commit b2fabbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e28e00964cdc90dec5ebb4c00dfa2fc1ecf36fa
refs/heads/master: cb7847249f1b2bad201e38c770ef4401c61c022a
23 changes: 14 additions & 9 deletions trunk/drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,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);
}
Expand Down Expand Up @@ -269,13 +271,21 @@ static inline int get_next_buf(struct em28xx_dmaqueue *dma_q,
{
struct em28xx *dev = container_of(dma_q, struct em28xx, vidq);

/* 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");
return 0;
}

*buf = list_entry(dma_q->active.next, struct em28xx_buffer, vb.queue);


dev->isoc_ctl.buf = *buf;

return 1;
}

Expand Down Expand Up @@ -303,13 +313,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);

Expand Down Expand Up @@ -351,7 +357,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);
}

Expand Down Expand Up @@ -416,7 +421,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) {
Expand Down Expand Up @@ -478,6 +482,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;

Expand Down

0 comments on commit b2fabbe

Please sign in to comment.