Lines Matching refs:fh

696 	struct tm6000_fh *fh = vq->priv_data;  in buffer_setup()  local
698 *size = fh->fmt->depth * fh->width * fh->height >> 3; in buffer_setup()
713 struct tm6000_fh *fh = vq->priv_data; in free_buffer() local
714 struct tm6000_core *dev = fh->dev; in free_buffer()
742 struct tm6000_fh *fh = vq->priv_data; in buffer_prepare() local
744 struct tm6000_core *dev = fh->dev; in buffer_prepare()
747 BUG_ON(NULL == fh->fmt); in buffer_prepare()
752 buf->vb.size = fh->fmt->depth*fh->width*fh->height >> 3; in buffer_prepare()
756 if (buf->fmt != fh->fmt || in buffer_prepare()
757 buf->vb.width != fh->width || in buffer_prepare()
758 buf->vb.height != fh->height || in buffer_prepare()
760 buf->fmt = fh->fmt; in buffer_prepare()
761 buf->vb.width = fh->width; in buffer_prepare()
762 buf->vb.height = fh->height; in buffer_prepare()
796 struct tm6000_fh *fh = vq->priv_data; in buffer_queue() local
797 struct tm6000_core *dev = fh->dev; in buffer_queue()
823 static bool is_res_read(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_read() argument
826 if (dev->resources == fh && dev->is_res_read) in is_res_read()
832 static bool is_res_streaming(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_streaming() argument
835 if (dev->resources == fh) in is_res_streaming()
841 static bool res_get(struct tm6000_core *dev, struct tm6000_fh *fh, in res_get() argument
845 if (dev->resources == fh && dev->is_res_read == is_res_read) in res_get()
853 dev->resources = fh; in res_get()
859 static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh) in res_free() argument
862 if (dev->resources != fh) in res_free()
910 struct tm6000_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
912 f->fmt.pix.width = fh->width; in vidioc_g_fmt_vid_cap()
913 f->fmt.pix.height = fh->height; in vidioc_g_fmt_vid_cap()
914 f->fmt.pix.field = fh->vb_vidq.field; in vidioc_g_fmt_vid_cap()
915 f->fmt.pix.pixelformat = fh->fmt->fourcc; in vidioc_g_fmt_vid_cap()
918 (f->fmt.pix.width * fh->fmt->depth) >> 3; in vidioc_g_fmt_vid_cap()
975 struct tm6000_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
976 struct tm6000_core *dev = fh->dev; in vidioc_s_fmt_vid_cap()
977 int ret = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
981 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat); in vidioc_s_fmt_vid_cap()
982 fh->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
983 fh->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
984 fh->vb_vidq.field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
985 fh->type = f->type; in vidioc_s_fmt_vid_cap()
997 struct tm6000_fh *fh = priv; in vidioc_reqbufs() local
999 return videobuf_reqbufs(&fh->vb_vidq, p); in vidioc_reqbufs()
1005 struct tm6000_fh *fh = priv; in vidioc_querybuf() local
1007 return videobuf_querybuf(&fh->vb_vidq, p); in vidioc_querybuf()
1012 struct tm6000_fh *fh = priv; in vidioc_qbuf() local
1014 return videobuf_qbuf(&fh->vb_vidq, p); in vidioc_qbuf()
1019 struct tm6000_fh *fh = priv; in vidioc_dqbuf() local
1021 return videobuf_dqbuf(&fh->vb_vidq, p, in vidioc_dqbuf()
1027 struct tm6000_fh *fh = priv; in vidioc_streamon() local
1028 struct tm6000_core *dev = fh->dev; in vidioc_streamon()
1030 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamon()
1032 if (i != fh->type) in vidioc_streamon()
1035 if (!res_get(dev, fh, false)) in vidioc_streamon()
1037 return videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1042 struct tm6000_fh *fh = priv; in vidioc_streamoff() local
1043 struct tm6000_core *dev = fh->dev; in vidioc_streamoff()
1045 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamoff()
1048 if (i != fh->type) in vidioc_streamoff()
1051 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1052 res_free(dev, fh); in vidioc_streamoff()
1060 struct tm6000_fh *fh = priv; in vidioc_s_std() local
1061 struct tm6000_core *dev = fh->dev; in vidioc_s_std()
1066 fh->width = dev->width; in vidioc_s_std()
1067 fh->height = dev->height; in vidioc_s_std()
1079 struct tm6000_fh *fh = priv; in vidioc_g_std() local
1080 struct tm6000_core *dev = fh->dev; in vidioc_g_std()
1096 struct tm6000_fh *fh = priv; in vidioc_enum_input() local
1097 struct tm6000_core *dev = fh->dev; in vidioc_enum_input()
1123 struct tm6000_fh *fh = priv; in vidioc_g_input() local
1124 struct tm6000_core *dev = fh->dev; in vidioc_g_input()
1133 struct tm6000_fh *fh = priv; in vidioc_s_input() local
1134 struct tm6000_core *dev = fh->dev; in vidioc_s_input()
1203 struct tm6000_fh *fh = priv; in vidioc_g_tuner() local
1204 struct tm6000_core *dev = fh->dev; in vidioc_g_tuner()
1227 struct tm6000_fh *fh = priv; in vidioc_s_tuner() local
1228 struct tm6000_core *dev = fh->dev; in vidioc_s_tuner()
1249 struct tm6000_fh *fh = priv; in vidioc_g_frequency() local
1250 struct tm6000_core *dev = fh->dev; in vidioc_g_frequency()
1267 struct tm6000_fh *fh = priv; in vidioc_s_frequency() local
1268 struct tm6000_core *dev = fh->dev; in vidioc_s_frequency()
1284 struct tm6000_fh *fh = file->private_data; in radio_g_tuner() local
1285 struct tm6000_core *dev = fh->dev; in radio_g_tuner()
1305 struct tm6000_fh *fh = file->private_data; in radio_s_tuner() local
1306 struct tm6000_core *dev = fh->dev; in radio_s_tuner()
1322 struct tm6000_fh *fh; in __tm6000_open() local
1350 fh = kzalloc(sizeof(*fh), GFP_KERNEL); in __tm6000_open()
1351 if (NULL == fh) { in __tm6000_open()
1356 v4l2_fh_init(&fh->fh, vdev); in __tm6000_open()
1357 file->private_data = fh; in __tm6000_open()
1358 fh->dev = dev; in __tm6000_open()
1359 fh->radio = radio; in __tm6000_open()
1361 fh->type = type; in __tm6000_open()
1364 fh->fmt = format_by_fourcc(dev->fourcc); in __tm6000_open()
1368 fh->width = dev->width; in __tm6000_open()
1369 fh->height = dev->height; in __tm6000_open()
1373 (unsigned long)fh, (unsigned long)dev, in __tm6000_open()
1387 if (!fh->radio) { in __tm6000_open()
1388 videobuf_queue_vmalloc_init(&fh->vb_vidq, &tm6000_video_qops, in __tm6000_open()
1390 fh->type, in __tm6000_open()
1392 sizeof(struct tm6000_buffer), fh, &dev->lock); in __tm6000_open()
1400 v4l2_fh_add(&fh->fh); in __tm6000_open()
1419 struct tm6000_fh *fh = file->private_data; in tm6000_read() local
1420 struct tm6000_core *dev = fh->dev; in tm6000_read()
1422 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in tm6000_read()
1425 if (!res_get(fh->dev, fh, true)) in tm6000_read()
1430 res = videobuf_read_stream(&fh->vb_vidq, data, count, pos, 0, in tm6000_read()
1442 struct tm6000_fh *fh = file->private_data; in __tm6000_poll() local
1446 if (v4l2_event_pending(&fh->fh)) in __tm6000_poll()
1449 poll_wait(file, &fh->fh.wait, wait); in __tm6000_poll()
1450 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) in __tm6000_poll()
1453 if (!!is_res_streaming(fh->dev, fh)) in __tm6000_poll()
1456 if (!is_res_read(fh->dev, fh)) { in __tm6000_poll()
1458 if (list_empty(&fh->vb_vidq.stream)) in __tm6000_poll()
1460 buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); in __tm6000_poll()
1467 return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); in __tm6000_poll()
1474 struct tm6000_fh *fh = file->private_data; in tm6000_poll() local
1475 struct tm6000_core *dev = fh->dev; in tm6000_poll()
1486 struct tm6000_fh *fh = file->private_data; in tm6000_release() local
1487 struct tm6000_core *dev = fh->dev; in tm6000_release()
1496 res_free(dev, fh); in tm6000_release()
1516 if (!fh->radio) in tm6000_release()
1517 videobuf_mmap_free(&fh->vb_vidq); in tm6000_release()
1519 v4l2_fh_del(&fh->fh); in tm6000_release()
1520 v4l2_fh_exit(&fh->fh); in tm6000_release()
1521 kfree(fh); in tm6000_release()
1529 struct tm6000_fh *fh = file->private_data; in tm6000_mmap() local
1530 struct tm6000_core *dev = fh->dev; in tm6000_mmap()
1535 res = videobuf_mmap_mapper(&fh->vb_vidq, vma); in tm6000_mmap()