Lines Matching refs:fh
675 struct tm6000_fh *fh = vq->priv_data; in buffer_setup() local
677 *size = fh->fmt->depth * fh->width * fh->height >> 3; in buffer_setup()
692 struct tm6000_fh *fh = vq->priv_data; in free_buffer() local
693 struct tm6000_core *dev = fh->dev; in free_buffer()
720 struct tm6000_fh *fh = vq->priv_data; in buffer_prepare() local
722 struct tm6000_core *dev = fh->dev; in buffer_prepare()
725 BUG_ON(NULL == fh->fmt); in buffer_prepare()
730 buf->vb.size = fh->fmt->depth*fh->width*fh->height >> 3; in buffer_prepare()
734 if (buf->fmt != fh->fmt || in buffer_prepare()
735 buf->vb.width != fh->width || in buffer_prepare()
736 buf->vb.height != fh->height || in buffer_prepare()
738 buf->fmt = fh->fmt; in buffer_prepare()
739 buf->vb.width = fh->width; in buffer_prepare()
740 buf->vb.height = fh->height; in buffer_prepare()
774 struct tm6000_fh *fh = vq->priv_data; in buffer_queue() local
775 struct tm6000_core *dev = fh->dev; in buffer_queue()
801 static bool is_res_read(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_read() argument
804 if (dev->resources == fh && dev->is_res_read) in is_res_read()
810 static bool is_res_streaming(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_streaming() argument
813 if (dev->resources == fh) in is_res_streaming()
819 static bool res_get(struct tm6000_core *dev, struct tm6000_fh *fh, in res_get() argument
823 if (dev->resources == fh && dev->is_res_read == is_res_read) in res_get()
831 dev->resources = fh; in res_get()
837 static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh) in res_free() argument
840 if (dev->resources != fh) in res_free()
882 struct tm6000_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
884 f->fmt.pix.width = fh->width; in vidioc_g_fmt_vid_cap()
885 f->fmt.pix.height = fh->height; in vidioc_g_fmt_vid_cap()
886 f->fmt.pix.field = fh->vb_vidq.field; in vidioc_g_fmt_vid_cap()
887 f->fmt.pix.pixelformat = fh->fmt->fourcc; in vidioc_g_fmt_vid_cap()
890 (f->fmt.pix.width * fh->fmt->depth) >> 3; in vidioc_g_fmt_vid_cap()
947 struct tm6000_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
948 struct tm6000_core *dev = fh->dev; in vidioc_s_fmt_vid_cap()
949 int ret = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
953 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat); in vidioc_s_fmt_vid_cap()
954 fh->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
955 fh->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
956 fh->vb_vidq.field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
957 fh->type = f->type; in vidioc_s_fmt_vid_cap()
969 struct tm6000_fh *fh = priv; in vidioc_reqbufs() local
971 return videobuf_reqbufs(&fh->vb_vidq, p); in vidioc_reqbufs()
977 struct tm6000_fh *fh = priv; in vidioc_querybuf() local
979 return videobuf_querybuf(&fh->vb_vidq, p); in vidioc_querybuf()
984 struct tm6000_fh *fh = priv; in vidioc_qbuf() local
986 return videobuf_qbuf(&fh->vb_vidq, p); in vidioc_qbuf()
991 struct tm6000_fh *fh = priv; in vidioc_dqbuf() local
993 return videobuf_dqbuf(&fh->vb_vidq, p, in vidioc_dqbuf()
999 struct tm6000_fh *fh = priv; in vidioc_streamon() local
1000 struct tm6000_core *dev = fh->dev; in vidioc_streamon()
1002 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamon()
1004 if (i != fh->type) in vidioc_streamon()
1007 if (!res_get(dev, fh, false)) in vidioc_streamon()
1009 return videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1014 struct tm6000_fh *fh = priv; in vidioc_streamoff() local
1015 struct tm6000_core *dev = fh->dev; in vidioc_streamoff()
1017 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamoff()
1020 if (i != fh->type) in vidioc_streamoff()
1023 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1024 res_free(dev, fh); in vidioc_streamoff()
1032 struct tm6000_fh *fh = priv; in vidioc_s_std() local
1033 struct tm6000_core *dev = fh->dev; in vidioc_s_std()
1038 fh->width = dev->width; in vidioc_s_std()
1039 fh->height = dev->height; in vidioc_s_std()
1051 struct tm6000_fh *fh = priv; in vidioc_g_std() local
1052 struct tm6000_core *dev = fh->dev; in vidioc_g_std()
1068 struct tm6000_fh *fh = priv; in vidioc_enum_input() local
1069 struct tm6000_core *dev = fh->dev; in vidioc_enum_input()
1095 struct tm6000_fh *fh = priv; in vidioc_g_input() local
1096 struct tm6000_core *dev = fh->dev; in vidioc_g_input()
1105 struct tm6000_fh *fh = priv; in vidioc_s_input() local
1106 struct tm6000_core *dev = fh->dev; in vidioc_s_input()
1175 struct tm6000_fh *fh = priv; in vidioc_g_tuner() local
1176 struct tm6000_core *dev = fh->dev; in vidioc_g_tuner()
1199 struct tm6000_fh *fh = priv; in vidioc_s_tuner() local
1200 struct tm6000_core *dev = fh->dev; in vidioc_s_tuner()
1221 struct tm6000_fh *fh = priv; in vidioc_g_frequency() local
1222 struct tm6000_core *dev = fh->dev; in vidioc_g_frequency()
1239 struct tm6000_fh *fh = priv; in vidioc_s_frequency() local
1240 struct tm6000_core *dev = fh->dev; in vidioc_s_frequency()
1256 struct tm6000_fh *fh = file->private_data; in radio_g_tuner() local
1257 struct tm6000_core *dev = fh->dev; in radio_g_tuner()
1277 struct tm6000_fh *fh = file->private_data; in radio_s_tuner() local
1278 struct tm6000_core *dev = fh->dev; in radio_s_tuner()
1294 struct tm6000_fh *fh; in __tm6000_open() local
1324 fh = kzalloc(sizeof(*fh), GFP_KERNEL); in __tm6000_open()
1325 if (NULL == fh) { in __tm6000_open()
1330 v4l2_fh_init(&fh->fh, vdev); in __tm6000_open()
1331 file->private_data = fh; in __tm6000_open()
1332 fh->dev = dev; in __tm6000_open()
1333 fh->radio = radio; in __tm6000_open()
1335 fh->type = type; in __tm6000_open()
1338 fh->fmt = format_by_fourcc(dev->fourcc); in __tm6000_open()
1342 fh->width = dev->width; in __tm6000_open()
1343 fh->height = dev->height; in __tm6000_open()
1346 fh, dev, &dev->vidq); in __tm6000_open()
1355 v4l2_fh_exit(&fh->fh); in __tm6000_open()
1356 kfree(fh); in __tm6000_open()
1362 if (!fh->radio) { in __tm6000_open()
1363 videobuf_queue_vmalloc_init(&fh->vb_vidq, &tm6000_video_qops, in __tm6000_open()
1365 fh->type, in __tm6000_open()
1367 sizeof(struct tm6000_buffer), fh, &dev->lock); in __tm6000_open()
1375 v4l2_fh_add(&fh->fh); in __tm6000_open()
1394 struct tm6000_fh *fh = file->private_data; in tm6000_read() local
1395 struct tm6000_core *dev = fh->dev; in tm6000_read()
1397 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in tm6000_read()
1400 if (!res_get(fh->dev, fh, true)) in tm6000_read()
1405 res = videobuf_read_stream(&fh->vb_vidq, data, count, pos, 0, in tm6000_read()
1417 struct tm6000_fh *fh = file->private_data; in __tm6000_poll() local
1421 if (v4l2_event_pending(&fh->fh)) in __tm6000_poll()
1424 poll_wait(file, &fh->fh.wait, wait); in __tm6000_poll()
1425 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) in __tm6000_poll()
1428 if (!!is_res_streaming(fh->dev, fh)) in __tm6000_poll()
1431 if (!is_res_read(fh->dev, fh)) { in __tm6000_poll()
1433 if (list_empty(&fh->vb_vidq.stream)) in __tm6000_poll()
1435 buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); in __tm6000_poll()
1442 return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); in __tm6000_poll()
1449 struct tm6000_fh *fh = file->private_data; in tm6000_poll() local
1450 struct tm6000_core *dev = fh->dev; in tm6000_poll()
1461 struct tm6000_fh *fh = file->private_data; in tm6000_release() local
1462 struct tm6000_core *dev = fh->dev; in tm6000_release()
1471 res_free(dev, fh); in tm6000_release()
1491 if (!fh->radio) in tm6000_release()
1492 videobuf_mmap_free(&fh->vb_vidq); in tm6000_release()
1494 v4l2_fh_del(&fh->fh); in tm6000_release()
1495 v4l2_fh_exit(&fh->fh); in tm6000_release()
1496 kfree(fh); in tm6000_release()
1504 struct tm6000_fh *fh = file->private_data; in tm6000_mmap() local
1505 struct tm6000_core *dev = fh->dev; in tm6000_mmap()
1510 res = videobuf_mmap_mapper(&fh->vb_vidq, vma); in tm6000_mmap()