]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
2 months agomedia: rkvdec: h264: Limit minimum profile to constrained baseline
Sebastian Fricke [Thu, 1 May 2025 19:55:47 +0000 (15:55 -0400)] 
media: rkvdec: h264: Limit minimum profile to constrained baseline

Neither the hardware nor the kernel API support FMO/ASO features
required by the full baseline profile. Therefore limit the minimum
profile to the constrained baseline profile explicitly.

Suggested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: mediatek: jpeg: support 34bits
Jianhua Lin [Thu, 24 Apr 2025 09:08:24 +0000 (17:08 +0800)] 
media: mediatek: jpeg: support 34bits

The HW iommu is able to support a 34-bit iova address-space (16GB),
enable this feature for the encoder/decoder driver by shifting the
address by two bits and setting the extended address registers.

Signed-off-by: Jianhua Lin <jianhua.lin@mediatek.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: verisilicon: Free post processor buffers on error
Detlev Casanova [Fri, 25 Apr 2025 19:24:47 +0000 (15:24 -0400)] 
media: verisilicon: Free post processor buffers on error

During initialization, the post processor allocates the same number of
buffers as the buf queue.
As the init function is called in streamon(), if an allocation fails,
streamon will return an error and streamoff() will not be called, keeping
all post processor buffers allocated.

To avoid that, all post proc buffers are freed in case of an allocation
error.

Fixes: 26711491a807 ("media: verisilicon: Refactor postprocessor to store more buffers")
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: mtk-mdp3: Remove unused mdp_get_plat_device
Dr. David Alan Gilbert [Wed, 5 Feb 2025 02:18:34 +0000 (02:18 +0000)] 
media: platform: mtk-mdp3: Remove unused mdp_get_plat_device

mdp_get_plat_device() was added in 2022 but has remained unused.

Remove it.

Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver")
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: amlogic: c3-mipi-csi2: Handle 64-bits division
Jacopo Mondi [Sat, 10 May 2025 08:48:52 +0000 (10:48 +0200)] 
media: amlogic: c3-mipi-csi2: Handle 64-bits division

The kernel test robot reports the following error when building on
Hexagon with hexagon-allmodconfig.

ERROR: modpost: "__hexagon_divdi3"
[drivers/media/platform/amlogic/c3/mipi-csi2/c3-mipi-csi2.ko] undefined!

The error is caused by using DIV_ROUND_UP() with a 64 bits divisor with
a 32-bit dividend, which on Hexagon and clang-17 is resolved with a call
to the __hexagon_divdi3() helper function, part of the compiler support
library and not available when building Linux.

Use DIV_ROUND_UP_ULL() to fix the build error and avoid calling the
__hexagon_divdi3() helper function.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505101334.UHxNcUUO-lkp@intel.com/
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Use dev_err_probe for devm_gpiod_get_optional
Ricardo Ribalda [Thu, 13 Mar 2025 12:20:40 +0000 (12:20 +0000)] 
media: uvcvideo: Use dev_err_probe for devm_gpiod_get_optional

Use the dev_err_probe() helper for devm_gpiod_get_optional(), like we do
with gpiod_to_irq()

That eventually calls device_set_deferred_probe_reason() which can be
helpful for tracking down problems.

Now that all the error paths in uvc_gpio_parse have dev_err_probe, we
can remove the error message in uvc_probe.

Suggested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250313-uvc-eprobedefer-v3-2-a1d312708eef@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Fix deferred probing error
Ricardo Ribalda [Thu, 13 Mar 2025 12:20:39 +0000 (12:20 +0000)] 
media: uvcvideo: Fix deferred probing error

uvc_gpio_parse() can return -EPROBE_DEFER when the GPIOs it depends on
have not yet been probed. This return code should be propagated to the
caller of uvc_probe() to ensure that probing is retried when the required
GPIOs become available.

Currently, this error code is incorrectly converted to -ENODEV,
causing some internal cameras to be ignored.

This commit fixes this issue by propagating the -EPROBE_DEFER error.

Cc: stable@vger.kernel.org
Fixes: 2886477ff987 ("media: uvcvideo: Implement UVC_EXT_GPIO_UNIT")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250313-uvc-eprobedefer-v3-1-a1d312708eef@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Rollback non processed entities on error
Ricardo Ribalda [Mon, 24 Feb 2025 10:34:55 +0000 (10:34 +0000)] 
media: uvcvideo: Rollback non processed entities on error

