• 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/cx88/

Lines Matching refs:fh

341 static int res_get(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bit)
344 if (fh->resources & bit)
356 fh->resources |= bit;
364 int res_check(struct cx8800_fh *fh, unsigned int bit)
366 return (fh->resources & bit);
376 void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits)
379 BUG_ON((fh->resources & bits) != bits);
382 fh->resources &= ~bits;
560 struct cx8800_fh *fh = q->priv_data;
562 *size = fh->fmt->depth*fh->width*fh->height >> 3;
574 struct cx8800_fh *fh = q->priv_data;
575 struct cx8800_dev *dev = fh->dev;
581 BUG_ON(NULL == fh->fmt);
582 if (fh->width < 48 || fh->width > norm_maxw(core->tvnorm) ||
583 fh->height < 32 || fh->height > norm_maxh(core->tvnorm))
585 buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3;
589 if (buf->fmt != fh->fmt ||
590 buf->vb.width != fh->width ||
591 buf->vb.height != fh->height ||
593 buf->fmt = fh->fmt;
594 buf->vb.width = fh->width;
595 buf->vb.height = fh->height;
645 fh->width, fh->height, fh->fmt->depth, fh->fmt->name,
661 struct cx8800_fh *fh = vq->priv_data;
662 struct cx8800_dev *dev = fh->dev;
725 static struct videobuf_queue* get_queue(struct cx8800_fh *fh)
727 switch (fh->type) {
729 return &fh->vidq;
731 return &fh->vbiq;
738 static int get_ressource(struct cx8800_fh *fh)
740 switch (fh->type) {
756 struct cx8800_fh *fh;
780 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
781 if (NULL == fh) {
785 file->private_data = fh;
786 fh->dev = dev;
787 fh->radio = radio;
788 fh->type = type;
789 fh->width = 320;
790 fh->height = 240;
791 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
793 videobuf_queue_sg_init(&fh->vidq, &cx8800_video_qops,
798 fh);
799 videobuf_queue_sg_init(&fh->vbiq, &cx8800_vbi_qops,
804 fh);
806 if (fh->radio) {
839 struct cx8800_fh *fh = file->private_data;
841 switch (fh->type) {
843 if (res_locked(fh->dev,RESOURCE_VIDEO))
845 return videobuf_read_one(&fh->vidq, data, count, ppos,
848 if (!res_get(fh->dev,fh,RESOURCE_VBI))
850 return videobuf_read_stream(&fh->vbiq, data, count, ppos, 1,
861 struct cx8800_fh *fh = file->private_data;
865 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
866 if (!res_get(fh->dev,fh,RESOURCE_VBI))
868 return videobuf_poll_stream(file, &fh->vbiq, wait);
871 mutex_lock(&fh->vidq.vb_lock);
872 if (res_check(fh,RESOURCE_VIDEO)) {
874 if (list_empty(&fh->vidq.stream))
876 buf = list_entry(fh->vidq.stream.next,struct cx88_buffer,vb.stream);
879 buf = (struct cx88_buffer*)fh->vidq.read_buf;
890 mutex_unlock(&fh->vidq.vb_lock);
896 struct cx8800_fh *fh = file->private_data;
897 struct cx8800_dev *dev = fh->dev;
900 if (res_check(fh, RESOURCE_OVERLAY)) {
901 res_free(dev,fh,RESOURCE_OVERLAY);
905 if (res_check(fh, RESOURCE_VIDEO)) {
906 videobuf_queue_cancel(&fh->vidq);
907 res_free(dev,fh,RESOURCE_VIDEO);
909 if (fh->vidq.read_buf) {
910 buffer_release(&fh->vidq,fh->vidq.read_buf);
911 kfree(fh->vidq.read_buf);
915 if (res_check(fh, RESOURCE_VBI)) {
916 videobuf_stop(&fh->vbiq);
917 res_free(dev,fh,RESOURCE_VBI);
920 videobuf_mmap_free(&fh->vidq);
921 videobuf_mmap_free(&fh->vbiq);
923 kfree(fh);
936 struct cx8800_fh *fh = file->private_data;
938 return videobuf_mmap_mapper(get_queue(fh), vma);
1057 struct cx8800_fh *fh = priv;
1059 f->fmt.pix.width = fh->width;
1060 f->fmt.pix.height = fh->height;
1061 f->fmt.pix.field = fh->vidq.field;
1062 f->fmt.pix.pixelformat = fh->fmt->fourcc;
1064 (f->fmt.pix.width * fh->fmt->depth) >> 3;
1117 struct cx8800_fh *fh = priv;
1122 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
1123 fh->width = f->fmt.pix.width;
1124 fh->height = f->fmt.pix.height;
1125 fh->vidq.field = f->fmt.pix.field;
1164 struct cx8800_fh *fh = priv;
1166 return videobuf_cgmbuf (get_queue(fh), mbuf, 8);
1172 struct cx8800_fh *fh = priv;
1173 return (videobuf_reqbufs(get_queue(fh), p));
1178 struct cx8800_fh *fh = priv;
1179 return (videobuf_querybuf(get_queue(fh), p));
1184 struct cx8800_fh *fh = priv;
1185 return (videobuf_qbuf(get_queue(fh), p));
1190 struct cx8800_fh *fh = priv;
1191 return (videobuf_dqbuf(get_queue(fh), p,
1197 struct cx8800_fh *fh = priv;
1198 struct cx8800_dev *dev = fh->dev;
1202 if (unlikely((fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) &&
1203 (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE)))
1206 if (unlikely(i != fh->type))
1209 if (unlikely(!res_get(dev,fh,get_ressource(fh))))
1211 return videobuf_streamon(get_queue(fh));
1216 struct cx8800_fh *fh = priv;
1217 struct cx8800_dev *dev = fh->dev;
1220 if ((fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) &&
1221 (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE))
1224 if (i != fh->type)
1227 res = get_ressource(fh);
1228 err = videobuf_streamoff(get_queue(fh));
1231 res_free(dev,fh,res);
1373 struct cx8800_fh *fh = priv;
1374 struct cx88_core *core = fh->dev->core;
1379 /* f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; */
1380 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
1414 struct cx8800_fh *fh = priv;
1415 struct cx88_core *core = fh->dev->core;
1417 if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
1419 if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))
1427 static int vidioc_g_register (struct file *file, void *fh,
1430 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
1440 static int vidioc_s_register (struct file *file, void *fh,
1443 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
1519 static int radio_s_audio (struct file *file, void *fh,
1525 static int radio_s_input (struct file *file, void *fh, unsigned int i)