Skip to content

Commit 42dc814

Browse files
committed
Merge tag 'media/v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: - driver fixes due to incorrect fwnode_handle_put() call - bt8xx: bttv_risc_packed(): remove field checks - vb2: frame_vector.c: replace WARN_ONCE with a comment - imx219: a couple typo fixes and perform a full mode set unconditionally - uvcvideo: Fix OOB read - some dependency fixes * tag 'media/v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: imx-mipi-csis: Remove an incorrect fwnode_handle_put() call media: vb2: frame_vector.c: replace WARN_ONCE with a comment media: uvcvideo: Fix OOB read media: bt8xx: bttv_risc_packed(): remove field checks media: i2c: rdacm21: Remove an incorrect fwnode_handle_put() call media: i2c: imx219: Perform a full mode set unconditionally media: i2c: imx219: Fix crop rectangle setting when changing format media: i2c: imx219: Fix a typo referring to a wrong variable media: i2c: max9286: Remove an incorrect fwnode_handle_put() call media: ivsc: Depend on VIDEO_DEV media: via: Use correct dependency for camera sensor drivers media: v4l: Use correct dependency for camera sensor drivers media: pci: ivsc: Select build dependencies
2 parents a229cf6 + 263cb0c commit 42dc814

File tree

12 files changed

+25
-22
lines changed

12 files changed

+25
-22
lines changed

drivers/media/common/videobuf2/frame_vector.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
* different type underlying the specified range of virtual addresses.
3232
* When the function isn't able to map a single page, it returns error.
3333
*
34+
* Note that get_vaddr_frames() cannot follow VM_IO mappings. It used
35+
* to be able to do that, but that could (racily) return non-refcounted
36+
* pfns.
37+
*
3438
* This function takes care of grabbing mmap_lock as necessary.
3539
*/
3640
int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
@@ -59,8 +63,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
5963
if (likely(ret > 0))
6064
return ret;
6165

62-
/* This used to (racily) return non-refcounted pfns. Let people know */
63-
WARN_ONCE(1, "get_vaddr_frames() cannot follow VM_IO mapping");
6466
vec->nr_frames = 0;
6567
return ret ? ret : -EFAULT;
6668
}

drivers/media/i2c/imx219.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,12 +691,12 @@ static int imx219_init_cfg(struct v4l2_subdev *sd,
691691
struct v4l2_mbus_framefmt *format;
692692
struct v4l2_rect *crop;
693693

694-
/* Initialize try_fmt */
694+
/* Initialize the format. */
695695
format = v4l2_subdev_get_pad_format(sd, state, 0);
696696
imx219_update_pad_format(imx219, &supported_modes[0], format,
697697
MEDIA_BUS_FMT_SRGGB10_1X10);
698698

699-
/* Initialize crop rectangle. */
699+
/* Initialize the crop rectangle. */
700700
crop = v4l2_subdev_get_pad_crop(sd, state, 0);
701701
crop->top = IMX219_PIXEL_ARRAY_TOP;
702702
crop->left = IMX219_PIXEL_ARRAY_LEFT;
@@ -750,17 +750,20 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
750750
const struct imx219_mode *mode;
751751
int exposure_max, exposure_def, hblank;
752752
struct v4l2_mbus_framefmt *format;
753+
struct v4l2_rect *crop;
753754

754755
mode = v4l2_find_nearest_size(supported_modes,
755756
ARRAY_SIZE(supported_modes),
756757
width, height,
757758
fmt->format.width, fmt->format.height);
758759

759760
imx219_update_pad_format(imx219, mode, &fmt->format, fmt->format.code);
761+
760762
format = v4l2_subdev_get_pad_format(sd, sd_state, 0);
763+
crop = v4l2_subdev_get_pad_crop(sd, sd_state, 0);
761764

762-
if (imx219->mode == mode && format->code == fmt->format.code)
763-
return 0;
765+
*format = fmt->format;
766+
*crop = mode->crop;
764767

765768
if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
766769
imx219->mode = mode;
@@ -788,8 +791,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
788791
hblank);
789792
}
790793

791-
*format = fmt->format;
792-
793794
return 0;
794795
}
795796

drivers/media/i2c/max9286.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ static int max9286_v4l2_register(struct max9286_priv *priv)
11101110