If we fail to commit an entity, we need to restore the
UVC_CTRL_DATA_BACKUP for the other uncommitted entities. Otherwise the
control cache and the device would be out of sync.

Cc: stable@kernel.org
Fixes: b4012002f3a3 ("[media] uvcvideo: Add support for control events")
Reported-by: Hans de Goede <hdegoede@redhat.com>
Closes: https://lore.kernel.org/linux-media/fe845e04-9fde-46ee-9763-a6f00867929a@redhat.com/
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250224-uvc-data-backup-v2-3-de993ed9823b@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Send control events for partial succeeds
Ricardo Ribalda [Mon, 24 Feb 2025 10:34:54 +0000 (10:34 +0000)] 
media: uvcvideo: Send control events for partial succeeds

Today, when we are applying a change to entities A, B. If A succeeds and B
fails the events for A are not sent.

This change changes the code so the events for A are send right after
they happen.

Cc: stable@kernel.org
Fixes: b4012002f3a3 ("[media] uvcvideo: Add support for control events")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250224-uvc-data-backup-v2-2-de993ed9823b@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Return the number of processed controls
Ricardo Ribalda [Mon, 24 Feb 2025 10:34:53 +0000 (10:34 +0000)] 
media: uvcvideo: Return the number of processed controls

If we let know our callers that we have not done anything, they will be
able to optimize their decisions.

Cc: stable@kernel.org
Fixes: b4012002f3a3 ("[media] uvcvideo: Add support for control events")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250224-uvc-data-backup-v2-1-de993ed9823b@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Do not turn on the camera for some ioctls
Ricardo Ribalda [Thu, 27 Mar 2025 21:05:31 +0000 (21:05 +0000)] 
media: uvcvideo: Do not turn on the camera for some ioctls

There are some ioctls that do not need to turn on the camera. Do not
call uvc_pm_get in those cases.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250327-uvc-granpower-ng-v6-5-35a2357ff348@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Make power management granular
Ricardo Ribalda [Thu, 27 Mar 2025 21:05:30 +0000 (21:05 +0000)] 
media: uvcvideo: Make power management granular

Now that every ioctl takes care of their power management we can remove
the "global" power management.

Despite its size, this is a relatively big change. We hope that there
are no size effects of it. If there are some specific devices that
miss-behave, we can add a small quirk for them.

This patch introduces a behavioral change for the uvc "trigger" button.
Before the "trigger" button would work as long as userspace has opened
/dev/videoX. Now it only works when the camera is actually streaming. We
consider that this the most common (if not the only) usecase and
therefore we do not think of this as a regression.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250327-uvc-granpower-ng-v6-4-35a2357ff348@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Increase/decrease the PM counter per IOCTL
Ricardo Ribalda [Thu, 27 Mar 2025 21:05:29 +0000 (21:05 +0000)] 
media: uvcvideo: Increase/decrease the PM counter per IOCTL

Now we call uvc_pm_get/put from the device open/close. This low
level of granularity might leave the camera powered on in situations
where it is not needed.

Increase the granularity by increasing and decreasing the Power
Management counter per ioctl. There are two special cases where the
power management outlives the ioctl: async controls and streamon. Handle
those cases as well.

In a future patch, we will remove the uvc_pm_get/put from open/close.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250327-uvc-granpower-ng-v6-3-35a2357ff348@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Create uvc_pm_(get|put) functions
Ricardo Ribalda [Thu, 27 Mar 2025 21:05:28 +0000 (21:05 +0000)] 
media: uvcvideo: Create uvc_pm_(get|put) functions

Most of the times that we have to call uvc_status_(get|put) we need to
call the usb_autopm_ functions.

Create a new pair of functions that automate this for us. This
simplifies the current code and future PM changes in the driver.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250327-uvc-granpower-ng-v6-2-35a2357ff348@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: uvcvideo: Keep streaming state in the file handle
Ricardo Ribalda [Thu, 27 Mar 2025 21:05:27 +0000 (21:05 +0000)] 
media: uvcvideo: Keep streaming state in the file handle

Add a variable in the file handle state to figure out if a camera is in
the streaming state or not. This variable will be used in the future for
power management policies.

Now that we are at it, make use of guards to simplify the code.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250327-uvc-granpower-ng-v6-1-35a2357ff348@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agoDocumentation: media: Add documentation file c3-isp.rst
Keke Li [Sun, 27 Apr 2025 06:27:18 +0000 (14:27 +0800)] 
Documentation: media: Add documentation file c3-isp.rst

