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()
454 static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) in vidioc_g_fbuf() argument
456 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fbuf()
465 static int vidioc_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *fb) in vidioc_s_fbuf() argument
467 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_s_fbuf()
487 if (IS_OVERLAY_ACTIVE(fh) != 0) { in vidioc_s_fbuf()
488 if (vv->video_fh != fh) { in vidioc_s_fbuf()
505 static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) in vidioc_enum_fmt_vid_cap() argument
563 struct saa7146_fh *fh = vv->video_fh; in saa7146_s_ctrl() local
565 saa7146_stop_preview(fh); in saa7146_s_ctrl()
566 saa7146_start_preview(fh); in saa7146_s_ctrl()
571 static int vidioc_g_parm(struct file *file, void *fh, in vidioc_g_parm() argument
574 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_parm()
585 static int vidioc_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vid_cap() argument
587 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vid_cap()
594 static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vid_overlay() argument
596 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vid_overlay()
603 static int vidioc_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_g_fmt_vbi_cap() argument
605 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_fmt_vbi_cap()
612 static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) in vidioc_try_fmt_vid_cap() argument
614 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_try_fmt_vid_cap()
621 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); in vidioc_try_fmt_vid_cap()
678 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) in vidioc_try_fmt_vid_overlay() argument
680 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_try_fmt_vid_overlay()
739 struct saa7146_fh *fh = __fh; in vidioc_s_fmt_vid_cap() local
740 struct saa7146_dev *dev = fh->dev; in vidioc_s_fmt_vid_cap()
744 DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); in vidioc_s_fmt_vid_cap()
745 if (IS_CAPTURE_ACTIVE(fh) != 0) { in vidioc_s_fmt_vid_cap()
749 err = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
760 struct saa7146_fh *fh = __fh; in vidioc_s_fmt_vid_overlay() local
761 struct saa7146_dev *dev = fh->dev; in vidioc_s_fmt_vid_overlay()
765 DEB_EE("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh); in vidioc_s_fmt_vid_overlay()
766 err = vidioc_try_fmt_vid_overlay(file, fh, f); in vidioc_s_fmt_vid_overlay()
779 vv->ov.fh = fh; in vidioc_s_fmt_vid_overlay()
782 if (IS_OVERLAY_ACTIVE(fh) != 0) { in vidioc_s_fmt_vid_overlay()
783 saa7146_stop_preview(fh); in vidioc_s_fmt_vid_overlay()
784 saa7146_start_preview(fh); in vidioc_s_fmt_vid_overlay()
789 static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm) in vidioc_g_std() argument
791 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_g_std()
816 static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id) in vidioc_s_std() argument
818 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; in vidioc_s_std()
863 static int vidioc_overlay(struct file *file, void *fh, unsigned int on) in vidioc_overlay() argument
869 err = saa7146_start_preview(fh); in vidioc_overlay()
871 err = saa7146_stop_preview(fh); in vidioc_overlay()
877 struct saa7146_fh *fh = __fh; in vidioc_reqbufs() local
880 return videobuf_reqbufs(&fh->video_q, b); in vidioc_reqbufs()
882 return videobuf_reqbufs(&fh->vbi_q, b); in vidioc_reqbufs()
888 struct saa7146_fh *fh = __fh; in vidioc_querybuf() local
891 return videobuf_querybuf(&fh->video_q, buf); in vidioc_querybuf()
893 return videobuf_querybuf(&fh->vbi_q, buf); in vidioc_querybuf()
899 struct saa7146_fh *fh = __fh; in vidioc_qbuf() local
902 return videobuf_qbuf(&fh->video_q, buf); in vidioc_qbuf()
904 return videobuf_qbuf(&fh->vbi_q, buf); in vidioc_qbuf()
910 struct saa7146_fh *fh = __fh; in vidioc_dqbuf() local
913 return videobuf_dqbuf(&fh->video_q, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
915 return videobuf_dqbuf(&fh->vbi_q, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
921 struct saa7146_fh *fh = __fh; in vidioc_streamon() local
926 err = video_begin(fh); in vidioc_streamon()
930 return videobuf_streamon(&fh->video_q); in vidioc_streamon()
932 return videobuf_streamon(&fh->vbi_q); in vidioc_streamon()
938 struct saa7146_fh *fh = __fh; in vidioc_streamoff() local
939 struct saa7146_dev *dev = fh->dev; in vidioc_streamoff()
953 if (vv->video_fh != fh) { in vidioc_streamoff()
960 err = videobuf_streamoff(&fh->video_q); in vidioc_streamoff()
962 err = videobuf_streamoff(&fh->vbi_q); in vidioc_streamoff()
965 video_end(fh, file); in vidioc_streamoff()
967 err = video_end(fh, file); in vidioc_streamoff()
1043 struct saa7146_fh *fh = file->private_data; in buffer_prepare() local
1044 struct saa7146_dev *dev = fh->dev; in buffer_prepare()
1124 struct saa7146_fh *fh = file->private_data; in buffer_setup() local
1125 struct saa7146_vv *vv = fh->dev->vv_data; in buffer_setup()
1145 struct saa7146_fh *fh = file->private_data; in buffer_queue() local
1146 struct saa7146_dev *dev = fh->dev; in buffer_queue()
1151 saa7146_buffer_queue(fh->dev, &vv->video_dmaq, buf); in buffer_queue()
1157 struct saa7146_fh *fh = file->private_data; in buffer_release() local
1158 struct saa7146_dev *dev = fh->dev; in buffer_release()
1196 struct saa7146_fh *fh = file->private_data; in video_open() local
1198 videobuf_queue_sg_init(&fh->video_q, &video_qops, in video_open()
1211 struct saa7146_fh *fh = file->private_data; in video_close() local
1213 struct videobuf_queue *q = &fh->video_q; in video_close()
1215 if (IS_CAPTURE_ACTIVE(fh) != 0) in video_close()
1216 video_end(fh, file); in video_close()
1217 else if (IS_OVERLAY_ACTIVE(fh) != 0) in video_close()
1218 saa7146_stop_preview(fh); in video_close()
1244 struct saa7146_fh *fh = file->private_data; in video_read() local
1245 struct saa7146_dev *dev = fh->dev; in video_read()
1253 if (vv->video_fh == fh) { in video_read()
1261 ret = video_begin(fh); in video_read()
1266 ret = videobuf_read_one(&fh->video_q , data, count, ppos, in video_read()
1269 video_end(fh, file); in video_read()
1271 ret = video_end(fh, file); in video_read()