From patchwork Thu Aug 27 10:49:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 28124 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 3EE66BDDFC for ; Thu, 27 Aug 2026 10:50:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E4D8F6847D; Thu, 27 Aug 2026 12:50:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Egedwv4Y"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F3C7D68454 for ; Thu, 27 Aug 2026 12:50:42 +0200 (CEST) Received: from neptunite.hamster-moth.ts.net (unknown [IPv6:2400:2411:160:2f00:306c:5b5b:3c7f:eabd]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6EEC0C1; Thu, 27 Aug 2026 12:49:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1787827756; bh=uosIflOYxlRN0/1CmcDBD7iyHzs1+//trWqQ5Wluhbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Egedwv4YkgmqWDwlb57IV1Rvq+ggbMzYJKKXOk521/WOFHi+tjDevkZMKmSVS6P5M H6FzphHy3ZleLCVeNaOK5q1R16v2C6ELeRL8StFRRTHUSa6M1h3hS7Z7y/Iu2fxl8u 8KnQ1RSj6k0I6cMycWPhhDeuCFsq9YBPluogtcv4= 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, mehdi.djait@linux.intel.com, libcamera-devel@lists.libcamera.org Subject: [PATCH v3 04/20] ipa: rkisp2: stats: Add rkisp2 extensible statistics wrapper Date: Thu, 27 Aug 2026 19:49:57 +0900 Message-ID: <20260827105018.2781166-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20260827105018.2781166-1-paul.elder@ideasonboard.com> References: <20260827105018.2781166-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 statistics for the rkisp2. This wraps the extensible statistics 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. New in v2 --- src/ipa/rkisp2/stats.h | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/ipa/rkisp2/stats.h diff --git a/src/ipa/rkisp2/stats.h b/src/ipa/rkisp2/stats.h new file mode 100644 index 000000000000..7d50183ef01e --- /dev/null +++ b/src/ipa/rkisp2/stats.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2026, Ideas On Board + * + * RkISP2 ISP Statistics + */ + +#pragma once + +#include + +#include +#include + +#include + +namespace libcamera { + +namespace ipa::rkisp2 { + +enum class RkISP2StatsBlocks : uint16_t { + AeLite, + HistLite, + HistBig0, + HistBig1, + HistBig2, + Awb, +}; + +template +struct block_type { +}; + +#define RKISP2_DEFINE_STATS_BLOCK_TYPE(id, cfgType, blkType) \ +template<> \ +struct block_type { \ + using type = struct rkisp2_stats_##cfgType; \ + static constexpr rkisp2_stats_block_type blockType = \ + rkisp2_stats_block_type::RKISP2_STATS_BLOCK_##blkType; \ +} + +RKISP2_DEFINE_STATS_BLOCK_TYPE(AeLite, ae_lite, AE_LITE); +RKISP2_DEFINE_STATS_BLOCK_TYPE(HistLite, hist, HIST_LITE); +RKISP2_DEFINE_STATS_BLOCK_TYPE(HistBig0, hist, HIST_BIG0); +RKISP2_DEFINE_STATS_BLOCK_TYPE(HistBig1, hist, HIST_BIG1); +RKISP2_DEFINE_STATS_BLOCK_TYPE(HistBig2, hist, HIST_BIG2); +RKISP2_DEFINE_STATS_BLOCK_TYPE(Awb, awb, AWB); + +struct stats_traits { + using id_type = RkISP2StatsBlocks; + template using id_to_details = block_type; +}; + +class RkISP2Stats : public V4L2Stats +{ +public: + RkISP2Stats(Span data) + : V4L2Stats(data, V4L2_ISP_VERSION_V1) + { + } +}; + +} /* namespace ipa::rkisp2 */ + +} /* namespace libcamera */