Add the file 'c3-isp.rst' that documents the c3-isp driver.

Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agoDocumentation: media: Add documentation file metafmt-c3-isp.rst
Keke Li [Sun, 27 Apr 2025 06:27:17 +0000 (14:27 +0800)] 
Documentation: media: Add documentation file metafmt-c3-isp.rst

Add the file 'metafmt-c3-isp.rst' that documents
the meta format of c3-isp.

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: Add C3 ISP driver
Keke Li [Sun, 27 Apr 2025 06:27:16 +0000 (14:27 +0800)] 
media: platform: Add C3 ISP driver

The C3 ISP supports multi-camera and multi-exposure HDR, integrates
advanced imaging technologies for optimal quality, and drives the
core pipeline to transform raw sensor data into high-fidelity images
through demosaicing, color correction, and tone mapping operations.

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: drop unnecessary vb2_ops_wait_prepare/finish callbacks]

2 months agomedia: uapi: Add stats info and parameters buffer for C3 ISP
Keke Li [Sun, 27 Apr 2025 06:27:15 +0000 (14:27 +0800)] 
media: uapi: Add stats info and parameters buffer for C3 ISP

Add a header that describes the 3A statistics buffer and the
parameters buffer for C3 ISP

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: Add C3ISP_PARAMS and C3ISP_STATS meta formats
Keke Li [Sun, 27 Apr 2025 06:27:14 +0000 (14:27 +0800)] 
media: Add C3ISP_PARAMS and C3ISP_STATS meta formats

C3ISP_PARAMS is the C3 ISP Parameters format.
C3ISP_STATS is the C3 ISP Statistics format.

Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: dt-bindings: Add amlogic,c3-isp.yaml
Keke Li [Sun, 27 Apr 2025 06:27:13 +0000 (14:27 +0800)] 
media: dt-bindings: Add amlogic,c3-isp.yaml

c3-isp is used to process raw image.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: Add C3 MIPI adapter driver
Keke Li [Sun, 27 Apr 2025 06:27:12 +0000 (14:27 +0800)] 
media: platform: Add C3 MIPI adapter driver

Add a driver for the MIPI adapter unit found on the Amlogic C3 SoC.

This driver is used to align the MIPI data from the MIPI CSI-2 receiver
unit and send the aligned data to the ISP unit.

Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: dt-bindings: Add amlogic,c3-mipi-adapter.yaml
Keke Li [Sun, 27 Apr 2025 06:27:11 +0000 (14:27 +0800)] 
media: dt-bindings: Add amlogic,c3-mipi-adapter.yaml

c3-mipi-adapter is used to organize mipi data and
send raw data to ISP module.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: Add C3 MIPI CSI-2 driver
Keke Li [Sun, 27 Apr 2025 06:27:10 +0000 (14:27 +0800)] 
media: platform: Add C3 MIPI CSI-2 driver

Add a driver for the CSI-2 receiver unit found on the Amlogic C3 SoC.

Create a drivers/media/platform/amlogic/c3/ directory to host the driver
and the forthcoming support for the Amlogic C3 MIPI adapter and C3 ISP.

This driver is used to receive the MIPI data from image sensor.

Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: fix typo: uinit -> unit]

2 months agomedia: dt-bindings: Add amlogic,c3-mipi-csi2.yaml
Keke Li [Sun, 27 Apr 2025 06:27:09 +0000 (14:27 +0800)] 
media: dt-bindings: Add amlogic,c3-mipi-csi2.yaml

c3-mipi-csi2 is used to receive mipi data from image sensor.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov02c10: Use div_u64 to divide a 64-bit number
Sakari Ailus [Fri, 9 May 2025 06:25:11 +0000 (09:25 +0300)] 
media: ov02c10: Use div_u64 to divide a 64-bit number

The ov02c10 driver divides a 64-bit number but reply relies on division
operator to do that. Use div_u64() so this will compile everywhere.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: platform: cros-ec: select ports ab for Dirks
Kells Ping [Thu, 8 May 2025 08:19:04 +0000 (16:19 +0800)] 
media: platform: cros-ec: select ports ab for Dirks

The Google Dirks device used the wrong ports, fix this.

Signed-off-by: Kells Ping <kells.ping@quanta.corp-partner.google.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: fixed outdated subject and commit log]

