[{"id":37132,"web_url":"https://patchwork.libcamera.org/comment/37132/","msgid":"<386bb17d-e3e7-4791-98d1-395ed9d67bff@ideasonboard.com>","date":"2025-12-01T11:46:11","subject":"Re: [PATCH v3] media: rkisp1: Fix filter mode register configuration","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 11. 30. 14:02 keltezéssel, Rui Wang írta:\n> The rkisp1_flt_config() function performs an initial direct write to\n> RKISP1_CIF_ISP_FILT_MODE without including the RKISP1_CIF_ISP_FLT_ENA\n> bit, which clears the filter enable bit in the hardware.\n> \n> The subsequent read/modify/write sequence then reads back the register\n> with the enable bit already cleared and cannot restore it, resulting in\n> the filter being inadvertently disabled.\n> \n> Remove the redundant direct write. The read/modify/write sequence alone\n> correctly preserves the existing enable bit state while updating the\n> DNR mode and filter configuration bits.\n> \n> Signed-off-by: Rui Wang <rui.wang@ideasonboard.com>\n> ---\n\nI suppose this will have to go to the linux kernel mailing list at some point,\nbut in any case, it looks good to me. The write indeed seems redundant.\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   drivers/media/platform/rockchip/rkisp1/rkisp1-params.c | 6 ------\n>   1 file changed, 6 deletions(-)\n> \n> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c\n> index c9f88635224c..6442436a5e42 100644\n> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c\n> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c\n> @@ -411,12 +411,6 @@ static void rkisp1_flt_config(struct rkisp1_params *params,\n>   \trkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_LUM_WEIGHT,\n>   \t\t     arg->lum_weight);\n>   \n> -\trkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE,\n> -\t\t     (arg->mode ? RKISP1_CIF_ISP_FLT_MODE_DNR : 0) |\n> -\t\t     RKISP1_CIF_ISP_FLT_CHROMA_V_MODE(arg->chr_v_mode) |\n> -\t\t     RKISP1_CIF_ISP_FLT_CHROMA_H_MODE(arg->chr_h_mode) |\n> -\t\t     RKISP1_CIF_ISP_FLT_GREEN_STAGE1(arg->grn_stage1));\n> -\n>   \t/* avoid to override the old enable value */\n>   \tfilt_mode = rkisp1_read(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE);\n>   \tfilt_mode &= RKISP1_CIF_ISP_FLT_ENA;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 10D5FC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Dec 2025 11:46:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 017B460AC8;\n\tMon,  1 Dec 2025 12:46:17 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7AE8160A7B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Dec 2025 12:46:15 +0100 (CET)","from [192.168.33.24] (185.182.214.104.nat.pool.zt.hu\n\t[185.182.214.104])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CC8AC6DF;\n\tMon,  1 Dec 2025 12:44:01 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"l9RL3C75\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1764589441;\n\tbh=rUheiOGocCxlw5vFHMzoFdeWXfegNMmtfFB5EDeNPWo=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=l9RL3C75rbpq4q7D97pu4ZViY+JjSQg3cm5wEwn4ZxdokEzhi5fxDQ77j+DPWfFSo\n\tWM5Th3logNPGPPcoWXvKoEANM0WVTgnfxBv+iiCEg8WJnceZhvB2s3GEMN4T1ZIHHJ\n\tXkoFVjszIsHOX+eK7vG2qiHTb1KCeg4s6MC3GZBQ=","Message-ID":"<386bb17d-e3e7-4791-98d1-395ed9d67bff@ideasonboard.com>","Date":"Mon, 1 Dec 2025 12:46:11 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3] media: rkisp1: Fix filter mode register configuration","To":"Rui Wang <rui.wang@ideasonboard.com>, libcamera-devel@lists.libcamera.org","References":"<20251130130220.138695-1-rui.wang@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251130130220.138695-1-rui.wang@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]