diff options
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 3c2cc270ccd5..a6a2cdb81566 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "ivtv-yuv.h" | 32 | #include "ivtv-yuv.h" |
33 | #include "ivtv-ioctl.h" | 33 | #include "ivtv-ioctl.h" |
34 | #include "ivtv-cards.h" | 34 | #include "ivtv-cards.h" |
35 | #include "ivtv-firmware.h" | ||
35 | #include <media/v4l2-event.h> | 36 | #include <media/v4l2-event.h> |
36 | #include <media/saa7115.h> | 37 | #include <media/saa7115.h> |
37 | 38 | ||
@@ -526,6 +527,7 @@ int ivtv_start_decoding(struct ivtv_open_id *id, int speed) | |||
526 | { | 527 | { |
527 | struct ivtv *itv = id->itv; | 528 | struct ivtv *itv = id->itv; |
528 | struct ivtv_stream *s = &itv->streams[id->type]; | 529 | struct ivtv_stream *s = &itv->streams[id->type]; |
530 | int rc; | ||
529 | 531 | ||
530 | if (atomic_read(&itv->decoding) == 0) { | 532 | if (atomic_read(&itv->decoding) == 0) { |
531 | if (ivtv_claim_stream(id, s->type)) { | 533 | if (ivtv_claim_stream(id, s->type)) { |
@@ -533,7 +535,13 @@ int ivtv_start_decoding(struct ivtv_open_id *id, int speed) | |||
533 | IVTV_DEBUG_WARN("start decode, stream already claimed\n"); | 535 | IVTV_DEBUG_WARN("start decode, stream already claimed\n"); |
534 | return -EBUSY; | 536 | return -EBUSY; |
535 | } | 537 | } |
536 | ivtv_start_v4l2_decode_stream(s, 0); | 538 | rc = ivtv_start_v4l2_decode_stream(s, 0); |
539 | if (rc < 0) { | ||
540 | if (rc == -EAGAIN) | ||
541 | rc = ivtv_start_v4l2_decode_stream(s, 0); | ||
542 | if (rc < 0) | ||
543 | return rc; | ||
544 | } | ||
537 | } | 545 | } |
538 | if (s->type == IVTV_DEC_STREAM_TYPE_MPG) | 546 | if (s->type == IVTV_DEC_STREAM_TYPE_MPG) |
539 | return ivtv_set_speed(itv, speed); | 547 | return ivtv_set_speed(itv, speed); |
@@ -912,12 +920,32 @@ int ivtv_v4l2_close(struct file *filp) | |||
912 | 920 | ||
913 | static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp) | 921 | static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp) |
914 | { | 922 | { |
923 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
924 | struct video_device *vdev = video_devdata(filp); | ||
925 | #endif | ||
915 | struct ivtv *itv = s->itv; | 926 | struct ivtv *itv = s->itv; |
916 | struct ivtv_open_id *item; | 927 | struct ivtv_open_id *item; |
917 | int res = 0; | 928 | int res = 0; |
918 | 929 | ||
919 | IVTV_DEBUG_FILE("open %s\n", s->name); | 930 | IVTV_DEBUG_FILE("open %s\n", s->name); |
920 | 931 | ||
932 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
933 | /* Unless ivtv_fw_debug is set, error out if firmware dead. */ | ||
934 | if (ivtv_fw_debug) { | ||
935 | IVTV_WARN("Opening %s with dead firmware lockout disabled\n", | ||
936 | video_device_node_name(vdev)); | ||
937 | IVTV_WARN("Selected firmware errors will be ignored\n"); | ||
938 | } else { | ||
939 | #else | ||
940 | if (1) { | ||
941 | #endif | ||
942 | res = ivtv_firmware_check(itv, "ivtv_serialized_open"); | ||
943 | if (res == -EAGAIN) | ||
944 | res = ivtv_firmware_check(itv, "ivtv_serialized_open"); | ||
945 | if (res < 0) | ||
946 | return -EIO; | ||
947 | } | ||
948 | |||
921 | if (s->type == IVTV_DEC_STREAM_TYPE_MPG && | 949 | if (s->type == IVTV_DEC_STREAM_TYPE_MPG && |
922 | test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags)) | 950 | test_bit(IVTV_F_S_CLAIMED, &itv->streams[IVTV_DEC_STREAM_TYPE_YUV].s_flags)) |
923 | return -EBUSY; | 951 | return -EBUSY; |