2 months agomedia: omap3isp: use sgtable-based scatterlist wrappers
Marek Szyprowski [Wed, 7 May 2025 16:09:13 +0000 (18:09 +0200)] 
media: omap3isp: use sgtable-based scatterlist wrappers

Use common wrappers operating directly on the struct sg_table objects to
fix incorrect use of scatterlists sync calls. dma_sync_sg_for_*()
functions have to be called with the number of elements originally passed
to dma_map_sg_*() function, not the one returned in sgtable's nents.

Fixes: d33186d0be18 ("[media] omap3isp: ccdc: Use the DMA API for LSC")
Fixes: 0e24e90f2ca7 ("[media] omap3isp: stat: Use the DMA API")
CC: stable@vger.kernel.org
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: videobuf2: use sgtable-based scatterlist wrappers
Marek Szyprowski [Wed, 7 May 2025 16:09:11 +0000 (18:09 +0200)] 
media: videobuf2: use sgtable-based scatterlist wrappers

Use common wrappers operating directly on the struct sg_table objects to
fix incorrect use of scatterlists sync calls. dma_sync_sg_for_*()
functions have to be called with the number of elements originally passed
to dma_map_sg_*() function, not the one returned in sgt->nents.

Fixes: d4db5eb57cab ("media: videobuf2: add begin/end cpu_access callbacks to dma-sg")
CC: stable@vger.kernel.org
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: synopsys: hdmirx: Count dropped frames
Nicolas Dufresne [Thu, 10 Apr 2025 20:43:47 +0000 (16:43 -0400)] 
media: synopsys: hdmirx: Count dropped frames

The sequence number communicate the lost frames to userspace. For this
reason, it must be incremented even when a frame is skipped. This allows
userspace such as GStreamer to report the loss.

Fixes: 7b59b132ad439 ("media: platform: synopsys: Add support for HDMI input driver")
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: synopsys: hdmirx: Renamed frame_idx to sequence
Nicolas Dufresne [Thu, 10 Apr 2025 20:43:46 +0000 (16:43 -0400)] 
media: synopsys: hdmirx: Renamed frame_idx to sequence

This variable is used to fill the v4l2_buffer.sequence, let's name it
the exact same way to reduce confusion.

No functional changes.

Fixes: 7b59b132ad439 ("media: platform: synopsys: Add support for HDMI input driver")
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: v4l: subdev: Fix coverity issue: Logically dead code
Chris Green [Tue, 8 Apr 2025 20:31:25 +0000 (21:31 +0100)] 
media: v4l: subdev: Fix coverity issue: Logically dead code

The conditional (type == V4L2_TUNER_RADIO) always evaluates true due to the
earlier check for (type != V4L2_TUNER_RADIO) (line 2826)

CID: 1226742

Signed-off-by: Chris Green <chris.e.green@hotmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: v4l2-dev: fix error handling in __video_register_device()
Ma Ke [Wed, 19 Mar 2025 08:02:48 +0000 (16:02 +0800)] 
media: v4l2-dev: fix error handling in __video_register_device()

Once device_register() failed, we should call put_device() to
decrement reference count for cleanup. Or it could cause memory leak.
And move callback function v4l2_device_release() and v4l2_device_get()
before put_device().

As comment of device_register() says, 'NOTE: _Never_ directly free
@dev after calling this function, even if it returned an error! Always
use put_device() to give up the reference initialized in this function
instead.'

Found by code review.

Cc: stable@vger.kernel.org
Fixes: dc93a70cc7f9 ("V4L/DVB (9973): v4l2-dev: use the release callback from device instead of cdev")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agodt-bindings: media: convert imx.txt to yaml format
Frank Li [Wed, 16 Apr 2025 15:47:27 +0000 (11:47 -0400)] 
dt-bindings: media: convert imx.txt to yaml format

Convert binding doc imx.txt to yaml format. Create two yaml files:
fsl,imx6-mipi-csi2.yaml and fsl,imx-capture-subsystem.yaml.

Additional changes:
- add example for fsl,imx6-mipi-csi2
- add irq err1 and err2 description
- update MAINTAINERS

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: drop empty line at the end of the yaml files]

2 months agomedia: dt-bindings: sony,imx290: Update usage example
Niklas Söderlund [Wed, 30 Apr 2025 12:53:22 +0000 (14:53 +0200)] 
media: dt-bindings: sony,imx290: Update usage example

