]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agomedia: dt-bindings: Add OmniVision OV02C10
Bryan O'Donoghue [Tue, 29 Apr 2025 09:34:34 +0000 (10:34 +0100)] 
media: dt-bindings: Add OmniVision OV02C10

Extend the ov02e10 bindings yaml to describe the ov02c10 sensor which has
the same bindings with a different compat string and different i2c
address only.

Other differences in sensor capabilities exist but are not expressed in
devicetree.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: fix typos: 0V02C10 -> OV02C10]
[hverkuil: fix type: Ominivision -> OmniVision]

2 months agomedia: atomisp: Remove atomisp-mt9m114 driver
Hans de Goede [Thu, 1 May 2025 09:00:16 +0000 (11:00 +0200)] 
media: atomisp: Remove atomisp-mt9m114 driver

The "media: atomisp: Add support for sensors with a separate ISP
v4l2_subdev" combined with some pending drivers/media/i2c/mt9m114.c changes
makes the atomisp work nicely with the standard V4L2 mt9m114.c driver,
avoiding the need for the atomisp specific atomisp-mt9m114 driver.

The normal driver actually works better since the atomisp-mt9m114 driver
does not have working exposure control, leading to a much too dark image.

Remove the no longer necessary atomisp-mt9m114 driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Add support for sensors with a separate ISP v4l2_subdev
Hans de Goede [Sun, 5 Jan 2025 21:17:27 +0000 (22:17 +0100)] 
media: atomisp: Add support for sensors with a separate ISP v4l2_subdev

Some sensors have an ISP inside the sensor which the sensor driver models
as a separate v4l2-subdev, like the mt9m114 sensor-driver does.

Since the atomisp driver emulates a standard /dev/video# v4l2-device
without requiring the application to be aware of media-controller centric
/dev/video# devices this requires some special handling in the driver.

Add support for this setup to the atomisp driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Avoid deadlock with sensor subdevs with state_lock set
Hans de Goede [Thu, 1 May 2025 09:44:44 +0000 (11:44 +0200)] 
media: atomisp: Avoid deadlock with sensor subdevs with state_lock set

When a (sensor) v4l2_subdev has its state_lock member set to non NULL,
then all v4l2_subdev_state-s for the sensor share the same lock.

atomisp_init_sensor() calls v4l2_subdev_lock_and_get_active_state() and
then later on also tries to lock a separate v4l2_subdev_state used for try
calls (rather then changing the active state), while still holding
the active state lock.

Since this try v4l2_subdev_state shares a lock with the active state this
results in a deadlock.

Skip locking try_sd_state when sensor->state_lock is set to avoid this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Rename camera to sensor
Hans de Goede [Sun, 5 Jan 2025 18:25:06 +0000 (19:25 +0100)] 
media: atomisp: Rename camera to sensor

The camera v4l2_subdev pointer in struct atomisp_input_subdev points to
an image sensor, rename camera to sensor to make this more clear.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Remove compat ioctl32 header file
Hardevsinh Palaniya [Mon, 21 Apr 2025 05:27:58 +0000 (10:57 +0530)] 
media: atomisp: Remove compat ioctl32 header file

The atomisp_compat_ioctl32() function was deleted in commit b4c650f1af68
("media: atomisp: remove compat_ioctl32 code"), so this header file is no
longer needed.

Additionally, the definition of atomisp_compat_ioctl32() in atomisp_ioctl.h
is unused as well. Delete the declaration from the header.

Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@siliconsignals.io>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250421052804.11721-1-hardevsinh.palaniya@siliconsignals.io
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: gmin: Fix indentation to use TAB instead of spaces
Thomas Andreatta [Sat, 26 Apr 2025 19:30:33 +0000 (21:30 +0200)] 
media: atomisp: gmin: Fix indentation to use TAB instead of spaces

Fix indentation to use TAB instead of spaces.

Signed-off-by: Thomas Andreatta <thomasandreatta2000@gmail.com>
Link: https://lore.kernel.org/r/20250426193033.483124-1-thomas.andreatta2000@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: gmin: Remove duplicate NULL test
Abraham Samuel Adekunle [Thu, 3 Apr 2025 13:26:41 +0000 (14:26 +0100)] 
media: atomisp: gmin: Remove duplicate NULL test

When a value has been tested for NULL in an expression, a
second NULL test on the same value in another expression
is unnecessary when the value has not been assigned NULL.

Remove unnecessary duplicate NULL tests on the same value that
has previously been NULL tested.

Found by Coccinelle.

Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Link: https://lore.kernel.org/r/26990d4a9d4419f9d4155a40595bc213acb671a0.1743685415.git.abrahamadekunle50@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Fix indentation to use TAB instead of spaces
Gabriel Shahrouzi [Mon, 7 Apr 2025 12:36:08 +0000 (08:36 -0400)] 
media: atomisp: Fix indentation to use TAB instead of spaces

Replace spaces with TAB to comply with kernel coding style.

Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
Link: https://lore.kernel.org/r/20250407123608.366190-1-gshahrouzi@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Fix spelling error in ia_css_sdis2_types.h
Liu Jing [Mon, 9 Dec 2024 06:40:22 +0000 (14:40 +0800)] 
media: atomisp: Fix spelling error in ia_css_sdis2_types.h

Fix the coefficients spelling error in ia_css_sdis2_types.h.

Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20241209064022.4342-1-liujing@cmss.chinamobile.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Use the actual value of the enum instead of the enum
Ricardo Ribalda [Mon, 2 Dec 2024 15:47:16 +0000 (15:47 +0000)] 
media: atomisp: Use the actual value of the enum instead of the enum

hrt_isp_css_irq_sw_pin_0 has a different enum type than
irq_sw_channel_id_t.

Replace it with the actual value of hrt_isp_css_irq_sw_pin_0 to avoid
arithmetic operations between different enum types (and make the
compiler happy).

It is required to build with llvm 19 without these warnings:
.../sh_css_hrt.c:68:19: warning: arithmetic between different enumeration types ('irq_sw_channel_id_t' and 'enum hrt_isp_css_irq') [-Wenum-enum-conversion]
.../sh_css.c:1233:40: warning: arithmetic between different enumeration types ('irq_sw_channel_id_t' and 'enum hrt_isp_css_irq') [-Wenum-enum-conversion]
.../sh_css.c:1237:40: warning: arithmetic between different enumeration types ('irq_sw_channel_id_t' and 'enum hrt_isp_css_irq') [-Wenum-enum-conversion]

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20241202-fix-llvm9-v1-2-2a50f5acfd0b@chromium.org
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Avoid picking too big sensor resolution
Hans de Goede [Wed, 11 Dec 2024 17:35:16 +0000 (18:35 +0100)] 
media: atomisp: Avoid picking too big sensor resolution

atomisp_try_fmt() is limiting the width of the requested resolution to 1920
before calling the sensor's try_fmt() method. But it is not limiting
the height. In case of the old mode-list based t4ka3 driver which has
a mode list of:

736x496
896x736
1936x1096
3280x2464

This results in 3280x2464 being selected when try_fmt is called
with a requested resolution of 3280x2464, which is not supported because
its width > 1920 .

