• Home
  • Raw
  • Download

Lines Matching refs:fh

374 static int res_get(struct cx23885_dev *dev, struct cx23885_fh *fh,  in res_get()  argument
378 if (fh->resources & bit) in res_get()
390 fh->resources |= bit; in res_get()
397 static int res_check(struct cx23885_fh *fh, unsigned int bit) in res_check() argument
399 return fh->resources & bit; in res_check()
407 static void res_free(struct cx23885_dev *dev, struct cx23885_fh *fh, in res_free() argument
410 BUG_ON((fh->resources & bits) != bits); in res_free()
414 fh->resources &= ~bits; in res_free()
639 struct cx23885_fh *fh = q->priv_data; in buffer_setup() local
641 *size = fh->fmt->depth*fh->width*fh->height >> 3; in buffer_setup()
652 struct cx23885_fh *fh = q->priv_data; in buffer_prepare() local
653 struct cx23885_dev *dev = fh->dev; in buffer_prepare()
661 BUG_ON(NULL == fh->fmt); in buffer_prepare()
662 if (fh->width < 48 || fh->width > norm_maxw(dev->tvnorm) || in buffer_prepare()
663 fh->height < 32 || fh->height > norm_maxh(dev->tvnorm)) in buffer_prepare()
665 buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3; in buffer_prepare()
669 if (buf->fmt != fh->fmt || in buffer_prepare()
670 buf->vb.width != fh->width || in buffer_prepare()
671 buf->vb.height != fh->height || in buffer_prepare()
673 buf->fmt = fh->fmt; in buffer_prepare()
674 buf->vb.width = fh->width; in buffer_prepare()
675 buf->vb.height = fh->height; in buffer_prepare()
750 fh->width, fh->height, fh->fmt->depth, fh->fmt->name, in buffer_prepare()
766 struct cx23885_fh *fh = vq->priv_data; in buffer_queue() local
767 struct cx23885_dev *dev = fh->dev; in buffer_queue()
830 static struct videobuf_queue *get_queue(struct cx23885_fh *fh) in get_queue() argument
832 switch (fh->type) { in get_queue()
834 return &fh->vidq; in get_queue()
836 return &fh->vbiq; in get_queue()
843 static int get_resource(struct cx23885_fh *fh) in get_resource() argument
845 switch (fh->type) { in get_resource()
860 struct cx23885_fh *fh; in video_open() local
880 fh = kzalloc(sizeof(*fh), GFP_KERNEL); in video_open()
881 if (NULL == fh) in video_open()
884 file->private_data = fh; in video_open()
885 fh->dev = dev; in video_open()
886 fh->radio = radio; in video_open()
887 fh->type = type; in video_open()
888 fh->width = 320; in video_open()
889 fh->height = 240; in video_open()
890 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); in video_open()
892 videobuf_queue_sg_init(&fh->vidq, &cx23885_video_qops, in video_open()
897 fh, NULL); in video_open()
899 videobuf_queue_sg_init(&fh->vbiq, &cx23885_vbi_qops, in video_open()
904 fh, NULL); in video_open()
915 struct cx23885_fh *fh = file->private_data; in video_read() local
917 switch (fh->type) { in video_read()
919 if (res_locked(fh->dev, RESOURCE_VIDEO)) in video_read()
921 return videobuf_read_one(&fh->vidq, data, count, ppos, in video_read()
924 if (!res_get(fh->dev, fh, RESOURCE_VBI)) in video_read()
926 return videobuf_read_stream(&fh->vbiq, data, count, ppos, 1, in video_read()
937 struct cx23885_fh *fh = file->private_data; in video_poll() local
941 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { in video_poll()
942 if (!res_get(fh->dev, fh, RESOURCE_VBI)) in video_poll()
944 return videobuf_poll_stream(file, &fh->vbiq, wait); in video_poll()
947 mutex_lock(&fh->vidq.vb_lock); in video_poll()
948 if (res_check(fh, RESOURCE_VIDEO)) { in video_poll()
950 if (list_empty(&fh->vidq.stream)) in video_poll()
952 buf = list_entry(fh->vidq.stream.next, in video_poll()
956 buf = (struct cx23885_buffer *)fh->vidq.read_buf; in video_poll()
967 mutex_unlock(&fh->vidq.vb_lock); in video_poll()
973 struct cx23885_fh *fh = file->private_data; in video_release() local
974 struct cx23885_dev *dev = fh->dev; in video_release()
977 if (res_check(fh, RESOURCE_OVERLAY)) { in video_release()
979 res_free(dev, fh, RESOURCE_OVERLAY); in video_release()
983 if (res_check(fh, RESOURCE_VIDEO)) { in video_release()
984 videobuf_queue_cancel(&fh->vidq); in video_release()
985 res_free(dev, fh, RESOURCE_VIDEO); in video_release()
987 if (fh->vidq.read_buf) { in video_release()
988 buffer_release(&fh->vidq, fh->vidq.read_buf); in video_release()
989 kfree(fh->vidq.read_buf); in video_release()
993 if (res_check(fh, RESOURCE_VBI)) { in video_release()
994 if (fh->vbiq.streaming) in video_release()
995 videobuf_streamoff(&fh->vbiq); in video_release()
996 if (fh->vbiq.reading) in video_release()
997 videobuf_read_stop(&fh->vbiq); in video_release()
998 res_free(dev, fh, RESOURCE_VBI); in video_release()
1001 videobuf_mmap_free(&fh->vidq); in video_release()
1002 videobuf_mmap_free(&fh->vbiq); in video_release()
1005 kfree(fh); in video_release()
1017 struct cx23885_fh *fh = file->private_data; in video_mmap() local
1019 return videobuf_mmap_mapper(get_queue(fh), vma); in video_mmap()
1061 struct cx23885_fh *fh = priv; in vidioc_g_fmt_vid_cap() local
1063 f->fmt.pix.width = fh->width; in vidioc_g_fmt_vid_cap()
1064 f->fmt.pix.height = fh->height; in vidioc_g_fmt_vid_cap()
1065 f->fmt.pix.field = fh->vidq.field; in vidioc_g_fmt_vid_cap()
1066 f->fmt.pix.pixelformat = fh->fmt->fourcc; in vidioc_g_fmt_vid_cap()
1068 (f->fmt.pix.width * fh->fmt->depth) >> 3; in vidioc_g_fmt_vid_cap()
1122 struct cx23885_fh *fh = priv; in vidioc_s_fmt_vid_cap() local
1132 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat); in vidioc_s_fmt_vid_cap()
1133 fh->width = f->fmt.pix.width; in vidioc_s_fmt_vid_cap()
1134 fh->height = f->fmt.pix.height; in vidioc_s_fmt_vid_cap()
1135 fh->vidq.field = f->fmt.pix.field; in vidioc_s_fmt_vid_cap()
1137 fh->width, fh->height, fh->vidq.field); in vidioc_s_fmt_vid_cap()
1179 struct cx23885_fh *fh = priv; in vidioc_reqbufs() local
1180 return videobuf_reqbufs(get_queue(fh), p); in vidioc_reqbufs()
1186 struct cx23885_fh *fh = priv; in vidioc_querybuf() local
1187 return videobuf_querybuf(get_queue(fh), p); in vidioc_querybuf()
1193 struct cx23885_fh *fh = priv; in vidioc_qbuf() local
1194 return videobuf_qbuf(get_queue(fh), p); in vidioc_qbuf()
1200 struct cx23885_fh *fh = priv; in vidioc_dqbuf() local
1201 return videobuf_dqbuf(get_queue(fh), p, in vidioc_dqbuf()
1208 struct cx23885_fh *fh = priv; in vidioc_streamon() local
1209 struct cx23885_dev *dev = fh->dev; in vidioc_streamon()
1212 if ((fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) && in vidioc_streamon()
1213 (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE)) in vidioc_streamon()
1215 if (unlikely(i != fh->type)) in vidioc_streamon()
1218 if (unlikely(!res_get(dev, fh, get_resource(fh)))) in vidioc_streamon()
1224 if ((fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) && in vidioc_streamon()
1228 return videobuf_streamon(get_queue(fh)); in vidioc_streamon()
1233 struct cx23885_fh *fh = priv; in vidioc_streamoff() local
1234 struct cx23885_dev *dev = fh->dev; in vidioc_streamoff()
1238 if ((fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) && in vidioc_streamoff()
1239 (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE)) in vidioc_streamoff()
1241 if (i != fh->type) in vidioc_streamoff()
1244 res = get_resource(fh); in vidioc_streamoff()
1245 err = videobuf_streamoff(get_queue(fh)); in vidioc_streamoff()
1248 res_free(dev, fh, res); in vidioc_streamoff()
1376 struct cx23885_fh *fh = priv; in vidioc_log_status() local
1377 struct cx23885_dev *dev = fh->dev; in vidioc_log_status()
1506 struct cx23885_fh *fh = priv; in vidioc_g_frequency() local
1507 struct cx23885_dev *dev = fh->dev; in vidioc_g_frequency()
1513 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; in vidioc_g_frequency()
1613 struct cx23885_fh *fh = priv; in cx23885_set_frequency() local
1614 struct cx23885_dev *dev = fh->dev; in cx23885_set_frequency()