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

Lines Matching refs:fh

496 static int res_get(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bit)
498 if (fh->resources & bit)
510 fh->resources |= bit;
517 static int res_check(struct saa7134_fh *fh, unsigned int bit)
519 return (fh->resources & bit);
528 void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits)
530 BUG_ON((fh->resources & bits) != bits);
533 fh->resources &= ~bits;
870 static int start_preview(struct saa7134_dev *dev, struct saa7134_fh *fh)
875 err = verify_preview(dev,&fh->win);
879 dev->ovfield = fh->win.field;
881 fh->win.w.width,fh->win.w.height,
882 fh->win.w.left,fh->win.w.top,
886 set_size(dev,TASK_B,fh->win.w.width,fh->win.w.height,
888 setup_clipping(dev,fh->clips,fh->nclips,
898 base += dev->ovbuf.fmt.bytesperline * fh->win.w.top;
899 base += dev->ovfmt->depth/8 * fh->win.w.left;
925 static int stop_preview(struct saa7134_dev *dev, struct saa7134_fh *fh)
1020 struct saa7134_fh *fh = q->priv_data;
1021 struct saa7134_dev *dev = fh->dev;
1027 if (NULL == fh->fmt)
1029 if (fh->width < 48 ||
1030 fh->height < 32 ||
1031 fh->width/4 > dev->crop_current.width ||
1032 fh->height/4 > dev->crop_current.height ||
1033 fh->width > dev->crop_bounds.width ||
1034 fh->height > dev->crop_bounds.height)
1036 size = (fh->width * fh->height * fh->fmt->depth) >> 3;
1041 vb->i,fh->width,fh->height,size,v4l2_field_names[field],
1042 fh->fmt->name);
1043 if (buf->vb.width != fh->width ||
1044 buf->vb.height != fh->height ||
1047 buf->fmt != fh->fmt) {
1054 buf->vb.width = fh->width;
1055 buf->vb.height = fh->height;
1058 buf->fmt = fh->fmt;
1059 buf->pt = &fh->pt_cap;
1084 struct saa7134_fh *fh = q->priv_data;
1086 *size = fh->fmt->depth * fh->width * fh->height >> 3;
1095 struct saa7134_fh *fh = q->priv_data;
1098 saa7134_buffer_queue(fh->dev,&fh->dev->video_q,buf);
1117 int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c)
1167 struct saa7134_fh *fh = priv;
1169 return saa7134_g_ctrl_internal(fh->dev, fh, c);
1172 int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c)
1179 /* When called from the empress code fh == NULL.
1182 if (fh) {
1183 err = v4l2_prio_check(&dev->prio, fh->prio);
1275 if (restart_overlay && fh && res_check(fh, RESOURCE_OVERLAY)) {
1277 stop_preview(dev,fh);
1278 start_preview(dev,fh);
1291 struct saa7134_fh *fh = f;
1293 return saa7134_s_ctrl_internal(fh->dev, fh, c);
1298 static struct videobuf_queue* saa7134_queue(struct saa7134_fh *fh)
1302 switch (fh->type) {
1304 q = &fh->cap;
1307 q = &fh->vbi;
1315 static int saa7134_resource(struct saa7134_fh *fh)
1317 if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
1320 if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
1331 struct saa7134_fh *fh;
1351 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
1352 if (NULL == fh)
1355 file->private_data = fh;
1356 fh->dev = dev;
1357 fh->radio = radio;
1358 fh->type = type;
1359 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
1360 fh->width = 720;
1361 fh->height = 576;
1362 v4l2_prio_open(&dev->prio, &fh->prio);
1364 videobuf_queue_sg_init(&fh->cap, &video_qops,
1369 fh);
1370 videobuf_queue_sg_init(&fh->vbi, &saa7134_vbi_qops,
1375 fh);
1376 saa7134_pgtable_alloc(dev->pci,&fh->pt_cap);
1377 saa7134_pgtable_alloc(dev->pci,&fh->pt_vbi);
1379 if (fh->radio) {
1393 struct saa7134_fh *fh = file->private_data;
1395 switch (fh->type) {
1397 if (res_locked(fh->dev,RESOURCE_VIDEO))
1399 return videobuf_read_one(saa7134_queue(fh),
1403 if (!res_get(fh->dev,fh,RESOURCE_VBI))
1405 return videobuf_read_stream(saa7134_queue(fh),
1418 struct saa7134_fh *fh = file->private_data;
1422 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type)
1423 return videobuf_poll_stream(file, &fh->vbi, wait);
1425 if (res_check(fh,RESOURCE_VIDEO)) {
1426 mutex_lock(&fh->cap.vb_lock);
1427 if (!list_empty(&fh->cap.stream))
1428 buf = list_entry(fh->cap.stream.next, struct videobuf_buffer, stream);
1430 mutex_lock(&fh->cap.vb_lock);
1431 if (UNSET == fh->cap.read_off) {
1433 if (res_locked(fh->dev,RESOURCE_VIDEO))
1435 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field))
1437 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
1438 fh->cap.read_off = 0;
1440 buf = fh->cap.read_buf;
1450 mutex_unlock(&fh->cap.vb_lock);
1454 mutex_unlock(&fh->cap.vb_lock);
1460 struct saa7134_fh *fh = file->private_data;
1461 struct saa7134_dev *dev = fh->dev;
1466 if (res_check(fh, RESOURCE_OVERLAY)) {
1468 stop_preview(dev,fh);
1470 res_free(dev,fh,RESOURCE_OVERLAY);
1474 if (res_check(fh, RESOURCE_VIDEO)) {
1475 videobuf_streamoff(&fh->cap);
1476 res_free(dev,fh,RESOURCE_VIDEO);
1478 if (fh->cap.read_buf) {
1479 buffer_release(&fh->cap,fh->cap.read_buf);
1480 kfree(fh->cap.read_buf);
1484 if (res_check(fh, RESOURCE_VBI)) {
1485 videobuf_stop(&fh->vbi);
1486 res_free(dev,fh,RESOURCE_VBI);
1496 if (fh->radio)
1500 videobuf_mmap_free(&fh->cap);
1501 videobuf_mmap_free(&fh->vbi);
1502 saa7134_pgtable_free(dev->pci,&fh->pt_cap);
1503 saa7134_pgtable_free(dev->pci,&fh->pt_vbi);
1505 v4l2_prio_close(&dev->prio, fh->prio);
1507 kfree(fh);
1513 struct saa7134_fh *fh = file->private_data;
1515 return videobuf_mmap_mapper(saa7134_queue(fh), vma);
1521 struct saa7134_fh *fh = file->private_data;
1522 struct saa7134_dev *dev = fh->dev;
1537 struct saa7134_fh *fh = file->private_data;
1538 struct saa7134_dev *dev = fh->dev;
1554 struct saa7134_fh *fh = priv;
1555 struct saa7134_dev *dev = fh->dev;
1574 struct saa7134_fh *fh = priv;
1576 f->fmt.pix.width = fh->width;
1577 f->fmt.pix.height = fh->height;
1578 f->fmt.pix.field = fh->cap.field;
1579 f->fmt.pix.pixelformat = fh->fmt->fourcc;
1581 (f->fmt.pix.width * fh->fmt->depth) >> 3;
1590 struct saa7134_fh *fh = priv;
1596 f->fmt.win = fh->win;
1604 struct saa7134_fh *fh = priv;
1605 struct saa7134_dev *dev = fh->dev;
1655 struct saa7134_fh *fh = priv;
1656 struct saa7134_dev *dev = fh->dev;
1669 struct saa7134_fh *fh = priv;
1676 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
1677 fh->width = f->fmt.pix.width;
1678 fh->height = f->fmt.pix.height;
1679 fh->cap.field = f->fmt.pix.field;
1686 struct saa7134_fh *fh = priv;
1687 struct saa7134_dev *dev = fh->dev;
1701 fh->win = f->fmt.win;
1702 fh->nclips = f->fmt.win.clipcount;
1704 if (fh->nclips > 8)
1705 fh->nclips = 8;
1707 if (copy_from_user(fh->clips, f->fmt.win.clips,
1708 sizeof(struct v4l2_clip)*fh->nclips)) {
1713 if (res_check(fh, RESOURCE_OVERLAY)) {
1715 stop_preview(dev, fh);
1716 start_preview(dev, fh);
1742 struct saa7134_fh *fh = priv;
1743 struct saa7134_dev *dev = fh->dev;
1775 struct saa7134_fh *fh = priv;
1776 struct saa7134_dev *dev = fh->dev;
1784 struct saa7134_fh *fh = priv;
1785 struct saa7134_dev *dev = fh->dev;
1788 err = v4l2_prio_check(&dev->prio, fh->prio);
1805 struct saa7134_fh *fh = priv;
1806 struct saa7134_dev *dev = fh->dev;
1831 int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id *id)
1838 /* When called from the empress code fh == NULL.
1841 if (fh) {
1842 err = v4l2_prio_check(&dev->prio, fh->prio);
1882 if (fh && res_check(fh, RESOURCE_OVERLAY)) {
1884 stop_preview(dev, fh);
1890 start_preview(dev, fh);
1903 struct saa7134_fh *fh = priv;
1905 return saa7134_s_std_internal(fh->dev, fh, id);
1910 struct saa7134_fh *fh = priv;
1911 struct saa7134_dev *dev = fh->dev;
1920 struct saa7134_fh *fh = priv;
1921 struct saa7134_dev *dev = fh->dev;
1943 struct saa7134_fh *fh = f;
1944 struct saa7134_dev *dev = fh->dev;
1955 struct saa7134_fh *fh = f;
1956 struct saa7134_dev *dev = fh->dev;
1967 if (res_locked(fh->dev, RESOURCE_OVERLAY))
1969 if (res_locked(fh->dev, RESOURCE_VIDEO))
1993 struct saa7134_fh *fh = priv;
1994 struct saa7134_dev *dev = fh->dev;
2022 struct saa7134_fh *fh = priv;
2023 struct saa7134_dev *dev = fh->dev;
2026 err = v4l2_prio_check(&dev->prio, fh->prio);
2044 struct saa7134_fh *fh = priv;
2045 struct saa7134_dev *dev = fh->dev;
2047 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
2056 struct saa7134_fh *fh = priv;
2057 struct saa7134_dev *dev = fh->dev;
2060 err = v4l2_prio_check(&dev->prio, fh->prio);
2066 if (0 == fh->radio && V4L2_TUNER_ANALOG_TV != f->type)
2068 if (1 == fh->radio && V4L2_TUNER_RADIO != f->type)
2093 struct saa7134_fh *fh = f;
2094 struct saa7134_dev *dev = fh->dev;
2103 struct saa7134_fh *fh = f;
2104 struct saa7134_dev *dev = fh->dev;
2106 return v4l2_prio_change(&dev->prio, &fh->prio, prio);
2145 struct saa7134_fh *fh = f;
2146 struct saa7134_dev *dev = fh->dev;
2157 struct saa7134_fh *fh = f;
2158 struct saa7134_dev *dev = fh->dev;
2181 struct saa7134_fh *fh = f;
2182 struct saa7134_dev *dev = fh->dev;
2191 if (!res_get(dev, fh, RESOURCE_OVERLAY))
2194 start_preview(dev, fh);
2198 if (!res_check(fh, RESOURCE_OVERLAY))
2201 stop_preview(dev, fh);
2203 res_free(dev, fh, RESOURCE_OVERLAY);
2211 struct saa7134_fh *fh = file->private_data;
2212 return videobuf_cgmbuf(saa7134_queue(fh), mbuf, 8);
2219 struct saa7134_fh *fh = priv;
2220 return videobuf_reqbufs(saa7134_queue(fh), p);
2226 struct saa7134_fh *fh = priv;
2227 return videobuf_querybuf(saa7134_queue(fh), b);
2232 struct saa7134_fh *fh = priv;
2233 return videobuf_qbuf(saa7134_queue(fh), b);
2238 struct saa7134_fh *fh = priv;
2239 return videobuf_dqbuf(saa7134_queue(fh), b,
2246 struct saa7134_fh *fh = priv;
2247 struct saa7134_dev *dev = fh->dev;
2248 int res = saa7134_resource(fh);
2250 if (!res_get(dev, fh, res))
2253 return videobuf_streamon(saa7134_queue(fh));
2260 struct saa7134_fh *fh = priv;
2261 struct saa7134_dev *dev = fh->dev;
2262 int res = saa7134_resource(fh);
2264 err = videobuf_streamoff(saa7134_queue(fh));
2267 res_free(dev, fh, res);
2271 static int saa7134_g_parm(struct file *file, void *fh,
2281 struct saa7134_fh *fh = priv;
2282 struct saa7134_dev *dev = fh->dev;
2294 struct saa7134_fh *fh = priv;
2295 struct saa7134_dev *dev = fh->dev;
2307 struct saa7134_fh *fh = file->private_data;
2308 struct saa7134_dev *dev = fh->dev;
2321 struct saa7134_fh *fh = file->private_data;
2322 struct saa7134_dev *dev = fh->dev;
2342 struct saa7134_fh *fh = file->private_data;
2343 struct saa7134_dev *dev = fh->dev;
2389 static int radio_s_std(struct file *file, void *fh, v4l2_std_id *norm)