Fix this by also limiting the height when in preview mode.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241211173516.350779-1-hdegoede@redhat.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: gmin: Remove GPIO driven regulator support
Hans de Goede [Thu, 7 Nov 2024 22:11:34 +0000 (23:11 +0100)] 
media: atomisp: gmin: Remove GPIO driven regulator support

The GMIN code has support for sensors using external regulators enabled
by GPIOS, rather then using regulators build into the PMIC.

With the exception of the Trekstor ST70408-4 (1) tablet there are no known
devices which actually use external regulators for the sensors and the code
for this is using deprecated old style GPIO numbers support for which is
going away.

Remove the GPIO driven regulator support so that the gmin code no longer
depends on deprecated GPIO APIs.

1) The GMIN support itself is also deprecated and all sensor drivers still
using it are being moved over to use ACPI + runtime-pm and the ST70408-4
shipped with Android as factory OS and thus will have broken ACPI tables
for the sensors, so like other Android factory OS tablets it will need
a bespoke solution anyways.

Reported-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20241107221134.596149-1-hdegoede@redhat.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: atomisp: Remove gmin_platform Asus T100TA quirks
Hans de Goede [Mon, 4 Nov 2024 12:38:32 +0000 (13:38 +0100)] 
media: atomisp: Remove gmin_platform Asus T100TA quirks

The Asus T100TA quirks set the same values as the defaults,
so they are not necessary. Remove them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241104123832.5539-1-hdegoede@redhat.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: renesas: vsp1: Expose color space through the DRM API
Laurent Pinchart [Tue, 29 Apr 2025 23:29:03 +0000 (02:29 +0300)] 
media: renesas: vsp1: Expose color space through the DRM API

Now that the VSP1 driver supports color spaces, expose them through the
API used by the DU driver. This allows configuring the YCbCr encoding
and quantization used by each plane, ensuring correct color rendering.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-9-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Name nested structure in vsp1_drm
Laurent Pinchart [Tue, 29 Apr 2025 23:29:02 +0000 (02:29 +0300)] 
media: renesas: vsp1: Name nested structure in vsp1_drm

The vsp1_drm structure defines an anonymous nested structure to store
per-input data. In preparation for extending that structure, give it a
name and is it through the driver. This improves code readability.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-8-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Allow setting encoding and quantization
Laurent Pinchart [Tue, 29 Apr 2025 23:29:01 +0000 (02:29 +0300)] 
media: renesas: vsp1: Allow setting encoding and quantization

The RPF and WPF support different encodings and quantizations when
converting between RGB and YUV formats. Allow setting the corresponding
format parameters from userspace, and configure the hardware
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-7-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Report colour space information to userspace
Laurent Pinchart [Tue, 29 Apr 2025 23:29:00 +0000 (02:29 +0300)] 
media: renesas: vsp1: Report colour space information to userspace

The vsp1 driver implements very partial colour space support: it
hardcodes the colorspace field on all video devices and subdevices to
V4L2_COLORSPACE_SRGB, regardless of the configured format. The
xfer_func, ycbcr_enc and quantization fields are not set (except for
hsv_enc for HSV formats on video devices). This doesn't match the
hardware configuration, which handles YUV data as encoding in BT.601
with limited range.

As a first step towards colour space configuration, keep the colour
space fields hardcoded, but set them based on the selected format type
(RGB, YUV or HSV).

While at it, remove an extra blank line.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-6-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Fix media bus code setup on RWPF source pad
Laurent Pinchart [Tue, 29 Apr 2025 23:28:59 +0000 (02:28 +0300)] 
media: renesas: vsp1: Fix media bus code setup on RWPF source pad

The RWPF source pad media bus code can only be different from the sink
pad code when enabling color space conversion, which can only convert
between RGB and YUV. If the sink pad code is HSV, no conversion is
possible. Fix the pad set format handler to reflect this hardware
limitation.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-5-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Fix HSV format enumeration
Laurent Pinchart [Tue, 29 Apr 2025 23:28:58 +0000 (02:28 +0300)] 
media: renesas: vsp1: Fix HSV format enumeration

The HSV formats are not restricted to Gen2 platforms, but to VSP
instances that implement the HSI and HST modules. Make it conditional to
the VSP1_HAS_HSIT feature flag.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-4-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Make HSI and HST modules optional
Laurent Pinchart [Tue, 29 Apr 2025 23:28:57 +0000 (02:28 +0300)] 
media: renesas: vsp1: Make HSI and HST modules optional

Not all VSP instance incorporate the HSI and HST modules. Add a
VSP1_HAS_HSIT feature flag, and create the modules only on VSP instances
that implement them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-3-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Implement pixel format enumeration
Laurent Pinchart [Tue, 29 Apr 2025 23:28:56 +0000 (02:28 +0300)] 
media: renesas: vsp1: Implement pixel format enumeration

The VSP1 driver is missing the ability to enumerate pixel formats on its
video nodes, which is supposed to be supported according to the V4L2
API. Implement the enumeration to fix this issue.

As the device is media controller-centric, also implement the ability to
filter pixel formats by media bus code, and report the missing
V4L2_CAP_IO_MC capability.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250429232904.26413-2-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Use %p4cc printk modifier to print FourCC codes
Biju Das [Sun, 30 Mar 2025 09:17:35 +0000 (10:17 +0100)] 
media: renesas: vsp1: Use %p4cc printk modifier to print FourCC codes

Replace '%08x->%p4cc' printk modifier to print FourCC codes for pixel
formats.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250330091738.27052-1-biju.das.jz@bp.renesas.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: rwpf: Support operations with IIF
Jacopo Mondi [Tue, 1 Apr 2025 14:22:04 +0000 (16:22 +0200)] 
media: renesas: vsp1: rwpf: Support operations with IIF

When the RPF/WPF units are used for ISP interfacing through
the IIF, the set of accessible registers is limited compared to
the regular VSPD operations.

Support ISP interfacing in the rpf and wpf entities by checking if
the pipe features an IIF instance and writing only the relevant
registers.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250401-v4h-iif-v7-4-cc547c0bddd5@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: wpf: Propagate vsp1_rwpf_init_ctrls()
Jacopo Mondi [Tue, 1 Apr 2025 14:22:03 +0000 (16:22 +0200)] 
media: renesas: vsp1: wpf: Propagate vsp1_rwpf_init_ctrls()

vsp1_wpf.c calls vsp1_rwpf_init_ctrls() to initialize controls that
are common between RPF and WPF.

However, the vsp1_wpf.c implementation does not check for the function
call return value. Fix this by propagating to the caller the return
value.

While at it, drop a duplicated error message in wpf_init_controls() as
the caller already report it.

Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20250401-v4h-iif-v7-3-cc547c0bddd5@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: dl: Use singleshot DL for VSPX
Jacopo Mondi [Tue, 1 Apr 2025 14:22:02 +0000 (16:22 +0200)] 
media: renesas: vsp1: dl: Use singleshot DL for VSPX