Since commit 98e0500eadb7 ("media: i2c: imx290: Add configurable link
frequency and pixel rate") the driver expects two specific
link-frequency settings 2-lane (445500000297000000) and 4-lane
(222750000148500000) operation. The driver fails to probe without
these exact settings.

Update the example in the bindings to match this to make it easier for
users to incorporate this sensor in their device tree descriptions
without having to read the driver sources when the driver fails to
probe.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: intel/ipu6: Change deprecated lock comment
Stanislaw Gruszka [Fri, 2 May 2025 15:44:44 +0000 (17:44 +0200)] 
media: intel/ipu6: Change deprecated lock comment

pre_streamon_queued is no longer used. The lock now is protecting active
and incoming lists.

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>
2 months agomedia: intel/ipu6: Remove line_align
Stanislaw Gruszka [Fri, 2 May 2025 15:44:43 +0000 (17:44 +0200)] 
media: intel/ipu6: Remove line_align

isys->line_align value is only used in one place and we can just use
the proper value directly there.

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>
2 months agomedia: intel/ipu6: Remove pin_ready function pointer
Stanislaw Gruszka [Fri, 2 May 2025 15:44:42 +0000 (17:44 +0200)] 
media: intel/ipu6: Remove pin_ready function pointer

We can call ipu6_isys_queue_buf_ready() directly. The only current
usage is pin_ready pointer is to check if pin was prepared before
IPU6_FW_ISYS_RESP_TYPE_PIN_DATA_READY interrupt, we can use queue
pointer for that purpose.

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>
2 months agomedia: i2c: imx335: Fix frame size enumeration
Kieran Bingham [Wed, 30 Apr 2025 07:36:49 +0000 (08:36 +0100)] 
media: i2c: imx335: Fix frame size enumeration

In commit cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit
mode") the IMX335 driver was extended to support multiple output
bitdepth modes.

This incorrectly extended the frame size enumeration to check against
the supported mbus_codes array instead of the supported mode/frame
array. This has the unwanted side effect of reporting the currently
supported frame size 2592x1944 three times.

Fix the check accordingly to report a frame size for each supported
size, which is presently only a single entry.

Fixes: cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit mode")
Cc: stable@vger.kernel.org
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: ds90ub960: Fix uninitialized variable in ub960_rxport_bc_ser_config()
Dan Carpenter [Wed, 30 Apr 2025 08:27:42 +0000 (11:27 +0300)] 
media: i2c: ds90ub960: Fix uninitialized variable in ub960_rxport_bc_ser_config()

The "ret" variable is not initialized on success.  Set it to zero.

Fixes: e2a3b695bc5f ("media: i2c: ds90ub960: Configure serializer using back-channel")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: ds90ub960: Fix uninitialized variable in ub960_serializer_temp_ramp()
Dan Carpenter [Wed, 30 Apr 2025 08:27:36 +0000 (11:27 +0300)] 
media: i2c: ds90ub960: Fix uninitialized variable in ub960_serializer_temp_ramp()

The "ret" variable is not initialized on the success path.

Fixes: a05744749600 ("media: i2c: ds90ub9xx: Set serializer temperature ramp")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: imx334: uninitialized variable in imx334_update_exp_gain()
Dan Carpenter [Wed, 30 Apr 2025 08:27:30 +0000 (11:27 +0300)] 
media: i2c: imx334: uninitialized variable in imx334_update_exp_gain()

The "ret" variable is not initialized on the success path.  Set it to
zero.

Fixes: 7b19b0fc8ac8 ("media: i2c: imx334: Convert to CCI register access helpers")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov08x40: Select mode based on mipi lane count
Jason Chen [Wed, 23 Apr 2025 17:56:36 +0000 (01:56 +0800)] 
media: ov08x40: Select mode based on mipi lane count

Use the v4l2_find_nearest_size_conditional() helper to figure out which
drive-supported lane can be used on a given system.
Also avoid exposing duplicate frame sizes to userspace when multiple
modes share the same resolution but differ in lane count.

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov08x40: Use v4l2_link_freq_to_bitmap helper
Jason Chen [Wed, 23 Apr 2025 17:56:35 +0000 (01:56 +0800)] 
media: ov08x40: Use v4l2_link_freq_to_bitmap helper

Use the v4l2_link_freq_to_bitmap() helper to figure out which
driver-supported link frequencies can be used on a given system.

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: drop unused variable 'max']

