media fixes for v6.5-rc7

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+QmuaPwR3wnBdVwACF8+vY7k4RUFAmTc0qUACgkQCF8+vY7k
 4RXRqQ//RPlpmt65W0iXWkGjfqIJENhPpjC18ae3UWkK7ecSfV9PY8rOUmDea31H
 SrJCMjDjHB2FkIQlQ0Ljx16X+MIiJZYPsk2PfsF0kTsvbIvz7ZD6zYW0ZJW7PtNL
 TDh9nNMQrKPH6H1BjSmDK18jz6IyQu7aCSi4rVd5NjzvIltgo7O/GFo3+8PtZA0j
 aa0KbB7ginzAjZSefbqy7uSF6ca0u/VNmp1J3yGeCPUsPnUJUSOeSmtAx2deV0gM
 t6ICC79hyUJbpA1g9XE3Yj6oOT1GgHbWAG8cstEXTnK7F/u1uKTNyMOhrcEF1fnf
 hN4it5Q9kujmN6dfk6R9q8boes3omtEKyh6LIhjzAVqvOCY9R3BnCzfUkYfWfXRq
 Uu51I8kXQTc2bm3nFKk3323JcfZuZkAkwl2GKJJXMJFkYxux3by8tyJI3IIRRfO5
 HYj/WnoM1VoKQ4Voa76jCv8gUZNwWEFcgXIIf6X6UWf5pDAy36gZFqQ1Jtb6Hk8l
 VbWC+o+7pG+e770Iw/dYDTPLWG23/C0tMvr1ra+nBKFDx38u49nbpQKa7WEDWL9w
 X51ldQ+Oww/zOSh1l85ZPid0xyEtPBjmf8jc9Jui1XwneW9j/4M2FzLRvWmbyf2v
 9EtxBXVVeWTCgEi2gthXqNGpfGMQJh+xaXpghnYzPPoYn3LI05M=
 =57HD
 -----END PGP SIGNATURE-----

Merge tag 'media/v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 "Three driver fixes"

* tag 'media/v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: imx: imx7-media-csi: Fix applying format constraints
  media: uvcvideo: Fix menu count handling for userspace XU mappings
  media: mtk-jpeg: Set platform driver data earlier
This commit is contained in:
Linus Torvalds 2023-08-19 13:13:55 +02:00
commit aa9ea98cca
3 changed files with 8 additions and 5 deletions

View File

@ -1310,6 +1310,8 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
jpeg->dev = &pdev->dev;
jpeg->variant = of_device_get_match_data(jpeg->dev);
platform_set_drvdata(pdev, jpeg);
ret = devm_of_platform_populate(&pdev->dev);
if (ret) {
v4l2_err(&jpeg->v4l2_dev, "Master of platform populate failed.");
@ -1381,8 +1383,6 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
jpeg->variant->dev_name, jpeg->vdev->num,
VIDEO_MAJOR, jpeg->vdev->minor);
platform_set_drvdata(pdev, jpeg);
pm_runtime_enable(&pdev->dev);
return 0;

View File

@ -9,7 +9,9 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/math.h>
#include <linux/mfd/syscon.h>
#include <linux/minmax.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/of_graph.h>
@ -1137,8 +1139,9 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
* TODO: Implement configurable stride support.
*/
walign = 8 * 8 / cc->bpp;
v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign,
&pixfmt->height, 1, 0xffff, 1, 0);
pixfmt->width = clamp(round_up(pixfmt->width, walign), walign,
round_down(65535U, walign));
pixfmt->height = clamp(pixfmt->height, 1U, 65535U);
pixfmt->bytesperline = pixfmt->width * cc->bpp / 8;
pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;

View File

@ -45,7 +45,7 @@ static int uvc_control_add_xu_mapping(struct uvc_video_chain *chain,
map->menu_names = NULL;
map->menu_mapping = NULL;
map->menu_mask = BIT_MASK(xmap->menu_count);
map->menu_mask = GENMASK(xmap->menu_count - 1, 0);
size = xmap->menu_count * sizeof(*map->menu_mapping);
map->menu_mapping = kzalloc(size, GFP_KERNEL);