The vsp1_dl library allows to program a display list and feed it
continuously to the VSP2. As an alternative operation mode, the library
allows to program the VSP2 in 'single shot' mode, where a display list
is submitted to the VSP on request only.

Currently the 'single shot' mode is only available when the VSP2 is
controlled by userspace, while it works in continuous mode when driven
by DRM, as frames have to be submitted to the display continuously.

For the VSPX use case, where there is no uapi support, we should however
work in single-shot mode as the ISP driver programs the VSPX on
request.

Initialize the display lists in single shot mode in case the VSP1 is
controlled by userspace or in case the pipeline features an IIF entity,
as in the VSPX case.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250401-v4h-iif-v7-2-cc547c0bddd5@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: renesas: vsp1: Add support IIF ISP Interface
Jacopo Mondi [Tue, 1 Apr 2025 14:22:01 +0000 (16:22 +0200)] 
media: renesas: vsp1: Add support IIF ISP Interface

The IIF (ISP InterFace) is a VSP2 function that transfers data
to the ISP by reading from external memory through two RPF
instances.

Add support for it in the vsp1 driver by introducing a new entity
type. The sole required operation is to enable the IIF function
during configure_stream().

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250401-v4h-iif-v7-1-cc547c0bddd5@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-isp: Parse named cs memory region
Niklas Söderlund [Wed, 23 Apr 2025 16:31:13 +0000 (18:31 +0200)] 
media: rcar-isp: Parse named cs memory region

Extend the device tree parsing to optionally parse the cs memory region
by name. The change is backward compatible with the device tree model
where a single unnamed region describes only the ISP channel select
function.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250423163113.2961049-8-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-isp: Rename base register variable
Niklas Söderlund [Wed, 23 Apr 2025 16:31:12 +0000 (18:31 +0200)] 
media: rcar-isp: Rename base register variable

Prepare for extending the driver to in addition to supporting the
channel selector (CS) also support the core ISP. The two different
functions have different base addresses so the driver needs to
distinguish between them.

Prepare for this by marking existing base address variable and
read/write functions to make it clear they operate on the CS portion of
the driver. There is no functional change.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20250423163113.2961049-7-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-isp: Move driver to own directory
Niklas Söderlund [Wed, 23 Apr 2025 16:31:11 +0000 (18:31 +0200)] 
media: rcar-isp: Move driver to own directory

Before extending the driver with functions from the R-Car ISP core that
will span multiple files move the existing driver to a separate
directory. While at it rename the single source file to allow future
files to be grouped by functions.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250423163113.2961049-6-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agodt-bindings: media: renesas,isp: Add ISP core function block
Niklas Söderlund [Wed, 23 Apr 2025 16:31:07 +0000 (18:31 +0200)] 
dt-bindings: media: renesas,isp: Add ISP core function block

Some R-Car ISP instances have in addition to the channel selector (CS)
an ISP core (CORE) to perform operations on an image stream. The core
function is mapped to a different memory region and has a separate
interrupt than CS, extend the bindings to allow describing this.

On the same SoC different instances of the ISP IP may have, or not have,
the CORE functionality. The CS function on all instances on the SoC are
the same and the documentation describes the full ISP (CS + CORE) as a
single IP block. Where instances not having the CORE function simply
lack the functionality to modify the image data. There are dependencies
on the CS functionality while operating the CORE functionality.

In order for the ISP core to function in memory-to-memory mode it needs
to be feed input data from a Streaming Bridge interface. This interface
is provided thru the VSP-X device. Add an optional new property
"renesas,vspx" to provide a phandle to describe this relationship.

While adding mandatory reg-names and interrupt-names breaks existing
bindings the driver itself remains backward compatible and provides CS
functionality if a single unnamed reg and interrupt property is present.
Furthermore all existing users of the bindings are updated in following
work to add these new mandatory properties.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250423163113.2961049-2-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-vin: Fix RAW10
Tomi Valkeinen [Thu, 24 Apr 2025 07:05:36 +0000 (10:05 +0300)] 
media: rcar-vin: Fix RAW10

Fix the following to get RAW10 formats working:

In rvin_formats, the bpp is set to 4 for RAW10. As VIN unpacks RAW10 to
16-bit containers, the bpp should be 2.

Don't set VNDMR_YC_THR to the VNDMR register. The YC_THR is "YC Data
Through Mode", used for YUV formats and should not be set for RAW10.

Fixes: 1b7e7240eaf3 ("media: rcar-vin: Add support for RAW10")
Cc: stable@vger.kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20250424-rcar-fix-raw-v2-4-f6afca378124@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-vin: Fix RAW8
Tomi Valkeinen [Thu, 24 Apr 2025 07:05:35 +0000 (10:05 +0300)] 
media: rcar-vin: Fix RAW8

On Gen4 we need to set VNMC's EXINF to a different value (1) than in
Gen3 (0). Add a define for this, and set the bit for Gen4.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20250424-rcar-fix-raw-v2-3-f6afca378124@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-vin: Remove unnecessary checks
Tomi Valkeinen [Thu, 24 Apr 2025 07:05:34 +0000 (10:05 +0300)] 
media: rcar-vin: Remove unnecessary checks

Remove unnecessary checks wrt. formats and interfaces in rvin_setup().
The validity of the formats has already been checked earlier.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20250424-rcar-fix-raw-v2-2-f6afca378124@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rcar-vin: Add RCAR_GEN4 model value
Tomi Valkeinen [Thu, 24 Apr 2025 07:05:33 +0000 (10:05 +0300)] 
media: rcar-vin: Add RCAR_GEN4 model value

Currently Gen4 VINs are marked as RCAN_GEN3 models. Add a new enum
value, RCAR_GEN4, and use it for Gen4 VINs. No functional changes in
this patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20250424-rcar-fix-raw-v2-1-f6afca378124@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: iris: add qcs8300 platform data
Vikash Garodia [Thu, 24 Apr 2025 08:50:47 +0000 (14:20 +0530)] 
media: iris: add qcs8300 platform data

Add platform data for QCS8300, which has different capabilities compared
to SM8550. Introduce a QCS8300 header that defines these capabilities.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: iris: fix the order of compat strings
Vikash Garodia [Thu, 24 Apr 2025 08:50:46 +0000 (14:20 +0530)] 
media: iris: fix the order of compat strings

Fix the order of compatible strings to make it in alpha numeric order.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agodt-bindings: media: qcom,sm8550-iris: document QCS8300 IRIS accelerator
Vikash Garodia [Thu, 24 Apr 2025 08:50:45 +0000 (14:20 +0530)] 
dt-bindings: media: qcom,sm8550-iris: document QCS8300 IRIS accelerator

Document the IRIS video decoder/encoder accelerator found in the QCS8300
platform. It belongs to same iris v3 family as that of SM8550 but is a
downscaled version of SM8550. It has 2 frame processing hardware blocks
while SM8550 has 4. Thereby QCS8300 have fewer capabilities than those
of SM8550.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: qcom/iris: add sm8650 support
Neil Armstrong [Thu, 17 Apr 2025 14:59:07 +0000 (16:59 +0200)] 
media: platform: qcom/iris: add sm8650 support

