From patchwork Thu Jun 18 10:18:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 26925 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 C72F1C3307 for ; Thu, 18 Jun 2026 10:19:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6110662C71; Thu, 18 Jun 2026 12:19:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ryW9D6UO"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B674C629E6 for ; Thu, 18 Jun 2026 12:18:59 +0200 (CEST) Received: from [192.168.125.177] (mob-109-113-4-199.net.vodafone.it [109.113.4.199]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 84E952393; Thu, 18 Jun 2026 12:18:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1781777904; bh=h04KN9mLyfrik8nFAtKM57O5ZCpidFxhIftsvizNnko=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ryW9D6UOWq9vmU7YeaPkV8ZvTVCVl36xbrWyGHpQGhVFMHe4AIz0X5iQwDF4hGi+t jLIrRZZFsEdiIWAdnt3gOoIZGRXxzzosWcaXr8PJhLLZVRoM4SBI7ARLZnnbxI2iYp p577BTcXH9453dgs7ix7/BPCyEDTD53AHkfuWvPI= From: Jacopo Mondi Date: Thu, 18 Jun 2026 12:18:49 +0200 Subject: [PATCH 10/14] ipa: rppx1: Add RppX1Params and RppX1Stats MIME-Version: 1.0 Message-Id: <20260618-rppx1-ipa-v1-10-32337264cfcd@ideasonboard.com> References: <20260618-rppx1-ipa-v1-0-32337264cfcd@ideasonboard.com> In-Reply-To: <20260618-rppx1-ipa-v1-0-32337264cfcd@ideasonboard.com> To: =?utf-8?q?Niklas_S=C3=B6derlund?= , libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4428; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=h04KN9mLyfrik8nFAtKM57O5ZCpidFxhIftsvizNnko=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBqM8YKrvJd9kHlySs+WHGLxm0brTfWhahGEtcco 8lLe6uuZG2JAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCajPGCgAKCRByNAaPFqFW PDw5D/491rPiSIw5tx4s682pvIw3tY6JQ3qmVopARuTL79hbttal2hYqvp+WnrkZCjMMNfjhGbR TOacnkuPdDdQur3SliiKJhVJDdKS05FNcw5jMrqrboUherovL0RV4gIbxw89T5zqZiVk1ySqbVE Qu9PurWzM/9TRK48qOoWbOGTr3j1BGNOfz5ospi+oJZbjp1azFAZSF+QJGqmKNLpw4UrNp1tSIQ Ii394aImG4e/NL+MLQbiOTf9C1h6oZFwZm/DW+Km11+ReB6pMgm/ursCfdaw8hH3InmQAJ8STZA +IO5n68VEVeDK7cw2Y58FAAM1NFr+DyN6THg6gdN2C4DHhuSjxUw6nmLw8rTBTiLmrNG19FZNk5 crmXQFsvJHPgwneayzyv6QogIWJsP1XZELBNZNVuKx/kXc/yzm7CkeZqcVkDjJsgaRHn5qv86R9 jlgtlyWc07juSEMQaJKSwNcL0mBLnTK5cs3jw8CD5aV5wnR6n27XD9dZ/hajUeC8mPUbfYs369Q OhFEcBCqzf4+wZMGcN1GhJOEh07kUzXm7XgURjpWJq8njx3x5VXjdp4WEMNYZBZtpp/M7PTiSIA V5/c4FZMR7Go3v9SCJKu2w1GnNWbOnEzf3YCITNIcPnSvHewHjOuVwKS70zQ8wxRSHWceAAzUKV wr+EIo82DHyHx8g== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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 RppX1Params and RppX1Stats classes that implement V4L2Params and V4L2Stats for the RPP-X1 ISP. Signed-off-by: Jacopo Mondi --- src/ipa/rppx1/params.h | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ src/ipa/rppx1/stats.h | 62 ++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) diff --git a/src/ipa/rppx1/params.h b/src/ipa/rppx1/params.h new file mode 100644 index 000000000000..a7f927372c1d --- /dev/null +++ b/src/ipa/rppx1/params.h @@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2026, Ideas On Board + * + * RPP-X1 ISP Parameters + */ + +#pragma once + +#include + +#include + +namespace libcamera { + +namespace ipa::rppx1 { + +enum class BlockType : uint16_t { + BlsPre1, + LinPre1, + LscPre1, + AwbgPre1, + CcorPost, + GaHv, + WbmeasPost, + HistPost, + ExmPre1, +}; + +namespace details { + +template +struct block_type { +}; + +#define RPPX1_DEFINE_BLOCK_TYPE(blkType, cfgType, id) \ +template<> \ +struct block_type { \ + using type = struct rppx1_##cfgType##_params; \ + static constexpr rppx1_params_block_type blockType = \ + RPPX1_PARAMS_BLOCK_TYPE_##id; \ +}; + +RPPX1_DEFINE_BLOCK_TYPE(BlsPre1, bls, BLS_PRE1) +RPPX1_DEFINE_BLOCK_TYPE(LinPre1, lin, LIN_PRE1) +RPPX1_DEFINE_BLOCK_TYPE(LscPre1, lsc, LSC_PRE1) +RPPX1_DEFINE_BLOCK_TYPE(AwbgPre1, awbg, AWBG_PRE1) +RPPX1_DEFINE_BLOCK_TYPE(CcorPost, ccor, CCOR_POST) +RPPX1_DEFINE_BLOCK_TYPE(GaHv, ga, GA_HV) +RPPX1_DEFINE_BLOCK_TYPE(WbmeasPost, wbmeas, WBMEAS_POST) +RPPX1_DEFINE_BLOCK_TYPE(HistPost, hist, HIST_POST) +RPPX1_DEFINE_BLOCK_TYPE(ExmPre1, exm, EXM_PRE1) + +struct params_traits { + using id_type = BlockType; + + template + using id_to_details = block_type; +}; + +} /* namespace details */ + +template +class RppX1ParamsBlock final : public V4L2ParamsBlock +{ +public: + RppX1ParamsBlock(const Span data) + : V4L2ParamsBlock(data), + configData_(data.subspan(sizeof(v4l2_isp_block_header))) + { + } + + const T *operator->() const override + { + return reinterpret_cast(configData_.data()); + } + + T *operator->() override + { + return reinterpret_cast(configData_.data()); + } + + const T &operator*() const override + { + return *reinterpret_cast(configData_.data()); + } + + T &operator*() override + { + return *reinterpret_cast(configData_.data()); + } + +private: + Span configData_; +}; + +class RppX1Params : public V4L2Params +{ +public: + RppX1Params(Span data) + : V4L2Params(data, V4L2_ISP_PARAMS_VERSION_V1) + { + } +}; + +} /* namespace ipa::rppx1 */ + +} /* namespace libcamera */ diff --git a/src/ipa/rppx1/stats.h b/src/ipa/rppx1/stats.h new file mode 100644 index 000000000000..71a3e1da505c --- /dev/null +++ b/src/ipa/rppx1/stats.h @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2026, Ideas On Board + * + * RPP-X1 ISP Statistics + */ + +#pragma once + +#include + +#include + +namespace libcamera { + +namespace ipa::rppx1 { + +enum class StatsType : uint16_t { + HistPost, + ExmPre1, + WbmeasPost, +}; + +namespace details { + +template +struct stats_type { +}; + +#define RPPX1_DEFINE_STATS_TYPE(blkType, cfgType, id) \ +template<> \ +struct stats_type { \ + using type = struct rppx1_##cfgType##_stats; \ + static constexpr rppx1_stats_block_type blockType = \ + RPPX1_STATS_BLOCK_TYPE_##id; \ +}; + +RPPX1_DEFINE_STATS_TYPE(HistPost, hist, HIST_POST) +RPPX1_DEFINE_STATS_TYPE(ExmPre1, exm, EXM_PRE1) +RPPX1_DEFINE_STATS_TYPE(WbmeasPost, wbmeas, WBMEAS_POST) + +struct stats_traits { + using id_type = StatsType; + + template + using id_to_details = stats_type; +}; + +} /* namespace details */ + +class RppX1Stats : public V4L2Stats +{ +public: + RppX1Stats(Span data) + : V4L2Stats(data, V4L2_ISP_VERSION_V1) + { + } +}; + +} /* namespace ipa::rppx1 */ + +} /* namespace libcamera */