From patchwork Fri Jul 3 12:25:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 27162 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 2815FC328C for ; Fri, 3 Jul 2026 12:26:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7C5665FCA; Fri, 3 Jul 2026 14:26:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JrddpVvW"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CD06F65FC3 for ; Fri, 3 Jul 2026 14:26:10 +0200 (CEST) Received: from neptunite.hamster-moth.ts.net (unknown [IPv6:2404:7a81:160:2100:a2cc:2f45:3bd7:2589]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EFEEA8E0; Fri, 3 Jul 2026 14:25:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1783081524; bh=G/6uyCRD1NKUobvC/oTtrFp+jzbE6ZxVDe2pRKvWNwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JrddpVvW4v1FqYjQ+0ZtRokPPMH7ChmLiYTMc7QHDVKKNqcRhm8wY4+ptAto0W0Gw 7uKaLS/NpQG6Jzcx7JNzeoWAiynsvUiKGbGz5CD2Pl9jsFvS/NJRRI/42XJnAiPHuY aqbr6ed4C2LfiR6L0uUgFYw+EGseppfxPcqyOvbw= From: Paul Elder To: laurent.pinchart@ideasonboard.com Cc: Paul Elder , michael.riesch@collabora.com, xuhf@rock-chips.com, stefan.klug@ideasonboard.com, kieran.bingham@ideasonboard.com, dan.scally@ideasonboard.com, jacopo.mondi@ideasonboard.com, nicolas.dufresne@collabora.com, libcamera-devel@lists.libcamera.org Subject: [RFC PATCH 03/19] ipa: rkisp2: params: Add rkisp2 extensible parameters wrapper Date: Fri, 3 Jul 2026 21:25:09 +0900 Message-ID: <20260703122543.1991189-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20260703122543.1991189-1-paul.elder@ideasonboard.com> References: <20260703122543.1991189-1-paul.elder@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" Add the libipa wrapper for extensible parameters for the rkisp2. This wraps the extensible parameters in the rkisp2 uapi to make them easier to use within libcamera. Signed-off-by: Paul Elder --- This is in a separate patch to reduce the size of the other patches to make them easier to review. --- src/ipa/rkisp2/algorithms/algorithm.h | 42 ++++++++++++++ src/ipa/rkisp2/params.h | 83 +++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 src/ipa/rkisp2/algorithms/algorithm.h create mode 100644 src/ipa/rkisp2/params.h diff --git a/src/ipa/rkisp2/algorithms/algorithm.h b/src/ipa/rkisp2/algorithms/algorithm.h new file mode 100644 index 000000000000..c30596e3299b --- /dev/null +++ b/src/ipa/rkisp2/algorithms/algorithm.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2026, Ideas On Board + * + * RkISP2 control algorithm interface + */ + +#pragma once + +#include + +#include + +#include "module.h" + +namespace libcamera { + +namespace ipa::rkisp2 { + +class Algorithm : public libcamera::ipa::Algorithm +{ +}; + +union rkisp2_params_block { + const struct v4l2_isp_params_block_header *header; + const struct rkisp2_params_bls *bls; + const struct rkisp2_params_awb_gains *awb_gains; + const struct rkisp2_params_csm *csm; + const struct rkisp2_params_ccm *ccm; + const struct rkisp2_params_goc *goc; + const struct rkisp2_params_lsc *lsc; + const struct rkisp2_params_ae_lite *ae_lite; + const struct rkisp2_params_hist_lite *hist_lite; + const struct rkisp2_params_hist_big *hist_big; + const struct rkisp2_params_awb_meas *awb_meas; + const __u8 *data; +}; + +} /* namespace ipa::rkisp2 */ + +} /* namespace libcamera */ + diff --git a/src/ipa/rkisp2/params.h b/src/ipa/rkisp2/params.h new file mode 100644 index 000000000000..c7c15483ee11 --- /dev/null +++ b/src/ipa/rkisp2/params.h @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2026, Ideas On Board + * + * RkISP2 ISP Parameters + */ + +#pragma once + +#include + +#include +#include + +#include + +namespace libcamera { + +namespace ipa::rkisp2 { + +enum class RkISP2Blocks : uint16_t { + Bls, + AwbGains, + Csm, + Ccm, + Goc, + Lsc, + AeLite, + HistLite, + HistBig0, + HistBig1, + HistBig2, + AwbMeas, +}; + +namespace details { + +template +struct block_type { +}; + +#define RKISP2_DEFINE_BLOCK_TYPE(id, cfgType, blkType) \ +template<> \ +struct block_type { \ + using type = struct rkisp2_params_##cfgType; \ + static constexpr rkisp2_params_block_type blockType = \ + rkisp2_params_block_type::RKISP2_PARAMS_##blkType; \ +} + +RKISP2_DEFINE_BLOCK_TYPE(Bls, bls, BLOCK_BLS); +RKISP2_DEFINE_BLOCK_TYPE(AwbGains, awb_gains, BLOCK_AWB_GAINS); +RKISP2_DEFINE_BLOCK_TYPE(Csm, csm, BLOCK_CSM); +RKISP2_DEFINE_BLOCK_TYPE(Ccm, ccm, BLOCK_CCM); +RKISP2_DEFINE_BLOCK_TYPE(Goc, goc, BLOCK_GOC); +RKISP2_DEFINE_BLOCK_TYPE(Lsc, lsc, BLOCK_LSC); +RKISP2_DEFINE_BLOCK_TYPE(AeLite, ae_lite, BLOCK_AE_LITE); +RKISP2_DEFINE_BLOCK_TYPE(HistLite, hist_lite, BLOCK_HIST_LITE); +RKISP2_DEFINE_BLOCK_TYPE(HistBig0, hist_big, BLOCK_HIST_BIG0); +RKISP2_DEFINE_BLOCK_TYPE(HistBig1, hist_big, BLOCK_HIST_BIG1); +RKISP2_DEFINE_BLOCK_TYPE(HistBig2, hist_big, BLOCK_HIST_BIG2); +RKISP2_DEFINE_BLOCK_TYPE(AwbMeas, awb_meas, BLOCK_AWB_MEAS); + +struct param_traits { + using id_type = RkISP2Blocks; + + template + using id_to_details = block_type; +}; + +} /* namespace details */ + +class RkISP2Params : public V4L2Params +{ +public: + RkISP2Params(Span data) + : V4L2Params(data, V4L2_ISP_PARAMS_VERSION_V1) + { + } +}; + +} /* namespace ipa::rkisp2 */ + +} /* namespace libcamera */