aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 13:40:10 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:08:00 -0400
commit47625da2ab5e98728cdefbd344fb1493c26769ad (patch)
tree9bd5105614a3efad2f5f8c8486ee9ad8718cce9d
parentea8df7e09d2226c321c234a8f736fdb167a046cb (diff)
V4L/DVB (7543): Fix capture start/stop and timeout
Also removes the dead restart_video_queue() function Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 6049a2278190..ecc146bfc022 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -413,12 +413,6 @@ static void em28xx_irq_callback(struct urb *urb)
413 urb->status); 413 urb->status);
414 } 414 }
415 415
416#if 0 /* Bad idea. There are problems that cause a load of valid, but
417 empty, data packets. Don't reset the timeout unless we've actually
418 got a frame. I've had xawtv hang in free_buffer due to this! */
419 if (rc >= 0)
420 mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
421#endif
422 spin_unlock_irqrestore(&dev->slock,flags); 416 spin_unlock_irqrestore(&dev->slock,flags);
423} 417}
424 418
@@ -458,7 +452,7 @@ static void em28xx_uninit_isoc(struct em28xx *dev)
458 452
459 dev->isoc_ctl.num_bufs=0; 453 dev->isoc_ctl.num_bufs=0;
460 454
461 // em28xx_capture_start(dev, 0); - FIXME - how could I restart it? 455 em28xx_capture_start(dev, 0);
462} 456}
463 457
464 458
@@ -554,6 +548,8 @@ static int em28xx_start_thread( struct em28xx_dmaqueue *dma_q)
554 548
555 init_waitqueue_head(&dma_q->wq); 549 init_waitqueue_head(&dma_q->wq);
556 550
551 em28xx_capture_start(dev, 1);
552
557 /* submit urbs and enables IRQ */ 553 /* submit urbs and enables IRQ */
558 for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { 554 for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {
559 rc = usb_submit_urb(dev->isoc_ctl.urb[i], GFP_ATOMIC); 555 rc = usb_submit_urb(dev->isoc_ctl.urb[i], GFP_ATOMIC);
@@ -571,7 +567,6 @@ static int em28xx_start_thread( struct em28xx_dmaqueue *dma_q)
571 return 0; 567 return 0;
572} 568}
573 569
574
575static void em28xx_vid_timeout(unsigned long data) 570static void em28xx_vid_timeout(unsigned long data)
576{ 571{
577 struct em28xx *dev = (struct em28xx*)data; 572 struct em28xx *dev = (struct em28xx*)data;
@@ -589,8 +584,9 @@ static void em28xx_vid_timeout(unsigned long data)
589 em28xx_videodbg("em28xx/0: [%p/%d] timeout\n", 584 em28xx_videodbg("em28xx/0: [%p/%d] timeout\n",
590 buf, buf->vb.i); 585 buf, buf->vb.i);
591 } 586 }
587 /* Instead of trying to restart, just sets timeout again */
588 mod_timer(&vidq->timeout, jiffies + BUFFER_TIMEOUT);
592 589
593 /* restart_video_queue(vidq); */
594 spin_unlock_irqrestore(&dev->slock,flags); 590 spin_unlock_irqrestore(&dev->slock,flags);
595} 591}
596 592
@@ -668,7 +664,6 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
668 if (rc<0) 664 if (rc<0)
669 goto fail; 665 goto fail;
670 666
671 /* FIXME - should probably be done in response to STREAMON */
672 rc = em28xx_start_thread(vidq); 667 rc = em28xx_start_thread(vidq);
673 if (rc<0) 668 if (rc<0)
674 goto fail; 669 goto fail;
@@ -999,7 +994,6 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv,
999 get_scale(dev, dev->width, dev->height, &dev->hscale, &dev->vscale); 994 get_scale(dev, dev->width, dev->height, &dev->hscale, &dev->vscale);
1000 995
1001 em28xx_set_alternate(dev); 996 em28xx_set_alternate(dev);
1002 em28xx_capture_start(dev, 1); /* ??? */
1003 em28xx_resolution_set(dev); 997 em28xx_resolution_set(dev);
1004 998
1005 mutex_unlock(&dev->lock); 999 mutex_unlock(&dev->lock);
@@ -1429,14 +1423,6 @@ static int vidioc_streamon(struct file *file, void *priv,
1429 if (unlikely(res_get(fh) < 0)) 1423 if (unlikely(res_get(fh) < 0))
1430 return -EBUSY; 1424 return -EBUSY;
1431 1425
1432 /* We can't do this from buffer_queue or anything called from
1433 there, since it's called with IRQs disabled and the spinlock held,
1434 and this uses USB functions that may sleep
1435
1436 FIXME FIXME FIXME - putting this here means it may not always
1437 be called when it needs to be */
1438 em28xx_capture_start(dev, 1);
1439
1440 return (videobuf_streamon(&fh->vb_vidq)); 1426 return (videobuf_streamon(&fh->vb_vidq));
1441} 1427}
1442 1428