From nobody Tue Apr 7 11:20:58 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 703DF2FE074; Fri, 13 Mar 2026 14:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413654; cv=none; b=ZuXT2cB+7HR0/ew0q5oEynAmKcRxJgZT1DIuuvxH3voy4NF3kXroYmshmoNJsv1bKkcRBpYt2ZZK8tKcdth2AocTXfsQ//IvHXl7WT415xf6zZS/Z/dt7o9YflH4IyFKQC/XRbLGW75VZGODnmQrLPVpzq1vw5FvRwGGmzkK6UI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413654; c=relaxed/simple; bh=akGh0x+lpCwAL9qoHpyWhYIMXA/NdwJVUnlsDSXqYTs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VCdusRm6M9/HgH4iI9e6pq8ABntLP7ZkmbYBf1zd7+IfTvNakkPIVftyp5W75uQgIDHH9ZohxkWWX4ZAJNF53x2As/UV57nMNEdwZyj0OgLZBiFEDuV1j4s01shCAuo3WjIlSb+48llLadPbc9BCxxVEbxauyTPmZlLLKJkjg80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=pastwKiZ; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pastwKiZ" Received: from [192.168.224.131] (unknown [37.159.122.93]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D9B14F52; Fri, 13 Mar 2026 15:52:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773413580; bh=akGh0x+lpCwAL9qoHpyWhYIMXA/NdwJVUnlsDSXqYTs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pastwKiZtcbRSNZ5aoXO+aXSzYlsWDNpoV7X6brvD7bRgDMSG4lU3VFemkM2PY394 d7Xj0lI8U72m7iDOiMDKNOXo6Ab1xPKaOJWaf8UoOX2dPjXJ+IyKBZqKvPtkzL4vVy OW/9bnEKwAG1cte0obAEWh6UZEMblxkFUKg7r/jk= From: Jacopo Mondi Date: Fri, 13 Mar 2026 15:53:57 +0100 Subject: [PATCH v2 1/6] media: mali-c55: Fix wrong comment of ISP block types Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-mali-c55-fixes-v7-0-v2-1-885c07961f30@ideasonboard.com> References: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> In-Reply-To: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> To: Anthony McGivern , Vincenzo Frascino , Nayden Kanchev , Konstantin Babin , Daniel Scally , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1688; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=akGh0x+lpCwAL9qoHpyWhYIMXA/NdwJVUnlsDSXqYTs=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBptCUO/1BJa4A8L9/VM9eYPxbORCHHeCwXpIp8i 15YGZocZsqJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCabQlDgAKCRByNAaPFqFW PPC2EACaFMYvo66bdK1ufyGmYcgjRgxkGQwd0I062U9MR8i8mRGJpVwh4pwUQeiv2lQOw4yottE PmD6CEB5n9/p0L/jrZsH4vWMZwsfsmXIlXXIcxLjUZwA6I8PAVfAp/Rc05wCfyHiUVUbCcOZEbI uMYQDD3lDtlyruVTXbkJCCCSt5tMkQEPs/5alwOk9Mgntgt4ypJLEdn4DBzCgt/sprQmjiy/8I3 Hi/VNzlsKQiOg8Pr+eupOlWtfOqETZCRS6fH8P4TscNICXOt8KklLCPqxZfpmNWusoGFrf8Y8jU ftRtqjL5qMHSR38jrLFTvx+ipVYjNqzza8tcxP/1yFn5Mt1Iq8IiAFb8mt/YEEw2jBYpRxnG799 RiBO9YccMeWbWEq/vPP+Ku5ixMnel6NSjSOopz+SidibDPFVD3ZWyDdO7xLCShLboANJEbN4w4o fRAkmMzLCakG2TT2TJFvL7dhM8ZA+zRlLTeHYI2vYM3AP8d0/UWAAX6kut1qwiE7mtdYsXYi3sk 3/31XLvV5teS32aO0/1pNIJFxuwliLVZE4exif/QXi0j26YCk3hzVqaJXcqKYuVnMW55FdwuADc cuFhCcsU9vRMDHYRZwkc0joZwF9IaLvQOFLJkLzLyljiYFkme9ZTnYw4of5n5r8/mdbNBzF5zuL 2UOIeauhwEPXIYg== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B Some bad copy&paste happened in the description of the ISP block types and AWB_CONFIG got mixed up with SHADING_CONFIG. Fix it by assigning to each block the correct type. As only the comment is changed, there is no uABI breakage or regression. Cc: stable@vger.kernel.org Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Reviewed-by: Daniel Scally Signed-off-by: Jacopo Mondi Reviewed-by: Barnab=C3=A1s P=C5=91cze --- drivers/media/platform/arm/mali-c55/mali-c55-params.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/driver= s/media/platform/arm/mali-c55/mali-c55-params.c index be0e909bcf29..c03a6120ddbf 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c @@ -43,9 +43,9 @@ * @digital_gain: For header->type =3D=3D MALI_C55_PARAM_BLOCK_DIGITAL_GAIN * @awb_gains: For header->type =3D=3D MALI_C55_PARAM_BLOCK_AWB_GAINS and * header->type =3D MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP - * @awb_config: For header->type =3D=3D MALI_C55_PARAM_MESH_SHADING_CONFIG - * @shading_config: For header->type =3D=3D MALI_C55_PARAM_MESH_SHADING_SE= LECTION - * @shading_selection: For header->type =3D=3D MALI_C55_PARAM_BLOCK_SENSOR= _OFFS + * @awb_config: For header->type =3D=3D MALI_C55_PARAM_BLOCK_AWB_CONFIG + * @shading_config: For header->type =3D=3D MALI_C55_PARAM_MESH_SHADING_CO= NFIG + * @shading_selection: For header->type =3D=3D MALI_C55_PARAM_MESH_SHADING= _SELECTION * @data: Allows easy initialisation of a union variable with a * pointer into a __u8 array. */ --=20 2.53.0 From nobody Tue Apr 7 11:20:58 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DB313AEF51; Fri, 13 Mar 2026 14:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413655; cv=none; b=jiUKTF0VGrLQHDGBu+C85qqdaYhncCEpdCKtcr0LSvmq61s+dcBrj1xk/QBY0kYa7XuG4ZVZwJW88j/Ya/JwtMpXI+onlOErYzm2Q9qUFXfyQJapHEm7igrBo57bI1rTASuy1hd6+1m9wiPmIheCi3l5frexRjcERTywZkxDYn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413655; c=relaxed/simple; bh=Dk8ZDvYfvz5HR2ziHGUIMpy0acO3OxhEfd43yVDbz7U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PxFMBIntYXRnKvqzODudPt0G8/B0ad2BDpW6rLRNNDybd9ZODZAO55CHP1/woadbRBVnglD3f5gMsTfWb9JbOIx3VbrwT0rAzgc/ay+y02eiZEXFMNCVXc7hvbf4LGptgvjk1w+Axob57b+SmYE86D4SH4dWJSDkOOwefuWewqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=hxY9+DL+; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hxY9+DL+" Received: from [192.168.224.131] (unknown [37.159.122.93]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 266CD1783; Fri, 13 Mar 2026 15:53:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773413582; bh=Dk8ZDvYfvz5HR2ziHGUIMpy0acO3OxhEfd43yVDbz7U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hxY9+DL+R/KRpHdMg8cgjJv09GKH0ZssuDzelXK8mP23pjGnf7iqE/ze9LC5drBbs 9Fhwcgl4SG6VPnBFn8OihqQ8ZTH97lH6ANi71Hm1ljsJOGsTrfKZvAwfVJsXDuhSHQ PTf505CFNpTfnWAv2mVAPFj8tZWdQ5oaGKy0NII4= From: Jacopo Mondi Date: Fri, 13 Mar 2026 15:53:58 +0100 Subject: [PATCH v2 2/6] media: mali-c55: Initialize the ISP in enable_streams() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-mali-c55-fixes-v7-0-v2-2-885c07961f30@ideasonboard.com> References: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> In-Reply-To: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> To: Anthony McGivern , Vincenzo Frascino , Nayden Kanchev , Konstantin Babin , Daniel Scally , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=9591; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=Dk8ZDvYfvz5HR2ziHGUIMpy0acO3OxhEfd43yVDbz7U=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBptCUOj5WA26h5diOUFrq5dCf7MYaDlRS8cxNLV BXxKFRPo0yJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCabQlDgAKCRByNAaPFqFW PAjfEACswjV8UMQm6fHEn6FGicz/mYLXAbOPfLpKdjw04c7+1966cMeWn3+mpf6G0y6uVWQHdR4 VeKFiNrfl/VLy7XEISuDoyRxfQUy43yYIhQntA6AjKT+O/SGFfyC2LTS0b6nx9u3w/7j3LcwE2G /evu8+drSFHqB7gxIJELNkXLvN3J3Kdhm6YlMjCgXQQuVa5omXvqp0CyGRCBL1wIfRG2Wh9Gg3+ QOv5EKkYWeTMT/SFef0E6IsvNhxeaY6yygHsva8xw596m9ctP9nNmbu7nwNLLkSKyxzawC3IsZU +Xh43gLogEDhm/yZZStYupTkkZfNqPrxl4nRlrRY4S2/7Xloz0KmFscL5mrcsHie4bC3YHCTm8W F3GuBIVmu7NZQyofnKcIhJVq40U9uSYtdXEUBlXxDCzy5NQ68+4Jz/coJ/my6GYAWpOx48zpbOP K8ZzTVxW8WDr9V56Mxw5tFKLHF11bNFetzvl8/MgncX3teMBA4kkCtAE30XP/uGKB6dkL0rz1xE 05NGe8AvwMmNAKo4V2wwvwztwf1wSQmvJmxkNnW7Aum7dm1uJ5dBbYFucf/TiXvSfz43J1IHYh/ 5PCLGrzQqjxniu6ftlkSn21n2qkMSS0CkN6RRmmpOKzN4Nqsvsn6jzLdxkA03MPDIeM1QLRpyT3 9G/KM7k14fumTrA== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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_strems() 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") Signed-off-by: Jacopo Mondi Reviewed-by: Daniel Scally --- .../media/platform/arm/mali-c55/mali-c55-common.h | 2 + .../media/platform/arm/mali-c55/mali-c55-core.c | 35 ----------- drivers/media/platform/arm/mali-c55/mali-c55-isp.c | 37 ++--------- .../media/platform/arm/mali-c55/mali-c55-params.c | 72 ++++++++++++++++++= ++++ 4 files changed, 79 insertions(+), 67 deletions(-) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-common.h b/driver= s/media/platform/arm/mali-c55/mali-c55-common.h index 31c1deaca146..13a3e9dc4243 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-common.h +++ b/drivers/media/platform/arm/mali-c55/mali-c55-common.h @@ -306,5 +306,7 @@ bool mali_c55_pipeline_ready(struct mali_c55 *mali_c55); void mali_c55_stats_fill_buffer(struct mali_c55 *mali_c55, enum mali_c55_config_spaces cfg_space); void mali_c55_params_write_config(struct mali_c55 *mali_c55); +void mali_c55_params_init_isp_config(struct mali_c55 *mali_c55, + const struct v4l2_subdev_state *state); =20 #endif /* _MALI_C55_COMMON_H */ diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/= media/platform/arm/mali-c55/mali-c55-core.c index 43b834459ccf..c1a562cd214e 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c @@ -663,41 +663,6 @@ static int mali_c55_init_context(struct mali_c55 *mali= _c55, mali_c55->base + config_space_addrs[MALI_C55_CONFIG_PING], MALI_C55_CONFIG_SPACE_SIZE); =20 - /* - * Some features of the ISP need to be disabled by default and only - * enabled at the same time as they're configured by a parameters buffer - */ - - /* Bypass the sqrt and square compression and expansion modules */ - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BYPASS_1, - MALI_C55_REG_BYPASS_1_FE_SQRT, - MALI_C55_REG_BYPASS_1_FE_SQRT); - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BYPASS_3, - MALI_C55_REG_BYPASS_3_SQUARE_BE, - MALI_C55_REG_BYPASS_3_SQUARE_BE); - - /* Bypass the temper module */ - mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_2, - MALI_C55_REG_BYPASS_2_TEMPER); - - /* Disable the temper module's DMA read/write */ - mali_c55_ctx_write(mali_c55, MALI_C55_REG_TEMPER_DMA_IO, 0x0); - - /* Bypass the colour noise reduction */ - mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_4, - MALI_C55_REG_BYPASS_4_CNR); - - /* Disable the sinter module */ - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_SINTER_CONFIG, - MALI_C55_SINTER_ENABLE_MASK, 0); - - /* Disable the RGB Gamma module for each output */ - mali_c55_ctx_write(mali_c55, MALI_C55_REG_FR_GAMMA_RGB_ENABLE, 0); - mali_c55_ctx_write(mali_c55, MALI_C55_REG_DS_GAMMA_RGB_ENABLE, 0); - - /* Disable the colour correction matrix */ - mali_c55_ctx_write(mali_c55, MALI_C55_REG_CCM_ENABLE, 0); - return 0; } =20 diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c b/drivers/m= edia/platform/arm/mali-c55/mali-c55-isp.c index 497f25fbdd13..4c0fd1ec741c 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c @@ -112,9 +112,6 @@ static int mali_c55_isp_start(struct mali_c55 *mali_c55, const struct v4l2_subdev_state *state) { struct mali_c55_context *ctx =3D mali_c55_get_active_context(mali_c55); - const struct mali_c55_isp_format_info *cfg; - const struct v4l2_mbus_framefmt *format; - const struct v4l2_rect *crop; u32 val; int ret; =20 @@ -122,35 +119,11 @@ static int mali_c55_isp_start(struct mali_c55 *mali_c= 55, MALI_C55_REG_MCU_CONFIG_WRITE_MASK, MALI_C55_REG_MCU_CONFIG_WRITE_PING); =20 - /* Apply input windowing */ - crop =3D v4l2_subdev_state_get_crop(state, MALI_C55_ISP_PAD_SINK_VIDEO); - format =3D v4l2_subdev_state_get_format(state, - MALI_C55_ISP_PAD_SINK_VIDEO); - cfg =3D mali_c55_isp_get_mbus_config_by_code(format->code); - - mali_c55_write(mali_c55, MALI_C55_REG_HC_START, - MALI_C55_HC_START(crop->left)); - mali_c55_write(mali_c55, MALI_C55_REG_HC_SIZE, - MALI_C55_HC_SIZE(crop->width)); - mali_c55_write(mali_c55, MALI_C55_REG_VC_START_SIZE, - MALI_C55_VC_START(crop->top) | - MALI_C55_VC_SIZE(crop->height)); - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BASE_ADDR, - MALI_C55_REG_ACTIVE_WIDTH_MASK, format->width); - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BASE_ADDR, - MALI_C55_REG_ACTIVE_HEIGHT_MASK, - format->height << 16); - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BAYER_ORDER, - MALI_C55_BAYER_ORDER_MASK, cfg->order); - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_INPUT_WIDTH, - MALI_C55_INPUT_WIDTH_MASK, - MALI_C55_INPUT_WIDTH_20BIT); - - mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_ISP_RAW_BYPASS, - MALI_C55_ISP_RAW_BYPASS_BYPASS_MASK, - cfg->bypass ? MALI_C55_ISP_RAW_BYPASS_BYPASS_MASK : - 0x00); - + /* + * Apply default ISP configuration and the apply configurations from + * the first available parameters buffer. + */ + mali_c55_params_init_isp_config(mali_c55, state); mali_c55_params_write_config(mali_c55); ret =3D mali_c55_config_write(ctx, MALI_C55_CONFIG_PING, true); if (ret) { diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/driver= s/media/platform/arm/mali-c55/mali-c55-params.c index c03a6120ddbf..c84a6047a570 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c @@ -732,6 +732,78 @@ void mali_c55_params_write_config(struct mali_c55 *mal= i_c55) vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); } =20 +void mali_c55_params_init_isp_config(struct mali_c55 *mali_c55, + const struct v4l2_subdev_state *state) +{ + const struct mali_c55_isp_format_info *cfg; + const struct v4l2_mbus_framefmt *format; + const struct v4l2_rect *crop; + + /* Apply input windowing */ + crop =3D v4l2_subdev_state_get_crop(state, MALI_C55_ISP_PAD_SINK_VIDEO); + format =3D v4l2_subdev_state_get_format(state, + MALI_C55_ISP_PAD_SINK_VIDEO); + cfg =3D mali_c55_isp_get_mbus_config_by_code(format->code); + + mali_c55_write(mali_c55, MALI_C55_REG_HC_START, + MALI_C55_HC_START(crop->left)); + mali_c55_write(mali_c55, MALI_C55_REG_HC_SIZE, + MALI_C55_HC_SIZE(crop->width)); + mali_c55_write(mali_c55, MALI_C55_REG_VC_START_SIZE, + MALI_C55_VC_START(crop->top) | + MALI_C55_VC_SIZE(crop->height)); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BASE_ADDR, + MALI_C55_REG_ACTIVE_WIDTH_MASK, format->width); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BASE_ADDR, + MALI_C55_REG_ACTIVE_HEIGHT_MASK, + format->height << 16); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BAYER_ORDER, + MALI_C55_BAYER_ORDER_MASK, cfg->order); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_INPUT_WIDTH, + MALI_C55_INPUT_WIDTH_MASK, + MALI_C55_INPUT_WIDTH_20BIT); + + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_ISP_RAW_BYPASS, + MALI_C55_ISP_RAW_BYPASS_BYPASS_MASK, + cfg->bypass ? MALI_C55_ISP_RAW_BYPASS_BYPASS_MASK : + 0x00); + + /* + * Some features of the ISP need to be disabled by default and only + * enabled at the same time as they're configured by a parameters buffer + */ + + /* Bypass the sqrt and square compression and expansion modules */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BYPASS_1, + MALI_C55_REG_BYPASS_1_FE_SQRT, + MALI_C55_REG_BYPASS_1_FE_SQRT); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BYPASS_3, + MALI_C55_REG_BYPASS_3_SQUARE_BE, + MALI_C55_REG_BYPASS_3_SQUARE_BE); + + /* Bypass the temper module */ + mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_2, + MALI_C55_REG_BYPASS_2_TEMPER); + + /* Disable the temper module's DMA read/write */ + mali_c55_ctx_write(mali_c55, MALI_C55_REG_TEMPER_DMA_IO, 0x0); + + /* Bypass the colour noise reduction */ + mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_4, + MALI_C55_REG_BYPASS_4_CNR); + + /* Disable the sinter module */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_SINTER_CONFIG, + MALI_C55_SINTER_ENABLE_MASK, 0); + + /* Disable the RGB Gamma module for each output */ + mali_c55_ctx_write(mali_c55, MALI_C55_REG_FR_GAMMA_RGB_ENABLE, 0); + mali_c55_ctx_write(mali_c55, MALI_C55_REG_DS_GAMMA_RGB_ENABLE, 0); + + /* Disable the colour correction matrix */ + mali_c55_ctx_write(mali_c55, MALI_C55_REG_CCM_ENABLE, 0); +} + void mali_c55_unregister_params(struct mali_c55 *mali_c55) { struct mali_c55_params *params =3D &mali_c55->params; --=20 2.53.0 From nobody Tue Apr 7 11:20:58 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 193143B3896; Fri, 13 Mar 2026 14:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413657; cv=none; b=AkZibRtXmL9nKisOauRPc916iWHuQZ0+BRYwYGPC10VZir/kbRPkHmmeSFif6u7UZo3ubiDd4gYT+V19L28sRNll+yCEk7Ffd8n9x50yerdhHCtvyCctmv0ocxCM/tFC/I1h5E5Dx4a5JDDHB1dfHoLC+T/CDD1rSkiMgIzrCtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413657; c=relaxed/simple; bh=0nP79qxKyt2X+hCH5uOYDoygKJCpsHZxRexF5epaeCY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rm/QHDvQbI83si0x5KkyiepoNgcFDiD//7tGY5DS/3iKDmAFwDDF9q2K0/he1RyRtwFgZQR7iM8Xma70TlEPQ+ZzENmfCukw/YJvNtxktac0i38/TtKBMOTxc9yCNlrBu5uJzbSTPqyg7hn6SEAuRJniSpWYecxvJOijLvm1WbY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=h+sCnRs4; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="h+sCnRs4" Received: from [192.168.224.131] (unknown [37.159.122.93]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 720D81934; Fri, 13 Mar 2026 15:53:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773413583; bh=0nP79qxKyt2X+hCH5uOYDoygKJCpsHZxRexF5epaeCY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=h+sCnRs48ii+ULgl73iF+dRHFpmRF9mmtu42BG+lsLq4VLkqit+Q1YPk62RAJ4ohS Qp2N4QTHAFFElMWJE9o6+5uUYsKt+m8ayndhKa+f8ik4GxYDywCckt17JFVe8x9+qy LplVETajpxFFNlL3081v5KZT5QnzZT6MdWcAf0W0= From: Jacopo Mondi Date: Fri, 13 Mar 2026 15:53:59 +0100 Subject: [PATCH v2 3/6] media: mali-c55: Fully reset the ISP configuration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-mali-c55-fixes-v7-0-v2-3-885c07961f30@ideasonboard.com> References: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> In-Reply-To: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> To: Anthony McGivern , Vincenzo Frascino , Nayden Kanchev , Konstantin Babin , Daniel Scally , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3739; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=0nP79qxKyt2X+hCH5uOYDoygKJCpsHZxRexF5epaeCY=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBptCUOYQk5tO8AtzN91XnVTR7Ee8TsQu84pR9dO hkmWpsoAZGJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCabQlDgAKCRByNAaPFqFW PI/nD/9dtpTry2G2H3eFrR4c43605cTaL0Y6DOGjo3IHjFIJbhYUAK+xPrmxie5ODDgUnI2twby v0+CVJq5LQsjB3PHEaXi1+UW0Bc/yqoQkXsfETEG1KkwdgvEY34gwi8F7AaJRwyrCsfp2gWQOlr GdZHxZlhu9cqqSbSZwVt8kpI6woxHEpfUhSaQNadtTxg+h1XG1eO4KjV7snrTUlnKQKT9xC2M0A PatAijEvpojipZnc9CYLFm/06uD1kxyU4NBFU/S0Vn8GyinCjHaJq8rZjtmxMPVuI5xfz+wiqlF mf8mZfLtLIYN1Bip/6c4VI9TiLgNjh7eh7wCZkI/HJfKBfFsP/F7szf6OWVrltMvbU68f37iJmR BOeUUL0e6UZyaT1q+LUaKA2gbuHcx7VxyEMb3CMvdGGl4NJfD6t4oYIreQSNNhd66PzJbaen63E Bwaa4fHsWem7QR1ZqcbQXDfGuRl2mNVtDqoAaqMrqPSjk/0rQEN3fn8fAbAKYNPKY+noNQg85h/ lAM+ZaPXdrQJ0WwIaX9SGWhnDxF6u5FlkMbcFtUsoRhKOtiO2nAUxJle0TIh21EKvyE2IWQBXJQ m1KMvc5xMhNYny5y4osH8U+q9tUocn/p8hul+NBP/AGTXuqXsY2I2aN7Idw+UW59Tablzs1sly5 HWjEte97UKQ33Ng== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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") Signed-off-by: Jacopo Mondi Reviewed-by: Daniel Scally --- .../media/platform/arm/mali-c55/mali-c55-params.c | 50 ++++++++++++++++++= ++++ 1 file changed, 50 insertions(+) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/driver= s/media/platform/arm/mali-c55/mali-c55-params.c index c84a6047a570..773e5b6a2b7e 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c @@ -781,6 +781,43 @@ void mali_c55_params_init_isp_config(struct mali_c55 *= mali_c55, MALI_C55_REG_BYPASS_3_SQUARE_BE, MALI_C55_REG_BYPASS_3_SQUARE_BE); =20 + /* Bypass the sensor offset correction (BLS) module */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BYPASS_3, + MALI_C55_REG_BYPASS_3_SENSOR_OFFSET_PRE_SH, + MALI_C55_REG_BYPASS_3_SENSOR_OFFSET_PRE_SH); + + /* Configure 1x digital gain. */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_DIGITAL_GAIN, + MALI_C55_DIGITAL_GAIN_MASK, 256); + + /* Set all AWB gains to 1x. at both AWB configuration points*/ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS1, + MALI_C55_AWB_GAIN00_MASK, 256); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS1, + MALI_C55_AWB_GAIN01_MASK, + MALI_C55_AWB_GAIN01(256)); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS2, + MALI_C55_AWB_GAIN10_MASK, 256); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS2, + MALI_C55_AWB_GAIN11_MASK, + MALI_C55_AWB_GAIN11(256)); + + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS1_AEXP, + MALI_C55_AWB_GAIN00_MASK, 256); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS1_AEXP, + MALI_C55_AWB_GAIN01_MASK, + MALI_C55_AWB_GAIN01(256)); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS2_AEXP, + MALI_C55_AWB_GAIN10_MASK, 256); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_AWB_GAINS2_AEXP, + MALI_C55_AWB_GAIN11_MASK, + MALI_C55_AWB_GAIN11(256)); + + /* Bypass mesh shading corrections (LSC). */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_MESH_SHADING_CONFIG, + MALI_C55_MESH_SHADING_ENABLE_MASK, + false); + /* Bypass the temper module */ mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_2, MALI_C55_REG_BYPASS_2_TEMPER); @@ -802,6 +839,19 @@ void mali_c55_params_init_isp_config(struct mali_c55 *= mali_c55, =20 /* Disable the colour correction matrix */ mali_c55_ctx_write(mali_c55, MALI_C55_REG_CCM_ENABLE, 0); + + /* Disable AWB stats. */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_METERING_CONFIG, + MALI_C55_AWB_DISABLE_MASK, + MALI_C55_AWB_DISABLE_MASK); + + /* Disable auto-exposure 1024-bin histograms at both tap points. */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_METERING_CONFIG, + MALI_C55_AEXP_HIST_DISABLE_MASK, + MALI_C55_AEXP_HIST_DISABLE); + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_METERING_CONFIG, + MALI_C55_AEXP_IHIST_DISABLE_MASK, + MALI_C55_AEXP_IHIST_DISABLE); } =20 void mali_c55_unregister_params(struct mali_c55 *mali_c55) --=20 2.53.0 From nobody Tue Apr 7 11:20:58 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33C703A6EF1; Fri, 13 Mar 2026 14:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413658; cv=none; b=VT7dWWVIBuCoRatCEnZwbSZL8Wofl3l8nVdFU9FnK9ekbfCjn13MrmiZrjhzGXtFyZEmTcQdL11P734EadYMCA58G+0CODcY8yh7ohu4JPyvypk3Vac86ttD1fe09XhyHCjDDwspjAf0uT9+BTqhMcxmWpFew88uoZAWUPCScV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413658; c=relaxed/simple; bh=XmLxcsUAKYkkjidcJqmK+cPfVsW3Ab7zChbDUSYi5/I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K3D9UnjdHhWKqUD5JQfBT4/3+OcNCfirNe5ttdifRj49PGij28RVR+C2tv/Vo8QcwBRt+kMfgb2tfxsH0z3xXBMCUQrgWxr8zTx2XZkMzjc5kQIOTM1WmvP7zKKmE9mpEo+Q4EYZk6rNaVx/sS04yTkqKwzvu0XfhnTy2oGVLCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=G5C1dj1c; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="G5C1dj1c" Received: from [192.168.224.131] (unknown [37.159.122.93]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C68AD1988; Fri, 13 Mar 2026 15:53:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773413584; bh=XmLxcsUAKYkkjidcJqmK+cPfVsW3Ab7zChbDUSYi5/I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=G5C1dj1ckaUOTHYu1RKBghzNKcxPOuDR9U3lfrH5Qt/SQy/t3NpbtdoMcfdE5hTx3 5qbVuko7+i2GJbDU5unlCWyptYAF6HgYQflSQ1Cjkml2pr/YsXJO61dZFw+KiN/s1T T1pX9lgnE2Bc6H/Z1wwGGXmWOKifsJqahalE8hrg= From: Jacopo Mondi Date: Fri, 13 Mar 2026 15:54:00 +0100 Subject: [PATCH v2 4/6] media: mali-c55: Fix Iridix bypass macros Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-mali-c55-fixes-v7-0-v2-4-885c07961f30@ideasonboard.com> References: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> In-Reply-To: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> To: Anthony McGivern , Vincenzo Frascino , Nayden Kanchev , Konstantin Babin , Daniel Scally , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1553; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=4N8oWm2wYAkAH06Iaeu2AiHBgMRAhSGXVKI6cFa7GuA=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBptCUOVdeQQ45IWm9/p0X2/9jhqMA9KWPvvAiYn jZIHuvYUmqJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCabQlDgAKCRByNAaPFqFW PGboD/9Es04a1vkeV7z/5agU/dXgwV2OrwbEy1rnfLfFeJVUUSdd/vO9+gy5Fw9GPnxiSIIF8dq coBGouvOVzDyAQhWnvEeDi1xic45/t4zB6IKO/LqqTwJlidOFxA8eDamVAJHzZsV59K57Pytt07 1xH32KyrtajQyBtEGlrcob1x+6m54W0y7ybV1IqqMoT2kH+OcPvELlWFPYgPTKKxBiL3sheZIRd M4cScFj3smoPd16oYZ2mD76W2KV2sjpDLZI6d9nt4VTBwYC9WvX0Pao7WzE9UaKIpsz8tkiJ8VV qc2myhffcFQvJREgfjQ3eZ1L8QjsowZH6jTmDV3uNB/IK94ipg4V5YcKPxcPNrB/EDGfVhed085 UU7mCzLEPuGHngVP3k4Lq1xDTFh1RZNp9UgDg+w8G8l6yh7t4PSMA/6vmy3gA8mamBcfb/aIInT jCqNPuG9UeqP1LpVDwISbdLlf7VUmCTPoDBs0kkhnAEe0DVv9rxcr6enV1NUtWqYPOHyKy8D+SK 11MEeFsRuVlqtgE0CbAfUc/CMASw6f4O3+wJjNDb3YEBh49Dyc5twIrdnV4oFFhQ/g3OO3YETxg nDqMIsxOBE8T+NwmvRm6cRLaeDi9f9CiuppghLe+Z2/+Kima5oLACGyZifzEcm3xoViOjACirbs RUraOm/EC2KAaOg== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B From: Daniel Scally 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 Reviewed-by: Barnab=C3=A1s P=C5=91cze Signed-off-by: Jacopo Mondi --- drivers/media/platform/arm/mali-c55/mali-c55-registers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-registers.h b/dri= vers/media/platform/arm/mali-c55/mali-c55-registers.h index f5a148add1c8..f098effde7b4 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-registers.h +++ b/drivers/media/platform/arm/mali-c55/mali-c55-registers.h @@ -128,8 +128,8 @@ enum mali_c55_interrupts { #define MALI_C55_REG_BYPASS_3_SENSOR_OFFSET_PRE_SH BIT(1) #define MALI_C55_REG_BYPASS_3_MESH_SHADING BIT(3) #define MALI_C55_REG_BYPASS_3_WHITE_BALANCE BIT(4) -#define MALI_C55_REG_BYPASS_3_IRIDIX BIT(5) -#define MALI_C55_REG_BYPASS_3_IRIDIX_GAIN BIT(6) +#define MALI_C55_REG_BYPASS_3_IRIDIX_GAIN BIT(5) +#define MALI_C55_REG_BYPASS_3_IRIDIX BIT(6) #define MALI_C55_REG_BYPASS_4 0x18ec0 #define MALI_C55_REG_BYPASS_4_DEMOSAIC_RGB BIT(1) #define MALI_C55_REG_BYPASS_4_PF_CORRECTION BIT(3) --=20 2.53.0 From nobody Tue Apr 7 11:20:58 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBAB63B47F8; Fri, 13 Mar 2026 14:54:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413660; cv=none; b=PiwMfmtkvrdx2f/zhlnwYKB04nNme03sLLK+FeSu9cGwRvRSoO8/WBJCtNaQGb9y7zHV1OnDBVw+AzcWqmtc43xpWF1bewyDYJirBDLK461550ZQPQsV2tar2RPY5cUzWhZDJb4UXBgR4Fu4RWkcf5NFRFLLBNtN9CD9K0RsyNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413660; c=relaxed/simple; bh=lrwSQ/eNX8gpc35hv6R8FV7RRXS5hR4Ghlea09Df8+E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JbYHnDqiy1wrOVVOjLtN1RQ9iZmi0PR794CwcO9bvsmRL+5CcPfyZxd6+NpR33yNP9l2KfzZydrSv7tn2O+Naj2XGDH10q3ISd+WbvYaMQjt/AgMaBIwqG5LAa6d+IW455ukFIqxi837jO12E039ySnoNVDoOoRS4i+7DIdyFQs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=pFEOYJ4/; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pFEOYJ4/" Received: from [192.168.224.131] (unknown [37.159.122.93]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DAF85E70; Fri, 13 Mar 2026 15:53:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773413585; bh=lrwSQ/eNX8gpc35hv6R8FV7RRXS5hR4Ghlea09Df8+E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pFEOYJ4/7n2htHxdTAyXt8XR5uH25SOBh9NhTXrUeNoUPS8Q8vcLtI+pQC8lZ7lIn xDZD/Nbi/nsprXy4HK43oFdS+XBIPQFKSxmKF47QV0EzjQvA4ngfJfsqqJqHmD532a hOyM3I1zjif+vruWS52ZL8B4x95Y5nHatv4e86XM= From: Jacopo Mondi Date: Fri, 13 Mar 2026 15:54:01 +0100 Subject: [PATCH v2 5/6] media: mali-c55: Bypass the Iridix Tonemap engine Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-mali-c55-fixes-v7-0-v2-5-885c07961f30@ideasonboard.com> References: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> In-Reply-To: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> To: Anthony McGivern , Vincenzo Frascino , Nayden Kanchev , Konstantin Babin , Daniel Scally , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1374; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=lrwSQ/eNX8gpc35hv6R8FV7RRXS5hR4Ghlea09Df8+E=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBptCUPD6QcyJQg07WlKWoqR7SmbsIkPltC/rKIO IMhEANR8MiJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCabQlDwAKCRByNAaPFqFW PHOpD/9MSrKEMMPSAQAlLqJSNex3RIbkLk540l1kO/WtDmrLG3Jp0iYrUvhoBjv9OYbGpp+dZn5 Tx3ZqIK40rapCbuL5UuEZxynQ1LSWylR5RPQb2SX66rzZBej8TXe/6yxd+FqEPsUKJY296LLP84 ikHN6wJfAbRv8C6QpvSGAqKBEfE2fN5FCi9vnVX/3UZ/M0qJ9Rm1hHtMUEvv5ntbIydSJ8vXEsa 6LvEivBYlMRG2BU2kd9+eWguEp5nHs9X2f63v7eDbCfxva2v83WWnpkC7oh9u4o+EH0HFhIbhLm S8uqWGISXk07oFLGBMLRZUVrMJb/fVeXQG4cyFUR1imYuq9U+lmrpwGMz94y8T/Y8gStCe1eng7 Vw+keSRRKxILsEGPuJ6r/rqxhRb48Z3zCF/8srZ04ELC2nUi1Gjhe5NoV9aBD7yeHbfe7rJLmyN +BztseH7xu26vWzkw3NGKvnc7V1DNt5aXdh25lheXfkHUe+SAwIH0HtOfMA+9Q9poJjLM1aMJX6 4QOSbHZ1wbdHB3UqGrRIdIvyvTw6wm0uTpLClEyUJIhLd9F7YDXfuefstu5PzRTveLy4p263TZS 5Vc2c12bKTTy++/iZ3kKiU0vEbowfAXR5fFv3K6zrW/1rBL6Egxw1r4fsKqp7MrE9eAFrJRihAv 8KvejE2evAG+TEg== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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. Signed-off-by: Jacopo Mondi Reviewed-by: Barnab=C3=A1s P=C5=91cze Reviewed-by: Daniel Scally --- drivers/media/platform/arm/mali-c55/mali-c55-params.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/driver= s/media/platform/arm/mali-c55/mali-c55-params.c index 773e5b6a2b7e..b9fc904a3844 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c @@ -825,6 +825,11 @@ void mali_c55_params_init_isp_config(struct mali_c55 *= mali_c55, /* Disable the temper module's DMA read/write */ mali_c55_ctx_write(mali_c55, MALI_C55_REG_TEMPER_DMA_IO, 0x0); =20 + /* Disable IRIDIX module. */ + mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_BYPASS_3, + MALI_C55_REG_BYPASS_3_IRIDIX, + MALI_C55_REG_BYPASS_3_IRIDIX); + /* Bypass the colour noise reduction */ mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_4, MALI_C55_REG_BYPASS_4_CNR); --=20 2.53.0 From nobody Tue Apr 7 11:20:58 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E11813B4EAD; Fri, 13 Mar 2026 14:54:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413661; cv=none; b=gFhe3Xu4TbNdaaLnfGNLLxJF10bVKFKNbiNfQT5xyLoHpyW3ymXzcTNwe/MXwaqKrz/A3BevAfp3cy2wHxmyVvgKtLlCd0+HyWi1Hn1MDCN4UarJZjruhWAw4WrWf5Zge2XFe1QUb+81KEDz0+XY4KcfFh7Xojw8Hf4nm+90QGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773413661; c=relaxed/simple; bh=K5xR+as2YLZIiFafNAQ3Wc9lccChZoZD4ad0tKCOnh0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n+TzKTsAtRQKmraQGRhofj/CtDARXjBIn05XnKBu2fKdZIjYTyZHWRzRTkuAAMFXyCSwYWbQYaR3Iqv9gGT6NZXvILhafLMFHjrhTNpYycb3WftQJzAOgO0AXea0SUupJK5LXjqGGffvgGI1WalxUwFOWuGLseER49Tp9dsY15A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=IAgbzwz6; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="IAgbzwz6" Received: from [192.168.224.131] (unknown [37.159.122.93]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D8BE3F52; Fri, 13 Mar 2026 15:53:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773413586; bh=K5xR+as2YLZIiFafNAQ3Wc9lccChZoZD4ad0tKCOnh0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IAgbzwz63P+DXSra6RKJFnKsBIFojcwklNwVjI4VN5oXOD8QRr6WxE3HPGWy8bXyg 2EahbG8MN+SRfxtSlsDXbk/O/H9z3kLrRe/wlTZIgyolDAMfFHSGCwVnrw7LCqzzQq qvIC5IjxQmFkjQDQSvlTopYNvrwnY9ynHAvXcky0= From: Jacopo Mondi Date: Fri, 13 Mar 2026 15:54:02 +0100 Subject: [PATCH v2 6/6] media: mali-c55: Bypass Purple Fringe Correction Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260313-mali-c55-fixes-v7-0-v2-6-885c07961f30@ideasonboard.com> References: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> In-Reply-To: <20260313-mali-c55-fixes-v7-0-v2-0-885c07961f30@ideasonboard.com> To: Anthony McGivern , Vincenzo Frascino , Nayden Kanchev , Konstantin Babin , Daniel Scally , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1470; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=K5xR+as2YLZIiFafNAQ3Wc9lccChZoZD4ad0tKCOnh0=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBptCUPO9gnynE2xKsLfZ4X/sjHs0xXAhEfUPf19 ZICDu98jbeJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCabQlDwAKCRByNAaPFqFW PLp3D/4uEniBjVIEPnEGmAi1rN7/AWDocHQC2mipWg/jlPiBIgki5xa1P1C7hQzTVbzCZ+V5yuV 8zelmZaYorAX/hJsH9qJy/R93HutxMvHETu+dlyaIZ7stSDAxYM77P2S9CByzcO/W6Dy1zJHUfE yc6wOdmHjyc/l9ETSa8tj21qwi21Uw81rOwlM12sKbnSOthGXgKq++VllcmOgTGnSq1YvgSn/2Z CGt8FIk6Dvz3r1vhxQnFpBxGNa3CE7S2OEXA5u4M00+D2cPexWFkaQchYSW4CSYXCjO7AmWTuUd TloWlGuYyxok0LMzF18ZL5OiMyXxU3AEi8MZ+u5W6eUm2xXK3jcMFTqigDbZTBA7qLfmdI2/DgS Lm+wEDtTm16mI++inofv4lUssYpb81j2kAuVUMamVk7uheoCaEBtjJVsXQHLOPwdbp140TnBRSx NcMQBtyGnyfJee6SH4a3QylMp7MNaW3hVjG/9Aw31OtG6I+S0akr3VLcOuOFM2U/sBYbX8jNBum DfGbrqQcJH+W0jc3aQdr7rDFpPJ+4BToM/q4khFeLmlWbvxiUSYX5a1xmFatNBXvVDgJX18wlCR eZaF5s7RaDyAtN2OgFHkc8kvfVvF9WPfHIdT783INdxkNyzJz1rfPIRD4rFAFSPpQ60fl+rHj7t 5O9pAu9xJa3Z64g== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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=C3=A1s P=C5=91cze Signed-off-by: Jacopo Mondi Reviewed-by: Daniel Scally --- drivers/media/platform/arm/mali-c55/mali-c55-params.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/driver= s/media/platform/arm/mali-c55/mali-c55-params.c index b9fc904a3844..de0e9d898db7 100644 --- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c +++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c @@ -830,9 +830,10 @@ void mali_c55_params_init_isp_config(struct mali_c55 *= mali_c55, MALI_C55_REG_BYPASS_3_IRIDIX, MALI_C55_REG_BYPASS_3_IRIDIX); =20 - /* Bypass the colour noise reduction */ + /* Bypass the colour noise reduction and the PF modules */ mali_c55_ctx_write(mali_c55, MALI_C55_REG_BYPASS_4, - MALI_C55_REG_BYPASS_4_CNR); + MALI_C55_REG_BYPASS_4_CNR | + MALI_C55_REG_BYPASS_4_PF_CORRECTION); =20 /* Disable the sinter module */ mali_c55_ctx_update_bits(mali_c55, MALI_C55_REG_SINTER_CONFIG, --=20 2.53.0