@@ -663,7 +663,7 @@ int check_alloc_btres_lock(struct bttv *btv, struct bttv_fh *fh, int bit)
663
663
if ((bit & VIDEO_RESOURCES )
664
664
&& 0 == (btv -> resources & VIDEO_RESOURCES )) {
665
665
/* Do crop - use current, don't - use default parameters. */
666
- __s32 top = btv -> crop [!!fh -> do_crop ].rect .top ;
666
+ __s32 top = btv -> crop [!!btv -> do_crop ].rect .top ;
667
667
668
668
if (btv -> vbi_end > top )
669
669
goto fail ;
@@ -1493,7 +1493,6 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1493
1493
unsigned int width , unsigned int height ,
1494
1494
enum v4l2_field field )
1495
1495
{
1496
- struct bttv_fh * fh = q -> priv_data ;
1497
1496
int redo_dma_risc = 0 ;
1498
1497
struct bttv_crop c ;
1499
1498
int norm ;
@@ -1523,7 +1522,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1523
1522
c .rect = bttv_tvnorms [norm ].cropcap .defrect ;
1524
1523
} else {
1525
1524
norm = btv -> tvnorm ;
1526
- c = btv -> crop [!!fh -> do_crop ];
1525
+ c = btv -> crop [!!btv -> do_crop ];
1527
1526
1528
1527
if (width < c .min_scaled_width ||
1529
1528
width > c .max_scaled_width ||
@@ -1919,9 +1918,9 @@ limit_scaled_size_lock (struct bttv_fh * fh,
1919
1918
b = & bttv_tvnorms [btv -> tvnorm ].cropcap .bounds ;
1920
1919
1921
1920
/* Do crop - use current, don't - use default parameters. */
1922
- c = & btv -> crop [!!fh -> do_crop ];
1921
+ c = & btv -> crop [!!btv -> do_crop ];
1923
1922
1924
- if (fh -> do_crop
1923
+ if (btv -> do_crop
1925
1924
&& adjust_size
1926
1925
&& adjust_crop
1927
1926
&& !locked_btres (btv , VIDEO_RESOURCES )) {
@@ -2121,7 +2120,7 @@ static int bttv_try_fmt_vid_cap(struct file *file, void *priv,
2121
2120
}
2122
2121
fallthrough ;
2123
2122
default : /* FIELD_ANY case */
2124
- height2 = btv -> crop [!!fh -> do_crop ].rect .height >> 1 ;
2123
+ height2 = btv -> crop [!!btv -> do_crop ].rect .height >> 1 ;
2125
2124
field = (f -> fmt .pix .height > height2 )
2126
2125
? V4L2_FIELD_INTERLACED
2127
2126
: V4L2_FIELD_BOTTOM ;
@@ -2360,20 +2359,14 @@ static int bttv_g_pixelaspect(struct file *file, void *priv,
2360
2359
2361
2360
static int bttv_g_selection (struct file * file , void * f , struct v4l2_selection * sel )
2362
2361
{
2363
- struct bttv_fh * fh = f ;
2364
2362
struct bttv * btv = video_drvdata (file );
2365
2363
2366
2364
if (sel -> type != V4L2_BUF_TYPE_VIDEO_CAPTURE )
2367
2365
return - EINVAL ;
2368
2366
2369
2367
switch (sel -> target ) {
2370
2368
case V4L2_SEL_TGT_CROP :
2371
- /*
2372
- * No fh->do_crop = 1; because btv->crop[1] may be
2373
- * inconsistent with fh->width or fh->height and apps
2374
- * do not expect a change here.
2375
- */
2376
- sel -> r = btv -> crop [!!fh -> do_crop ].rect ;
2369
+ sel -> r = btv -> crop [!!btv -> do_crop ].rect ;
2377
2370
break ;
2378
2371
case V4L2_SEL_TGT_CROP_DEFAULT :
2379
2372
sel -> r = bttv_tvnorms [btv -> tvnorm ].cropcap .defrect ;
@@ -2447,7 +2440,7 @@ static int bttv_s_selection(struct file *file, void *f, struct v4l2_selection *s
2447
2440
2448
2441
btv -> crop [1 ] = c ;
2449
2442
2450
- fh -> do_crop = 1 ;
2443
+ btv -> do_crop = 1 ;
2451
2444
2452
2445
if (btv -> width < c .min_scaled_width )
2453
2446
btv -> width = c .min_scaled_width ;
@@ -2610,7 +2603,7 @@ static int bttv_open(struct file *file)
2610
2603
current video standard, and VIDIOC_S_FMT will not implicitly
2611
2604
change the cropping parameters until VIDIOC_S_SELECTION has been
2612
2605
called. */
2613
- fh -> do_crop = !reset_crop ; /* module parameter */
2606
+ btv -> do_crop = !reset_crop ; /* module parameter */
2614
2607
2615
2608
/* Likewise there should be one global set of VBI capture
2616
2609
parameters, but for compatibility with V4L apps and earlier
@@ -3639,6 +3632,7 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id)
3639
3632
btv -> input = 0 ;
3640
3633
btv -> tvnorm = 0 ; /* Index into bttv_tvnorms[] i.e. PAL. */
3641
3634
bttv_vbi_fmt_reset (& btv -> vbi_fmt , btv -> tvnorm );
3635
+ btv -> do_crop = 0 ;
3642
3636
3643
3637
v4l2_ctrl_new_std (hdl , & bttv_ctrl_ops ,
3644
3638
V4L2_CID_BRIGHTNESS , 0 , 0xff00 , 0x100 , 32768 );
0 commit comments