11111111
static void max9286_v4l2_unregister(struct max9286_priv *priv)
11121112
{
1113-
fwnode_handle_put(priv->sd.fwnode);
11141113
v4l2_ctrl_handler_free(&priv->ctrls);
11151114
v4l2_async_unregister_subdev(&priv->sd);
11161115
max9286_v4l2_notifier_unregister(priv);

drivers/media/i2c/rdacm21.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ static void rdacm21_remove(struct i2c_client *client)
608608
v4l2_async_unregister_subdev(&dev->sd);
609609
v4l2_ctrl_handler_free(&dev->ctrls);
610610
i2c_unregister_device(dev->isp);
611-
fwnode_handle_put(dev->sd.fwnode);
612611
}
613612

614613
static const struct of_device_id rdacm21_of_ids[] = {

drivers/media/pci/bt8xx/bttv-risc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
6868
sg = sglist;
6969
for (line = 0; line < store_lines; line++) {
7070
if ((line >= (store_lines - VCR_HACK_LINES)) &&
71-
(btv->opt_vcr_hack ||
72-
(V4L2_FIELD_HAS_BOTH(btv->field) ||
73-
btv->field == V4L2_FIELD_ALTERNATE)))
71+
btv->opt_vcr_hack)
7472
continue;
7573
while (offset && offset >= sg_dma_len(sg)) {
7674
offset -= sg_dma_len(sg);

drivers/media/pci/intel/ivsc/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
config INTEL_VSC
55
tristate "Intel Visual Sensing Controller"
6-
depends on INTEL_MEI && ACPI
6+
depends on INTEL_MEI && ACPI && VIDEO_DEV
7+
select MEDIA_CONTROLLER
8+
select VIDEO_V4L2_SUBDEV_API
9+
select V4L2_ASYNC
710
help
811
This adds support for Intel Visual Sensing Controller (IVSC).
912

drivers/media/platform/marvell/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config VIDEO_CAFE_CCIC
77
depends on V4L_PLATFORM_DRIVERS
88
depends on PCI && I2C && VIDEO_DEV
99
depends on COMMON_CLK
10-
select VIDEO_OV7670
10+
select VIDEO_OV7670 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
1111
select VIDEOBUF2_VMALLOC
1212
select VIDEOBUF2_DMA_CONTIG
1313
select VIDEOBUF2_DMA_SG
@@ -22,7 +22,7 @@ config VIDEO_MMP_CAMERA
2222
depends on I2C && VIDEO_DEV
2323
depends on ARCH_MMP || COMPILE_TEST
2424
depends on COMMON_CLK
25-
select VIDEO_OV7670
25+
select VIDEO_OV7670 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
2626
select I2C_GPIO
2727
select VIDEOBUF2_VMALLOC
2828
select VIDEOBUF2_DMA_CONTIG

drivers/media/platform/nxp/imx-mipi-csis.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,6 @@ static int mipi_csis_probe(struct platform_device *pdev)
14901490
v4l2_async_unregister_subdev(&csis->sd);
14911491
err_disable_clock:
14921492
mipi_csis_clk_disable(csis);
1493-
fwnode_handle_put(csis->sd.fwnode);
14941493

14951494
return ret;
14961495
}
@@ -1510,7 +1509,6 @@ static void mipi_csis_remove(struct platform_device *pdev)
15101509
mipi_csis_clk_disable(csis);
15111510
v4l2_subdev_cleanup(&csis->sd);
15121511
media_entity_cleanup(&csis->sd.entity);
1513-
fwnode_handle_put(csis->sd.fwnode);
15141512
pm_runtime_set_suspended(&pdev->dev);
15151513
}
15161514

drivers/media/platform/via/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config VIDEO_VIA_CAMERA
77
depends on V4L_PLATFORM_DRIVERS
88
depends on FB_VIA && VIDEO_DEV
99
select VIDEOBUF2_DMA_SG
10-
select VIDEO_OV7670
10+
select VIDEO_OV7670 if VIDEO_CAMERA_SENSOR
1111
help
1212
Driver support for the integrated camera controller in VIA
1313
Chrome9 chipsets. Currently only tested on OLPC xo-1.5 systems

drivers/media/usb/em28xx/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ config VIDEO_EM28XX_V4L2
1212
select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
1313
select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT
1414
select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
15-
select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
16-
select VIDEO_OV2640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
15+
select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
16+
select VIDEO_OV2640 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
1717
help
1818
This is a video4linux driver for Empia 28xx based TV cards.
1919

0 commit comments

Comments
 (0)