Commit Graph

1222990 Commits

Author SHA1 Message Date
Dave Stevenson
d8467deca1 staging: bcm2835-codec: Fix up for 6.8 - use ignore_cap_streaming
Drops downstream patch to v4l2_mem2mem, and uses the new mainline
flag to achieve the same functionality

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2024-03-22 11:22:22 +00:00
Naushir Patuck
4c35b3a2ad ARM: dts: bcm270x: Add the reg-names label to unicam
This is needed by the new upstream/downstream Unicam driver.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:37 +00:00
Naushir Patuck
a579720ebf drivers: media: platform: Remove the downstream unicam driver
This has been replaced with the upstream driver in
drivers/media/platform/broadcom/bcm2835-unicam.c.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:37 +00:00
Naushir Patuck
00edfb7822 drivers: media: arducam_64mp: Remove legacy embedded data support
With the introduction of the streams API, the legacy embedded data
support has been removed. Pull out all code associated with the legacy
support.

Note that this driver has not been converted to use the streams API, so
embedded data will be unavailable.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:37 +00:00
Naushir Patuck
42619dc0ff drivers: media: i2c: Add streams support to IMX519
Add the V4L2 streams API support for embedded data in the IMX519 device
driver. This also updates the drier to use the V4L2 subdev state API.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:37 +00:00
Naushir Patuck
d71c60a9dc drivers: media: i2c: Add streams support to IMX708
Add the V4L2 streams API support for embedded/pdaf/hdr data in the
IMX708 device driver. This also updates the drier to use the V4L2 subdev
state API.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:36 +00:00
Naushir Patuck
416150697f drivers: media: i2c: Add streams support to IMX477
Add the V4L2 streams API support for embedded data in the IMX477 device
driver. This also updates the drier to use the V4L2 subdev state API.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:36 +00:00
Naushir Patuck
563dd03f92 drivers: media: i2c: imx258: Bring driver up-to-date with upstream
This commit brings the IMX258 driver up-to-date with upstream v6.8 and
updated V4L2 APIs.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:36 +00:00
Naushir Patuck
a2626c3f93 drivers: media: i2c: imx219: Bring driver up-to-date with upstream
This commit brings the IMX219 driver up-to-date with upstream v6.8 and
adds streams support for embedded data.

Currently HBLANK control has been removed and needs to be re-added.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:35 +00:00
Naushir Patuck
994f04427d ARM: dts: rp1: update the compatible string for the cfe driver
The upstream now driver uses "raspberrypi,rpi5-rp1-cfe", update it.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 13:37:35 +00:00
Tomi Valkeinen
0c06d42e5e media: mc: Fix graph walk in media_pipeline_start
The graph walk tries to follow all links, even if they are not between
pads. This causes a crash with, e.g. a MEDIA_LNK_FL_ANCILLARY_LINK link.

Fix this by allowing the walk to proceed only for MEDIA_LNK_FL_DATA_LINK
links.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fixes: ae21987283 ("media: mc: entity: Rewrite media_pipeline_start()")
2024-03-21 11:23:30 +00:00
Tomi Valkeinen
60cb697f1d media: admin-guide: Document the Raspberry Pi CFE (rp1-cfe)
Add documentation for rp1-cfe driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2024-03-21 11:23:30 +00:00
Tomi Valkeinen
8740422fe9 media: raspberrypi: Add support for RP1-CFE
Add support for Raspberry Pi CFE. The CFE is a hardware block that
contains:

- MIPI D-PHY
- MIPI CSI-2 receiver
- Front End ISP (FE)

The driver has been upported from the Raspberry Pi kernel commit
88a681df96 ("ARM: dts: bcm2712-rpi: Add i2c<n>_pins labels").

Co-developed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2024-03-21 11:23:30 +00:00
Tomi Valkeinen
4d8ed1506c dt-bindings: media: Add bindings for raspberrypi,rp1-cfe
Add DT bindings for raspberrypi,rp1-cfe.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2024-03-21 11:23:29 +00:00
Tomi Valkeinen
f0d22c4660 media: uapi: Add meta formats for PiSP FE config and stats
Add two meta formats for PiSP FE: V4L2_META_FMT_RPI_FE_CFG and
V4L2_META_FMT_RPI_FE_STATS. The former is used to provide configuration
for the FE and the latter is used to read the statistics from the FE.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2024-03-21 11:23:29 +00:00
Jacopo Mondi
98673f5b02 media: admin-guide: Document the Raspberry Pi PiSP BE
Add documentation for the PiSP Back End memory-to-memory ISP.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-03-21 11:23:29 +00:00
Naushir Patuck
65350fccae media: raspberrypi: Add support for PiSP BE
Add support for the Raspberry Pi PiSP Back End.

