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

Lines Matching refs:fh

845 int check_alloc_btres(struct bttv *btv, struct bttv_fh *fh, int bit)
849 if (fh->resources & bit)
867 __s32 top = btv->crop[!!fh->do_crop].rect.top;
876 __s32 end = fh->vbi_fmt.end;
881 /* Claim scan lines above fh->vbi_fmt.end. */
886 fh->resources |= bit;
897 int check_btres(struct bttv_fh *fh, int bit)
899 return (fh->resources & bit);
938 void free_btres(struct bttv *btv, struct bttv_fh *fh, int bits)
940 if ((fh->resources & bits) != bits) {
945 fh->resources &= ~bits;
974 unsigned char fl, fh, fi;
984 fh=fout/fin;
990 btwrite(fh, BT848_PLL_F_HI);
1456 struct bttv_fh *fh = priv;
1457 struct bttv *btv = fh->btv;
1525 struct bttv_fh *fh = f;
1526 struct bttv *btv = fh->btv;
1528 err = v4l2_prio_check(&btv->prio, fh->prio);
1663 bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
1681 bttv_dma_free(&fh->cap,btv, old);
1685 free_btres(btv,fh,RESOURCE_OVERLAY);
1699 struct bttv_fh *fh = q->priv_data;
1735 c = btv->crop[!!fh->do_crop];
1804 struct bttv_fh *fh = q->priv_data;
1806 *size = fh->fmt->depth*fh->width*fh->height >> 3;
1819 struct bttv_fh *fh = q->priv_data;
1821 return bttv_prepare_buffer(q,fh->btv, buf, fh->fmt,
1822 fh->width, fh->height, field);
1829 struct bttv_fh *fh = q->priv_data;
1830 struct bttv *btv = fh->btv;
1843 struct bttv_fh *fh = q->priv_data;
1845 bttv_dma_free(q,fh->btv,buf);
1857 struct bttv_fh *fh = priv;
1858 struct bttv *btv = fh->btv;
1862 err = v4l2_prio_check(&btv->prio, fh->prio);
1881 struct bttv_fh *fh = f;
1882 struct bttv *btv = fh->btv;
1894 struct bttv_fh *fh = priv;
1895 struct bttv *btv = fh->btv;
1930 struct bttv_fh *fh = priv;
1931 struct bttv *btv = fh->btv;
1939 struct bttv_fh *fh = priv;
1940 struct bttv *btv = fh->btv;
1944 err = v4l2_prio_check(&btv->prio, fh->prio);
1960 struct bttv_fh *fh = priv;
1961 struct bttv *btv = fh->btv;
1964 err = v4l2_prio_check(&btv->prio, fh->prio);
1988 struct bttv_fh *fh = priv;
1989 struct bttv *btv = fh->btv;
2000 struct bttv_fh *fh = priv;
2001 struct bttv *btv = fh->btv;
2004 err = v4l2_prio_check(&btv->prio, fh->prio);
2024 struct bttv_fh *fh = f;
2025 struct bttv *btv = fh->btv;
2039 struct bttv_fh *fh = f;
2040 struct bttv *btv = fh->btv;
2059 struct bttv_fh *fh = f;
2060 struct bttv *btv = fh->btv;
2127 limit_scaled_size (struct bttv_fh * fh,
2136 struct bttv *btv = fh->btv;
2155 c = &btv->crop[!!fh->do_crop];
2157 if (fh->do_crop
2241 verify_window (struct bttv_fh * fh,
2260 height2 = fh->btv->crop[!!fh->do_crop].rect.height >> 1;
2275 if (NULL == fh->ovfmt)
2278 switch (fh->ovfmt->depth) {
2295 rc = limit_scaled_size(fh, &win->w.width, &win->w.height,
2306 static int setup_window(struct bttv_fh *fh, struct bttv *btv,
2312 if (NULL == fh->ovfmt)
2314 if (!(fh->ovfmt->flags & FORMAT_FLAGS_PACKED))
2316 retval = verify_window(fh, win,
2342 switch (fh->ovfmt->depth) {
2357 mutex_lock(&fh->cap.vb_lock);
2358 kfree(fh->ov.clips);
2359 fh->ov.clips = clips;
2360 fh->ov.nclips = n;
2362 fh->ov.w = win->w;
2363 fh->ov.field = win->field;
2364 fh->ov.setup_ok = 1;
2371 if (check_btres(fh, RESOURCE_OVERLAY)) {
2375 new->crop = btv->crop[!!fh->do_crop].rect;
2376 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
2377 retval = bttv_switch_overlay(btv,fh,new);
2379 mutex_unlock(&fh->cap.vb_lock);
2385 static struct videobuf_queue* bttv_queue(struct bttv_fh *fh)
2389 switch (fh->type) {
2391 q = &fh->cap;
2394 q = &fh->vbi;
2402 static int bttv_resource(struct bttv_fh *fh)
2406 switch (fh->type) {
2419 static int bttv_switch_type(struct bttv_fh *fh, enum v4l2_buf_type type)
2421 struct videobuf_queue *q = bttv_queue(fh);
2422 int res = bttv_resource(fh);
2424 if (check_btres(fh,res))
2428 fh->type = type;
2453 struct bttv_fh *fh = priv;
2455 pix_format_set_size(&f->fmt.pix, fh->fmt,
2456 fh->width, fh->height);
2457 f->fmt.pix.field = fh->cap.field;
2458 f->fmt.pix.pixelformat = fh->fmt->fourcc;
2466 struct bttv_fh *fh = priv;
2468 f->fmt.win.w = fh->ov.w;
2469 f->fmt.win.field = fh->ov.field;
2478 struct bttv_fh *fh = priv;
2479 struct bttv *btv = fh->btv;
2493 height2 = btv->crop[!!fh->do_crop].rect.height >> 1;
2519 rc = limit_scaled_size(fh, &width, &height, field,
2537 struct bttv_fh *fh = priv;
2539 return verify_window(fh, &f->fmt.win,
2549 struct bttv_fh *fh = priv;
2550 struct bttv *btv = fh->btv;
2554 retval = bttv_switch_type(fh, f->type);
2566 retval = limit_scaled_size(fh, &width, &height, f->fmt.pix.field,
2579 mutex_lock(&fh->cap.vb_lock);
2580 fh->fmt = fmt;
2581 fh->cap.field = f->fmt.pix.field;
2582 fh->cap.last = V4L2_FIELD_NONE;
2583 fh->width = f->fmt.pix.width;
2584 fh->height = f->fmt.pix.height;
2588 mutex_unlock(&fh->cap.vb_lock);
2596 struct bttv_fh *fh = priv;
2597 struct bttv *btv = fh->btv;
2604 return setup_window(fh, btv, &f->fmt.win, 1);
2612 struct bttv_fh *fh = priv;
2614 mutex_lock(&fh->cap.vb_lock);
2615 retval = __videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize,
2618 mutex_unlock(&fh->cap.vb_lock);
2630 mutex_unlock(&fh->cap.vb_lock);
2638 struct bttv_fh *fh = priv;
2639 struct bttv *btv = fh->btv;
2718 struct bttv_fh *fh = f;
2719 struct bttv *btv = fh->btv;
2723 if (fh->ovfmt)
2724 fb->fmt.pixelformat = fh->ovfmt->fourcc;
2730 struct bttv_fh *fh = f;
2731 struct bttv *btv = fh->btv;
2739 if (!fh->ov.setup_ok) {
2745 if (!check_alloc_btres(btv, fh, RESOURCE_OVERLAY))
2748 mutex_lock(&fh->cap.vb_lock);
2750 fh->ov.tvnorm = btv->tvnorm;
2752 new->crop = btv->crop[!!fh->do_crop].rect;
2753 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
2759 retval = bttv_switch_overlay(btv, fh, new);
2760 mutex_unlock(&fh->cap.vb_lock);
2767 struct bttv_fh *fh = f;
2768 struct bttv *btv = fh->btv;
2788 retval = limit_scaled_size(fh, &width, &height,
2799 mutex_lock(&fh->cap.vb_lock);
2809 fh->ovfmt = fmt;
2812 fh->ov.w.left = 0;
2813 fh->ov.w.top = 0;
2814 fh->ov.w.width = fb->fmt.width;
2815 fh->ov.w.height = fb->fmt.height;
2818 kfree(fh->ov.clips);
2819 fh->ov.clips = NULL;
2820 fh->ov.nclips = 0;
2822 if (check_btres(fh, RESOURCE_OVERLAY)) {
2826 new->crop = btv->crop[!!fh->do_crop].rect;
2827 bttv_overlay_risc(btv, &fh->ov, fh->ovfmt, new);
2828 retval = bttv_switch_overlay(btv, fh, new);
2831 mutex_unlock(&fh->cap.vb_lock);
2838 struct bttv_fh *fh = priv;
2839 return videobuf_reqbufs(bttv_queue(fh), p);
2845 struct bttv_fh *fh = priv;
2846 return videobuf_querybuf(bttv_queue(fh), b);
2851 struct bttv_fh *fh = priv;
2852 struct bttv *btv = fh->btv;
2853 int res = bttv_resource(fh);
2855 if (!check_alloc_btres(btv, fh, res))
2858 return videobuf_qbuf(bttv_queue(fh), b);
2863 struct bttv_fh *fh = priv;
2864 return videobuf_dqbuf(bttv_queue(fh), b,
2871 struct bttv_fh *fh = priv;
2872 struct bttv *btv = fh->btv;
2873 int res = bttv_resource(fh);
2875 if (!check_alloc_btres(btv, fh, res))
2877 return videobuf_streamon(bttv_queue(fh));
2884 struct bttv_fh *fh = priv;
2885 struct bttv *btv = fh->btv;
2887 int res = bttv_resource(fh);
2890 retval = videobuf_streamoff(bttv_queue(fh));
2893 free_btres(btv, fh, res);
2900 struct bttv_fh *fh = priv;
2901 struct bttv *btv = fh->btv;
2924 struct bttv_fh *fh = f;
2925 struct bttv *btv = fh->btv;
2935 struct bttv_fh *fh = priv;
2936 struct bttv *btv = fh->btv;
2961 struct bttv_fh *fh = f;
2962 struct bttv *btv = fh->btv;
2972 struct bttv_fh *fh = f;
2973 struct bttv *btv = fh->btv;
2975 return v4l2_prio_change(&btv->prio, &fh->prio, prio);
2981 struct bttv_fh *fh = priv;
2982 struct bttv *btv = fh->btv;
2995 struct bttv_fh *fh = f;
2996 struct bttv *btv = fh->btv;
3002 /* No fh->do_crop = 1; because btv->crop[1] may be
3003 inconsistent with fh->width or fh->height and apps
3006 crop->c = btv->crop[!!fh->do_crop].rect;
3013 struct bttv_fh *fh = f;
3014 struct bttv *btv = fh->btv;
3027 retval = v4l2_prio_check(&btv->prio, fh->prio);
3038 if (locked_btres(fh->btv, VIDEO_RESOURCES)) {
3076 fh->do_crop = 1;
3078 mutex_lock(&fh->cap.vb_lock);
3080 if (fh->width < c.min_scaled_width) {
3081 fh->width = c.min_scaled_width;
3083 } else if (fh->width > c.max_scaled_width) {
3084 fh->width = c.max_scaled_width;
3088 if (fh->height < c.min_scaled_height) {
3089 fh->height = c.min_scaled_height;
3091 } else if (fh->height > c.max_scaled_height) {
3092 fh->height = c.max_scaled_height;
3096 mutex_unlock(&fh->cap.vb_lock);
3121 struct bttv_fh *fh = file->private_data;
3124 if (fh->btv->errors)
3125 bttv_reinit_bt848(fh->btv);
3127 fh->btv->c.nr,(int)count,v4l2_type_names[fh->type]);
3129 switch (fh->type) {
3131 if (!check_alloc_btres(fh->btv, fh, RESOURCE_VIDEO_READ)) {
3132 /* VIDEO_READ in use by another fh,
3133 or VIDEO_STREAM by any fh. */
3136 retval = videobuf_read_one(&fh->cap, data, count, ppos,
3138 free_btres(fh->btv, fh, RESOURCE_VIDEO_READ);
3141 if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI))
3143 retval = videobuf_read_stream(&fh->vbi, data, count, ppos, 1,
3154 struct bttv_fh *fh = file->private_data;
3159 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
3160 if (!check_alloc_btres(fh->btv,fh,RESOURCE_VBI))
3162 return videobuf_poll_stream(file, &fh->vbi, wait);
3165 if (check_btres(fh,RESOURCE_VIDEO_STREAM)) {
3166 mutex_lock(&fh->cap.vb_lock);
3168 if (list_empty(&fh->cap.stream))
3170 buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream);
3173 mutex_lock(&fh->cap.vb_lock);
3174 if (NULL == fh->cap.read_buf) {
3176 if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM))
3178 fh->cap.read_buf = videobuf_sg_alloc(fh->cap.msize);
3179 if (NULL == fh->cap.read_buf)
3181 fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR;
3182 field = videobuf_next_field(&fh->cap);
3183 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) {
3184 kfree (fh->cap.read_buf);
3185 fh->cap.read_buf = NULL;
3188 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
3189 fh->cap.read_off = 0;
3191 mutex_unlock(&fh->cap.vb_lock);
3192 buf = (struct bttv_buffer*)fh->cap.read_buf;
3202 mutex_unlock(&fh->cap.vb_lock);
3210 struct bttv_fh *fh;
3230 fh = kmalloc(sizeof(*fh),GFP_KERNEL);
3231 if (NULL == fh) {
3235 file->private_data = fh;
3236 *fh = btv->init;
3237 fh->type = type;
3238 fh->ov.setup_ok = 0;
3239 v4l2_prio_open(&btv->prio, &fh->prio);
3241 videobuf_queue_sg_init(&fh->cap, &bttv_video_qops,
3246 fh);
3247 videobuf_queue_sg_init(&fh->vbi, &bttv_vbi_qops,
3252 fh);
3262 this fh, which is to say VIDIOC_G_CROP and scaling limit checks
3267 fh->do_crop = !reset_crop; /* module parameter */
3271 driver versions each fh has its own parameters. */
3272 bttv_vbi_fmt_reset(&fh->vbi_fmt, btv->tvnorm);
3281 struct bttv_fh *fh = file->private_data;
3282 struct bttv *btv = fh->btv;
3285 if (check_btres(fh, RESOURCE_OVERLAY))
3286 bttv_switch_overlay(btv,fh,NULL);
3289 if (check_btres(fh, RESOURCE_VIDEO_STREAM)) {
3290 videobuf_streamoff(&fh->cap);
3291 free_btres(btv,fh,RESOURCE_VIDEO_STREAM);
3293 if (fh->cap.read_buf) {
3294 buffer_release(&fh->cap,fh->cap.read_buf);
3295 kfree(fh->cap.read_buf);
3297 if (check_btres(fh, RESOURCE_VIDEO_READ)) {
3298 free_btres(btv, fh, RESOURCE_VIDEO_READ);
3302 if (check_btres(fh, RESOURCE_VBI)) {
3303 videobuf_stop(&fh->vbi);
3304 free_btres(btv,fh,RESOURCE_VBI);
3308 videobuf_mmap_free(&fh->cap);
3309 videobuf_mmap_free(&fh->vbi);
3310 v4l2_prio_close(&btv->prio, fh->prio);
3312 kfree(fh);
3326 struct bttv_fh *fh = file->private_data;
3329 fh->btv->c.nr, v4l2_type_names[fh->type],
3331 return videobuf_mmap_mapper(bttv_queue(fh),vma);
3411 struct bttv_fh *fh;
3420 fh = kmalloc(sizeof(*fh), GFP_KERNEL);
3421 if (NULL == fh) {
3425 file->private_data = fh;
3426 *fh = btv->init;
3427 v4l2_prio_open(&btv->prio, &fh->prio);
3443 struct bttv_fh *fh = file->private_data;
3444 struct bttv *btv = fh->btv;
3447 v4l2_prio_close(&btv->prio, fh->prio);
3449 kfree(fh);
3461 struct bttv_fh *fh = priv;
3462 struct bttv *btv = fh->btv;
3475 struct bttv_fh *fh = priv;
3476 struct bttv *btv = fh->btv;
3522 struct bttv_fh *fh = priv;
3523 struct bttv *btv = fh->btv;
3549 static int radio_s_std(struct file *file, void *fh, v4l2_std_id *norm)
3581 struct bttv_fh *fh = file->private_data;
3582 struct bttv *btv = fh->btv;
3596 struct bttv_fh *fh = file->private_data;
3597 struct bttv *btv = fh->btv;