| 69627031 | 30-Jun-2026 |
Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> |
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
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 <jacopo.mondi+renesas@ideasonboard.com> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| bb401df6 | 30-Jun-2026 |
Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> |
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 suppor
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 <jacopo.mondi+renesas@ideasonboard.com> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| f499befe | 03-Jul-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Fix clock leak on reset deassert failure
__mali_c55_power_on() enables the clocks before deasserting the resets, but bails out on a deassert failure without disabling them again. Bo
media: mali-c55: Fix clock leak on reset deassert failure
__mali_c55_power_on() enables the clocks before deasserting the resets, but bails out on a deassert failure without disabling them again. Both callers treat a failed power-on as already cleaned up, so the clocks are left enabled.
Disable them on the error path.
Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 876006e9 | 30-Jun-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Drop redundant mutex_destroy in capture register error path
In mali_c55_register_cap_dev(), a failure of media_entity_pads_init() destroys cap_dev->lock inline and then jumps to err
media: mali-c55: Drop redundant mutex_destroy in capture register error path
In mali_c55_register_cap_dev(), a failure of media_entity_pads_init() destroys cap_dev->lock inline and then jumps to err_destroy_mutex, which destroys the same mutex a second time. Calling mutex_destroy() twice is harmless, so this is not a bugfix, but the inline call is redundant: the err_destroy_mutex label already covers this path, just like the switch default case immediately above.
Drop the inline mutex_destroy() and rely solely on the err_destroy_mutex label, so the mutex is destroyed exactly once on every error path.
Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 2447c768 | 18-Jun-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Fix scaler factor overflow for large crop sizes
The horizontal and vertical scaling factors multiply the crop dimensions by MALI_C55_RSZ_SCALER_FACTOR, a Q4.20 factor of (1 << 20).
media: mali-c55: Fix scaler factor overflow for large crop sizes
The horizontal and vertical scaling factors multiply the crop dimensions by MALI_C55_RSZ_SCALER_FACTOR, a Q4.20 factor of (1 << 20). Both operands are 32-bit, so the multiplication wraps before the result is stored in the u64 scale variables. For any crop dimension of 4096 or more (the maximum is 8192) the value overflows; an 8192 to 4096 downscale yields a TINC of zero, so the scaler never advances and the output is corrupted.
Define MALI_C55_RSZ_SCALER_FACTOR as a 64-bit constant so the multiplication is performed in 64-bit.
Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 9a2925b8 | 09-Jun-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Fix AEXP IHIST disable bit shift
The post-Iridix auto-exposure histogram disable bit in MALI_C55_REG_METERING_CONFIG is bit 16, but MALI_C55_AEXP_IHIST_DISABLE was defined with a sh
media: mali-c55: Fix AEXP IHIST disable bit shift
The post-Iridix auto-exposure histogram disable bit in MALI_C55_REG_METERING_CONFIG is bit 16, but MALI_C55_AEXP_IHIST_DISABLE was defined with a shift of 12, copied from the AEXP_HIST definition above it. As the value is masked with the BIT(16) disable mask when it is programmed, the result is always zero and the disable bit is never set. The IHIST can therefore never be disabled, neither at ISP init nor via a parameters block flagged V4L2_ISP_PARAMS_FL_BLOCK_DISABLE, and the hardware keeps producing histogram statistics that userspace believes are switched off.
Use a shift of 16 so the disable request takes effect.
Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-4-8 Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| a1db83cc | 28-Mar-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Disable pm_runtime on probe error
When mali_c55_media_frameworks_init() fails, the goto target jumps to err_free_context_registers, skipping pm_runtime_disable() despite pm_runtime
media: mali-c55: Disable pm_runtime on probe error
When mali_c55_media_frameworks_init() fails, the goto target jumps to err_free_context_registers, skipping pm_runtime_disable() despite pm_runtime having already been enabled earlier in the function.
Fix this by adding an err_pm_runtime_disable label and redirecting the frameworks init failure to it, so pm_runtime is properly unwound on that error path. The runtime PM status is also set back to suspended before disabling, to undo the pm_runtime_set_active() from probe.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 2c9b9bcc | 28-Mar-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Power-off the peripheral in remove()
The Mali C55 driver doesn't depend on PM. For this reason, if pm_runtime is not compiled in it is required to manually power-off the peripheral
media: mali-c55: Power-off the peripheral in remove()
The Mali C55 driver doesn't depend on PM. For this reason, if pm_runtime is not compiled in it is required to manually power-off the peripheral during the driver's remove() handler.
Also pm_runtime_enable() is called during probe but mali_c55_remove() never calls pm_runtime_disable(), leaving the device's runtime PM state enabled after the driver is unbound.
Manually power-off the peripheral in remove() if the peripheral has not been suspended using runtime_pm and disable runtime pm.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 38e3509d | 28-Mar-2026 |
David Carlier <devnexen@gmail.com> |
media: mali-c55: Add missing of_reserved_mem_device_release()
mali_c55_probe() calls of_reserved_mem_device_init() to associate reserved memory regions with the device. This function allocates a str
media: mali-c55: Add missing of_reserved_mem_device_release()
mali_c55_probe() calls of_reserved_mem_device_init() to associate reserved memory regions with the device. This function allocates a struct rmem_assigned_device and adds it to a global linked list, which must be explicitly released via of_reserved_mem_device_release() — there is no devm variant of this API.
However, neither the probe error paths nor mali_c55_remove() called of_reserved_mem_device_release(). Any probe failure after the of_reserved_mem_device_init() call, as well as every normal device removal, leaked the reserved memory association on the global list.
Fix this by adding an err_release_mem label at the end of the probe error chain and calling of_reserved_mem_device_release() in mali_c55_remove(). The remove teardown order is also corrected to call mali_c55_media_frameworks_deinit() before kfree(), mirroring the probe init order in reverse.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 94c6402e | 07-Feb-2026 |
Alper Ak <alperyasinak1@gmail.com> |
media: mali-c55: Fix possible ERR_PTR in enable_streams
The media_pad_remote_pad_unique() function returns either a valid pointer or an ERR_PTR() on failure (-ENOTUNIQ if multiple links are enabled,
media: mali-c55: Fix possible ERR_PTR in enable_streams
The media_pad_remote_pad_unique() function returns either a valid pointer or an ERR_PTR() on failure (-ENOTUNIQ if multiple links are enabled, -ENOLINK if no connected pad is found). The return value was assigned directly to isp->remote_src and dereferenced in the next line without checking for errors, which could lead to an ERR_PTR dereference.
Add proper error checking with IS_ERR() before dereferencing the pointer. Also set isp->remote_src to NULL on error to maintain consistency with other error paths in the function.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Signed-off-by: Alper Ak <alperyasinak1@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| ff57ee85 | 15-Jan-2026 |
Chen Ni <nichen@iscas.ac.cn> |
media: mali-c55: core: Remove redundant dev_err()
The platform_get_irq_byname() function already prints an error message internally upon failure using dev_err_probe(). Therefore, the explicit dev_er
media: mali-c55: core: Remove redundant dev_err()
The platform_get_irq_byname() function already prints an error message internally upon failure using dev_err_probe(). Therefore, the explicit dev_err() is redundant and results in duplicate error logs.
Remove the redundant dev_err() call to clean up the error path.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 5a11410b | 13-Jan-2026 |
jempty.liang <imntjempty@163.com> |
media: mali-c55: Initialise dev for tpg/rsz/isp subdevs
The subdevices registered by the Mali-C55 driver do not have their 'struct device *dev' member initialized. This is visibile when looking at d
media: mali-c55: Initialise dev for tpg/rsz/isp subdevs
The subdevices registered by the Mali-C55 driver do not have their 'struct device *dev' member initialized. This is visibile when looking at debug message, as in example:
"(NULL device *): collect_streams: sub-device 'mali-c55 tpg' does not support streams"
Fix this by initializing the *dev field for each subdevice registered by the Mali-C55 driver.
Signed-off-by: jempty.liang <imntjempty@163.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 062ae1d0 | 11-Mar-2026 |
Jacopo Mondi <jacopo.mondi@ideasonboard.com> |
media: mali-c55: Bypass Purple Fringe Correction
The Purple Fringe Correction module is enabled by default with a POR configuration which might not be correct for the lens/sensor combination in use.
media: mali-c55: Bypass Purple Fringe Correction
The Purple Fringe Correction module is enabled by default with a POR configuration which might not be correct for the lens/sensor combination in use.
If the Purple Fringe Correction module has to be used, it needs to be supported in the driver's uAPI and properly configured by userspace.
As the driver doesn't support it at the moment, bypass it by default.
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 762ec66e | 11-Mar-2026 |
Jacopo Mondi <jacopo.mondi@ideasonboard.com> |
media: mali-c55: Bypass the Iridix Tonemap engine
The Iridix Tonemap engine, if not bypassed, applies a digital gain in order to compensate under-exposed images.
This however breaks the exposure an
media: mali-c55: Bypass the Iridix Tonemap engine
The Iridix Tonemap engine, if not bypassed, applies a digital gain in order to compensate under-exposed images.
This however breaks the exposure and gain regulation performed on the sensor.
If the Iridix Tonemap has to be used, it need to be supported in the ISP uAPI and properly configured by userspace.
As the driver doesn't support it at the moment, bypass it by default.
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| db7faf48 | 12-Feb-2026 |
Daniel Scally <dan.scally@ideasonboard.com> |
media: mali-c55: Fix Iridix bypass macros
The Mali C55 Iridix block has a digital gain function and tone mapping function, whose enablement is controlled by two different bits in the BYPASS_3 regist
media: mali-c55: Fix Iridix bypass macros
The Mali C55 Iridix block has a digital gain function and tone mapping function, whose enablement is controlled by two different bits in the BYPASS_3 register.
Unfortunately, the "Gain" and "Tonemap" bypass bit definitions are the wrong way around. Swap them.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 26ad493b | 19-Jan-2026 |
Jacopo Mondi <jacopo.mondi@ideasonboard.com> |
media: mali-c55: Fully reset the ISP configuration
The Mali C55 driver uses an auto-suspend delay of 2000 milli-seconds.
As the delay is quite large, it is certainly possible that two consecutive c
media: mali-c55: Fully reset the ISP configuration
The Mali C55 driver uses an auto-suspend delay of 2000 milli-seconds.
As the delay is quite large, it is certainly possible that two consecutive calls to enable_streams() do not go through a suspend of the peripheral, meaning we cannot rely on POW register values for the ISP configuration.
To prevent a streaming session to be initialized with settings from the previous one, reset the full ISP configuration to know state disabling or bypassing all the ISP blocks the driver supports.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| d5c24b71 | 19-Jan-2026 |
Jacopo Mondi <jacopo.mondi@ideasonboard.com> |
media: mali-c55: Initialize the ISP in enable_streams()
The Mali C55 driver initializes the ISP in two points:
1) At probe time it disables ISP blocks by configuring them in bypass mode 2) At en
media: mali-c55: Initialize the ISP in enable_streams()
The Mali C55 driver initializes the ISP in two points:
1) At probe time it disables ISP blocks by configuring them in bypass mode 2) At enable_streams() it initializes the crop rectangles and the image processing pipeline using the current image format
However, as ISP blocks are configured by userspace, if their configuration is not reset, from the second enable_streams() call onwards the ISP configuration will depend on the previous streaming session configuration.
To re-initialize the ISP completely at enable_streams() time consolidate the ISP block bypass configuration and the image processing path configuration in a single function to be called at enabled_streams() time.
Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 2f1e8881 | 14-Nov-2025 |
Jacopo Mondi <jacopo.mondi@ideasonboard.com> |
media: mali-c55: Mark pm handlers as __maybe_unused
As the Mali-C55 driver is instrumented to work without depending on CONFIG_PM, mark the two pm_runtime handlers as __maybe_unused to suppress the
media: mali-c55: Mark pm handlers as __maybe_unused
As the Mali-C55 driver is instrumented to work without depending on CONFIG_PM, mark the two pm_runtime handlers as __maybe_unused to suppress the compiler warning when compiling without CONFIG_PM.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|