Add support for the SM8650 platform by re-using the SM8550
definitions and using the vpu33 ops.

Move the Sm8650 reset tables that differs in a per-SoC platform
header, that will contain mode SoC specific data when
more codecs are introduced.

The SM8650/vpu33 requires more reset lines, but the H.264
decoder capabilities are identical.

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: qcom/iris: rename platform_sm8550 to platform_gen2
Neil Armstrong [Thu, 17 Apr 2025 14:59:06 +0000 (16:59 +0200)] 
media: platform: qcom/iris: rename platform_sm8550 to platform_gen2

In order to prepare for supporting the SM8650 SoC, move the
iris_platform_sm8550.c file into iris_platform_gen2.c that will
contain all the common HFI GEN2x structures.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: qcom/iris: add support for vpu33
Neil Armstrong [Thu, 17 Apr 2025 14:59:05 +0000 (16:59 +0200)] 
media: platform: qcom/iris: add support for vpu33

The IRIS acceleration found in the SM8650 platforms uses the vpu33
hardware version, and requires a slighly different reset and power off
sequences in order to properly get out of runtime suspend.

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: qcom/iris: rename iris_vpu3 to iris_vpu3x
Neil Armstrong [Thu, 17 Apr 2025 14:59:04 +0000 (16:59 +0200)] 
media: platform: qcom/iris: rename iris_vpu3 to iris_vpu3x

The vpu33 HW is very close to vpu3, and shares most of the
operations, so rename file to vpu3x since we'll handle all vpu3
variants in it.

Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: qcom/iris: introduce optional controller_rst_tbl
Neil Armstrong [Thu, 17 Apr 2025 14:59:03 +0000 (16:59 +0200)] 
media: platform: qcom/iris: introduce optional controller_rst_tbl

Introduce an optional controller_rst_tbl use to store reset lines
used to reset part of the controller.

This is necessary for the vpu3 support, when the xo reset line
must be asserted separately from the other reset line
on power off operation.

Factor the iris_init_resets() logic to allow requesting
multiple reset tables.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: qcom/iris: add power_off_controller to vpu_ops
Neil Armstrong [Thu, 17 Apr 2025 14:59:02 +0000 (16:59 +0200)] 
media: platform: qcom/iris: add power_off_controller to vpu_ops

In order to support the SM8650 iris33 hardware, we need to provide a
specific constoller power off sequences via the vpu_ops callbacks.

Add the callback, and use the current helper for currently supported
platforms.

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agodt-bindings: media: qcom,sm8550-iris: document SM8650 IRIS accelerator
Neil Armstrong [Thu, 17 Apr 2025 14:59:01 +0000 (16:59 +0200)] 
dt-bindings: media: qcom,sm8550-iris: document SM8650 IRIS accelerator

Document the IRIS video decoder and encoder accelerator found in the
SM8650 platform, it requires 2 more reset lines in addition to the
properties required for the SM8550 platform.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: rkisp1: Remove unnecessary defines
Stefan Klug [Thu, 27 Feb 2025 11:45:01 +0000 (12:45 +0100)] 
media: rkisp1: Remove unnecessary defines

The effect modes are not shifts but numbers which are already defined a
few lines above. Remove the misleading defines.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Link: https://lore.kernel.org/r/20250227114558.3097101-4-stefan.klug@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: nxp: imx8-isi: better handle the m2m usage_count
Laurentiu Palcu [Wed, 23 Oct 2024 08:56:43 +0000 (11:56 +0300)] 
media: nxp: imx8-isi: better handle the m2m usage_count

Currently, if streamon/streamoff calls are imbalanced we can either end up
with a negative ISI m2m usage_count (if streamoff() is called more times
than streamon()) in which case we'll not be able to restart the ISI pipe
next time, or the usage_count never gets to 0 and the pipe is never
switched off.

To avoid that, add a 'streaming' flag to mxc_isi_m2m_ctx_queue_data and use it
in the streamon/streamoff to avoid incrementing/decrementing the usage_count
uselessly, if called multiple times from the same context.

Fixes: cf21f328fcafac ("media: nxp: Add i.MX8 ISI driver")
Cc: stable@vger.kernel.org
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241023085643.978729-1-laurentiu.palcu@oss.nxp.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: rc: add keymap for Hauppauge Credit Card RC
Petja Patjas [Thu, 27 Mar 2025 18:56:04 +0000 (20:56 +0200)] 
media: rc: add keymap for Hauppauge Credit Card RC

Add keymap for the black Hauppauge Credit Card Remote Control.

Signed-off-by: Petja Patjas <pp01415943@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: uapi: cec-funcs.h: use CEC_LOG_ADDR_BROADCAST
Hans Verkuil [Thu, 10 Apr 2025 10:00:49 +0000 (12:00 +0200)] 
media: uapi: cec-funcs.h: use CEC_LOG_ADDR_BROADCAST

The cec-funcs.h header sets the destination to 0xf for those
messages that can only be broadcast. Instead of writing:

msg->msg[0] |= 0xf; /* broadcast */

just write:

msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;

which is more descriptive and allows us to drop the comment.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: tc358743: ignore video while HPD is low
Hans Verkuil [Tue, 1 Apr 2025 09:54:17 +0000 (11:54 +0200)] 
media: tc358743: ignore video while HPD is low

If the HPD is low (happens if there is no EDID or the
EDID is being updated), then return -ENOLINK in
tc358743_get_detected_timings() instead of detecting video.

This avoids userspace thinking that it can start streaming when
the HPD is low.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Tested-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/linux-media/20240628-stoic-bettong-of-fortitude-e25611@houat/
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: platform: use (t,l)/wxh format for rectangle
Hans Verkuil [Tue, 4 Mar 2025 11:08:14 +0000 (12:08 +0100)] 
media: platform: use (t,l)/wxh format for rectangle

Standardize reporting of rectangles to (t,l)/wxh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: pci: zoran: use (t,l)/wxh format for rectangle
Hans Verkuil [Tue, 4 Mar 2025 11:08:13 +0000 (12:08 +0100)] 
media: pci: zoran: use (t,l)/wxh format for rectangle

Standardize reporting of rectangles to (t,l)/wxh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: i2c: imx283: use (t,l)/wxh format for rectangle
Hans Verkuil [Tue, 4 Mar 2025 11:08:12 +0000 (12:08 +0100)] 
media: i2c: imx283: use (t,l)/wxh format for rectangle

Standardize reporting of rectangles to (t,l)/wxh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: vivid: use (t,l)/wxh format for rectangle
Hans Verkuil [Tue, 4 Mar 2025 11:08:11 +0000 (12:08 +0100)] 
media: vivid: use (t,l)/wxh format for rectangle

Standardize reporting of rectangles to (t,l)/wxh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: usb: em28xx: use (t,l)/wxh format for rectangle
Hans Verkuil [Tue, 4 Mar 2025 11:08:10 +0000 (12:08 +0100)] 
media: usb: em28xx: use (t,l)/wxh format for rectangle

Standardize reporting of rectangles to (t,l)/wxh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: staging: atomisp/starfive: use (t,l)/wxh format for rectangle
Hans Verkuil [Tue, 4 Mar 2025 11:08:09 +0000 (12:08 +0100)] 
media: staging: atomisp/starfive: use (t,l)/wxh format for rectangle

