• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/media/video/cx23885/

Lines Matching refs:fh

351 static int res_get(struct cx23885_dev *dev, struct cx23885_fh *fh,
355 if (fh->resources & bit)
367 fh->resources |= bit;
374 static int res_check(struct cx23885_fh *fh, unsigned int bit)
376 return fh->resources & bit;
384 static void res_free(struct cx23885_dev *dev, struct cx23885_fh *fh,
387 BUG_ON((fh->resources & bits) != bits);
391 fh->resources &= ~bits;
512 struct cx23885_fh *fh = q->priv_data;
514 *size = fh->fmt->depth*fh->width*fh->height >> 3;
525 struct cx23885_fh *fh = q->priv_data;
526 struct cx23885_dev *dev = fh->dev;
533 BUG_ON(NULL == fh->fmt);
534 if (fh->width < 48 || fh->width > norm_maxw(dev->tvnorm) ||
535 fh->height < 32 || fh->height > norm_maxh(dev->tvnorm))
537 buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3;
541 if (buf->fmt != fh->fmt ||
542 buf->vb.width != fh->width ||
543 buf->vb.height != fh->height ||
545 buf->fmt = fh->fmt;
546 buf->vb.width = fh->width;
547 buf->vb.height = fh->height;
612 fh->width, fh->height, fh->fmt->depth, fh->fmt->name,
628 struct cx23885_fh *fh = vq->priv_data;
629 struct cx23885_dev *dev = fh->dev;
692 static struct videobuf_queue *get_queue(struct cx23885_fh *fh)
694 switch (fh->type) {
696 return &fh->vidq;
698 return &fh->vbiq;
705 static int get_resource(struct cx23885_fh *fh)
707 switch (fh->type) {
722 struct cx23885_fh *fh;
742 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
743 if (NULL == fh)
748 file->private_data = fh;
749 fh->dev = dev;
750 fh->radio = radio;
751 fh->type = type;
752 fh->width = 320;
753 fh->height = 240;
754 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
756 videobuf_queue_sg_init(&fh->vidq, &cx23885_video_qops,
761 fh);
773 struct cx23885_fh *fh = file->private_data;
775 switch (fh->type) {
777 if (res_locked(fh->dev, RESOURCE_VIDEO))
779 return videobuf_read_one(&fh->vidq, data, count, ppos,
782 if (!res_get(fh->dev, fh, RESOURCE_VBI))
784 return videobuf_read_stream(&fh->vbiq, data, count, ppos, 1,
795 struct cx23885_fh *fh = file->private_data;
799 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
800 if (!res_get(fh->dev, fh, RESOURCE_VBI))
802 return videobuf_poll_stream(file, &fh->vbiq, wait);
805 mutex_lock(&fh->vidq.vb_lock);
806 if (res_check(fh, RESOURCE_VIDEO)) {
808 if (list_empty(&fh->vidq.stream))
810 buf = list_entry(fh->vidq.stream.next,
814 buf = (struct cx23885_buffer *)fh->vidq.read_buf;
825 mutex_unlock(&fh->vidq.vb_lock);
831 struct cx23885_fh *fh = file->private_data;
832 struct cx23885_dev *dev = fh->dev;
835 if (res_check(fh, RESOURCE_OVERLAY)) {
836 res_free(dev, fh, RESOURCE_OVERLAY);
840 if (res_check(fh, RESOURCE_VIDEO)) {
841 videobuf_queue_cancel(&fh->vidq);
842 res_free(dev, fh, RESOURCE_VIDEO);
844 if (fh->vidq.read_buf) {
845 buffer_release(&fh->vidq, fh->vidq.read_buf);
846 kfree(fh->vidq.read_buf);
850 if (res_check(fh, RESOURCE_VBI)) {
851 if (fh->vbiq.streaming)
852 videobuf_streamoff(&fh->vbiq);
853 if (fh->vbiq.reading)
854 videobuf_read_stop(&fh->vbiq);
855 res_free(dev, fh, RESOURCE_VBI);
858 videobuf_mmap_free(&fh->vidq);
860 kfree(fh);
872 struct cx23885_fh *fh = file->private_data;
874 return videobuf_mmap_mapper(get_queue(fh), vma);
915 struct cx23885_fh *fh = priv;
917 f->fmt.pix.width = fh->width;
918 f->fmt.pix.height = fh->height;
919 f->fmt.pix.field = fh->vidq.field;
920 f->fmt.pix.pixelformat = fh->fmt->fourcc;
922 (f->fmt.pix.width * fh->fmt->depth) >> 3;
976 struct cx23885_fh *fh = priv;
986 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
987 fh->width = f->fmt.pix.width;
988 fh->height = f->fmt.pix.height;
989 fh->vidq.field = f->fmt.pix.field;
991 fh->width, fh->height, fh->vidq.field);
1035 struct cx23885_fh *fh = priv;
1041 q = get_queue(fh);
1063 struct cx23885_fh *fh = priv;
1064 return videobuf_reqbufs(get_queue(fh), p);
1070 struct cx23885_fh *fh = priv;
1071 return videobuf_querybuf(get_queue(fh), p);
1077 struct cx23885_fh *fh = priv;
1078 return videobuf_qbuf(get_queue(fh), p);
1084 struct cx23885_fh *fh = priv;
1085 return videobuf_dqbuf(get_queue(fh), p,
1092 struct cx23885_fh *fh = priv;
1093 struct cx23885_dev *dev = fh->dev;
1096 if (unlikely(fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE))
1098 if (unlikely(i != fh->type))
1101 if (unlikely(!res_get(dev, fh, get_resource(fh))))
1103 return videobuf_streamon(get_queue(fh));
1108 struct cx23885_fh *fh = priv;
1109 struct cx23885_dev *dev = fh->dev;
1113 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1115 if (i != fh->type)
1118 res = get_resource(fh);
1119 err = videobuf_streamoff(get_queue(fh));
1122 res_free(dev, fh, res);
1209 struct cx23885_fh *fh = priv;
1210 struct cx23885_dev *dev = fh->dev;
1280 struct cx23885_fh *fh = priv;
1281 struct cx23885_dev *dev = fh->dev;
1286 /* f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; */
1287 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
1318 struct cx23885_fh *fh = priv;
1319 struct cx23885_dev *dev = fh->dev;
1321 if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
1323 if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))