2 months agomedia: ov08x40: Add shared global register list
Jason Chen [Wed, 23 Apr 2025 17:56:34 +0000 (01:56 +0800)] 
media: ov08x40: Add shared global register list

This follows the previous cleanup commit where duplicate entries were
removed from each mode's register list.

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov08x40: Remove common register settings from resolution-specific table
Jason Chen [Wed, 23 Apr 2025 17:56:33 +0000 (01:56 +0800)] 
media: ov08x40: Remove common register settings from resolution-specific table

Prepare for refactoring register table by removing register entries
that are common across all modes from resolution-specific table
These will be moved into a shared common register array in the next commit.

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov08x40: Add support for 2/4 lanes at 1500 Mbps
Jason Chen [Wed, 23 Apr 2025 17:56:32 +0000 (01:56 +0800)] 
media: ov08x40: Add support for 2/4 lanes at 1500 Mbps

Add register settings for 1500Mbps to support both 2-lane
and 4-lane configurations

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov08x40: Separate the lane configuration and PLL settings
Jason Chen [Wed, 23 Apr 2025 17:56:31 +0000 (01:56 +0800)] 
media: ov08x40: Separate the lane configuration and PLL settings

To prepare upcoming support of multiple sensor modes,
this change separates the lane configuration and PLL settings
from the original mode-specific settings.

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: common: Add v4l2_find_nearest_size_conditional()
Sakari Ailus [Wed, 5 Mar 2025 09:22:01 +0000 (11:22 +0200)] 
media: common: Add v4l2_find_nearest_size_conditional()

v4l2_find_nearest_size() returns a mode from sensor driver's mode list
that is a best match width and height wise for the sensor. Some drivers
have different set of available modes depending on the number of lanes.
While this could be handled within a driver by providing different lists
of modes, provide a helper v4l2_find_nearest_size_conditional() to ignore
modes that aren't available.

Also use size_t for the array index and remove extra commas while at it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: ov13b10: Support 2 lane mode
Hao Yao [Wed, 12 Mar 2025 02:06:28 +0000 (10:06 +0800)] 
media: i2c: ov13b10: Support 2 lane mode

1. Fix pixel rate calculation to consider different lane number
2. Add 2104x1560 60fps 2 data lanes register setting
3. Support 2 lane in check_hwcfg
4. Select correct mode considering lane number used

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: ov13b10: Improve code readability
Hao Yao [Wed, 12 Mar 2025 02:06:27 +0000 (10:06 +0800)] 
media: i2c: ov13b10: Improve code readability

Use mode instead of ov13b->cur_mode in set_pad_format.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
[hverkuil: fix typo: redability -> readability]

2 months agomedia: i2c: ov13b10: Fix h_blank calculation
Hao Yao [Wed, 12 Mar 2025 02:06:26 +0000 (10:06 +0800)] 
media: i2c: ov13b10: Fix h_blank calculation

Pixel per line (PPL) is calculated as pixel_rate / (VTS * FPS), which
is not decided by MIPI CSI-2 link frequency. PPL can vary while link
frequency keeps the same. If PPL is wrong, the h_blank = PPL - width
is also wrong then FPS control is inaccurate.

This patch fix h_blank by:
1. Move PPL from link_freq_config to ov13b10_mode
2. Add PPL value for different modes
3. Use PPL from mode to calculate h_blank

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agoMAINTAINERS: adjust file entry in OMNIVISION OV7670 SENSOR DRIVER
Lukas Bulwahn [Sun, 4 May 2025 03:35:02 +0000 (05:35 +0200)] 
MAINTAINERS: adjust file entry in OMNIVISION OV7670 SENSOR DRIVER

