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()
718 struct tm6000_fh *fh = vq->priv_data; in buffer_prepare() local
720 struct tm6000_core *dev = fh->dev; in buffer_prepare()
723 BUG_ON(NULL == fh->fmt); in buffer_prepare()
728 buf->vb.size = fh->fmt->depth*fh->width*fh->height >> 3; in buffer_prepare()
732 if (buf->fmt != fh->fmt || in buffer_prepare()
733 buf->vb.width != fh->width || in buffer_prepare()
734 buf->vb.height != fh->height || in buffer_prepare()
736 buf->fmt = fh->fmt; in buffer_prepare()
737 buf->vb.width = fh->width; in buffer_prepare()
738 buf->vb.height = fh->height; in buffer_prepare()
772 struct tm6000_fh *fh = vq->priv_data; in buffer_queue() local
773 struct tm6000_core *dev = fh->dev; in buffer_queue()
799 static bool is_res_read(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_read() argument
802 if (dev->resources == fh && dev->is_res_read) in is_res_read()
808 static bool is_res_streaming(struct tm6000_core *dev, struct tm6000_fh *fh) in is_res_streaming() argument
811 if (dev->resources == fh) in is_res_streaming()
817 static bool res_get(struct tm6000_core *dev, struct tm6000_fh *fh, in res_get() argument
821 if (dev->resources == fh && dev->is_res_read == is_res_read) in res_get()
829 dev->resources = fh; in res_get()
835 static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh) in res_free() argument
838 if (dev->resources != fh) in res_free()
880 struct tm6000_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
882 f->fmt.pix.width = fh->width; in vidioc_g_fmt_vid_cap()
883 f->fmt.pix.height = fh->height; in vidioc_g_fmt_vid_cap()
884 f->fmt.pix.field = fh->vb_vidq.field; in vidioc_g_fmt_vid_cap()
885 f->fmt.pix.pixelformat = fh->fmt->fourcc; in vidioc_g_fmt_vid_cap()
888 (f->fmt.pix.width * fh->fmt->depth) >> 3; in vidioc_g_fmt_vid_cap()
945 struct tm6000_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
946 struct tm6000_core *dev = fh->dev; in vidioc_s_fmt_vid_cap()
947 int ret = vidioc_try_fmt_vid_cap(file, fh, f); in vidioc_s_fmt_vid_cap()
951 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat); in vidioc_s_fmt_vid_cap()
952 fh->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
953 fh->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
954 fh->vb_vidq.field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
955 fh->type = f->type; in vidioc_s_fmt_vid_cap()
967 struct tm6000_fh *fh = priv; in vidioc_reqbufs() local
969 return videobuf_reqbufs(&fh->vb_vidq, p); in vidioc_reqbufs()
975 struct tm6000_fh *fh = priv; in vidioc_querybuf() local
977 return videobuf_querybuf(&fh->vb_vidq, p); in vidioc_querybuf()
982 struct tm6000_fh *fh = priv; in vidioc_qbuf() local
984 return videobuf_qbuf(&fh->vb_vidq, p); in vidioc_qbuf()
989 struct tm6000_fh *fh = priv; in vidioc_dqbuf() local
991 return videobuf_dqbuf(&fh->vb_vidq, p, in vidioc_dqbuf()
997 struct tm6000_fh *fh = priv; in vidioc_streamon() local
998 struct tm6000_core *dev = fh->dev; in vidioc_streamon()
1000 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamon()
1002 if (i != fh->type) in vidioc_streamon()
1005 if (!res_get(dev, fh, false)) in vidioc_streamon()
1007 return videobuf_streamon(&fh->vb_vidq); in vidioc_streamon()
1012 struct tm6000_fh *fh = priv; in vidioc_streamoff() local
1013 struct tm6000_core *dev = fh->dev; in vidioc_streamoff()
1015 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in vidioc_streamoff()
1018 if (i != fh->type) in vidioc_streamoff()
1021 videobuf_streamoff(&fh->vb_vidq); in vidioc_streamoff()
1022 res_free(dev, fh); in vidioc_streamoff()
1030 struct tm6000_fh *fh = priv; in vidioc_s_std() local
1031 struct tm6000_core *dev = fh->dev; in vidioc_s_std()
1036 fh->width = dev->width; in vidioc_s_std()
1037 fh->height = dev->height; in vidioc_s_std()
1049 struct tm6000_fh *fh = priv; in vidioc_g_std() local
1050 struct tm6000_core *dev = fh->dev; in vidioc_g_std()
1066 struct tm6000_fh *fh = priv; in vidioc_enum_input() local
1067 struct tm6000_core *dev = fh->dev; in vidioc_enum_input()
1093 struct tm6000_fh *fh = priv; in vidioc_g_input() local
1094 struct tm6000_core *dev = fh->dev; in vidioc_g_input()
1103 struct tm6000_fh *fh = priv; in vidioc_s_input() local
1104 struct tm6000_core *dev = fh->dev; in vidioc_s_input()
1173 struct tm6000_fh *fh = priv; in vidioc_g_tuner() local
1174 struct tm6000_core *dev = fh->dev; in vidioc_g_tuner()
1197 struct tm6000_fh *fh = priv; in vidioc_s_tuner() local
1198 struct tm6000_core *dev = fh->dev; in vidioc_s_tuner()
1219 struct tm6000_fh *fh = priv; in vidioc_g_frequency() local
1220 struct tm6000_core *dev = fh->dev; in vidioc_g_frequency()
1237 struct tm6000_fh *fh = priv; in vidioc_s_frequency() local
1238 struct tm6000_core *dev = fh->dev; in vidioc_s_frequency()
1254 struct tm6000_fh *fh = file->private_data; in radio_g_tuner() local
1255 struct tm6000_core *dev = fh->dev; in radio_g_tuner()
1275 struct tm6000_fh *fh = file->private_data; in radio_s_tuner() local
1276 struct tm6000_core *dev = fh->dev; in radio_s_tuner()
1292 struct tm6000_fh *fh; in __tm6000_open() local
1322 fh = kzalloc(sizeof(*fh), GFP_KERNEL); in __tm6000_open()
1323 if (NULL == fh) { in __tm6000_open()
1328 v4l2_fh_init(&fh->fh, vdev); in __tm6000_open()
1329 file->private_data = fh; in __tm6000_open()
1330 fh->dev = dev; in __tm6000_open()
1331 fh->radio = radio; in __tm6000_open()
1333 fh->type = type; in __tm6000_open()
1336 fh->fmt = format_by_fourcc(dev->fourcc); in __tm6000_open()
1340 fh->width = dev->width; in __tm6000_open()
1341 fh->height = dev->height; in __tm6000_open()
1344 fh, dev, &dev->vidq); in __tm6000_open()
1353 v4l2_fh_exit(&fh->fh); in __tm6000_open()
1354 kfree(fh); in __tm6000_open()
1360 if (!fh->radio) { in __tm6000_open()
1361 videobuf_queue_vmalloc_init(&fh->vb_vidq, &tm6000_video_qops, in __tm6000_open()
1363 fh->type, in __tm6000_open()
1365 sizeof(struct tm6000_buffer), fh, &dev->lock); in __tm6000_open()
1373 v4l2_fh_add(&fh->fh); in __tm6000_open()
1392 struct tm6000_fh *fh = file->private_data; in tm6000_read() local
1393 struct tm6000_core *dev = fh->dev; in tm6000_read()
1395 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { in tm6000_read()
1398 if (!res_get(fh->dev, fh, true)) in tm6000_read()
1403 res = videobuf_read_stream(&fh->vb_vidq, data, count, pos, 0, in tm6000_read()
1415 struct tm6000_fh *fh = file->private_data; in __tm6000_poll() local
1419 if (v4l2_event_pending(&fh->fh)) in __tm6000_poll()
1422 poll_wait(file, &fh->fh.wait, wait); in __tm6000_poll()
1423 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) in __tm6000_poll()
1426 if (!!is_res_streaming(fh->dev, fh)) in __tm6000_poll()
1429 if (!is_res_read(fh->dev, fh)) { in __tm6000_poll()
1431 if (list_empty(&fh->vb_vidq.stream)) in __tm6000_poll()
1433 buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); in __tm6000_poll()
1440 return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); in __tm6000_poll()
1447 struct tm6000_fh *fh = file->private_data; in tm6000_poll() local
1448 struct tm6000_core *dev = fh->dev; in tm6000_poll()
1459 struct tm6000_fh *fh = file->private_data; in tm6000_release() local
1460 struct tm6000_core *dev = fh->dev; in tm6000_release()
1469 res_free(dev, fh); in tm6000_release()
1489 if (!fh->radio) in tm6000_release()
1490 videobuf_mmap_free(&fh->vb_vidq); in tm6000_release()
1492 v4l2_fh_del(&fh->fh); in tm6000_release()
1493 v4l2_fh_exit(&fh->fh); in tm6000_release()
1494 kfree(fh); in tm6000_release()
1502 struct tm6000_fh *fh = file->private_data; in tm6000_mmap() local
1503 struct tm6000_core *dev = fh->dev; in tm6000_mmap()
1508 res = videobuf_mmap_mapper(&fh->vb_vidq, vma); in tm6000_mmap()