[{"id":37153,"web_url":"https://patchwork.libcamera.org/comment/37153/","msgid":"<176465775606.135635.13034018447792643478@localhost>","date":"2025-12-02T06:42:36","subject":"Re: [PATCH v1 1/1] media: rkisp1: Fix filter mode register\n\tconfiguration","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Rui,\n\nThank you for the patch.\n\nQuoting Rui Wang (2025-12-02 02:50:25)\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\nThat sentence is a bit hard for me to understand. Maybe:\n\n\"The rkisp1_flt_config() function overwrites RKISP1_CIF_ISP_FILT_MODE\nwithout preserving the RKISP1_CIF_ISP_FLT_ENA bit thereby unconditionally\ndisabling the hardware block on reconfiguration.\n\nBut as I'm no native speaker you could maybe wait for feedback from a\nnative speaker.\n\nFunctionality wise the change is correct.\n\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nBest regards,\nStefan\n\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>  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>         rkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_LUM_WEIGHT,\n>                      arg->lum_weight);\n>  \n> -       rkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE,\n> -                    (arg->mode ? RKISP1_CIF_ISP_FLT_MODE_DNR : 0) |\n> -                    RKISP1_CIF_ISP_FLT_CHROMA_V_MODE(arg->chr_v_mode) |\n> -                    RKISP1_CIF_ISP_FLT_CHROMA_H_MODE(arg->chr_h_mode) |\n> -                    RKISP1_CIF_ISP_FLT_GREEN_STAGE1(arg->grn_stage1));\n> -\n>         /* avoid to override the old enable value */\n>         filt_mode = rkisp1_read(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE);\n>         filt_mode &= RKISP1_CIF_ISP_FLT_ENA;\n> -- \n> 2.43.0\n>","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 3883FC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  2 Dec 2025 06:42:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 64E0660C23;\n\tTue,  2 Dec 2025 07:42:43 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BDC4D60C23\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Dec 2025 07:42:41 +0100 (CET)","from ideasonboard.com (113x43x203x98.ap113.ftth.arteria-hikari.net\n\t[113.43.203.98])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E59B8E77;\n\tTue,  2 Dec 2025 07:40:26 +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=\"JBGWJfUv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1764657627;\n\tbh=jLcjBx9AvHp2WbwJbosGQXZob7xTDXEgsrM1sIqbe6Q=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=JBGWJfUvVCROXrhaNG0Ge1lXR/8RfqrkeQfq+4/j/eNmtZasxK6M0KIXziO7OvSPG\n\t1b+yTFzMVRLmnz9p9ra4goqaKz64kpNupGtcYpBoyQ2JZqnc3tHLyIBwxMvCKdnFin\n\t3VG5qFWTG21c40xQ1xCKbypJkivffaqurCfcI5ko=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251202015025.601549-2-rui.wang@ideasonboard.com>","References":"<20251202015025.601549-1-rui.wang@ideasonboard.com>\n\t<20251202015025.601549-2-rui.wang@ideasonboard.com>","Subject":"Re: [PATCH v1 1/1] media: rkisp1: Fix filter mode register\n\tconfiguration","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, Rui Wang <rui.wang@ideasonboard.com>","To":"Rui Wang <rui.wang@ideasonboard.com>, dafna@fastmail.com, heiko@sntech.de,\n\tlaurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, \n\tlinux-kernel@vger.kernel.org, linux-media@vger.kernel.org,\n\tlinux-rockchip@lists.infradead.org, mchehab@kernel.org","Date":"Tue, 02 Dec 2025 07:42:36 +0100","Message-ID":"<176465775606.135635.13034018447792643478@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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>"}},{"id":37476,"web_url":"https://patchwork.libcamera.org/comment/37476/","msgid":"<176761256763.3192372.8001486757502337420@ping.linuxembedded.co.uk>","date":"2026-01-05T11:29:27","subject":"Re: [PATCH v1 1/1] media: rkisp1: Fix filter mode register\n\tconfiguration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-12-02 06:42:36)\n> Hi Rui,\n> \n> Thank you for the patch.\n> \n> Quoting Rui Wang (2025-12-02 02:50:25)\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> That sentence is a bit hard for me to understand. Maybe:\n> \n> \"The rkisp1_flt_config() function overwrites RKISP1_CIF_ISP_FILT_MODE\n> without preserving the RKISP1_CIF_ISP_FLT_ENA bit thereby unconditionally\n> disabling the hardware block on reconfiguration.\n\n\nStefan's proposal sounds good here.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> But as I'm no native speaker you could maybe wait for feedback from a\n> native speaker.\n> \n> Functionality wise the change is correct.\n> \n> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> Best regards,\n> Stefan\n> \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> >  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> >         rkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_LUM_WEIGHT,\n> >                      arg->lum_weight);\n> >  \n> > -       rkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE,\n> > -                    (arg->mode ? RKISP1_CIF_ISP_FLT_MODE_DNR : 0) |\n> > -                    RKISP1_CIF_ISP_FLT_CHROMA_V_MODE(arg->chr_v_mode) |\n> > -                    RKISP1_CIF_ISP_FLT_CHROMA_H_MODE(arg->chr_h_mode) |\n> > -                    RKISP1_CIF_ISP_FLT_GREEN_STAGE1(arg->grn_stage1));\n> > -\n> >         /* avoid to override the old enable value */\n> >         filt_mode = rkisp1_read(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE);\n> >         filt_mode &= RKISP1_CIF_ISP_FLT_ENA;\n> > -- \n> > 2.43.0\n> >","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 E2079BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Jan 2026 11:29:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F130C61F9F;\n\tMon,  5 Jan 2026 12:29:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D16E61F35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Jan 2026 12:29:31 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 15C42664;\n\tMon,  5 Jan 2026 12:29:10 +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=\"EzzMb8HO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767612550;\n\tbh=iISwdZtvnnraV/VMYYVj79jvGkuZPTBqF1C6SfCyOhY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=EzzMb8HOeneWwzjW6sYtITaQ8Sg50f2HmArAmxA9vGADkwgV6rGLYbY4Aps7IK0Ys\n\tqdJMpeVTgDso/wLf6WaCRV6v3Uylym63LK83uGB9IhtwGTE6E+6Vvc5YbsbEn0WI1L\n\tL90b+d9rvoArIvwQYmg3m+NbAijw4cYgT/Na4k7k=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<176465775606.135635.13034018447792643478@localhost>","References":"<20251202015025.601549-1-rui.wang@ideasonboard.com>\n\t<20251202015025.601549-2-rui.wang@ideasonboard.com>\n\t<176465775606.135635.13034018447792643478@localhost>","Subject":"Re: [PATCH v1 1/1] media: rkisp1: Fix filter mode register\n\tconfiguration","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, Rui Wang <rui.wang@ideasonboard.com>","To":"Rui Wang <rui.wang@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>, dafna@fastmail.com,\n\theiko@sntech.de, laurent.pinchart@ideasonboard.com,\n\tlinux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org,\n\tlinux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,\n\tmchehab@kernel.org","Date":"Mon, 05 Jan 2026 11:29:27 +0000","Message-ID":"<176761256763.3192372.8001486757502337420@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}}]