From patchwork Sun Nov 23 20:32:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25158 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4B31CC3336 for ; Sun, 23 Nov 2025 20:32:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8237B60A80; Sun, 23 Nov 2025 21:32:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lUEInwY/"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 792F1608CF for ; Sun, 23 Nov 2025 21:32:36 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.171.85.75]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 55E89606; Sun, 23 Nov 2025 21:30:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1763929828; bh=fHIi8H4QtFXebb4CdezvbnzBd9uc9qv0MRW0NFmwQyc=; h=From:To:Cc:Subject:Date:From; b=lUEInwY/H/scB4ht8BFa9POrD9k3fbVjKJaNn9uK3VCefLf5IicUtQ3dHN31g4ZOU R5GNVoQocBpQBlTNf77ukBrnbBFFBvJMVNPnv7uqMS1Z6GfgQauWyQuShj/WR/dRh4 IK0UQ6RU7aXoxEiTsd0WGMKGyk8MeA+cw9vH26QY= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [[PATCH v1]] media: rkisp1: Fix filter mode register configuration to handle enable and DNR bits separately Date: Sun, 23 Nov 2025 15:32:28 -0500 Message-ID: <20251123203228.3462026-1-rui.wang@ideasonboard.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The current implementation in rkisp1_flt_config() treats the arg->mode field as a boolean for enabling DNR mode, which doesn't properly separate the filter enable bit from the DNR mode bit in the RKISP1_CIF_ISP_FILT_MODE register. Update the register write to explicitly check individual bits: Bit 0 of arg->mode controls the filter enable (RKISP1_CIF_ISP_FLT_ENA) Bit 1 of arg->mode controls the DNR mode (RKISP1_CIF_ISP_FLT_MODE_DNR) This ensures that the filter enable and DNR mode can be configured independently through the mode field, Signed-off-by: Rui Wang --- drivers/media/platform/rockchip/rkisp1/rkisp1-params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c index b28f4140c8a3..077269848058 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c @@ -408,7 +408,8 @@ static void rkisp1_flt_config(struct rkisp1_params *params, arg->lum_weight); rkisp1_write(params->rkisp1, RKISP1_CIF_ISP_FILT_MODE, - (arg->mode ? RKISP1_CIF_ISP_FLT_MODE_DNR : 0) | + ((arg->mode & (1 << 1)) ? RKISP1_CIF_ISP_FLT_MODE_DNR : 0) | + ((arg->mode & (1 << 0)) ? RKISP1_CIF_ISP_FLT_ENA : 0) | RKISP1_CIF_ISP_FLT_CHROMA_V_MODE(arg->chr_v_mode) | RKISP1_CIF_ISP_FLT_CHROMA_H_MODE(arg->chr_h_mode) | RKISP1_CIF_ISP_FLT_GREEN_STAGE1(arg->grn_stage1));