diff options
Diffstat (limited to 'drivers/media/pci/ivtv')
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-alsa-main.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-alsa-pcm.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-driver.c | 4 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-driver.h | 2 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-fileops.c | 2 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-ioctl.c | 159 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-irq.c | 8 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-streams.c | 113 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-streams.h | 2 |
9 files changed, 160 insertions, 134 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-main.c b/drivers/media/pci/ivtv/ivtv-alsa-main.c index 39b52929755a..41fa21534edf 100644 --- a/drivers/media/pci/ivtv/ivtv-alsa-main.c +++ b/drivers/media/pci/ivtv/ivtv-alsa-main.c | |||
@@ -224,7 +224,7 @@ static int ivtv_alsa_load(struct ivtv *itv) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_PCM]; | 226 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_PCM]; |
227 | if (s->vdev == NULL) { | 227 | if (s->vdev.v4l2_dev == NULL) { |
228 | IVTV_DEBUG_ALSA_INFO("%s: PCM stream for card is disabled - " | 228 | IVTV_DEBUG_ALSA_INFO("%s: PCM stream for card is disabled - " |
229 | "skipping\n", __func__); | 229 | "skipping\n", __func__); |
230 | return 0; | 230 | return 0; |
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c index 7bf9cbca4fa6..f198b9826ed8 100644 --- a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c +++ b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c | |||
@@ -167,7 +167,7 @@ static int snd_ivtv_pcm_capture_open(struct snd_pcm_substream *substream) | |||
167 | 167 | ||
168 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_PCM]; | 168 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_PCM]; |
169 | 169 | ||
170 | v4l2_fh_init(&item.fh, s->vdev); | 170 | v4l2_fh_init(&item.fh, &s->vdev); |
171 | item.itv = itv; | 171 | item.itv = itv; |
172 | item.type = s->type; | 172 | item.type = s->type; |
173 | 173 | ||
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 802642d26643..c2e60b4f292d 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c | |||
@@ -1284,7 +1284,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) | |||
1284 | return 0; | 1284 | return 0; |
1285 | 1285 | ||
1286 | free_streams: | 1286 | free_streams: |
1287 | ivtv_streams_cleanup(itv, 1); | 1287 | ivtv_streams_cleanup(itv); |
1288 | free_irq: | 1288 | free_irq: |
1289 | free_irq(itv->pdev->irq, (void *)itv); | 1289 | free_irq(itv->pdev->irq, (void *)itv); |
1290 | free_i2c: | 1290 | free_i2c: |
@@ -1444,7 +1444,7 @@ static void ivtv_remove(struct pci_dev *pdev) | |||
1444 | flush_kthread_worker(&itv->irq_worker); | 1444 | flush_kthread_worker(&itv->irq_worker); |
1445 | kthread_stop(itv->irq_worker_task); | 1445 | kthread_stop(itv->irq_worker_task); |
1446 | 1446 | ||
1447 | ivtv_streams_cleanup(itv, 1); | 1447 | ivtv_streams_cleanup(itv); |
1448 | ivtv_udma_free(itv); | 1448 | ivtv_udma_free(itv); |
1449 | 1449 | ||
1450 | v4l2_ctrl_handler_free(&itv->cxhdl.hdl); | 1450 | v4l2_ctrl_handler_free(&itv->cxhdl.hdl); |
diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/ivtv-driver.h index bc309f42c8ed..e8b6c7ad2ba9 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.h +++ b/drivers/media/pci/ivtv/ivtv-driver.h | |||
@@ -327,7 +327,7 @@ struct ivtv; /* forward reference */ | |||
327 | struct ivtv_stream { | 327 | struct ivtv_stream { |
328 | /* These first four fields are always set, even if the stream | 328 | /* These first four fields are always set, even if the stream |
329 | is not actually created. */ | 329 | is not actually created. */ |
330 | struct video_device *vdev; /* NULL when stream not created */ | 330 | struct video_device vdev; /* vdev.v4l2_dev is NULL if there is no device */ |
331 | struct ivtv *itv; /* for ease of use */ | 331 | struct ivtv *itv; /* for ease of use */ |
332 | const char *name; /* name of the stream */ | 332 | const char *name; /* name of the stream */ |
333 | int type; /* stream type */ | 333 | int type; /* stream type */ |
diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c index e5ff6277ca85..605d280d8a5f 100644 --- a/drivers/media/pci/ivtv/ivtv-fileops.c +++ b/drivers/media/pci/ivtv/ivtv-fileops.c | |||
@@ -995,7 +995,7 @@ static int ivtv_open(struct file *filp) | |||
995 | IVTV_DEBUG_WARN("nomem on v4l2 open\n"); | 995 | IVTV_DEBUG_WARN("nomem on v4l2 open\n"); |
996 | return -ENOMEM; | 996 | return -ENOMEM; |
997 | } | 997 | } |
998 | v4l2_fh_init(&item->fh, s->vdev); | 998 | v4l2_fh_init(&item->fh, &s->vdev); |
999 | item->itv = itv; | 999 | item->itv = itv; |
1000 | item->type = s->type; | 1000 | item->type = s->type; |
1001 | 1001 | ||
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 4d8ee18c3feb..6fe6c4a0e858 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c | |||
@@ -448,9 +448,12 @@ static int ivtv_g_fmt_vid_out(struct file *file, void *fh, struct v4l2_format *f | |||
448 | static int ivtv_g_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_format *fmt) | 448 | static int ivtv_g_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_format *fmt) |
449 | { | 449 | { |
450 | struct ivtv *itv = fh2id(fh)->itv; | 450 | struct ivtv *itv = fh2id(fh)->itv; |
451 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | ||
451 | struct v4l2_window *winfmt = &fmt->fmt.win; | 452 | struct v4l2_window *winfmt = &fmt->fmt.win; |
452 | 453 | ||
453 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | 454 | if (!(s->caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) |
455 | return -EINVAL; | ||
456 | if (!itv->osd_video_pbase) | ||
454 | return -EINVAL; | 457 | return -EINVAL; |
455 | winfmt->chromakey = itv->osd_chroma_key; | 458 | winfmt->chromakey = itv->osd_chroma_key; |
456 | winfmt->global_alpha = itv->osd_global_alpha; | 459 | winfmt->global_alpha = itv->osd_global_alpha; |
@@ -555,10 +558,13 @@ static int ivtv_try_fmt_vid_out(struct file *file, void *fh, struct v4l2_format | |||
555 | static int ivtv_try_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_format *fmt) | 558 | static int ivtv_try_fmt_vid_out_overlay(struct file *file, void *fh, struct v4l2_format *fmt) |
556 | { | 559 | { |
557 | struct ivtv *itv = fh2id(fh)->itv; | 560 | struct ivtv *itv = fh2id(fh)->itv; |
561 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | ||
558 | u32 chromakey = fmt->fmt.win.chromakey; | 562 | u32 chromakey = fmt->fmt.win.chromakey; |
559 | u8 global_alpha = fmt->fmt.win.global_alpha; | 563 | u8 global_alpha = fmt->fmt.win.global_alpha; |
560 | 564 | ||
561 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | 565 | if (!(s->caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) |
566 | return -EINVAL; | ||
567 | if (!itv->osd_video_pbase) | ||
562 | return -EINVAL; | 568 | return -EINVAL; |
563 | ivtv_g_fmt_vid_out_overlay(file, fh, fmt); | 569 | ivtv_g_fmt_vid_out_overlay(file, fh, fmt); |
564 | fmt->fmt.win.chromakey = chromakey; | 570 | fmt->fmt.win.chromakey = chromakey; |
@@ -741,6 +747,11 @@ static int ivtv_querycap(struct file *file, void *fh, struct v4l2_capability *vc | |||
741 | snprintf(vcap->bus_info, sizeof(vcap->bus_info), "PCI:%s", pci_name(itv->pdev)); | 747 | snprintf(vcap->bus_info, sizeof(vcap->bus_info), "PCI:%s", pci_name(itv->pdev)); |
742 | vcap->capabilities = itv->v4l2_cap | V4L2_CAP_DEVICE_CAPS; | 748 | vcap->capabilities = itv->v4l2_cap | V4L2_CAP_DEVICE_CAPS; |
743 | vcap->device_caps = s->caps; | 749 | vcap->device_caps = s->caps; |
750 | if ((s->caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY) && | ||
751 | !itv->osd_video_pbase) { | ||
752 | vcap->capabilities &= ~V4L2_CAP_VIDEO_OUTPUT_OVERLAY; | ||
753 | vcap->device_caps &= ~V4L2_CAP_VIDEO_OUTPUT_OVERLAY; | ||
754 | } | ||
744 | return 0; | 755 | return 0; |
745 | } | 756 | } |
746 | 757 | ||
@@ -816,80 +827,103 @@ static int ivtv_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropca | |||
816 | { | 827 | { |
817 | struct ivtv_open_id *id = fh2id(fh); | 828 | struct ivtv_open_id *id = fh2id(fh); |
818 | struct ivtv *itv = id->itv; | 829 | struct ivtv *itv = id->itv; |
819 | struct yuv_playback_info *yi = &itv->yuv_info; | ||
820 | int streamtype; | ||
821 | |||
822 | streamtype = id->type; | ||
823 | 830 | ||
824 | if (cropcap->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) | ||
825 | return -EINVAL; | ||
826 | cropcap->bounds.top = cropcap->bounds.left = 0; | ||
827 | cropcap->bounds.width = 720; | ||
828 | if (cropcap->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { | 831 | if (cropcap->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { |
829 | cropcap->bounds.height = itv->is_50hz ? 576 : 480; | ||
830 | cropcap->pixelaspect.numerator = itv->is_50hz ? 59 : 10; | 832 | cropcap->pixelaspect.numerator = itv->is_50hz ? 59 : 10; |
831 | cropcap->pixelaspect.denominator = itv->is_50hz ? 54 : 11; | 833 | cropcap->pixelaspect.denominator = itv->is_50hz ? 54 : 11; |
832 | } else if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { | 834 | } else if (cropcap->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { |
833 | if (yi->track_osd) { | ||
834 | cropcap->bounds.width = yi->osd_full_w; | ||
835 | cropcap->bounds.height = yi->osd_full_h; | ||
836 | } else { | ||
837 | cropcap->bounds.width = 720; | ||
838 | cropcap->bounds.height = | ||
839 | itv->is_out_50hz ? 576 : 480; | ||
840 | } | ||
841 | cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10; | 835 | cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10; |
842 | cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11; | 836 | cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11; |
843 | } else { | 837 | } else { |
844 | cropcap->bounds.height = itv->is_out_50hz ? 576 : 480; | 838 | return -EINVAL; |
845 | cropcap->pixelaspect.numerator = itv->is_out_50hz ? 59 : 10; | ||
846 | cropcap->pixelaspect.denominator = itv->is_out_50hz ? 54 : 11; | ||
847 | } | 839 | } |
848 | cropcap->defrect = cropcap->bounds; | ||
849 | return 0; | 840 | return 0; |
850 | } | 841 | } |
851 | 842 | ||
852 | static int ivtv_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop) | 843 | static int ivtv_s_selection(struct file *file, void *fh, |
844 | struct v4l2_selection *sel) | ||
853 | { | 845 | { |
854 | struct ivtv_open_id *id = fh2id(fh); | 846 | struct ivtv_open_id *id = fh2id(fh); |
855 | struct ivtv *itv = id->itv; | 847 | struct ivtv *itv = id->itv; |
856 | struct yuv_playback_info *yi = &itv->yuv_info; | 848 | struct yuv_playback_info *yi = &itv->yuv_info; |
857 | int streamtype; | 849 | struct v4l2_rect r = { 0, 0, 720, 0 }; |
850 | int streamtype = id->type; | ||
858 | 851 | ||
859 | streamtype = id->type; | 852 | if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT || |
853 | !(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
854 | return -EINVAL; | ||
860 | 855 | ||
861 | if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && | 856 | if (sel->target != V4L2_SEL_TGT_COMPOSE) |
862 | (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { | ||
863 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { | ||
864 | yi->main_rect = crop->c; | ||
865 | return 0; | ||
866 | } else { | ||
867 | if (!ivtv_vapi(itv, CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, 4, | ||
868 | crop->c.width, crop->c.height, crop->c.left, crop->c.top)) { | ||
869 | itv->main_rect = crop->c; | ||
870 | return 0; | ||
871 | } | ||
872 | } | ||
873 | return -EINVAL; | 857 | return -EINVAL; |
858 | |||
859 | |||
860 | if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT || | ||
861 | !(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
862 | return -EINVAL; | ||
863 | |||
864 | r.height = itv->is_out_50hz ? 576 : 480; | ||
865 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV && yi->track_osd) { | ||
866 | r.width = yi->osd_full_w; | ||
867 | r.height = yi->osd_full_h; | ||
868 | } | ||
869 | sel->r.width = clamp(sel->r.width, 16U, r.width); | ||
870 | sel->r.height = clamp(sel->r.height, 16U, r.height); | ||
871 | sel->r.left = clamp_t(unsigned, sel->r.left, 0, r.width - sel->r.width); | ||
872 | sel->r.top = clamp_t(unsigned, sel->r.top, 0, r.height - sel->r.height); | ||
873 | |||
874 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) { | ||
875 | yi->main_rect = sel->r; | ||
876 | return 0; | ||
877 | } | ||
878 | if (!ivtv_vapi(itv, CX2341X_OSD_SET_FRAMEBUFFER_WINDOW, 4, | ||
879 | sel->r.width, sel->r.height, sel->r.left, sel->r.top)) { | ||
880 | itv->main_rect = sel->r; | ||
881 | return 0; | ||
874 | } | 882 | } |
875 | return -EINVAL; | 883 | return -EINVAL; |
876 | } | 884 | } |
877 | 885 | ||
878 | static int ivtv_g_crop(struct file *file, void *fh, struct v4l2_crop *crop) | 886 | static int ivtv_g_selection(struct file *file, void *fh, |
887 | struct v4l2_selection *sel) | ||
879 | { | 888 | { |
880 | struct ivtv_open_id *id = fh2id(fh); | 889 | struct ivtv_open_id *id = fh2id(fh); |
881 | struct ivtv *itv = id->itv; | 890 | struct ivtv *itv = id->itv; |
882 | struct yuv_playback_info *yi = &itv->yuv_info; | 891 | struct yuv_playback_info *yi = &itv->yuv_info; |
883 | int streamtype; | 892 | struct v4l2_rect r = { 0, 0, 720, 0 }; |
893 | int streamtype = id->type; | ||
894 | |||
895 | if (sel->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { | ||
896 | switch (sel->target) { | ||
897 | case V4L2_SEL_TGT_CROP_DEFAULT: | ||
898 | case V4L2_SEL_TGT_CROP_BOUNDS: | ||
899 | sel->r.top = sel->r.left = 0; | ||
900 | sel->r.width = 720; | ||
901 | sel->r.height = itv->is_50hz ? 576 : 480; | ||
902 | return 0; | ||
903 | default: | ||
904 | return -EINVAL; | ||
905 | } | ||
906 | } | ||
884 | 907 | ||
885 | streamtype = id->type; | 908 | if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT || |
909 | !(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) | ||
910 | return -EINVAL; | ||
886 | 911 | ||
887 | if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && | 912 | switch (sel->target) { |
888 | (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { | 913 | case V4L2_SEL_TGT_COMPOSE: |
889 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) | 914 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV) |
890 | crop->c = yi->main_rect; | 915 | sel->r = yi->main_rect; |
891 | else | 916 | else |
892 | crop->c = itv->main_rect; | 917 | sel->r = itv->main_rect; |
918 | return 0; | ||
919 | case V4L2_SEL_TGT_COMPOSE_DEFAULT: | ||
920 | case V4L2_SEL_TGT_COMPOSE_BOUNDS: | ||
921 | r.height = itv->is_out_50hz ? 576 : 480; | ||
922 | if (streamtype == IVTV_DEC_STREAM_TYPE_YUV && yi->track_osd) { | ||
923 | r.width = yi->osd_full_w; | ||
924 | r.height = yi->osd_full_h; | ||
925 | } | ||
926 | sel->r = r; | ||
893 | return 0; | 927 | return 0; |
894 | } | 928 | } |
895 | return -EINVAL; | 929 | return -EINVAL; |
@@ -987,7 +1021,7 @@ int ivtv_s_input(struct file *file, void *fh, unsigned int inp) | |||
987 | else | 1021 | else |
988 | std = V4L2_STD_ALL; | 1022 | std = V4L2_STD_ALL; |
989 | for (i = 0; i <= IVTV_ENC_STREAM_TYPE_VBI; i++) | 1023 | for (i = 0; i <= IVTV_ENC_STREAM_TYPE_VBI; i++) |
990 | itv->streams[i].vdev->tvnorms = std; | 1024 | itv->streams[i].vdev.tvnorms = std; |
991 | 1025 | ||
992 | /* prevent others from messing with the streams until | 1026 | /* prevent others from messing with the streams until |
993 | we're finished changing inputs. */ | 1027 | we're finished changing inputs. */ |
@@ -1038,7 +1072,7 @@ static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency * | |||
1038 | struct ivtv *itv = fh2id(fh)->itv; | 1072 | struct ivtv *itv = fh2id(fh)->itv; |
1039 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | 1073 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; |
1040 | 1074 | ||
1041 | if (s->vdev->vfl_dir) | 1075 | if (s->vdev.vfl_dir) |
1042 | return -ENOTTY; | 1076 | return -ENOTTY; |
1043 | if (vf->tuner != 0) | 1077 | if (vf->tuner != 0) |
1044 | return -EINVAL; | 1078 | return -EINVAL; |
@@ -1052,7 +1086,7 @@ int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *v | |||
1052 | struct ivtv *itv = fh2id(fh)->itv; | 1086 | struct ivtv *itv = fh2id(fh)->itv; |
1053 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | 1087 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; |
1054 | 1088 | ||
1055 | if (s->vdev->vfl_dir) | 1089 | if (s->vdev.vfl_dir) |
1056 | return -ENOTTY; | 1090 | return -ENOTTY; |
1057 | if (vf->tuner != 0) | 1091 | if (vf->tuner != 0) |
1058 | return -EINVAL; | 1092 | return -EINVAL; |
@@ -1340,6 +1374,7 @@ static int ivtv_try_encoder_cmd(struct file *file, void *fh, struct v4l2_encoder | |||
1340 | static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) | 1374 | static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) |
1341 | { | 1375 | { |
1342 | struct ivtv *itv = fh2id(fh)->itv; | 1376 | struct ivtv *itv = fh2id(fh)->itv; |
1377 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | ||
1343 | u32 data[CX2341X_MBOX_MAX_DATA]; | 1378 | u32 data[CX2341X_MBOX_MAX_DATA]; |
1344 | struct yuv_playback_info *yi = &itv->yuv_info; | 1379 | struct yuv_playback_info *yi = &itv->yuv_info; |
1345 | 1380 | ||
@@ -1363,10 +1398,10 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) | |||
1363 | 0, | 1398 | 0, |
1364 | }; | 1399 | }; |
1365 | 1400 | ||
1366 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) | 1401 | if (!(s->caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) |
1367 | return -EINVAL; | 1402 | return -ENOTTY; |
1368 | if (!itv->osd_video_pbase) | 1403 | if (!itv->osd_video_pbase) |
1369 | return -EINVAL; | 1404 | return -ENOTTY; |
1370 | 1405 | ||
1371 | fb->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_CHROMAKEY | | 1406 | fb->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_CHROMAKEY | |
1372 | V4L2_FBUF_CAP_GLOBAL_ALPHA; | 1407 | V4L2_FBUF_CAP_GLOBAL_ALPHA; |
@@ -1427,12 +1462,13 @@ static int ivtv_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffe | |||
1427 | { | 1462 | { |
1428 | struct ivtv_open_id *id = fh2id(fh); | 1463 | struct ivtv_open_id *id = fh2id(fh); |
1429 | struct ivtv *itv = id->itv; | 1464 | struct ivtv *itv = id->itv; |
1465 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | ||
1430 | struct yuv_playback_info *yi = &itv->yuv_info; | 1466 | struct yuv_playback_info *yi = &itv->yuv_info; |
1431 | 1467 | ||
1432 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) | 1468 | if (!(s->caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) |
1433 | return -EINVAL; | 1469 | return -ENOTTY; |
1434 | if (!itv->osd_video_pbase) | 1470 | if (!itv->osd_video_pbase) |
1435 | return -EINVAL; | 1471 | return -ENOTTY; |
1436 | 1472 | ||
1437 | itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0; | 1473 | itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0; |
1438 | itv->osd_local_alpha_state = | 1474 | itv->osd_local_alpha_state = |
@@ -1447,9 +1483,12 @@ static int ivtv_overlay(struct file *file, void *fh, unsigned int on) | |||
1447 | { | 1483 | { |
1448 | struct ivtv_open_id *id = fh2id(fh); | 1484 | struct ivtv_open_id *id = fh2id(fh); |
1449 | struct ivtv *itv = id->itv; | 1485 | struct ivtv *itv = id->itv; |
1486 | struct ivtv_stream *s = &itv->streams[fh2id(fh)->type]; | ||
1450 | 1487 | ||
1451 | if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) | 1488 | if (!(s->caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) |
1452 | return -EINVAL; | 1489 | return -ENOTTY; |
1490 | if (!itv->osd_video_pbase) | ||
1491 | return -ENOTTY; | ||
1453 | 1492 | ||
1454 | ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, on != 0); | 1493 | ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, on != 0); |
1455 | 1494 | ||
@@ -1547,7 +1586,7 @@ static int ivtv_log_status(struct file *file, void *fh) | |||
1547 | for (i = 0; i < IVTV_MAX_STREAMS; i++) { | 1586 | for (i = 0; i < IVTV_MAX_STREAMS; i++) { |
1548 | struct ivtv_stream *s = &itv->streams[i]; | 1587 | struct ivtv_stream *s = &itv->streams[i]; |
1549 | 1588 | ||
1550 | if (s->vdev == NULL || s->buffers == 0) | 1589 | if (s->vdev.v4l2_dev == NULL || s->buffers == 0) |
1551 | continue; | 1590 | continue; |
1552 | IVTV_INFO("Stream %s: status 0x%04lx, %d%% of %d KiB (%d buffers) in use\n", s->name, s->s_flags, | 1591 | IVTV_INFO("Stream %s: status 0x%04lx, %d%% of %d KiB (%d buffers) in use\n", s->name, s->s_flags, |
1553 | (s->buffers - s->q_free.buffers) * 100 / s->buffers, | 1592 | (s->buffers - s->q_free.buffers) * 100 / s->buffers, |
@@ -1837,8 +1876,8 @@ static const struct v4l2_ioctl_ops ivtv_ioctl_ops = { | |||
1837 | .vidioc_enum_output = ivtv_enum_output, | 1876 | .vidioc_enum_output = ivtv_enum_output, |
1838 | .vidioc_enumaudout = ivtv_enumaudout, | 1877 | .vidioc_enumaudout = ivtv_enumaudout, |
1839 | .vidioc_cropcap = ivtv_cropcap, | 1878 | .vidioc_cropcap = ivtv_cropcap, |
1840 | .vidioc_s_crop = ivtv_s_crop, | 1879 | .vidioc_s_selection = ivtv_s_selection, |
1841 | .vidioc_g_crop = ivtv_g_crop, | 1880 | .vidioc_g_selection = ivtv_g_selection, |
1842 | .vidioc_g_input = ivtv_g_input, | 1881 | .vidioc_g_input = ivtv_g_input, |
1843 | .vidioc_s_input = ivtv_s_input, | 1882 | .vidioc_s_input = ivtv_s_input, |
1844 | .vidioc_g_output = ivtv_g_output, | 1883 | .vidioc_g_output = ivtv_g_output, |
diff --git a/drivers/media/pci/ivtv/ivtv-irq.c b/drivers/media/pci/ivtv/ivtv-irq.c index e7d701777e53..36ca2d67c812 100644 --- a/drivers/media/pci/ivtv/ivtv-irq.c +++ b/drivers/media/pci/ivtv/ivtv-irq.c | |||
@@ -75,7 +75,7 @@ static void ivtv_pio_work_handler(struct ivtv *itv) | |||
75 | 75 | ||
76 | IVTV_DEBUG_HI_DMA("ivtv_pio_work_handler\n"); | 76 | IVTV_DEBUG_HI_DMA("ivtv_pio_work_handler\n"); |
77 | if (itv->cur_pio_stream < 0 || itv->cur_pio_stream >= IVTV_MAX_STREAMS || | 77 | if (itv->cur_pio_stream < 0 || itv->cur_pio_stream >= IVTV_MAX_STREAMS || |
78 | s->vdev == NULL || !ivtv_use_pio(s)) { | 78 | s->vdev.v4l2_dev == NULL || !ivtv_use_pio(s)) { |
79 | itv->cur_pio_stream = -1; | 79 | itv->cur_pio_stream = -1; |
80 | /* trigger PIO complete user interrupt */ | 80 | /* trigger PIO complete user interrupt */ |
81 | write_reg(IVTV_IRQ_ENC_PIO_COMPLETE, 0x44); | 81 | write_reg(IVTV_IRQ_ENC_PIO_COMPLETE, 0x44); |
@@ -132,7 +132,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA | |||
132 | int rc; | 132 | int rc; |
133 | 133 | ||
134 | /* sanity checks */ | 134 | /* sanity checks */ |
135 | if (s->vdev == NULL) { | 135 | if (s->vdev.v4l2_dev == NULL) { |
136 | IVTV_DEBUG_WARN("Stream %s not started\n", s->name); | 136 | IVTV_DEBUG_WARN("Stream %s not started\n", s->name); |
137 | return -1; | 137 | return -1; |
138 | } | 138 | } |
@@ -890,8 +890,8 @@ static void ivtv_irq_vsync(struct ivtv *itv) | |||
890 | if (s) | 890 | if (s) |
891 | wake_up(&s->waitq); | 891 | wake_up(&s->waitq); |
892 | } | 892 | } |
893 | if (s && s->vdev) | 893 | if (s && s->vdev.v4l2_dev) |
894 | v4l2_event_queue(s->vdev, frame ? &evtop : &evbottom); | 894 | v4l2_event_queue(&s->vdev, frame ? &evtop : &evbottom); |
895 | wake_up(&itv->vsync_waitq); | 895 | wake_up(&itv->vsync_waitq); |
896 | 896 | ||
897 | /* Send VBI to saa7127 */ | 897 | /* Send VBI to saa7127 */ |
diff --git a/drivers/media/pci/ivtv/ivtv-streams.c b/drivers/media/pci/ivtv/ivtv-streams.c index f0a1cc472313..d27c6df97566 100644 --- a/drivers/media/pci/ivtv/ivtv-streams.c +++ b/drivers/media/pci/ivtv/ivtv-streams.c | |||
@@ -130,7 +130,8 @@ static struct { | |||
130 | "decoder MPG", | 130 | "decoder MPG", |
131 | VFL_TYPE_GRABBER, IVTV_V4L2_DEC_MPG_OFFSET, | 131 | VFL_TYPE_GRABBER, IVTV_V4L2_DEC_MPG_OFFSET, |
132 | PCI_DMA_TODEVICE, 0, | 132 | PCI_DMA_TODEVICE, 0, |
133 | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE, | 133 | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | |
134 | V4L2_CAP_VIDEO_OUTPUT_OVERLAY, | ||
134 | &ivtv_v4l2_dec_fops | 135 | &ivtv_v4l2_dec_fops |
135 | }, | 136 | }, |
136 | { /* IVTV_DEC_STREAM_TYPE_VBI */ | 137 | { /* IVTV_DEC_STREAM_TYPE_VBI */ |
@@ -151,7 +152,8 @@ static struct { | |||
151 | "decoder YUV", | 152 | "decoder YUV", |
152 | VFL_TYPE_GRABBER, IVTV_V4L2_DEC_YUV_OFFSET, | 153 | VFL_TYPE_GRABBER, IVTV_V4L2_DEC_YUV_OFFSET, |
153 | PCI_DMA_TODEVICE, 0, | 154 | PCI_DMA_TODEVICE, 0, |
154 | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE, | 155 | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | |
156 | V4L2_CAP_VIDEO_OUTPUT_OVERLAY, | ||
155 | &ivtv_v4l2_dec_fops | 157 | &ivtv_v4l2_dec_fops |
156 | } | 158 | } |
157 | }; | 159 | }; |
@@ -159,11 +161,9 @@ static struct { | |||
159 | static void ivtv_stream_init(struct ivtv *itv, int type) | 161 | static void ivtv_stream_init(struct ivtv *itv, int type) |
160 | { | 162 | { |
161 | struct ivtv_stream *s = &itv->streams[type]; | 163 | struct ivtv_stream *s = &itv->streams[type]; |
162 | struct video_device *vdev = s->vdev; | ||
163 | 164 | ||
164 | /* we need to keep vdev, so restore it afterwards */ | 165 | /* we need to keep vdev, so restore it afterwards */ |
165 | memset(s, 0, sizeof(*s)); | 166 | memset(s, 0, sizeof(*s)); |
166 | s->vdev = vdev; | ||
167 | 167 | ||
168 | /* initialize ivtv_stream fields */ | 168 | /* initialize ivtv_stream fields */ |
169 | s->itv = itv; | 169 | s->itv = itv; |
@@ -194,10 +194,10 @@ static int ivtv_prep_dev(struct ivtv *itv, int type) | |||
194 | int num_offset = ivtv_stream_info[type].num_offset; | 194 | int num_offset = ivtv_stream_info[type].num_offset; |
195 | int num = itv->instance + ivtv_first_minor + num_offset; | 195 | int num = itv->instance + ivtv_first_minor + num_offset; |
196 | 196 | ||
197 | /* These four fields are always initialized. If vdev == NULL, then | 197 | /* These four fields are always initialized. If vdev.v4l2_dev == NULL, then |
198 | this stream is not in use. In that case no other fields but these | 198 | this stream is not in use. In that case no other fields but these |
199 | four can be used. */ | 199 | four can be used. */ |
200 | s->vdev = NULL; | 200 | s->vdev.v4l2_dev = NULL; |
201 | s->itv = itv; | 201 | s->itv = itv; |
202 | s->type = type; | 202 | s->type = type; |
203 | s->name = ivtv_stream_info[type].name; | 203 | s->name = ivtv_stream_info[type].name; |
@@ -218,40 +218,33 @@ static int ivtv_prep_dev(struct ivtv *itv, int type) | |||
218 | 218 | ||
219 | ivtv_stream_init(itv, type); | 219 | ivtv_stream_init(itv, type); |
220 | 220 | ||
221 | /* allocate and initialize the v4l2 video device structure */ | 221 | snprintf(s->vdev.name, sizeof(s->vdev.name), "%s %s", |
222 | s->vdev = video_device_alloc(); | ||
223 | if (s->vdev == NULL) { | ||
224 | IVTV_ERR("Couldn't allocate v4l2 video_device for %s\n", s->name); | ||
225 | return -ENOMEM; | ||
226 | } | ||
227 | |||
228 | snprintf(s->vdev->name, sizeof(s->vdev->name), "%s %s", | ||
229 | itv->v4l2_dev.name, s->name); | 222 | itv->v4l2_dev.name, s->name); |
230 | 223 | ||
231 | s->vdev->num = num; | 224 | s->vdev.num = num; |
232 | s->vdev->v4l2_dev = &itv->v4l2_dev; | 225 | s->vdev.v4l2_dev = &itv->v4l2_dev; |
233 | if (ivtv_stream_info[type].v4l2_caps & | 226 | if (ivtv_stream_info[type].v4l2_caps & |
234 | (V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_SLICED_VBI_OUTPUT)) | 227 | (V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_SLICED_VBI_OUTPUT)) |
235 | s->vdev->vfl_dir = VFL_DIR_TX; | 228 | s->vdev.vfl_dir = VFL_DIR_TX; |
236 | s->vdev->fops = ivtv_stream_info[type].fops; | 229 | s->vdev.fops = ivtv_stream_info[type].fops; |
237 | s->vdev->ctrl_handler = itv->v4l2_dev.ctrl_handler; | 230 | s->vdev.ctrl_handler = itv->v4l2_dev.ctrl_handler; |
238 | s->vdev->release = video_device_release; | 231 | s->vdev.release = video_device_release_empty; |
239 | s->vdev->tvnorms = V4L2_STD_ALL; | 232 | s->vdev.tvnorms = V4L2_STD_ALL; |
240 | s->vdev->lock = &itv->serialize_lock; | 233 | s->vdev.lock = &itv->serialize_lock; |
241 | if (s->type == IVTV_DEC_STREAM_TYPE_VBI) { | 234 | if (s->type == IVTV_DEC_STREAM_TYPE_VBI) { |
242 | v4l2_disable_ioctl(s->vdev, VIDIOC_S_AUDIO); | 235 | v4l2_disable_ioctl(&s->vdev, VIDIOC_S_AUDIO); |
243 | v4l2_disable_ioctl(s->vdev, VIDIOC_G_AUDIO); | 236 | v4l2_disable_ioctl(&s->vdev, VIDIOC_G_AUDIO); |
244 | v4l2_disable_ioctl(s->vdev, VIDIOC_ENUMAUDIO); | 237 | v4l2_disable_ioctl(&s->vdev, VIDIOC_ENUMAUDIO); |
245 | v4l2_disable_ioctl(s->vdev, VIDIOC_ENUMINPUT); | 238 | v4l2_disable_ioctl(&s->vdev, VIDIOC_ENUMINPUT); |
246 | v4l2_disable_ioctl(s->vdev, VIDIOC_S_INPUT); | 239 | v4l2_disable_ioctl(&s->vdev, VIDIOC_S_INPUT); |
247 | v4l2_disable_ioctl(s->vdev, VIDIOC_G_INPUT); | 240 | v4l2_disable_ioctl(&s->vdev, VIDIOC_G_INPUT); |
248 | v4l2_disable_ioctl(s->vdev, VIDIOC_S_FREQUENCY); | 241 | v4l2_disable_ioctl(&s->vdev, VIDIOC_S_FREQUENCY); |
249 | v4l2_disable_ioctl(s->vdev, VIDIOC_G_FREQUENCY); | 242 | v4l2_disable_ioctl(&s->vdev, VIDIOC_G_FREQUENCY); |
250 | v4l2_disable_ioctl(s->vdev, VIDIOC_S_TUNER); | 243 | v4l2_disable_ioctl(&s->vdev, VIDIOC_S_TUNER); |
251 | v4l2_disable_ioctl(s->vdev, VIDIOC_G_TUNER); | 244 | v4l2_disable_ioctl(&s->vdev, VIDIOC_G_TUNER); |
252 | v4l2_disable_ioctl(s->vdev, VIDIOC_S_STD); | 245 | v4l2_disable_ioctl(&s->vdev, VIDIOC_S_STD); |
253 | } | 246 | } |
254 | ivtv_set_funcs(s->vdev); | 247 | ivtv_set_funcs(&s->vdev); |
255 | return 0; | 248 | return 0; |
256 | } | 249 | } |
257 | 250 | ||
@@ -266,7 +259,7 @@ int ivtv_streams_setup(struct ivtv *itv) | |||
266 | if (ivtv_prep_dev(itv, type)) | 259 | if (ivtv_prep_dev(itv, type)) |
267 | break; | 260 | break; |
268 | 261 | ||
269 | if (itv->streams[type].vdev == NULL) | 262 | if (itv->streams[type].vdev.v4l2_dev == NULL) |
270 | continue; | 263 | continue; |
271 | 264 | ||
272 | /* Allocate Stream */ | 265 | /* Allocate Stream */ |
@@ -277,7 +270,7 @@ int ivtv_streams_setup(struct ivtv *itv) | |||
277 | return 0; | 270 | return 0; |
278 | 271 | ||
279 | /* One or more streams could not be initialized. Clean 'em all up. */ | 272 | /* One or more streams could not be initialized. Clean 'em all up. */ |
280 | ivtv_streams_cleanup(itv, 0); | 273 | ivtv_streams_cleanup(itv); |
281 | return -ENOMEM; | 274 | return -ENOMEM; |
282 | } | 275 | } |
283 | 276 | ||
@@ -288,28 +281,26 @@ static int ivtv_reg_dev(struct ivtv *itv, int type) | |||
288 | const char *name; | 281 | const char *name; |
289 | int num; | 282 | int num; |
290 | 283 | ||
291 | if (s->vdev == NULL) | 284 | if (s->vdev.v4l2_dev == NULL) |
292 | return 0; | 285 | return 0; |
293 | 286 | ||
294 | num = s->vdev->num; | 287 | num = s->vdev.num; |
295 | /* card number + user defined offset + device offset */ | 288 | /* card number + user defined offset + device offset */ |
296 | if (type != IVTV_ENC_STREAM_TYPE_MPG) { | 289 | if (type != IVTV_ENC_STREAM_TYPE_MPG) { |
297 | struct ivtv_stream *s_mpg = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG]; | 290 | struct ivtv_stream *s_mpg = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG]; |
298 | 291 | ||
299 | if (s_mpg->vdev) | 292 | if (s_mpg->vdev.v4l2_dev) |
300 | num = s_mpg->vdev->num + ivtv_stream_info[type].num_offset; | 293 | num = s_mpg->vdev.num + ivtv_stream_info[type].num_offset; |
301 | } | 294 | } |
302 | video_set_drvdata(s->vdev, s); | 295 | video_set_drvdata(&s->vdev, s); |
303 | 296 | ||
304 | /* Register device. First try the desired minor, then any free one. */ | 297 | /* Register device. First try the desired minor, then any free one. */ |
305 | if (video_register_device_no_warn(s->vdev, vfl_type, num)) { | 298 | if (video_register_device_no_warn(&s->vdev, vfl_type, num)) { |
306 | IVTV_ERR("Couldn't register v4l2 device for %s (device node number %d)\n", | 299 | IVTV_ERR("Couldn't register v4l2 device for %s (device node number %d)\n", |
307 | s->name, num); | 300 | s->name, num); |
308 | video_device_release(s->vdev); | ||
309 | s->vdev = NULL; | ||
310 | return -ENOMEM; | 301 | return -ENOMEM; |
311 | } | 302 | } |
312 | name = video_device_node_name(s->vdev); | 303 | name = video_device_node_name(&s->vdev); |
313 | 304 | ||
314 | switch (vfl_type) { | 305 | switch (vfl_type) { |
315 | case VFL_TYPE_GRABBER: | 306 | case VFL_TYPE_GRABBER: |
@@ -346,29 +337,25 @@ int ivtv_streams_register(struct ivtv *itv) | |||
346 | return 0; | 337 | return 0; |
347 | 338 | ||
348 | /* One or more streams could not be initialized. Clean 'em all up. */ | 339 | /* One or more streams could not be initialized. Clean 'em all up. */ |
349 | ivtv_streams_cleanup(itv, 1); | 340 | ivtv_streams_cleanup(itv); |
350 | return -ENOMEM; | 341 | return -ENOMEM; |
351 | } | 342 | } |
352 | 343 | ||
353 | /* Unregister v4l2 devices */ | 344 | /* Unregister v4l2 devices */ |
354 | void ivtv_streams_cleanup(struct ivtv *itv, int unregister) | 345 | void ivtv_streams_cleanup(struct ivtv *itv) |
355 | { | 346 | { |
356 | int type; | 347 | int type; |
357 | 348 | ||
358 | /* Teardown all streams */ | 349 | /* Teardown all streams */ |
359 | for (type = 0; type < IVTV_MAX_STREAMS; type++) { | 350 | for (type = 0; type < IVTV_MAX_STREAMS; type++) { |
360 | struct video_device *vdev = itv->streams[type].vdev; | 351 | struct video_device *vdev = &itv->streams[type].vdev; |
361 | 352 | ||
362 | itv->streams[type].vdev = NULL; | 353 | if (vdev->v4l2_dev == NULL) |
363 | if (vdev == NULL) | ||
364 | continue; | 354 | continue; |
365 | 355 | ||
356 | video_unregister_device(vdev); | ||
366 | ivtv_stream_free(&itv->streams[type]); | 357 | ivtv_stream_free(&itv->streams[type]); |
367 | /* Unregister or release device */ | 358 | itv->streams[type].vdev.v4l2_dev = NULL; |
368 | if (unregister) | ||
369 | video_unregister_device(vdev); | ||
370 | else | ||
371 | video_device_release(vdev); | ||
372 | } | 359 | } |
373 | } | 360 | } |
374 | 361 | ||
@@ -492,7 +479,7 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s) | |||
492 | int captype = 0, subtype = 0; | 479 | int captype = 0, subtype = 0; |
493 | int enable_passthrough = 0; | 480 | int enable_passthrough = 0; |
494 | 481 | ||
495 | if (s->vdev == NULL) | 482 | if (s->vdev.v4l2_dev == NULL) |
496 | return -EINVAL; | 483 | return -EINVAL; |
497 | 484 | ||
498 | IVTV_DEBUG_INFO("Start encoder stream %s\n", s->name); | 485 | IVTV_DEBUG_INFO("Start encoder stream %s\n", s->name); |
@@ -661,7 +648,7 @@ static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s) | |||
661 | u16 width; | 648 | u16 width; |
662 | u16 height; | 649 | u16 height; |
663 | 650 | ||
664 | if (s->vdev == NULL) | 651 | if (s->vdev.v4l2_dev == NULL) |
665 | return -EINVAL; | 652 | return -EINVAL; |
666 | 653 | ||
667 | IVTV_DEBUG_INFO("Setting some initial decoder settings\n"); | 654 | IVTV_DEBUG_INFO("Setting some initial decoder settings\n"); |
@@ -723,7 +710,7 @@ int ivtv_start_v4l2_decode_stream(struct ivtv_stream *s, int gop_offset) | |||
723 | struct ivtv *itv = s->itv; | 710 | struct ivtv *itv = s->itv; |
724 | int rc; | 711 | int rc; |
725 | 712 | ||
726 | if (s->vdev == NULL) | 713 | if (s->vdev.v4l2_dev == NULL) |
727 | return -EINVAL; | 714 | return -EINVAL; |
728 | 715 | ||
729 | if (test_and_set_bit(IVTV_F_S_STREAMING, &s->s_flags)) | 716 | if (test_and_set_bit(IVTV_F_S_STREAMING, &s->s_flags)) |
@@ -778,7 +765,7 @@ void ivtv_stop_all_captures(struct ivtv *itv) | |||
778 | for (i = IVTV_MAX_STREAMS - 1; i >= 0; i--) { | 765 | for (i = IVTV_MAX_STREAMS - 1; i >= 0; i--) { |
779 | struct ivtv_stream *s = &itv->streams[i]; | 766 | struct ivtv_stream *s = &itv->streams[i]; |
780 | 767 | ||
781 | if (s->vdev == NULL) | 768 | if (s->vdev.v4l2_dev == NULL) |
782 | continue; | 769 | continue; |
783 | if (test_bit(IVTV_F_S_STREAMING, &s->s_flags)) { | 770 | if (test_bit(IVTV_F_S_STREAMING, &s->s_flags)) { |
784 | ivtv_stop_v4l2_encode_stream(s, 0); | 771 | ivtv_stop_v4l2_encode_stream(s, 0); |
@@ -793,7 +780,7 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) | |||
793 | int cap_type; | 780 | int cap_type; |
794 | int stopmode; | 781 | int stopmode; |
795 | 782 | ||
796 | if (s->vdev == NULL) | 783 | if (s->vdev.v4l2_dev == NULL) |
797 | return -EINVAL; | 784 | return -EINVAL; |
798 | 785 | ||
799 | /* This function assumes that you are allowed to stop the capture | 786 | /* This function assumes that you are allowed to stop the capture |
@@ -917,7 +904,7 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts) | |||
917 | }; | 904 | }; |
918 | struct ivtv *itv = s->itv; | 905 | struct ivtv *itv = s->itv; |
919 | 906 | ||
920 | if (s->vdev == NULL) | 907 | if (s->vdev.v4l2_dev == NULL) |
921 | return -EINVAL; | 908 | return -EINVAL; |
922 | 909 | ||
923 | if (s->type != IVTV_DEC_STREAM_TYPE_YUV && s->type != IVTV_DEC_STREAM_TYPE_MPG) | 910 | if (s->type != IVTV_DEC_STREAM_TYPE_YUV && s->type != IVTV_DEC_STREAM_TYPE_MPG) |
@@ -969,7 +956,7 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts) | |||
969 | 956 | ||
970 | set_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags); | 957 | set_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags); |
971 | wake_up(&itv->event_waitq); | 958 | wake_up(&itv->event_waitq); |
972 | v4l2_event_queue(s->vdev, &ev); | 959 | v4l2_event_queue(&s->vdev, &ev); |
973 | 960 | ||
974 | /* wake up wait queues */ | 961 | /* wake up wait queues */ |
975 | wake_up(&s->waitq); | 962 | wake_up(&s->waitq); |
@@ -982,7 +969,7 @@ int ivtv_passthrough_mode(struct ivtv *itv, int enable) | |||
982 | struct ivtv_stream *yuv_stream = &itv->streams[IVTV_ENC_STREAM_TYPE_YUV]; | 969 | struct ivtv_stream *yuv_stream = &itv->streams[IVTV_ENC_STREAM_TYPE_YUV]; |
983 | struct ivtv_stream *dec_stream = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV]; | 970 | struct ivtv_stream *dec_stream = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV]; |
984 | 971 | ||
985 | if (yuv_stream->vdev == NULL || dec_stream->vdev == NULL) | 972 | if (yuv_stream->vdev.v4l2_dev == NULL || dec_stream->vdev.v4l2_dev == NULL) |
986 | return -EINVAL; | 973 | return -EINVAL; |
987 | 974 | ||
988 | IVTV_DEBUG_INFO("ivtv ioctl: Select passthrough mode\n"); | 975 | IVTV_DEBUG_INFO("ivtv ioctl: Select passthrough mode\n"); |
diff --git a/drivers/media/pci/ivtv/ivtv-streams.h b/drivers/media/pci/ivtv/ivtv-streams.h index a653a5136417..3d76a415fbd8 100644 --- a/drivers/media/pci/ivtv/ivtv-streams.h +++ b/drivers/media/pci/ivtv/ivtv-streams.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | int ivtv_streams_setup(struct ivtv *itv); | 24 | int ivtv_streams_setup(struct ivtv *itv); |
25 | int ivtv_streams_register(struct ivtv *itv); | 25 | int ivtv_streams_register(struct ivtv *itv); |
26 | void ivtv_streams_cleanup(struct ivtv *itv, int unregister); | 26 | void ivtv_streams_cleanup(struct ivtv *itv); |
27 | 27 | ||
28 | /* Capture related */ | 28 | /* Capture related */ |
29 | int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s); | 29 | int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s); |