29 Commits
Author SHA1 Message Date
Jai Luthra 465425926f media: rppx1: lin: Add support for gamma sensor linearization
Extend the RPPX1 driver to allow setting the gamma sensor linearization
configuration parameters. It uses the RPPX1 framework for parameters and
its writer abstraction to allow the user to control how, and when,
configuration is applied to the RPPX1.

Signed-off-by: Jai Luthra <[email protected]>
Signed-off-by: Niklas Söderlund <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund d011daefa1 media: rppx1: ga: Add support for gamma out correction
Extend the RPPX1 driver to allow setting the gamma out correction
configuration parameters. It uses the RPPX1 framework for parameters and
its writer abstraction to allow the user to control how, and when,
configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund b39656efb7 media: rppx1: lsc: Add support for lens shade correction
Extend the RPPX1 driver to allow setting the lens shade correction
configuration parameters. It uses the RPPX1 framework for parameters and
its writer abstraction to allow the user to control how, and when,
configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund aaeee9b743 media: rppx1: ccor: Add support for color correction matrix
Extend the RPPX1 driver to allow setting the color correction matrix
configuration parameters. It uses the RPPX1 framework for parameters and
its writer abstraction to allow the user to control how, and when,
configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund 3f8a2a8836 media: rppx1: bls: Add support for black level compensation
Extend the RPPX1 driver to allow setting the black level measurement
and gain configuration. It uses the RPPX1 framework for parameters and
its writer abstraction to allow the user to control how, and when,
configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund 9a52f7de7c media: rppx1: hist: Add support histogram measurement
Extend the RPPX1 driver to allow setting the histogram measurement
configuration and consuming the resulting statistics. It uses the RPPX1
framework for parameters and its writer abstraction to allow the user to
control how, and when, configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund b020bec416 media: rppx1: exm: Add support for exposure measurement
Extend the RPPX1 driver to allow setting the exposure measurement
configuration and consuming the resulting statistics. It uses the RPPX1
framework for parameters and its writer abstraction to allow the user to
control how, and when, configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund 9ebf50010c media: rppx1: awbg: Add support for white balance gain settings
Extend the RPPX1 driver to allow setting the white balance gain
configuration parameters. It uses the RPPX1 framework for parameters and
its writer abstraction to allow the user to control how, and when,
configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Niklas Söderlund 884d6794a8 media: rppx1: wbmeas: Add support for white balance measurement
Extend the RPPX1 driver to allow setting the white balance measurement
configuration and consuming the resulting statistics. It uses the RPPX1
framework for parameters and its writer abstraction to allow the user to
control how, and when, configuration is applied to the RPPX1.

Signed-off-by: Niklas Söderlund <[email protected]>
Co-developed-by: Jai Luthra <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Jai Luthra d2655e8b78 media: uapi: Add extensible param and stats blocks for RPPX1
Add the scaffolding for the parameters and statistics buffers for
Dreamchip RPPX1. The parameters for each ISP function block will be
added together with the logic for it.

In addition to the scaffolding add a common struct that describes the
measurement window. This struct is not specific to any block and will
used by many of them.

Signed-off-by: Jai Luthra <[email protected]>
[Niklas: Commit message]
Signed-off-by: Niklas Söderlund <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:35 +03:00
Antoine Bouyer 01498beb8d media: uapi: v4l2-isp: Add extensible statistics
Extend the v4l2-isp extensible format introduced for isp parameters buffers
to the support buffers of ISP statistic.

Like for ISP configuration purpose, that will help supporting various ISP
hardware versions reporting different statistics data with less impact on
userspace.

Rename all 'v4l2_isp_params' types to generic 'v4l2_isp' types to
prepare to use them for statistics as well and maintain the existing
types for compatibility with existing userspace only.

Signed-off-by: Antoine Bouyer <[email protected]>
Reviewed-by: Niklas Söderlund <[email protected]>
[Rework to remove 'v4l2_isp_stats' and unify types]
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
2026-07-30 20:51:12 +03:00
Jacopo Mondi 6962703102 media: mali-c55: Add support for RGB Gamma
Add support for Gamma curve correction for the Mali C55 ISP.

