Lines Matching refs:fh
13 #define IS_CAPTURE_ACTIVE(fh) \ argument
14 (((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh))
16 #define IS_OVERLAY_ACTIVE(fh) \ argument
17 (((vv->video_status & STATUS_OVERLAY) != 0) && (vv->video_fh == fh))
105 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f);
107 int saa7146_start_preview(struct saa7146_fh *fh) in saa7146_start_preview() argument
109 struct saa7146_dev *dev = fh->dev; in saa7146_start_preview()
114 DEB_EE("dev:%p, fh:%p\n", dev, fh); in saa7146_start_preview()
117 if (vv->ov.fh == NULL) { in saa7146_start_preview()
123 if (IS_CAPTURE_ACTIVE(fh) != 0) { in saa7146_start_preview()
129 if (IS_OVERLAY_ACTIVE(fh) != 0) { in saa7146_start_preview()
130 if (vv->video_fh == fh) { in saa7146_start_preview()
138 if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) { in saa7146_start_preview()
144 err = vidioc_try_fmt_vid_overlay(NULL, fh, &fmt); in saa7146_start_preview()
156 if (0 != (ret = saa7146_enable_overlay(fh))) { in saa7146_start_preview()
163 vv->video_fh = fh; in saa7146_start_preview()
169 int saa7146_stop_preview(struct saa7146_fh *fh) in saa7146_stop_preview() argument
171 struct saa7146_dev *dev = fh->dev; in saa7146_stop_preview()
174 DEB_EE("dev:%p, fh:%p\n", dev, fh); in saa7146_stop_preview()
177 if (IS_CAPTURE_ACTIVE(fh) != 0) { in saa7146_stop_preview()
188 if (vv->video_fh != fh) { in saa7146_stop_preview()
196 saa7146_disable_overlay(fh); in saa7146_stop_preview()
198 saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); in saa7146_stop_preview()
328 static int video_begin(struct saa7146_fh *fh) in video_begin() argument
330 struct saa7146_dev *dev = fh->dev; in video_begin()
336 DEB_EE("dev:%p, fh:%p\n", dev, fh); in video_begin()
339 if (vv->video_fh == fh) { in video_begin()
367 ret = saa7146_res_get(fh, resource); in video_begin()
383 vv->video_fh = fh; in video_begin()
389 static int video_end(struct saa7146_fh *fh, struct file *file) in video_end() argument
391 struct saa7146_dev *dev = fh->dev; in video_end()
397 DEB_EE("dev:%p, fh:%p\n", dev, fh); in video_end()
404 if (vv->video_fh != fh) { in video_end()
436 saa7146_res_free(fh, resource); in video_end()
446 static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *cap) in vidioc_querycap() argument
449 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_querycap()
470 static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) in vidioc_g_fbuf() argument
472 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fbuf()
481 static int vidioc_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *fb) in vidioc_s_fbuf() argument
483 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_s_fbuf()
503 if (IS_OVERLAY_ACTIVE(fh) != 0) { in vidioc_s_fbuf()
504 if (vv->video_fh != fh) { in vidioc_s_fbuf()
521 static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) in vidioc_enum_fmt_vid_cap() argument
581 struct saa7146_fh *fh = vv->video_fh; in saa7146_s_ctrl() local
583 saa7146_stop_preview(fh); in saa7146_s_ctrl()
584 saa7146_start_preview(fh); in saa7146_s_ctrl()
589 static int vidioc_g_parm(struct file *file, void *fh, in vidioc_g_parm() argument
592 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_parm()
603 static int vidioc_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vid_cap() argument
605 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vid_cap()
612 static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vid_overlay() argument
614 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vid_overlay()
621 static int vidioc_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vbi_cap() argument
623 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vbi_cap()
630 static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_try_fmt_vid_cap() argument
632 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_try_fmt_vid_cap()
639 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); in vidioc_try_fmt_vid_cap()
696 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) in vidioc_try_fmt_vid_overlay() argument
698 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_try_fmt_vid_overlay()
757 struct saa7146_fh *fh = __fh; in vidioc_s_fmt_vid_cap() local
758 struct saa7146_dev *dev = fh->dev; in vidioc_s_fmt_vid_cap()
762 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); in vidioc_s_fmt_vid_cap()
763 if (IS_CAPTURE_ACTIVE(fh) != 0) { in vidioc_s_fmt_vid_cap()
767 err = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
778 struct saa7146_fh *fh = __fh; in vidioc_s_fmt_vid_overlay() local
779 struct saa7146_dev *dev = fh->dev; in vidioc_s_fmt_vid_overlay()
783 DEB_EE("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh); in vidioc_s_fmt_vid_overlay()
784 err = vidioc_try_fmt_vid_overlay(file, fh, f); in vidioc_s_fmt_vid_overlay()
797 vv->ov.fh = fh; in vidioc_s_fmt_vid_overlay()
800 if (IS_OVERLAY_ACTIVE(fh) != 0) { in vidioc_s_fmt_vid_overlay()
801 saa7146_stop_preview(fh); in vidioc_s_fmt_vid_overlay()
802 saa7146_start_preview(fh); in vidioc_s_fmt_vid_overlay()
807 static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm) in vidioc_g_std() argument
809 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_std()
834 static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id) in vidioc_s_std() argument
836 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_s_std()
881 static int vidioc_overlay(struct file *file, void *fh, unsigned int on) in vidioc_overlay() argument
887 err = saa7146_start_preview(fh); in vidioc_overlay()
889 err = saa7146_stop_preview(fh); in vidioc_overlay()
895 struct saa7146_fh *fh = __fh; in vidioc_reqbufs() local
898 return videobuf_reqbufs(&fh->video_q, b); in vidioc_reqbufs()
900 return videobuf_reqbufs(&fh->vbi_q, b); in vidioc_reqbufs()
906 struct saa7146_fh *fh = __fh; in vidioc_querybuf() local
909 return videobuf_querybuf(&fh->video_q, buf); in vidioc_querybuf()
911 return videobuf_querybuf(&fh->vbi_q, buf); in vidioc_querybuf()
917 struct saa7146_fh *fh = __fh; in vidioc_qbuf() local
920 return videobuf_qbuf(&fh->video_q, buf); in vidioc_qbuf()
922 return videobuf_qbuf(&fh->vbi_q, buf); in vidioc_qbuf()
928 struct saa7146_fh *fh = __fh; in vidioc_dqbuf() local
931 return videobuf_dqbuf(&fh->video_q, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
933 return videobuf_dqbuf(&fh->vbi_q, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
939 struct saa7146_fh *fh = __fh; in vidioc_streamon() local
944 err = video_begin(fh); in vidioc_streamon()
948 return videobuf_streamon(&fh->video_q); in vidioc_streamon()
950 return videobuf_streamon(&fh->vbi_q); in vidioc_streamon()
956 struct saa7146_fh *fh = __fh; in vidioc_streamoff() local
957 struct saa7146_dev *dev = fh->dev; in vidioc_streamoff()
971 if (vv->video_fh != fh) { in vidioc_streamoff()
978 err = videobuf_streamoff(&fh->video_q); in vidioc_streamoff()
980 err = videobuf_streamoff(&fh->vbi_q); in vidioc_streamoff()
983 video_end(fh, file); in vidioc_streamoff()
985 err = video_end(fh, file); in vidioc_streamoff()
1061 struct saa7146_fh *fh = file->private_data; in buffer_prepare() local
1062 struct saa7146_dev *dev = fh->dev; in buffer_prepare()
1142 struct saa7146_fh *fh = file->private_data; in buffer_setup() local
1143 struct saa7146_vv *vv = fh->dev->vv_data; in buffer_setup()
1163 struct saa7146_fh *fh = file->private_data; in buffer_queue() local
1164 struct saa7146_dev *dev = fh->dev; in buffer_queue()
1169 saa7146_buffer_queue(fh->dev, &vv->video_dmaq, buf); in buffer_queue()
1175 struct saa7146_fh *fh = file->private_data; in buffer_release() local
1176 struct saa7146_dev *dev = fh->dev; in buffer_release()
1216 struct saa7146_fh *fh = file->private_data; in video_open() local
1218 videobuf_queue_sg_init(&fh->video_q, &video_qops, in video_open()
1231 struct saa7146_fh *fh = file->private_data; in video_close() local
1233 struct videobuf_queue *q = &fh->video_q; in video_close()
1235 if (IS_CAPTURE_ACTIVE(fh) != 0) in video_close()
1236 video_end(fh, file); in video_close()
1237 else if (IS_OVERLAY_ACTIVE(fh) != 0) in video_close()
1238 saa7146_stop_preview(fh); in video_close()
1264 struct saa7146_fh *fh = file->private_data; in video_read() local
1265 struct saa7146_dev *dev = fh->dev; in video_read()
1273 if (vv->video_fh == fh) { in video_read()
1281 ret = video_begin(fh); in video_read()
1286 ret = videobuf_read_one(&fh->video_q , data, count, ppos, in video_read()
1289 video_end(fh, file); in video_read()
1291 ret = video_end(fh, file); in video_read()