Lines Matching refs:fh

14 #define IS_CAPTURE_ACTIVE(fh) \  argument
15 (((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh))
17 #define IS_OVERLAY_ACTIVE(fh) \ argument
18 (((vv->video_status & STATUS_OVERLAY) != 0) && (vv->video_fh == fh))
94 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f);
96 int saa7146_start_preview(struct saa7146_fh *fh) in saa7146_start_preview() argument
98 struct saa7146_dev *dev = fh->dev; in saa7146_start_preview()
103 DEB_EE("dev:%p, fh:%p\n", dev, fh); in saa7146_start_preview()
106 if (vv->ov.fh == NULL) { in saa7146_start_preview()
112 if (IS_CAPTURE_ACTIVE(fh) != 0) { in saa7146_start_preview()
118 if (IS_OVERLAY_ACTIVE(fh) != 0) { in saa7146_start_preview()
119 if (vv->video_fh == fh) { in saa7146_start_preview()
127 if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) { in saa7146_start_preview()
133 err = vidioc_try_fmt_vid_overlay(NULL, fh, &fmt); in saa7146_start_preview()
145 if (0 != (ret = saa7146_enable_overlay(fh))) { in saa7146_start_preview()
152 vv->video_fh = fh; in saa7146_start_preview()
158 int saa7146_stop_preview(struct saa7146_fh *fh) in saa7146_stop_preview() argument
160 struct saa7146_dev *dev = fh->dev; in saa7146_stop_preview()
163 DEB_EE("dev:%p, fh:%p\n", dev, fh); in saa7146_stop_preview()
166 if (IS_CAPTURE_ACTIVE(fh) != 0) { in saa7146_stop_preview()
177 if (vv->video_fh != fh) { in saa7146_stop_preview()
185 saa7146_disable_overlay(fh); in saa7146_stop_preview()
187 saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); in saa7146_stop_preview()
316 static int video_begin(struct saa7146_fh *fh) in video_begin() argument
318 struct saa7146_dev *dev = fh->dev; in video_begin()
324 DEB_EE("dev:%p, fh:%p\n", dev, fh); in video_begin()
327 if (vv->video_fh == fh) { in video_begin()
356 ret = saa7146_res_get(fh, resource); in video_begin()
372 vv->video_fh = fh; in video_begin()
378 static int video_end(struct saa7146_fh *fh, struct file *file) in video_end() argument
380 struct saa7146_dev *dev = fh->dev; in video_end()
387 DEB_EE("dev:%p, fh:%p\n", dev, fh); in video_end()
394 if (vv->video_fh != fh) { in video_end()
430 saa7146_res_free(fh, resource); in video_end()
440 static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *cap) in vidioc_querycap() argument
442 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_querycap()
453 static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) in vidioc_g_fbuf() argument
455 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fbuf()
464 static int vidioc_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *fb) in vidioc_s_fbuf() argument
466 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_s_fbuf()
486 if (IS_OVERLAY_ACTIVE(fh) != 0) { in vidioc_s_fbuf()
487 if (vv->video_fh != fh) { in vidioc_s_fbuf()
504 static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) in vidioc_enum_fmt_vid_cap() argument
562 struct saa7146_fh *fh = vv->video_fh; in saa7146_s_ctrl() local
564 saa7146_stop_preview(fh); in saa7146_s_ctrl()
565 saa7146_start_preview(fh); in saa7146_s_ctrl()
570 static int vidioc_g_parm(struct file *file, void *fh, in vidioc_g_parm() argument
573 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_parm()
584 static int vidioc_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vid_cap() argument
586 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vid_cap()
593 static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vid_overlay() argument
595 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vid_overlay()
602 static int vidioc_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vbi_cap() argument
604 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vbi_cap()
611 static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_try_fmt_vid_cap() argument
613 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_try_fmt_vid_cap()
620 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); in vidioc_try_fmt_vid_cap()
677 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) in vidioc_try_fmt_vid_overlay() argument
679 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_try_fmt_vid_overlay()
738 struct saa7146_fh *fh = __fh; in vidioc_s_fmt_vid_cap() local
739 struct saa7146_dev *dev = fh->dev; in vidioc_s_fmt_vid_cap()
743 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); in vidioc_s_fmt_vid_cap()
744 if (IS_CAPTURE_ACTIVE(fh) != 0) { in vidioc_s_fmt_vid_cap()
748 err = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
759 struct saa7146_fh *fh = __fh; in vidioc_s_fmt_vid_overlay() local
760 struct saa7146_dev *dev = fh->dev; in vidioc_s_fmt_vid_overlay()
764 DEB_EE("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh); in vidioc_s_fmt_vid_overlay()
765 err = vidioc_try_fmt_vid_overlay(file, fh, f); in vidioc_s_fmt_vid_overlay()
776 vv->ov.fh = fh; in vidioc_s_fmt_vid_overlay()
779 if (IS_OVERLAY_ACTIVE(fh) != 0) { in vidioc_s_fmt_vid_overlay()
780 saa7146_stop_preview(fh); in vidioc_s_fmt_vid_overlay()
781 saa7146_start_preview(fh); in vidioc_s_fmt_vid_overlay()
786 static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm) in vidioc_g_std() argument
788 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_std()
813 static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id) in vidioc_s_std() argument
815 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_s_std()
860 static int vidioc_overlay(struct file *file, void *fh, unsigned int on) in vidioc_overlay() argument
866 err = saa7146_start_preview(fh); in vidioc_overlay()
868 err = saa7146_stop_preview(fh); in vidioc_overlay()
874 struct saa7146_fh *fh = __fh; in vidioc_reqbufs() local
877 return videobuf_reqbufs(&fh->video_q, b); in vidioc_reqbufs()
879 return videobuf_reqbufs(&fh->vbi_q, b); in vidioc_reqbufs()
885 struct saa7146_fh *fh = __fh; in vidioc_querybuf() local
888 return videobuf_querybuf(&fh->video_q, buf); in vidioc_querybuf()
890 return videobuf_querybuf(&fh->vbi_q, buf); in vidioc_querybuf()
896 struct saa7146_fh *fh = __fh; in vidioc_qbuf() local
899 return videobuf_qbuf(&fh->video_q, buf); in vidioc_qbuf()
901 return videobuf_qbuf(&fh->vbi_q, buf); in vidioc_qbuf()
907 struct saa7146_fh *fh = __fh; in vidioc_dqbuf() local
910 return videobuf_dqbuf(&fh->video_q, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
912 return videobuf_dqbuf(&fh->vbi_q, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
918 struct saa7146_fh *fh = __fh; in vidioc_streamon() local
923 err = video_begin(fh); in vidioc_streamon()
927 return videobuf_streamon(&fh->video_q); in vidioc_streamon()
929 return videobuf_streamon(&fh->vbi_q); in vidioc_streamon()
935 struct saa7146_fh *fh = __fh; in vidioc_streamoff() local
936 struct saa7146_dev *dev = fh->dev; in vidioc_streamoff()
950 if (vv->video_fh != fh) { in vidioc_streamoff()
957 err = videobuf_streamoff(&fh->video_q); in vidioc_streamoff()
959 err = videobuf_streamoff(&fh->vbi_q); in vidioc_streamoff()
962 video_end(fh, file); in vidioc_streamoff()
964 err = video_end(fh, file); in vidioc_streamoff()
1040 struct saa7146_fh *fh = file->private_data; in buffer_prepare() local
1041 struct saa7146_dev *dev = fh->dev; in buffer_prepare()
1121 struct saa7146_fh *fh = file->private_data; in buffer_setup() local
1122 struct saa7146_vv *vv = fh->dev->vv_data; in buffer_setup()
1142 struct saa7146_fh *fh = file->private_data; in buffer_queue() local
1143 struct saa7146_dev *dev = fh->dev; in buffer_queue()
1148 saa7146_buffer_queue(fh->dev, &vv->video_dmaq, buf); in buffer_queue()
1154 struct saa7146_fh *fh = file->private_data; in buffer_release() local
1155 struct saa7146_dev *dev = fh->dev; in buffer_release()
1193 struct saa7146_fh *fh = file->private_data; in video_open() local
1195 videobuf_queue_sg_init(&fh->video_q, &video_qops, in video_open()
1208 struct saa7146_fh *fh = file->private_data; in video_close() local
1210 struct videobuf_queue *q = &fh->video_q; in video_close()
1212 if (IS_CAPTURE_ACTIVE(fh) != 0) in video_close()
1213 video_end(fh, file); in video_close()
1214 else if (IS_OVERLAY_ACTIVE(fh) != 0) in video_close()
1215 saa7146_stop_preview(fh); in video_close()
1241 struct saa7146_fh *fh = file->private_data; in video_read() local
1242 struct saa7146_dev *dev = fh->dev; in video_read()
1250 if (vv->video_fh == fh) { in video_read()
1258 ret = video_begin(fh); in video_read()
1263 ret = videobuf_read_one(&fh->video_q , data, count, ppos, in video_read()
1266 video_end(fh, file); in video_read()
1268 ret = video_end(fh, file); in video_read()