Define a new block in the uAPI using the extensible v4l2-isp format and
implement support for configuring the RGB Gamma parameters in the
mali-c55 parameters handler.

While at it, rename the MALI_C55_REG_GAMMA_GAINS_[1|2] register name
to MALI_C55_REG_GAMMA_GAINS_[RG|B] and the
MALI_C55_REG_GAMMA_OFFSETS_[1|2] register name to
MALI_C55_REG_GAMMA_OFFSETS_[RG|B] to better clarify their intent.

Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Vincenzo Frascino <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2026-07-28 11:36:46 +02:00
Jacopo Mondi bb401df68c media: mali-c55: Add support for CCM
Add support for the CCM (Color Correction Matrix) for the Mali C55 ISP.

Define a new block in the uAPI using the extensible v4l2-isp format and
implement support for configuring the CCM parameters in the mali-c55
ISP driver.

Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Vincenzo Frascino <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2026-07-28 11:36:46 +02:00
Jacopo Mondi 22cd0db47f media: uapi: mali-c55-config: Remove version identifier
The Mali C55 driver uses the v4l2-isp framework, which defines its own
versioning number which does not need to be defined again in each
platform-specific header.

Remove the definition of mali_c55_param_buffer_version enumeration from
the Mali C55 uAPI header.

Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Daniel Scally <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2026-01-06 10:14:13 +01:00
Jacopo Mondi f7231cff1f media: uapi: c3-isp: Fix documentation warning
Building htmldocs generates a warning:

WARNING: include/uapi/linux/media/amlogic/c3-isp-config.h:199
error: Cannot parse struct or union!

Which correctly highlights that the c3_isp_params_block_header symbol
is wrongly documented as a struct while it's a plain #define instead.

Fix this by removing the 'struct' identifier from the documentation of
the c3_isp_params_block_header symbol.

[ribalda: Add Closes:]

Reported-by: Stephen Rothwell <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Fixes: 4566208285 ("media: uapi: Convert Amlogic C3 to V4L2 extensible params")
Cc: [email protected]
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Ricardo Ribalda <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2025-12-03 10:07:37 +01:00
Daniel Scally 08a99369f4 media: uapi: Add parameters structs to mali-c55-config.h
Add structures describing the ISP parameters to mali-c55-config.h

Tested-by: Lad Prabhakar <[email protected]>
Acked-by: Nayden Kanchev  <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Daniel Scally <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-11-14 15:48:49 +01:00
Daniel Scally c7f832f6f8 media: uapi: Add 3a stats buffer for mali-c55
Describe the format of the 3A statistics buffers in the userspace API
header for the mali-c55 ISP.

Tested-by: Lad Prabhakar <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Acked-by: Nayden Kanchev  <[email protected]>
Co-developed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Daniel Scally <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-11-14 15:48:49 +01:00
Daniel Scally 8d0bbed21e media: uapi: Add controls for Mali-C55 ISP
Add definitions and documentation for the custom control that will
be needed by the Mali-C55 ISP driver. This will be a read only
bitmask of the driver's capabilities, informing userspace of which
blocks are fitted and which are absent.

Tested-by: Lad Prabhakar <[email protected]>
Reviewed-by: Lad Prabhakar <[email protected]>
Reviewed-by: Jacopo Mondi <[email protected]>
Signed-off-by: Daniel Scally <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-11-14 15:48:49 +01:00
Jacopo Mondi 4566208285 media: uapi: Convert Amlogic C3 to V4L2 extensible params
With the introduction of common types for extensible parameters
format, convert the c3-isp-config.h header to use the new types.

Factor-out the documentation that is now part of the common header
and only keep the driver-specific on in place.

The conversion to use common types doesn't impact userspace as the
new types are either identical to the ones already existing in the
C3 ISP uAPI or are 1-to-1 type convertible.

Reviewed-by: Daniel Scally <[email protected]>
Reviewed-by: Keke Li <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Tested-by: Lad Prabhakar <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-11-14 15:48:48 +01:00
Jacopo Mondi e36dbd1cf3 media: uapi: Introduce V4L2 generic ISP types
Introduce v4l2-isp.h in the Linux kernel uAPI.

