From patchwork Mon Nov 16 17:49:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28922 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 36A29C3304 for ; Mon, 16 Nov 2026 17:49:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 55C7B6A860; Mon, 16 Nov 2026 18:49:39 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dpUgNXli"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6247B6A848 for ; Mon, 16 Nov 2026 18:49:27 +0100 (CET) Received: from pb-laptop.local (185.221.140.49.nat.pool.zt.hu [185.221.140.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6E26D175; Mon, 16 Nov 2026 18:47:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794851220; bh=xmu86H1kwOfr/Rn6BvOhB4CP4pmrshuoZCO5bxWAjF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dpUgNXlifp98puH1cti8S/m0YNUi4YmbN5mjfPzUxXHAiq/LOk1KjlAPM1RIASuS4 qGIUxyZhVHGKuRHRfYL/2Nbfgeuz5xlKt+zpZAhvOqJX3Ky5iJ7PvW0X5FuCf8XH2t sqX8D5GCgmVXGPhQs93lcSKf7fpF5ALwck2i8/wM= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham Subject: [PATCH v5 09/22] ipa: libipa: ccm: Use 32-bit offsets Date: Mon, 16 Nov 2026 18:49:05 +0100 Message-ID: <20261116174919.1056403-10-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261116174919.1056403-1-barnabas.pocze@ideasonboard.com> References: <20261116174919.1056403-1-barnabas.pocze@ideasonboard.com> 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 currently used 16-bit offsets are not enough for all platforms. Offsets should ideally be defined as normalized numbers instead of effectively "raw" register values. But that requires breaking the tuning files, so it is postponsed, and this temporary solution is used. Link: https://gitlab.freedesktop.org/camera/libcamera/-/work_items/371 Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/ipa/ipu3/algorithms/ccm.cpp | 2 +- src/ipa/libipa/ccm.cpp | 2 +- src/ipa/libipa/ccm.h | 4 ++-- src/ipa/rkisp1/algorithms/ccm.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ipa/ipu3/algorithms/ccm.cpp b/src/ipa/ipu3/algorithms/ccm.cpp index 105d815b03..95ba67f8d1 100644 --- a/src/ipa/ipu3/algorithms/ccm.cpp +++ b/src/ipa/ipu3/algorithms/ccm.cpp @@ -57,7 +57,7 @@ void Ccm::queueRequest(IPAContext &context, [[maybe_unused]] const uint32_t fram void Ccm::setParameters(ipu3_uapi_params *params, IPAFrameContext &context) { const Matrix &matrix = context.ccm.ccm; - const Matrix &offsets = context.ccm.offsets; + const Matrix &offsets = context.ccm.offsets; params->use.acc_ccm = 1; diff --git a/src/ipa/libipa/ccm.cpp b/src/ipa/libipa/ccm.cpp index 8f3652f7e3..a19ae9f778 100644 --- a/src/ipa/libipa/ccm.cpp +++ b/src/ipa/libipa/ccm.cpp @@ -83,7 +83,7 @@ int CcmAlgorithmBase::init(const ValueNode &tuningData) << "Failed to parse 'offsets' " << "parameter from tuning file; falling back to zero offsets"; - offsets_.setData({ { 0, Matrix({ 0, 0, 0 }) } }); + offsets_.setData({ { 0, Matrix({ 0, 0, 0 }) } }); } return 0; diff --git a/src/ipa/libipa/ccm.h b/src/ipa/libipa/ccm.h index b72b25e2a3..c17d1ef303 100644 --- a/src/ipa/libipa/ccm.h +++ b/src/ipa/libipa/ccm.h @@ -23,7 +23,7 @@ namespace ccm { struct CcmContext { Matrix ccm; - Matrix offsets; + Matrix offsets; }; struct ActiveState { @@ -50,7 +50,7 @@ public: private: unsigned int ct_; Interpolator> ccm_; - Interpolator> offsets_; + Interpolator> offsets_; }; template diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp index 0e54c98710..f54edd44d1 100644 --- a/src/ipa/rkisp1/algorithms/ccm.cpp +++ b/src/ipa/rkisp1/algorithms/ccm.cpp @@ -67,7 +67,7 @@ void Ccm::queueRequest(IPAContext &context, void Ccm::setParameters(RkISP1Params *params, IPAFrameContext &context) { const Matrix &matrix = context.ccm.ccm; - const Matrix &offsets = context.ccm.offsets; + const Matrix &offsets = context.ccm.offsets; auto config = params->block(); config.setEnabled(true);