The driver has been upported from the Raspberry Pi kernel at revision
f74893f8a0 ("drivers: media: pisp_be: Update seqeuence numbers of the
buffers").

The ISP documentation is available at:
https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.org>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-03-21 11:23:29 +00:00
Jacopo Mondi
cf495beffe media: dt-bindings: Add bindings for Raspberry Pi PiSP Back End
Add bindings for the Raspberry Pi PiSP Back End memory-to-memory image
signal processor.

Datasheet:
https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 11:23:29 +00:00
Jacopo Mondi
a6e8406481 media: uapi: Add PiSP Compressed RAW Bayer formats
Add Raspberry Pi compressed RAW Bayer formats.

The compression algorithm description is provided by Nick Hollinghurst
<nick.hollinghurst@raspberrypi.com> from Raspberry Pi.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 11:23:29 +00:00
Jacopo Mondi
de51e1ac61 media: uapi: Add meta pixel format for PiSP BE config
Add format description for the PiSP Back End configuration parameter
buffer.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 11:23:29 +00:00
Jacopo Mondi
2b823061df media: uapi: Add a pixel format for BGR48 and RGB48
Add BGR48 and RGB48 16-bit per component image formats.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 11:23:28 +00:00
Jacopo Mondi
c3df076a73 media: uapi: pixfmt-luma: Document MIPI CSI-2 packing
The Y10P, Y12P and Y14P format variants are packed according to
the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
specification. Document it.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2024-03-21 11:23:28 +00:00
Dave Stevenson
62aba94bc1 media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface
Add a driver for the Unicam camera receiver block on BCM283x processors.
It is represented as two video device nodes: unicam-image and
unicam-embedded which are connected to an internal subdev (named
unicam-subdev) in order to manage streams routing.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Co-developed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Co-developed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-03-21 11:23:28 +00:00
Dave Stevenson
0ed887a498 dt-bindings: media: Add bindings for bcm2835-unicam
Introduce the dt-bindings documentation for bcm2835 CCP2/CSI2 Unicam
camera interface.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Co-developed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Co-developed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-03-21 11:23:28 +00:00
Sakari Ailus
7d3f6b99a2 media: ov2740: Add IMMUTABLE route flag
Add immutable route flag to the routing table.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:28 +00:00
Sakari Ailus
ea45869f7b media: ccs: Add IMMUTABLE route flag
Add immutable route flag to the routing table.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:28 +00:00
Sakari Ailus
98050742b6 media: v4l: Add V4L2_SUBDEV_ROUTE_FL_IMMUTABLE sub-device routing flag
Add a flag to denote immutable routes, V4L2_SUBDEV_ROUTE_FL_IMMUTABLE.
Such routes cannot be changed and they're always active.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:28 +00:00
Sakari Ailus
e5053fc6ce media: ov2740: Add support for embedded data
Add support for embedded data. This introduces two internal pads for pixel
and embedded data streams. As the driver supports a single mode only,
there's no need for backward compatibility in mode selection.

The embedded data is configured to be placed before the image data whereas
after the image data is the default.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:28 +00:00
Sakari Ailus
65d0415c1b media: ov2740: Track streaming state
With enable_streams and disable_streams, the driver for a device where
streams are not independently started and stopped needs to maintain state
information on streams that have been requested to be started. Do that
now.

In the future, a helper function in the framework is a desirable way to do
this instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
5d65bbe9ba media: ov2740: Switch to {enable,disable}_streams
Switch from s_stream to enable_streams and disable_streams callbacks.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
4238428a79 media: uapi: Add media bus code for ov2740 embedded data
Add a media bus code for ov2740 camera sensor embedded data and document
it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
ef2f0b3b58 media: uapi: v4l: subdev: Enable streams API
Remove v4l2_subdev_enable_streams_api variable that was used to easily
enable streams API for development, and conditions that use the variable.

This patch enables the streams API for V4L2 sub-device interface which
allows transporting multiple streams on a single MC link.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
f772446ba4 media: Documentation: ccs: Document routing
Document which routes are available for the CCS driver (source) sub-device
and what configuration are possible.

Also update copyright.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
6a6c9e1735 media: ccs: Remove which parameter from ccs_propagate
ccs_propagate() no longer stores information in the driver's context
struct. The which parameter can thus be removed.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
a74251b1f6 media: ccs: Compute scaling configuration from sub-device state
Compute scaling configuration from sub-device state instead of storing it
to the driver's device context struct.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
fd45b10a56 media: ccs: Compute binning configuration from sub-device state
Calculate binning configuration from sub-device state so the state related
configuration can be removed from the driver's device context struct.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:27 +00:00
Sakari Ailus
9c78a3add7 media: ccs: Rely on sub-device state locking
Rely on sub-device state locking to serialise access to driver's data
structures. The driver-provided mutex is used as the state lock for all
driver sub-devices.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
ca23dce521 media: ccs: Remove ccs_get_crop_compose helper
As it's now easier to obtain the necessary information on crop and compose
rectangles after moving to sub-device state, remove the
ccs_get_crop_compose helper.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
b651fbc6da media: ccs: Add support for embedded data stream
Add support for embedded data stream, in UAPI and frame descriptor.

This patch adds also a new embedded data pad (2) to the source sub-device.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
1b084cd5a3 media: uapi: ccs: Add media bus code for MIPI CCS embedded data
Add new MIPI CCS embedded data media bus code
(MEDIA_BUS_FMT_CCS_EMBEDDED).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
ea67c8739a media: ccs: Support frame descriptors
Provide information on the frame layout using frame descriptors.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
a525dace1e media: ccs: Move ccs_validate_csi_data_format up
ccs_validate_csi_data_format() will soon be needed elsewhere, above its
current location. Move it up.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
101fa1151e media: ccs: Track streaming state
With enable_streams and disable_streams, the driver for a device where
streams are not independently started and stopped needs to maintain state
information on streams that have been requested to be started. Do that
now.

In the future, a helper function in the framework is a desirable way to do
this instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:26 +00:00
Sakari Ailus
639b893e33 media: ccs: Use {enable,disable}_streams operations
Switch from s_stream() video op to enable_streams() and disable_streams()
pad operations. They are preferred and required for streams support.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:25 +00:00
Sakari Ailus
140d115483 media: ccs: No need to set streaming to false in power off
Streaming will have been stopped by the sensor is powered off, and so
sensor->streaming is also false already. Do not set it as part of the
runtime suspend callback.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-03-21 11:23:25 +00:00
Sakari Ailus
e79afc5811 media: v4l: subdev: Add trivial set_routing support
Add trivial S_ROUTING IOCTL support for drivers where routing is static.
Essentially this means returning the same information G_ROUTING call would
have done.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:25 +00:00
Sakari Ailus
45d064e1a3 media: v4l: subdev: Allow a larger number of routes than there's room for
On VIDIOC_SUBDEV_[GS]_ROUTING, only return as many routes back to the user
as there's room. Do not consider it an error if more routes existed.
Simply inform the user there are more routes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:25 +00:00
Sakari Ailus
acdd4cb488 media: v4l: subdev: Return routes set using S_ROUTING
Return the routes set using S_ROUTING back to the user. Also reflect this
in documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:25 +00:00
Sakari Ailus
030befe83e media: v4l: subdev: Add len_routes field to struct v4l2_subdev_routing
The len_routes field is used to tell the size of the routes array in
struct v4l2_subdev_routing. This way the number of routes returned from
S_ROUTING IOCTL may be larger than the number of routes provided, in case
there are more routes returned by the driver.

Note that this uAPI is still disabled in the code, so this change can
safely be done. Anyone who manually patched the code to enable this uAPI
must update their code.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-03-21 11:23:25 +00:00
Sakari Ailus
829f5edd4c media: v4l: subdev: Copy argument back to user also for S_ROUTING
As the user needs to know what went wrong for S_ROUTING, copy array
arguments back to the user.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
2024-03-21 11:23:25 +00:00