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()
741 struct tm6000_fh *fh = vq->priv_data; in buffer_prepare() local
743 struct tm6000_core *dev = fh->dev; in buffer_prepare()
746 BUG_ON(NULL == fh->fmt); in buffer_prepare()
751 buf->vb.size = fh->fmt->depth*fh->width*fh->height >> 3; in buffer_prepare()
755 if (buf->fmt != fh->fmt || in buffer_prepare()
756 buf->vb.width != fh->width || in buffer_prepare()
757 buf->vb.height != fh->height || in buffer_prepare()
759 buf->fmt = fh->fmt; in buffer_prepare()
760 buf->vb.width = fh->width; in buffer_prepare()
761 buf->vb.height = fh->height; in buffer_prepare()
795 struct tm6000_fh *fh = vq->priv_data; in buffer_queue() local
796 struct tm6000_core *dev = fh->dev; in buffer_queue()
822 static bool is_res_read(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_read() argument
825 if (dev->resources == fh && dev->is_res_read) in is_res_read()
831 static bool is_res_streaming(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_streaming() argument
834 if (dev->resources == fh) in is_res_streaming()
840 static bool res_get(struct tm6000_core *dev, struct tm6000_fh *fh, in res_get() argument
844 if (dev->resources == fh && dev->is_res_read == is_res_read) in res_get()
852 dev->resources = fh; in res_get()
858 static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh) in res_free() argument
861 if (dev->resources != fh) in res_free()
909 struct tm6000_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
911 f->fmt.pix.width = fh->width; in vidioc_g_fmt_vid_cap()
912 f->fmt.pix.height = fh->height; in vidioc_g_fmt_vid_cap()
913 f->fmt.pix.field = fh->vb_vidq.field; in vidioc_g_fmt_vid_cap()
914 f->fmt.pix.pixelformat = fh->fmt->fourcc; in vidioc_g_fmt_vid_cap()
917 (f->fmt.pix.width * fh->fmt->depth) >> 3; in vidioc_g_fmt_vid_cap()
974 struct tm6000_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
975 struct tm6000_core *dev = fh->dev; in vidioc_s_fmt_vid_cap()
976 int ret = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
980 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat); in vidioc_s_fmt_vid_cap()
981 fh->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
982 fh->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
983 fh->vb_vidq.field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
984 fh->type = f->type; in vidioc_s_fmt_vid_cap()
996 struct tm6000_fh *fh = priv; in vidioc_reqbufs() local
998 return videobuf_reqbufs(&fh->vb_vidq, p); in vidioc_reqbufs()
1004 struct tm6000_fh *fh = priv; in vidioc_querybuf() local
1006 return videobuf_querybuf(&fh->vb_vidq, p); in vidioc_querybuf()
1011 struct tm6000_fh *fh = priv; in vidioc_qbuf() local
1013 return videobuf_qbuf(&fh->vb_vidq, p); in vidioc_qbuf()
1018 struct tm6000_fh *fh = priv; in vidioc_dqbuf() local
1020 return videobuf_dqbuf(&fh->vb_vidq, p, in vidioc_dqbuf()
1026 struct tm6000_fh *fh = priv; in vidioc_streamon() local
1027 struct tm6000_core *dev = fh->dev; in vidioc_streamon()
1029 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamon()
1031 if (i != fh->type) in vidioc_streamon()
1034 if (!res_get(dev, fh, false)) in vidioc_streamon()
1036 return videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1041 struct tm6000_fh *fh = priv; in vidioc_streamoff() local
1042 struct tm6000_core *dev = fh->dev; in vidioc_streamoff()
1044 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamoff()
1047 if (i != fh->type) in vidioc_streamoff()
1050 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1051 res_free(dev, fh); in vidioc_streamoff()
1059 struct tm6000_fh *fh = priv; in vidioc_s_std() local
1060 struct tm6000_core *dev = fh->dev; in vidioc_s_std()
1065 fh->width = dev->width; in vidioc_s_std()
1066 fh->height = dev->height; in vidioc_s_std()
1078 struct tm6000_fh *fh = priv; in vidioc_g_std() local
1079 struct tm6000_core *dev = fh->dev; in vidioc_g_std()
1095 struct tm6000_fh *fh = priv; in vidioc_enum_input() local
1096 struct tm6000_core *dev = fh->dev; in vidioc_enum_input()
1122 struct tm6000_fh *fh = priv; in vidioc_g_input() local
1123 struct tm6000_core *dev = fh->dev; in vidioc_g_input()
1132 struct tm6000_fh *fh = priv; in vidioc_s_input() local
1133 struct tm6000_core *dev = fh->dev; in vidioc_s_input()
1202 struct tm6000_fh *fh = priv; in vidioc_g_tuner() local
1203 struct tm6000_core *dev = fh->dev; in vidioc_g_tuner()
1226 struct tm6000_fh *fh = priv; in vidioc_s_tuner() local
1227 struct tm6000_core *dev = fh->dev; in vidioc_s_tuner()
1248 struct tm6000_fh *fh = priv; in vidioc_g_frequency() local
1249 struct tm6000_core *dev = fh->dev; in vidioc_g_frequency()
1266 struct tm6000_fh *fh = priv; in vidioc_s_frequency() local
1267 struct tm6000_core *dev = fh->dev; in vidioc_s_frequency()
1283 struct tm6000_fh *fh = file->private_data; in radio_g_tuner() local
1284 struct tm6000_core *dev = fh->dev; in radio_g_tuner()
1304 struct tm6000_fh *fh = file->private_data; in radio_s_tuner() local
1305 struct tm6000_core *dev = fh->dev; in radio_s_tuner()
1321 struct tm6000_fh *fh; in __tm6000_open() local
1349 fh = kzalloc(sizeof(*fh), GFP_KERNEL); in __tm6000_open()
1350 if (NULL == fh) { in __tm6000_open()
1355 v4l2_fh_init(&fh->fh, vdev); in __tm6000_open()
1356 file->private_data = fh; in __tm6000_open()
1357 fh->dev = dev; in __tm6000_open()
1358 fh->radio = radio; in __tm6000_open()
1360 fh->type = type; in __tm6000_open()
1363 fh->fmt = format_by_fourcc(dev->fourcc); in __tm6000_open()
1367 fh->width = dev->width; in __tm6000_open()
1368 fh->height = dev->height; in __tm6000_open()
1372 (unsigned long)fh, (unsigned long)dev, in __tm6000_open()
1386 if (!fh->radio) { in __tm6000_open()
1387 videobuf_queue_vmalloc_init(&fh->vb_vidq, &tm6000_video_qops, in __tm6000_open()
1389 fh->type, in __tm6000_open()
1391 sizeof(struct tm6000_buffer), fh, &dev->lock); in __tm6000_open()
1399 v4l2_fh_add(&fh->fh); in __tm6000_open()
1418 struct tm6000_fh *fh = file->private_data; in tm6000_read() local
1419 struct tm6000_core *dev = fh->dev; in tm6000_read()
1421 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in tm6000_read()
1424 if (!res_get(fh->dev, fh, true)) in tm6000_read()
1429 res = videobuf_read_stream(&fh->vb_vidq, data, count, pos, 0, in tm6000_read()
1441 struct tm6000_fh *fh = file->private_data; in __tm6000_poll() local
1445 if (v4l2_event_pending(&fh->fh)) in __tm6000_poll()
1448 poll_wait(file, &fh->fh.wait, wait); in __tm6000_poll()
1449 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) in __tm6000_poll()
1452 if (!!is_res_streaming(fh->dev, fh)) in __tm6000_poll()
1455 if (!is_res_read(fh->dev, fh)) { in __tm6000_poll()
1457 if (list_empty(&fh->vb_vidq.stream)) in __tm6000_poll()
1459 buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); in __tm6000_poll()
1466 return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); in __tm6000_poll()
1473 struct tm6000_fh *fh = file->private_data; in tm6000_poll() local
1474 struct tm6000_core *dev = fh->dev; in tm6000_poll()
1485 struct tm6000_fh *fh = file->private_data; in tm6000_release() local
1486 struct tm6000_core *dev = fh->dev; in tm6000_release()
1495 res_free(dev, fh); in tm6000_release()
1515 if (!fh->radio) in tm6000_release()
1516 videobuf_mmap_free(&fh->vb_vidq); in tm6000_release()
1518 v4l2_fh_del(&fh->fh); in tm6000_release()
1519 v4l2_fh_exit(&fh->fh); in tm6000_release()
1520 kfree(fh); in tm6000_release()
1528 struct tm6000_fh *fh = file->private_data; in tm6000_mmap() local
1529 struct tm6000_core *dev = fh->dev; in tm6000_mmap()
1534 res = videobuf_mmap_mapper(&fh->vb_vidq, vma); in tm6000_mmap()