aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-streams.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-19 06:10:55 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:43 -0400
commitbaa4072d84e7a2e9954121c826d7bb8f1fb66b38 (patch)
tree0b354b98963f39c3089e9c5729d40b1d3a0d231c /drivers/media/video/ivtv/ivtv-streams.c
parent1aa32c2ffd146dddd76babf842e998502f1b993a (diff)
V4L/DVB (6056): ivtv: move serialization to the fileops level
Serialization is now done on the open/close/ioctl level and also when the read/write/poll start an encoder/decoder stream. 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-streams.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index fab5c51b1519..65fa247e33c5 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -437,9 +437,6 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
437 if (s->v4l2dev == NULL) 437 if (s->v4l2dev == NULL)
438 return -EINVAL; 438 return -EINVAL;
439 439
440 /* Big serialization lock to ensure no two streams are started
441 simultaneously: that can give all sorts of weird results. */
442 mutex_lock(&itv->serialize_lock);
443 IVTV_DEBUG_INFO("Start encoder stream %s\n", s->name); 440 IVTV_DEBUG_INFO("Start encoder stream %s\n", s->name);
444 441
445 switch (s->type) { 442 switch (s->type) {
@@ -481,7 +478,6 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
481 0, sizeof(itv->vbi.sliced_mpeg_size)); 478 0, sizeof(itv->vbi.sliced_mpeg_size));
482 break; 479 break;
483 default: 480 default:
484 mutex_unlock(&itv->serialize_lock);
485 return -EINVAL; 481 return -EINVAL;
486 } 482 }
487 s->subtype = subtype; 483 s->subtype = subtype;
@@ -564,7 +560,6 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
564 if (ivtv_vapi(itv, CX2341X_ENC_START_CAPTURE, 2, captype, subtype)) 560 if (ivtv_vapi(itv, CX2341X_ENC_START_CAPTURE, 2, captype, subtype))
565 { 561 {
566 IVTV_DEBUG_WARN( "Error starting capture!\n"); 562 IVTV_DEBUG_WARN( "Error starting capture!\n");
567 mutex_unlock(&itv->serialize_lock);
568 return -EINVAL; 563 return -EINVAL;
569 } 564 }
570 565
@@ -580,7 +575,6 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
580 575
581 /* you're live! sit back and await interrupts :) */ 576 /* you're live! sit back and await interrupts :) */
582 atomic_inc(&itv->capturing); 577 atomic_inc(&itv->capturing);
583 mutex_unlock(&itv->serialize_lock);
584 return 0; 578 return 0;
585} 579}
586 580
@@ -751,9 +745,6 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
751 stopmode = 1; 745 stopmode = 1;
752 } 746 }
753 747
754 /* ensure these actions are done only once */
755 mutex_lock(&itv->serialize_lock);
756
757 /* end_capture */ 748 /* end_capture */
758 /* when: 0 = end of GOP 1 = NOW!, type: 0 = mpeg, subtype: 3 = video+audio */ 749 /* when: 0 = end of GOP 1 = NOW!, type: 0 = mpeg, subtype: 3 = video+audio */
759 ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, stopmode, cap_type, s->subtype); 750 ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, stopmode, cap_type, s->subtype);
@@ -810,7 +801,6 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
810 ivtv_set_irq_mask(itv, IVTV_IRQ_ENC_VBI_CAP); 801 ivtv_set_irq_mask(itv, IVTV_IRQ_ENC_VBI_CAP);
811 802
812 if (atomic_read(&itv->capturing) > 0) { 803 if (atomic_read(&itv->capturing) > 0) {
813 mutex_unlock(&itv->serialize_lock);
814 return 0; 804 return 0;
815 } 805 }
816 806
@@ -827,7 +817,6 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
827 } 817 }
828 818
829 wake_up(&s->waitq); 819 wake_up(&s->waitq);
830 mutex_unlock(&itv->serialize_lock);
831 820
832 return 0; 821 return 0;
833} 822}