From patchwork Sun Nov 23 20:28:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 25157 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 570A9C0F1B for ; Sun, 23 Nov 2025 20:28:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C6B060A8B; Sun, 23 Nov 2025 21:28:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UoimuY8n"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AD569608CF for ; Sun, 23 Nov 2025 21:28:26 +0100 (CET) Received: from rui-Precision-7560.local (unknown [209.171.85.75]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 37017606; Sun, 23 Nov 2025 21:26:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1763929578; bh=40POMfb/Qziu/+9FDbfW/fRo660d+MIkfsa9/2YkZrg=; h=From:To:Cc:Subject:Date:From; b=UoimuY8n2La7l3aOMgyskZOHFC0/ExnJrjnqwMgqDujq0E/woWu/ulNO+Ag3rOObK gwb+TYz2JG0XKGmGBR5HnLqeNH8dglIpyN9I9o/FNinLk8woys+tMd2/MFLXUfCf1O 4xUbBZI1PpqJNX2mjs+aqfY2w5hykVf/00DFnu0M= From: Rui Wang To: libcamera-devel@lists.libcamera.org Cc: Rui Wang Subject: [[PATCH v1]] ipa: rkisp1: filter: Fix sharpness enable/disable logic Date: Sun, 23 Nov 2025 15:28:16 -0500 Message-ID: <20251123202816.3460261-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 sharpness enable bit in the filter mode register was not being controlled correctly based on the sharpness level. Add explicit code to enable sharpness when sharpness > 1, and disable it otherwise. This ensures the hardware register is set properly to activate sharpness as intended. Signed-off-by: Rui Wang --- src/ipa/rkisp1/algorithms/filter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ipa/rkisp1/algorithms/filter.cpp b/src/ipa/rkisp1/algorithms/filter.cpp index 8ad79801..017618e4 100644 --- a/src/ipa/rkisp1/algorithms/filter.cpp +++ b/src/ipa/rkisp1/algorithms/filter.cpp @@ -216,6 +216,11 @@ void Filter::prepare([[maybe_unused]] IPAContext &context, config->fac_bl1 /= 2; } } + /* Set bit 0 of the config->mode to toggle on/off sharpness + * if sharpness > 1, enable sharpness, viseverse disable it + */ + config->mode &= ~(1u << 0); + config->mode |= static_cast(sharpness > 1) << 0; } REGISTER_IPA_ALGORITHM(Filter, "Filter")