The header includes types for generic ISP configuration parameters
and will be extended in the future with support for generic ISP statistics
formats.

Generic ISP parameters support is provided by introducing two new
types that represent an extensible and versioned buffer of ISP
configuration parameters.

The v4l2_params_buffer represents the container for the ISP
configuration data block. The generic type is defined with a 0-sized
data member that the ISP driver implementations shall properly size
according to their capabilities. The v4l2_params_block_header structure
represents the header to be prepend to each ISP configuration block.

Signed-off-by: Daniel Scally <[email protected]>
Reviewed-by: Daniel Scally <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Michael Riesch <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Tested-by: Lad Prabhakar <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-11-14 15:48:48 +01:00
Jacopo Mondi aa89281bbc media: pisp_be: Use clamp() and define max sizes
Use the clamp() function from minmax.h and provide a define for the max
sizes as they will be used in subsequent patches.

Reviewed-by: Daniel Scally <[email protected]>
Reviewed-by: Stefan Klug <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-07-03 09:25:01 +02:00
Keke Li 6d406187eb 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 <[email protected]>
Signed-off-by: Keke Li <[email protected]>
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2025-05-09 12:08:37 +02:00
Tomi Valkeinen 6edb685abb 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
88a681df9623 ("ARM: dts: bcm2712-rpi: Add i2c<n>_pins labels").

Co-developed-by: Naushir Patuck <[email protected]>
Signed-off-by: Naushir Patuck <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2024-10-16 09:32:40 +02:00
Jacopo Mondi 1c2c57bd43 media: uapi: pisp_be_config: Add extra config fields
Complete the pisp_be_config strcture by adding fields that even if not
written to the HW are relevant to complete the uAPI and put it in par
with the BSP driver.

Fixes: c6c49bac87 ("media: uapi: Add Raspberry Pi PiSP Back End uAPI")
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2024-07-12 10:11:43 +02:00
Jacopo Mondi 639065c621 media: uapi: pisp_be_config: Re-sort pisp_be_tiles_config
The order of the members of pisp_be_tiles_config is relevant
as the driver logic assumes 'config' to be at offset 0.

Re-sort the member to match the driver's expectations.

Fixes: c6c49bac87 ("media: uapi: Add Raspberry Pi PiSP Back End uAPI")
Signed-off-by: Jacopo Mondi <[email protected]>
Acked-by: Naushir Patuck <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2024-07-12 10:11:43 +02:00
Jacopo Mondi f5cee94f2d media: uapi: pisp_common: Capitalize all macros
The macro used to inspect an image format characteristic use a mixture
of capitalized and non-capitalized letters, which is rather unusual for
the Linux kernel style.

Capitalize all identifiers.

Fixes: c6c49bac87 ("media: uapi: Add Raspberry Pi PiSP Back End uAPI")
Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2024-07-12 10:11:43 +02:00
Jacopo Mondi 1991a09e6d media: uapi: pisp_common: Add 32 bpp format test
Add definition and test for 32-bits image formats to the pisp_common.h
uAPI header.

Fixes: c6c49bac87 ("media: uapi: Add Raspberry Pi PiSP Back End uAPI")
Signed-off-by: Jacopo Mondi <[email protected]>
Acked-by: David Plowman <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2024-07-12 10:11:43 +02:00
Jacopo Mondi 79cf9c6ee4 media: uapi: pisp_be_config: Drop BIT() from uAPI
The pisp_be_config.h uAPI header file contains a bit-field definition
that uses the BIT() helper macro.

As the BIT() identifier is not defined in userspace, drop it from the
uAPI header.

Fixes: c6c49bac87 ("media: uapi: Add Raspberry Pi PiSP Back End uAPI")
Signed-off-by: Jacopo Mondi <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2024-07-12 10:11:43 +02:00
Jacopo Mondi c6c49bac87 media: uapi: Add Raspberry Pi PiSP Back End uAPI
Add the Raspberry Pi PiSP Back End uAPI header.

The header defines the data type used to configure the PiSP Back End
ISP.

The detailed description of the types and of the ISP configuration
procedure is available at
https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf

Signed-off-by: Jacopo Mondi <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
2024-06-27 13:06:47 +02:00