Commit 59b24c0047a2 ("media: dt-bindings: media: i2c: align filenames
format with standard") renames the files in
Documentation/devicetree/bindings/media/i2c/, but misses to adjust the file
entry in OMNIVISION OV7670 SENSOR DRIVER.

Adjust the file entry after this renaming.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: rdacm2x: Make use of device properties
Andy Shevchenko [Mon, 31 Mar 2025 08:35:04 +0000 (11:35 +0300)] 
media: i2c: rdacm2x: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: raspberrypi: rp1-cfe: Remove (explicitly) unused header
Andy Shevchenko [Mon, 31 Mar 2025 07:21:36 +0000 (10:21 +0300)] 
media: raspberrypi: rp1-cfe: Remove (explicitly) unused header

The fwnode.h is not supposed to be used by the drivers as it
has the definitions for the core parts for different device
property provider implementations. Drop it.

Note, that fwnode API for drivers is provided in property.h
which is included here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: ds90ub9x3: Remove (explicitly) unused header
Andy Shevchenko [Mon, 31 Mar 2025 07:25:07 +0000 (10:25 +0300)] 
media: i2c: ds90ub9x3: Remove (explicitly) unused header

The fwnode.h is not supposed to be used by the drivers as it
has the definitions for the core parts for different device
property provider implementations. Drop it.

Note, that fwnode API for drivers is provided in property.h
which is included here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: max9671x: Remove (explicitly) unused header
Andy Shevchenko [Mon, 31 Mar 2025 07:27:07 +0000 (10:27 +0300)] 
media: i2c: max9671x: Remove (explicitly) unused header

The fwnode.h is not supposed to be used by the drivers as it
has the definitions for the core parts for different device
property provider implementations. Drop it.

Note, that fwnode API for drivers is provided in property.h
which is included here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ccs-pll: Print a debug message when VT tree calculation fails
Laurent Pinchart [Sun, 27 Apr 2025 22:13:32 +0000 (01:13 +0300)] 
media: ccs-pll: Print a debug message when VT tree calculation fails

When the VT tree calculation fails to find a valid pre-divider, the
ccs_pll_calculate_vt_tree() function returns an error silently, and the
caller doesn't print any message either. This makes debugging PLL
calculation issues more difficult. Add a debug message to report the
issue, and amend the corresponding message for the OP tree to mention
"OP".

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov8856: suppress probe deferral errors
Johan Hovold [Fri, 25 Apr 2025 12:52:38 +0000 (14:52 +0200)] 
media: ov8856: suppress probe deferral errors

Probe deferral should not be logged as an error:

ov8856 24-0010: failed to get HW configuration: -517

Use dev_err_probe() for the clock lookup and drop the (mostly) redundant
dev_err() from sensor probe() to suppress it.

Note that errors during regulator lookup is already correctly logged
using dev_err_probe().

Fixes: 0c2c7a1e0d69 ("media: ov8856: Add devicetree support")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: ov5675: suppress probe deferral errors
Johan Hovold [Fri, 25 Apr 2025 12:52:37 +0000 (14:52 +0200)] 
media: ov5675: suppress probe deferral errors

Probe deferral should not be logged as an error:

ov5675 24-0010: failed to get HW configuration: -517

Drop the (mostly) redundant dev_err() from sensor probe() to suppress
it.

Note that errors during clock and regulator lookup are already correctly
logged using dev_err_probe().

Fixes: 49d9ad719e89 ("media: ov5675: add device-tree support and support runtime PM")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: change lt6911uxe irq_gpio name to "hpd"
Dongcheng Yan [Fri, 25 Apr 2025 10:43:31 +0000 (18:43 +0800)] 
media: i2c: change lt6911uxe irq_gpio name to "hpd"

Lt6911uxe is used in IPU6 / x86 platform, worked with an out-of-tree
int3472 patch and upstream intel/ipu6 before. It is only used on ACPI
platforms till now and there are no devicetree bindings for this
driver.

The upstream int3472 driver uses "hpd" instead of "readystat" now.
this patch updates the irq_gpio name to "hpd" accordingly, so that
mere users can now use the upstream version directly without relying
on out-of-tree int3472 pin support.

The new name "hpd" (Hotplug Detect) aligns with common naming
conventions used in other drivers(like adv7604) and documentation.

Fixes: e49563c3be09d4 ("media: i2c: add lt6911uxe hdmi bridge driver")
Cc: stable@vger.kernel.org
Signed-off-by: Dongcheng Yan <dongcheng.yan@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: dt-bindings: sony,imx415: update maintainer e-mail address
Michael Riesch [Thu, 10 Apr 2025 19:41:32 +0000 (21:41 +0200)] 
media: dt-bindings: sony,imx415: update maintainer e-mail address

I recently left WolfVision but would like to continue to maintain the
Sony IMX415 image sensor driver. Update my e-mail address.

Signed-off-by: Michael Riesch <michael.riesch@collabora.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: mailmap: add entry for Michael Riesch
Michael Riesch [Thu, 10 Apr 2025 19:41:31 +0000 (21:41 +0200)] 
media: mailmap: add entry for Michael Riesch

After five interesting years, I left WolfVision and started to work for
Collabora. Add a corresponding mailmap entry.

Signed-off-by: Michael Riesch <michael.riesch@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: intel/ipu6: Remove unused ipu6_isys_csi2_pdata
Stanislaw Gruszka [Mon, 17 Mar 2025 07:38:56 +0000 (08:38 +0100)] 
media: intel/ipu6: Remove unused ipu6_isys_csi2_pdata

The pointer to ipu6_isys_csi2_pdata is not used.

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>
2 months agomedia: imx335: Use correct register width for HNUM
Umang Jain [Tue, 22 Apr 2025 12:20:52 +0000 (13:20 +0100)] 
media: imx335: Use correct register width for HNUM

CCI_REG_HNUM should be using CCI_REG16_LE() instead of CCI_REG8()
as HNUM spans from 0x302e[0:7] to 0x302f[0:3].

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Fixes: 8f0926dba799 ("media: imx335: Use V4L2 CCI for accessing sensor registers")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: imx335: Add MAINTAINER entry
Kieran Bingham [Tue, 22 Apr 2025 12:27:01 +0000 (13:27 +0100)] 
media: imx335: Add MAINTAINER entry

In commit 5b0e91fd477d ("media: imx335: Orphan the driver"), the IMX335
driver was marked as an orphan.

I have several of these sensors, tested on Raspberry Pi and NXP systems,
and the full datasheet. Add myself as a maintainer for the IMX335.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: Add driver for ST VD55G1 camera sensor
Benjamin Mugnier [Wed, 30 Apr 2025 08:24:39 +0000 (10:24 +0200)] 
media: i2c: Add driver for ST VD55G1 camera sensor

The VD55G1 is a monochrome global shutter camera with a 804x704 maximum
resolution with RAW8 and RAW10 bytes per pixel.
The driver supports :
- Auto exposure from the sensor, or manual exposure mode
- HDR subtraction mode, allowing edge detection and background removal
- Auto exposure cold start, using configuration values from last stream
to start the next one
- LED GPIOs for illumination
- Most standard camera sensor features (hblank, vblank, test patterns,
again, dgain, hflip, vflip, auto exposure bias, etc.)
Add driver source code to MAINTAINERS file.

Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: dt-bindings: Add ST VD55G1 camera sensor
Benjamin Mugnier [Wed, 30 Apr 2025 08:24:38 +0000 (10:24 +0200)] 
media: dt-bindings: Add ST VD55G1 camera sensor

Also update MAINTAINERS file accordingly.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: Add driver for ST VD56G3 camera sensor
Sylvain Petinot [Fri, 2 May 2025 20:18:49 +0000 (22:18 +0200)] 
media: i2c: Add driver for ST VD56G3 camera sensor

Add V4L2 sub-device driver for STMicroelectronics VD56G3 camera sensor.
This is a 1.5 M pixel global shutter image sensor with an active array
size of 1124 x 1364 (portrait orientation).

The driver supports Mono (VD56G3) and Color (VD66GY) variants.

Signed-off-by: Sylvain Petinot <sylvain.petinot@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: dt-bindings: Add ST VD56G3 camera sensor
Sylvain Petinot [Fri, 2 May 2025 20:18:48 +0000 (22:18 +0200)] 
media: dt-bindings: Add ST VD56G3 camera sensor

Add devicetree bindings Documentation for ST VD56G3 & ST VD66GY camera
sensors. Update MAINTAINERS file.

Signed-off-by: Sylvain Petinot <sylvain.petinot@foss.st.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2 months agomedia: i2c: Add Omnivision OV02C10 sensor driver
Heimir Thor Sverrisson [Thu, 27 Mar 2025 16:49:27 +0000 (17:49 +0100)] 
media: i2c: Add Omnivision OV02C10 sensor driver

Add a new driver for the Omnivision OV02C10 camera sensor. This is based
on the out of tree driver by Hao Yao <hao.yao@intel.com> from:
https://github.com/intel/ipu6-drivers/blob/master/drivers/media/i2c/ov02c10.c

This has been tested on a Dell XPS 9440 together with the IPU6 isys CSI
driver and the libcamera software ISP code.

Tested-by: Ingvar Hagelund <ingvar@redpill-linpro.com> # Dell XPS 9340
Tested-by: Heimir Thor Sverrisson <heimir.sverrisson@gmail.com> # Dell XPS 9440
Signed-off-by: Heimir Thor Sverrisson <heimir.sverrisson@gmail.com>
Co-developed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Co-developed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> # Dell XPS 9340
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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>