Commit 42dc8149 authored by Linus Torvalds's avatar Linus Torvalds

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
parents a229cf67 263cb0cc
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
* different type underlying the specified range of virtual addresses. * different type underlying the specified range of virtual addresses.
* When the function isn't able to map a single page, it returns error. * When the function isn't able to map a single page, it returns error.
* *
* Note that get_vaddr_frames() cannot follow VM_IO mappings. It used
* to be able to do that, but that could (racily) return non-refcounted
* pfns.
*
* This function takes care of grabbing mmap_lock as necessary. * This function takes care of grabbing mmap_lock as necessary.
*/ */
int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write, 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, ...@@ -59,8 +63,6 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
if (likely(ret > 0)) if (likely(ret > 0))
return ret; return ret;
/* This used to (racily) return non-refcounted pfns. Let people know */
WARN_ONCE(1, "get_vaddr_frames() cannot follow VM_IO mapping");
vec->nr_frames = 0; vec->nr_frames = 0;
return ret ? ret : -EFAULT; return ret ? ret : -EFAULT;
} }
......
...@@ -691,12 +691,12 @@ static int imx219_init_cfg(struct v4l2_subdev *sd, ...@@ -691,12 +691,12 @@ static int imx219_init_cfg(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *format; struct v4l2_mbus_framefmt *format;
struct v4l2_rect *crop; struct v4l2_rect *crop;
/* Initialize try_fmt */ /* Initialize the format. */
format = v4l2_subdev_get_pad_format(sd, state, 0); format = v4l2_subdev_get_pad_format(sd, state, 0);
imx219_update_pad_format(imx219, &supported_modes[0], format, imx219_update_pad_format(imx219, &supported_modes[0], format,
MEDIA_BUS_FMT_SRGGB10_1X10); MEDIA_BUS_FMT_SRGGB10_1X10);
/* Initialize crop rectangle. */ /* Initialize the crop rectangle. */
crop = v4l2_subdev_get_pad_crop(sd, state, 0); crop = v4l2_subdev_get_pad_crop(sd, state, 0);
crop->top = IMX219_PIXEL_ARRAY_TOP; crop->top = IMX219_PIXEL_ARRAY_TOP;
crop->left = IMX219_PIXEL_ARRAY_LEFT; crop->left = IMX219_PIXEL_ARRAY_LEFT;
...@@ -750,6 +750,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, ...@@ -750,6 +750,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
const struct imx219_mode *mode; const struct imx219_mode *mode;
int exposure_max, exposure_def, hblank; int exposure_max, exposure_def, hblank;
struct v4l2_mbus_framefmt *format; struct v4l2_mbus_framefmt *format;
struct v4l2_rect *crop;
mode = v4l2_find_nearest_size(supported_modes, mode = v4l2_find_nearest_size(supported_modes,
ARRAY_SIZE(supported_modes), ARRAY_SIZE(supported_modes),
...@@ -757,10 +758,12 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, ...@@ -757,10 +758,12 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
fmt->format.width, fmt->format.height); fmt->format.width, fmt->format.height);
imx219_update_pad_format(imx219, mode, &fmt->format, fmt->format.code); imx219_update_pad_format(imx219, mode, &fmt->format, fmt->format.code);
format = v4l2_subdev_get_pad_format(sd, sd_state, 0); format = v4l2_subdev_get_pad_format(sd, sd_state, 0);
crop = v4l2_subdev_get_pad_crop(sd, sd_state, 0);
if (imx219->mode == mode && format->code == fmt->format.code) *format = fmt->format;
return 0; *crop = mode->crop;
if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
imx219->mode = mode; imx219->mode = mode;
...@@ -788,8 +791,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, ...@@ -788,8 +791,6 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
hblank); hblank);
} }
*format = fmt->format;
return 0; return 0;
} }
......
...@@ -1110,7 +1110,6 @@ static int max9286_v4l2_register(struct max9286_priv *priv) ...@@ -1110,7 +1110,6 @@ static int max9286_v4l2_register(struct max9286_priv *priv)
static void max9286_v4l2_unregister(struct max9286_priv *priv) static void max9286_v4l2_unregister(struct max9286_priv *priv)
{ {
fwnode_handle_put(priv->sd.fwnode);
v4l2_ctrl_handler_free(&priv->ctrls); v4l2_ctrl_handler_free(&priv->ctrls);
v4l2_async_unregister_subdev(&priv->sd); v4l2_async_unregister_subdev(&priv->sd);
max9286_v4l2_notifier_unregister(priv); max9286_v4l2_notifier_unregister(priv);
......
...@@ -608,7 +608,6 @@ static void rdacm21_remove(struct i2c_client *client) ...@@ -608,7 +608,6 @@ static void rdacm21_remove(struct i2c_client *client)
v4l2_async_unregister_subdev(&dev->sd); v4l2_async_unregister_subdev(&dev->sd);
v4l2_ctrl_handler_free(&dev->ctrls); v4l2_ctrl_handler_free(&dev->ctrls);
i2c_unregister_device(dev->isp); i2c_unregister_device(dev->isp);
fwnode_handle_put(dev->sd.fwnode);
} }
static const struct of_device_id rdacm21_of_ids[] = { static const struct of_device_id rdacm21_of_ids[] = {
......
...@@ -68,9 +68,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc, ...@@ -68,9 +68,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
sg = sglist; sg = sglist;
for (line = 0; line < store_lines; line++) { for (line = 0; line < store_lines; line++) {
if ((line >= (store_lines - VCR_HACK_LINES)) && if ((line >= (store_lines - VCR_HACK_LINES)) &&
(btv->opt_vcr_hack || btv->opt_vcr_hack)
(V4L2_FIELD_HAS_BOTH(btv->field) ||
btv->field == V4L2_FIELD_ALTERNATE)))
continue; continue;
while (offset && offset >= sg_dma_len(sg)) { while (offset && offset >= sg_dma_len(sg)) {
offset -= sg_dma_len(sg); offset -= sg_dma_len(sg);
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
config INTEL_VSC config INTEL_VSC
tristate "Intel Visual Sensing Controller" tristate "Intel Visual Sensing Controller"
depends on INTEL_MEI && ACPI depends on INTEL_MEI && ACPI && VIDEO_DEV
select MEDIA_CONTROLLER
select VIDEO_V4L2_SUBDEV_API
select V4L2_ASYNC
help help
This adds support for Intel Visual Sensing Controller (IVSC). This adds support for Intel Visual Sensing Controller (IVSC).
......
...@@ -7,7 +7,7 @@ config VIDEO_CAFE_CCIC ...@@ -7,7 +7,7 @@ config VIDEO_CAFE_CCIC
depends on V4L_PLATFORM_DRIVERS depends on V4L_PLATFORM_DRIVERS
depends on PCI && I2C && VIDEO_DEV depends on PCI && I2C && VIDEO_DEV
depends on COMMON_CLK depends on COMMON_CLK
select VIDEO_OV7670 select VIDEO_OV7670 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
select VIDEOBUF2_VMALLOC select VIDEOBUF2_VMALLOC
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select VIDEOBUF2_DMA_SG select VIDEOBUF2_DMA_SG
...@@ -22,7 +22,7 @@ config VIDEO_MMP_CAMERA ...@@ -22,7 +22,7 @@ config VIDEO_MMP_CAMERA
depends on I2C && VIDEO_DEV depends on I2C && VIDEO_DEV
depends on ARCH_MMP || COMPILE_TEST depends on ARCH_MMP || COMPILE_TEST
depends on COMMON_CLK depends on COMMON_CLK
select VIDEO_OV7670 select VIDEO_OV7670 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
select I2C_GPIO select I2C_GPIO
select VIDEOBUF2_VMALLOC select VIDEOBUF2_VMALLOC
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
......
...@@ -1490,7 +1490,6 @@ static int mipi_csis_probe(struct platform_device *pdev) ...@@ -1490,7 +1490,6 @@ static int mipi_csis_probe(struct platform_device *pdev)
v4l2_async_unregister_subdev(&csis->sd); v4l2_async_unregister_subdev(&csis->sd);
err_disable_clock: err_disable_clock:
mipi_csis_clk_disable(csis); mipi_csis_clk_disable(csis);
fwnode_handle_put(csis->sd.fwnode);
return ret; return ret;
} }
...@@ -1510,7 +1509,6 @@ static void mipi_csis_remove(struct platform_device *pdev) ...@@ -1510,7 +1509,6 @@ static void mipi_csis_remove(struct platform_device *pdev)
mipi_csis_clk_disable(csis); mipi_csis_clk_disable(csis);
v4l2_subdev_cleanup(&csis->sd); v4l2_subdev_cleanup(&csis->sd);
media_entity_cleanup(&csis->sd.entity); media_entity_cleanup(&csis->sd.entity);
fwnode_handle_put(csis->sd.fwnode);
pm_runtime_set_suspended(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);
} }
......
...@@ -7,7 +7,7 @@ config VIDEO_VIA_CAMERA ...@@ -7,7 +7,7 @@ config VIDEO_VIA_CAMERA
depends on V4L_PLATFORM_DRIVERS depends on V4L_PLATFORM_DRIVERS
depends on FB_VIA && VIDEO_DEV depends on FB_VIA && VIDEO_DEV
select VIDEOBUF2_DMA_SG select VIDEOBUF2_DMA_SG
select VIDEO_OV7670 select VIDEO_OV7670 if VIDEO_CAMERA_SENSOR
help help
Driver support for the integrated camera controller in VIA Driver support for the integrated camera controller in VIA
Chrome9 chipsets. Currently only tested on OLPC xo-1.5 systems Chrome9 chipsets. Currently only tested on OLPC xo-1.5 systems
......
...@@ -12,8 +12,8 @@ config VIDEO_EM28XX_V4L2 ...@@ -12,8 +12,8 @@ config VIDEO_EM28XX_V4L2
select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
select VIDEO_OV2640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT select VIDEO_OV2640 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
help help
This is a video4linux driver for Empia 28xx based TV cards. This is a video4linux driver for Empia 28xx based TV cards.
......
...@@ -12,8 +12,8 @@ config VIDEO_GO7007 ...@@ -12,8 +12,8 @@ config VIDEO_GO7007
select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && VIDEO_CAMERA_SENSOR
help help
This is a video4linux driver for the WIS GO7007 MPEG This is a video4linux driver for the WIS GO7007 MPEG
encoder chip. encoder chip.
......
...@@ -1402,6 +1402,9 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain, ...@@ -1402,6 +1402,9 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
query_menu->id = id; query_menu->id = id;
query_menu->index = index; query_menu->index = index;
if (index >= BITS_PER_TYPE(mapping->menu_mask))
return -EINVAL;
ret = mutex_lock_interruptible(&chain->ctrl_mutex); ret = mutex_lock_interruptible(&chain->ctrl_mutex);
if (ret < 0) if (ret < 0)
return -ERESTARTSYS; return -ERESTARTSYS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment