Re: [PATCH v2 1/2] media: arm: mali-c55: Add support for CCM

From: Vincenzo Frascino

Date: Mon Jun 29 2026 - 03:45:35 EST


Hi Jacopo,

On 26/06/2026 15:45, Jacopo Mondi wrote:
>>> }
>>>
>>> +static void mali_c55_params_ccm(struct mali_c55 *mali_c55,
>>> + union mali_c55_params_block block)
>>> +{
>>> + const struct mali_c55_params_ccm *params = block.ccm;
>>> +
>>> + if (block.header->flags & V4L2_ISP_PARAMS_FL_BLOCK_DISABLE) {
>>> + mali_c55_ctx_write(mali_c55, MALI_C55_REG_CCM_ENABLE, 0);
>>> + return;
>>> + }
>>> +
>>> + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_CCM_COEF_R_R,
>>> + MALI_C55_CCM_COEF_MASK, params->coeffs[0][0]);
>> Should values be validated or masked before programming? Since this is
> Don't mali_c55_ctx_update_bits() does making already ?

mali_c55_ctx_update_bits() masks the value before programming, yes.

What I was trying to suggest is that silently truncating uAPI-provided values is
not ideal. I would add an explicit validation in the params validation path and
reject coefficients with bits outside MALI_C55_CCM_COEF_MASK, so userspace gets
a warning instead of having values silently altered.

--
Regards,
Vincenzo