Standardize reporting of rectangles to (t,l)/wxh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2 months agomedia: omap3isp: drop wait_prepare/finish callbacks
Hans Verkuil [Tue, 28 Jan 2025 15:08:18 +0000 (16:08 +0100)] 
media: omap3isp: drop wait_prepare/finish callbacks

Since commit 88785982a19d ("media: vb2: use lock if wait_prepare/finish
are NULL") it is no longer needed to set the wait_prepare/finish
vb2_ops callbacks as long as the lock field in vb2_queue is set.

Set the queue lock to &video->queue_lock, which makes it possible to drop
the wait_prepare/finish callbacks.

This simplifies the code and this is a step towards the goal of deleting
these callbacks.

Note that the lock field of struct video_device is never set in this
driver, so the core v4l2_ioctl.c function v4l2_ioctl_get_lock() will never
take a lock.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 months agomedia: gspca: Add error handling for stv06xx_read_sensor()
Wentao Liang [Tue, 22 Apr 2025 03:07:39 +0000 (11:07 +0800)] 
media: gspca: Add error handling for stv06xx_read_sensor()

In hdcs_init(), the return value of stv06xx_read_sensor() needs to be
checked. A proper implementation can be found in vv6410_dump(). Add a
check in loop condition and propergate error code to fix this issue.

Fixes: 4c98834addfe ("V4L/DVB (10048): gspca - stv06xx: New subdriver.")
Cc: stable@vger.kernel.org # v2.6+
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode()
Wentao Liang [Tue, 22 Apr 2025 02:13:45 +0000 (10:13 +0800)] 
media: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode()

In fimc_is_hw_change_mode(), the function changes camera modes without
waiting for hardware completion, risking corrupted data or system hangs
if subsequent operations proceed before the hardware is ready.

Add fimc_is_hw_wait_intmsr0_intmsd0() after mode configuration, ensuring
hardware state synchronization and stable interrupt handling.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: adv7511-v4l2: use constants for BT.2020 colorimetry
Dmitry Baryshkov [Wed, 16 Apr 2025 22:46:01 +0000 (01:46 +0300)] 
media: adv7511-v4l2: use constants for BT.2020 colorimetry

Replace numeric values with constants from hdmi.h.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: davinci: vpif: Fix memory leak in probe error path
Dmitry Nikiforov [Wed, 16 Apr 2025 20:51:19 +0000 (23:51 +0300)] 
media: davinci: vpif: Fix memory leak in probe error path

If an error occurs during the initialization of `pdev_display`,
the allocated platform device `pdev_capture` is not released properly,
leading to a memory leak.

Adjust error path handling to fix the leak.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 43acb728bbc4 ("media: davinci: vpif: fix use-after-free on driver unbind")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Nikiforov <Dm1tryNk@yandex.ru>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: dvb: Fix typos bloc -> block
Andrew Kreimer [Tue, 15 Apr 2025 12:38:55 +0000 (15:38 +0300)] 
media: dvb: Fix typos bloc -> block

There are some typos in comments / dprintk messages: bloc -> block.

Fix them via codespell.

Signed-off-by: Andrew Kreimer <algonell@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: vivid: Change the siize of the composing
Denis Arefev [Tue, 15 Apr 2025 08:27:21 +0000 (11:27 +0300)] 
media: vivid: Change the siize of the composing

syzkaller found a bug:

BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2608 [inline]
BUG: KASAN: vmalloc-out-of-bounds in tpg_fill_plane_buffer+0x1a9c/0x5af0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705
Write of size 1440 at addr ffffc9000d0ffda0 by task vivid-000-vid-c/5304

CPU: 0 UID: 0 PID: 5304 Comm: vivid-000-vid-c Not tainted 6.14.0-rc2-syzkaller-00039-g09fbf3d50205 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014

Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:489
 kasan_report+0x143/0x180 mm/kasan/report.c:602
 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189
 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106
 tpg_fill_plane_pattern drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2608 [inline]
 tpg_fill_plane_buffer+0x1a9c/0x5af0 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:2705
 vivid_fillbuff drivers/media/test-drivers/vivid/vivid-kthread-cap.c:470 [inline]
 vivid_thread_vid_cap_tick+0xf8e/0x60d0 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:629
 vivid_thread_vid_cap+0x8aa/0xf30 drivers/media/test-drivers/vivid/vivid-kthread-cap.c:767
 kthread+0x7a9/0x920 kernel/kthread.c:464
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>

The composition size cannot be larger than the size of fmt_cap_rect.
So execute v4l2_rect_map_inside() even if has_compose_cap == 0.

Fixes: 94a7ad928346 ("media: vivid: fix compose size exceed boundary")
Cc: stable@vger.kernel.org
Reported-by: syzbot+365005005522b70a36f2@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?id=8ed8e8cc30cbe0d86c9a25bd1d6a5775129b8ea3
Signed-off-by: Denis Arefev <arefev@swemel.ru>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: dt-bindings: Document Tegra186 and Tegra194 cec
Aaron Kling [Sun, 13 Apr 2025 19:35:32 +0000 (14:35 -0500)] 
media: dt-bindings: Document Tegra186 and Tegra194 cec

These are already used in device trees, so describe them here. As the
driver only declares up through Tegra210, these must use a fallback
compatible of tegra210-cec.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: platform: exynos4-is: Use of_get_available_child_by_name()
Biju Das [Thu, 10 Apr 2025 05:52:21 +0000 (06:52 +0100)] 
media: platform: exynos4-is: Use of_get_available_child_by_name()

Simplify fimc_md_is_isp_available() by using
of_get_available_child_by_name().

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: platform: cros-ec: Add Moxie to the match table
Ken Lin [Thu, 10 Apr 2025 03:03:59 +0000 (11:03 +0800)] 
media: platform: cros-ec: Add Moxie to the match table

The Google Moxie device uses the same approach as the Google Brask
which enables the HDMI CEC via the cros-ec-cec driver.

Signed-off-by: Ken Lin <kenlin5@quanta.corp-partner.google.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: stm32-dcmi: use devm_kmemdup_array()
Raag Jadav [Wed, 9 Apr 2025 08:47:38 +0000 (14:17 +0530)] 
media: stm32-dcmi: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: atmel-isi: use devm_kmemdup_array()
Raag Jadav [Wed, 9 Apr 2025 08:47:37 +0000 (14:17 +0530)] 
media: atmel-isi: use devm_kmemdup_array()

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: mgb4: Enumerate only the available timings
Martin Tůma [Tue, 8 Apr 2025 13:21:55 +0000 (15:21 +0200)] 
media: mgb4: Enumerate only the available timings

Enumerate only the available (as given by the input source) timings, not
all theoretically possible.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: nuvoton: npcm-video: Prevent returning unsupported resolutions
Michael Chang [Tue, 8 Apr 2025 05:54:54 +0000 (13:54 +0800)] 
media: nuvoton: npcm-video: Prevent returning unsupported resolutions

To restrict the returned resolution due to Nuvoton SoC hardware
limitations.

Signed-off-by: Michael Chang <zhang971090220@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: nuvoton: npcm-video: Fix stuck due to no video signal error
Michael Chang [Tue, 8 Apr 2025 05:48:39 +0000 (13:48 +0800)] 
media: nuvoton: npcm-video: Fix stuck due to no video signal error

Fix the issue when start_frame and detect_resolution
functions are executed at the same time, which may cause driver
stops capturing due to status of no video signal error.

Signed-off-by: Michael Chang <zhang971090220@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: platform: cros-ec: Add Dirks to the match table
Kells Ping [Tue, 8 Apr 2025 02:53:09 +0000 (10:53 +0800)] 
media: platform: cros-ec: Add Dirks to the match table

The Google Dirks device uses the same approach as the Google Brask
which enables the HDMI CEC via the cros-ec-cec driver.

Signed-off-by: Kells Ping <kellsping@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: mgb4: Fix resolution change events triggering
Martin Tůma [Mon, 7 Apr 2025 15:50:35 +0000 (17:50 +0200)] 
media: mgb4: Fix resolution change events triggering

Always generate the resolution change event when the HW reports it and only
discard the streaming termination in case the new resolution is the same as
the old one. The old logic prevented events on
"no signal" -> "valid resolution" transitions as VIDIOC_QUERY_DV_TIMINGS
never updates the timings when there is no signal present.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: cxusb: no longer judge rbuf when the write fails
Edward Adam Davis [Sat, 5 Apr 2025 11:56:41 +0000 (19:56 +0800)] 
media: cxusb: no longer judge rbuf when the write fails

syzbot reported a uninit-value in cxusb_i2c_xfer. [1]

Only when the write operation of usb_bulk_msg() in dvb_usb_generic_rw()
succeeds and rlen is greater than 0, the read operation of usb_bulk_msg()
will be executed to read rlen bytes of data from the dvb device into the
rbuf.

In this case, although rlen is 1, the write operation failed which resulted
in the dvb read operation not being executed, and ultimately variable i was
not initialized.

[1]
BUG: KMSAN: uninit-value in cxusb_gpio_tuner drivers/media/usb/dvb-usb/cxusb.c:124 [inline]
BUG: KMSAN: uninit-value in cxusb_i2c_xfer+0x153a/0x1a60 drivers/media/usb/dvb-usb/cxusb.c:196
 cxusb_gpio_tuner drivers/media/usb/dvb-usb/cxusb.c:124 [inline]
 cxusb_i2c_xfer+0x153a/0x1a60 drivers/media/usb/dvb-usb/cxusb.c:196
 __i2c_transfer+0xe25/0x3150 drivers/i2c/i2c-core-base.c:-1
 i2c_transfer+0x317/0x4a0 drivers/i2c/i2c-core-base.c:2315
 i2c_transfer_buffer_flags+0x125/0x1e0 drivers/i2c/i2c-core-base.c:2343
 i2c_master_send include/linux/i2c.h:109 [inline]
 i2cdev_write+0x210/0x280 drivers/i2c/i2c-dev.c:183
 do_loop_readv_writev fs/read_write.c:848 [inline]
 vfs_writev+0x963/0x14e0 fs/read_write.c:1057
 do_writev+0x247/0x5c0 fs/read_write.c:1101
 __do_sys_writev fs/read_write.c:1169 [inline]
 __se_sys_writev fs/read_write.c:1166 [inline]
 __x64_sys_writev+0x98/0xe0 fs/read_write.c:1166
 x64_sys_call+0x2229/0x3c80 arch/x86/include/generated/asm/syscalls_64.h:21
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported-by: syzbot+526bd95c0ec629993bf3@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=526bd95c0ec629993bf3
Tested-by: syzbot+526bd95c0ec629993bf3@syzkaller.appspotmail.com
Fixes: 22c6d93a7310 ("[PATCH] dvb: usb: support Medion hybrid USB2.0 DVB-T/analogue box")
Cc: stable@vger.kernel.org
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: tw5864: Replace deprecated PCI functions
Philipp Stanner [Fri, 4 Apr 2025 13:53:45 +0000 (15:53 +0200)] 
media: tw5864: Replace deprecated PCI functions

pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
pcim_iomap_regions(), furthermore, has so far wrongly been passed the
device's name instead of the driver's name, which makes that function's
debug prints useless.

Replace the deprecated function with pcim_iomap_region().

Define the driver name globally and use it where appropriate.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: solo6x10: Replace deprecated PCI functions
Philipp Stanner [Fri, 4 Apr 2025 13:53:44 +0000 (15:53 +0200)] 
media: solo6x10: Replace deprecated PCI functions

pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
Replace them with pcim_iomap_region().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: pt3: Replace deprecated PCI functions
Philipp Stanner [Fri, 4 Apr 2025 13:53:42 +0000 (15:53 +0200)] 
media: pt3: Replace deprecated PCI functions

pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
Replace them with pcim_iomap_region().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Tested-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: cec: extron-da-hd-4k-plus: Fix Wformat-truncation
Hans Verkuil [Tue, 1 Apr 2025 14:17:55 +0000 (14:17 +0000)] 
media: cec: extron-da-hd-4k-plus: Fix Wformat-truncation

Fix gcc8 warning:

drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c:1014:44: warning: 'DCEC' directive output may be truncated writing 4 bytes into a region of size between 0 and 53 [-Wformat-truncation=]

Resizing the 'buf' and 'cmd' arrays fixed the warning.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: atomisp: Fix Wformat-truncation warning
Ricardo Ribalda [Tue, 1 Apr 2025 14:17:54 +0000 (14:17 +0000)] 
media: atomisp: Fix Wformat-truncation warning

Gcc8 is convinced that we do not have enough space in dot_id_input_bin.
Extend the variable 17 bytes which is just used for debugging.

drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:1336:9: warning: '(pipe' directive output may be truncated writing 5 bytes into a region of size between 1 and 74 [-Wformat-truncation=]

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: videobuf2: check constants during build time
Michał Mirosław [Fri, 28 Mar 2025 22:05:27 +0000 (23:05 +0100)] 
media: videobuf2: check constants during build time

There is nothing a driver author can do fix in the driver to make the
global constants match. Since the assertion can be verified at build
time, don't return EINVAL at runtime for it.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: vivid: Add more webcam resolutions
Ricardo Ribalda [Fri, 14 Mar 2025 12:39:41 +0000 (12:39 +0000)] 
media: vivid: Add more webcam resolutions

Add 3 more common resolution for webcams. This is required to increase
the test coverage of unit tests based on vivid.

Co-developed-by: Hidenori Kobayashi <hidenorik@chromium.org>
Signed-off-by: Hidenori Kobayashi <hidenorik@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Tested-by: Hidenori Kobayashi <hidenorik@chromium.org> # v4l2-compliance,
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: vivid: Fix requirement about webcam_intervals
Ricardo Ribalda [Fri, 14 Mar 2025 12:39:40 +0000 (12:39 +0000)] 
media: vivid: Fix requirement about webcam_intervals

Since commit f0b4a2c037c0 ("media: vivid: Extend FPS rates offered by
simulated webcam") we do not require twice as many intervals as sizes. In
fact, now we have 13 intervals and 6 sizes.

Fix the comment.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agodocs: media: mgb4: Improve mgb4 driver documentation
Martin Tůma [Tue, 11 Mar 2025 17:31:41 +0000 (18:31 +0100)] 
docs: media: mgb4: Improve mgb4 driver documentation

Add some basic info about the HW/driver + contact info.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: vidtv: Terminating the subsequent process of initialization failure
Edward Adam Davis [Tue, 11 Mar 2025 07:20:14 +0000 (15:20 +0800)] 
media: vidtv: Terminating the subsequent process of initialization failure

syzbot reported a slab-use-after-free Read in vidtv_mux_init. [1]

After PSI initialization fails, the si member is accessed again, resulting
in this uaf.

After si initialization fails, the subsequent process needs to be exited.

[1]
BUG: KASAN: slab-use-after-free in vidtv_mux_pid_ctx_init drivers/media/test-drivers/vidtv/vidtv_mux.c:78 [inline]
BUG: KASAN: slab-use-after-free in vidtv_mux_init+0xac2/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:524
Read of size 8 at addr ffff88802fa42acc by task syz.2.37/6059

CPU: 0 UID: 0 PID: 6059 Comm: syz.2.37 Not tainted 6.14.0-rc5-syzkaller #0
Hardware name: Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:408 [inline]
print_report+0xc3/0x670 mm/kasan/report.c:521
kasan_report+0xd9/0x110 mm/kasan/report.c:634
vidtv_mux_pid_ctx_init drivers/media/test-drivers/vidtv/vidtv_mux.c:78
vidtv_mux_init+0xac2/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:524
vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194
vidtv_start_feed drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
dmx_section_feed_start_filtering drivers/media/dvb-core/dvb_demux.c:973
dvb_dmxdev_feed_start drivers/media/dvb-core/dmxdev.c:508 [inline]
dvb_dmxdev_feed_restart.isra.0 drivers/media/dvb-core/dmxdev.c:537
dvb_dmxdev_filter_stop+0x2b4/0x3a0 drivers/media/dvb-core/dmxdev.c:564
dvb_dmxdev_filter_free drivers/media/dvb-core/dmxdev.c:840 [inline]
dvb_demux_release+0x92/0x550 drivers/media/dvb-core/dmxdev.c:1246
__fput+0x3ff/0xb70 fs/file_table.c:464
task_work_run+0x14e/0x250 kernel/task_work.c:227
exit_task_work include/linux/task_work.h:40 [inline]
do_exit+0xad8/0x2d70 kernel/exit.c:938
do_group_exit+0xd3/0x2a0 kernel/exit.c:1087
__do_sys_exit_group kernel/exit.c:1098 [inline]
__se_sys_exit_group kernel/exit.c:1096 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096
x64_sys_call+0x151f/0x1720 arch/x86/include/generated/asm/syscalls_64.h:232
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f871d58d169
Code: Unable to access opcode bytes at 0x7f871d58d13f.
RSP: 002b:00007fff4b19a788 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f871d58d169
RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fff4b19a7ec R08: 0000000b4b19a87f R09: 00000000000927c0
R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000003
R13: 00000000000927c0 R14: 000000000001d553 R15: 00007fff4b19a840
 </TASK>

Allocated by task 6059:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
 kmalloc_noprof include/linux/slab.h:901 [inline]
 kzalloc_noprof include/linux/slab.h:1037 [inline]
 vidtv_psi_pat_table_init drivers/media/test-drivers/vidtv/vidtv_psi.c:970
 vidtv_channel_si_init drivers/media/test-drivers/vidtv/vidtv_channel.c:423
 vidtv_mux_init drivers/media/test-drivers/vidtv/vidtv_mux.c:519
 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194
 vidtv_start_feed drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
 dmx_section_feed_start_filtering drivers/media/dvb-core/dvb_demux.c:973
 dvb_dmxdev_feed_start drivers/media/dvb-core/dmxdev.c:508 [inline]
 dvb_dmxdev_feed_restart.isra.0 drivers/media/dvb-core/dmxdev.c:537
 dvb_dmxdev_filter_stop+0x2b4/0x3a0 drivers/media/dvb-core/dmxdev.c:564
 dvb_dmxdev_filter_free drivers/media/dvb-core/dmxdev.c:840 [inline]
 dvb_demux_release+0x92/0x550 drivers/media/dvb-core/dmxdev.c:1246
 __fput+0x3ff/0xb70 fs/file_table.c:464
 task_work_run+0x14e/0x250 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0xad8/0x2d70 kernel/exit.c:938
 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087
 __do_sys_exit_group kernel/exit.c:1098 [inline]
 __se_sys_exit_group kernel/exit.c:1096 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096
 x64_sys_call arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 6059:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2353 [inline]
 slab_free mm/slub.c:4609 [inline]
 kfree+0x2c4/0x4d0 mm/slub.c:4757
 vidtv_channel_si_init drivers/media/test-drivers/vidtv/vidtv_channel.c:499
 vidtv_mux_init drivers/media/test-drivers/vidtv/vidtv_mux.c:519
 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194
 vidtv_start_feed drivers/media/test-drivers/vidtv/vidtv_bridge.c:239
 dmx_section_feed_start_filtering drivers/media/dvb-core/dvb_demux.c:973
 dvb_dmxdev_feed_start drivers/media/dvb-core/dmxdev.c:508 [inline]
 dvb_dmxdev_feed_restart.isra.0 drivers/media/dvb-core/dmxdev.c:537
 dvb_dmxdev_filter_stop+0x2b4/0x3a0 drivers/media/dvb-core/dmxdev.c:564
 dvb_dmxdev_filter_free drivers/media/dvb-core/dmxdev.c:840 [inline]
 dvb_demux_release+0x92/0x550 drivers/media/dvb-core/dmxdev.c:1246
 __fput+0x3ff/0xb70 fs/file_table.c:464
 task_work_run+0x14e/0x250 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0xad8/0x2d70 kernel/exit.c:938
 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087
 __do_sys_exit_group kernel/exit.c:1098 [inline]
 __se_sys_exit_group kernel/exit.c:1096 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096
 x64_sys_call arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: 3be8037960bc ("media: vidtv: add error checks")
Cc: stable@vger.kernel.org
Reported-by: syzbot+0d33ab192bd50b6c91e6@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=0d33ab192bd50b6c91e6
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: pvrusb2: Remove unused pvr2_std_create_enum
Dr. David Alan Gilbert [Sun, 9 Mar 2025 00:14:31 +0000 (00:14 +0000)] 
media: pvrusb2: Remove unused pvr2_std_create_enum

pvr2_std_create_enum() has been unused since 2012's
commit c0bb609fdc0b ("[media] pvrusb2: Get rid of obsolete code for video
standard enumeration")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: s5p-mfc: Support for handling RET_ENC_BUFFER_FULL interrupt
Aakarsh Jain [Wed, 5 Mar 2025 05:53:08 +0000 (11:23 +0530)] 
media: s5p-mfc: Support for handling RET_ENC_BUFFER_FULL interrupt

When output encoded buffer size provided by userspace
is insufficient with current encoding parameters, it
leads to RET_ENC_BUFFER_FULL interrupt which was not
handled in IRQ handler.

On handling of RET_ENC_BUFFER_FULL interrupt leads to
NAL_ABORT command from host to risc which in turn leads
to RET_NAL_ABORT interrupt. On receiving RET_NAL_ABORT
driver clears workbit and VB2 queues for cleaner closing
of MFC instance.

When user encounters "Call on DQBUF after unrecoverable
error", userspace should close fd and restart with larger
output encoder buffer size.

Signed-off-by: Aakarsh Jain <aakarsh.jain@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: vim2m: Add parametized support for multiplanar API
Matthew Majewski [Tue, 4 Mar 2025 19:17:01 +0000 (14:17 -0500)] 
media: vim2m: Add parametized support for multiplanar API

Add support for the mulitiplaner API. The device can now act as
either a multi-planar or a single-planar device depending on a module
parameter, similar to the way vivid behaves.

Multiplanar support was added by implementing the appropate
try/get/set mplane functions, and by modifying the queue_setup() and
buf_prepare() functions to handle multiple planes. Implementation
was inspired by vivid.

Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: vim2m: Simplify try_fmt
Matthew Majewski [Tue, 4 Mar 2025 19:17:00 +0000 (14:17 -0500)] 
media: vim2m: Simplify try_fmt

Clean up vidioc_try_fmt with the following changes:

1. remove unsused vim2m_fmt parameter
2. use clamp() macro to restrain width/height bounds
3. use ALIGN() macro to align width/height
4. use v4l2_fill_pixfmt to set bytesperline/sizeimage

Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: v4l2-common: Add RGBR format info
Matthew Majewski [Tue, 4 Mar 2025 19:16:59 +0000 (14:16 -0500)] 
media: v4l2-common: Add RGBR format info

Add missing RGBR entry in the v4l2_format_info[] table.

RGBR has identical format information to RGBP, as it is a
big endian variant of RGB-5-6-5 pixel encoding according to the
description in videodev2.h.

Signed-off-by: Matthew Majewski <mattwmajewski@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: remove STA2x11 media pci driver
Lukas Bulwahn [Mon, 3 Mar 2025 10:30:22 +0000 (11:30 +0100)] 
media: remove STA2x11 media pci driver

With commit dcbb01fbb7ae ("x86/pci: Remove old STA2x11 support"), the
STA2X11 Video Input Port driver is not needed and cannot be built anymore.

Remove the driver and its reference in media documentation.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: switch to {enable,disable}_streams
Tarang Raval [Sat, 29 Mar 2025 05:43:31 +0000 (11:13 +0530)] 
media: i2c: imx334: switch to {enable,disable}_streams

Switch from s_stream to enable_streams and disable_streams callbacks.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Use subdev state lock for synchronization
Tarang Raval [Sat, 29 Mar 2025 05:43:30 +0000 (11:13 +0530)] 
media: i2c: imx334: Use subdev state lock for synchronization

Replace the custom mutex in the imx334 driver with the V4L2 subdev state
lock for control synchronization. Initialize the subdev with
v4l2_subdev_init_finalize in imx334_probe, adding proper cleanup in error
paths and imx334_remove. This aligns the driver with V4L2 standards.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Enable runtime PM before sub-device registration
Tarang Raval [Sat, 29 Mar 2025 05:43:29 +0000 (11:13 +0530)] 
media: i2c: imx334: Enable runtime PM before sub-device registration

Runtime PM is fully initialized before calling
v4l2_async_register_subdev_sensor(). Moving the runtime PM initialization
earlier prevents potential access to an uninitialized or powered-down
device.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Fix runtime PM handling in remove function
Tarang Raval [Sat, 29 Mar 2025 05:43:28 +0000 (11:13 +0530)] 
media: i2c: imx334: Fix runtime PM handling in remove function

pm_runtime_suspended() only checks the current runtime PM status and does
not modify it, making it ineffective in this context. This could result in
improper power management if the device remains active when removed.

This patch fixes the issue by introducing a check with
pm_runtime_status_suspended() to determine if the device is already
suspended. If it is not, it calls imx334_power_off() to power down the
device and then uses pm_runtime_set_suspended() to correctly update the
runtime PM status to suspended.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Fix power management and control handling
Tarang Raval [Sat, 29 Mar 2025 05:43:27 +0000 (11:13 +0530)] 
media: i2c: imx334: Fix power management and control handling

Some controls may need the sensor to be powered on to update their
values. Currently, only the exposure control does this. To ensure
proper handling, the power-up sequence is moved outside the switch-case.

Additionally, VBLANK control is now processed earlier so its changes
can correctly affect other controls.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Configure lane mode dynamically
Tarang Raval [Sat, 29 Mar 2025 05:43:26 +0000 (11:13 +0530)] 
media: i2c: imx334: Configure lane mode dynamically

Configure the lane mode dynamically from the streaming
function instead of using a hardcoded value.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
[Sakari Ailus: Fix checkpatch.pl issue, lower Dynamically.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Remove redundant register entries
Tarang Raval [Sat, 29 Mar 2025 05:43:25 +0000 (11:13 +0530)] 
media: i2c: imx334: Remove redundant register entries

IMX334_REG_{ADBIT, MDBIT, ADBIT1}: Already written in
imx334_set_framefmt function.

IMX334_REG_THSPREPARE: Unnecessary repeated writes removed.

CCI_REG8(0x3e04): Unnecessary repeated writes removed.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Convert to CCI register access helpers
Tarang Raval [Sat, 29 Mar 2025 05:43:24 +0000 (11:13 +0530)] 
media: i2c: imx334: Convert to CCI register access helpers

Use the new common CCI register access helpers to replace the private
register access helpers in the imx334 driver. This simplifies the driver
by reducing the amount of code.

Acked-by: Shravan Chippa <Shravan.Chippa@microchip.com>
Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: i2c: imx334: Simplify with dev_err_probe()
Tarang Raval [Sat, 29 Mar 2025 05:43:23 +0000 (11:13 +0530)] 
media: i2c: imx334: Simplify with dev_err_probe()

Error handling in probe() can be a bit simpler with dev_err_probe().

also, Added missing newline characters (\n) in error messages.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
3 months agomedia: intel/ipu6: Fix dma mask for non-secure mode
Stanislaw Gruszka [Thu, 10 Apr 2025 09:47:06 +0000 (11:47 +0200)] 
media: intel/ipu6: Fix dma mask for non-secure mode

We use dma_get_mask() of auxdev device for calculate iova pfn limit.
This is always 32 bit mask as we do not initialize the mask (and we can
not do so, since dev->dev_mask is NULL anyways for auxdev).

Since we need 31 bit mask for non-secure mode use mmu_info->aperture_end
which is properly initialized to correct mask for both modes.

Fixes: daabc5c64703 ("media: ipu6: not override the dma_ops of device in driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>