From patchwork Mon Aug 24 09:06:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 28015 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 16248C3339 for ; Mon, 24 Aug 2026 09:07:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5D9C68393; Mon, 24 Aug 2026 11:07:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HszAR/1h"; 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 0DAA467FEC for ; Mon, 24 Aug 2026 11:07:07 +0200 (CEST) Received: from neptunite.hamster-moth.ts.net (unknown [IPv6:2400:2411:160:2f00:e616:f172:fe90:f1b5]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ABF86C24; Mon, 24 Aug 2026 11:05:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1787562342; bh=wE+G8FOfk2l9WPTDhebO2dGae0MfXf1PpV7BtEI4mWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HszAR/1hhtR1rfcFh6i/emXWaYAHmUGL02m4Xaw7E+2DEDxutTe1cK8Q9WPIl6SfK xlCK3f5gQeFsLvfa8Yok5ABDsqVzgPJwD5IAgDGR05WfrbdXDFd0+iHm5tN74NU6QT qBOSG3mkWBpIM9eTrUnt3zKPqw0PhfB9Txh3qQzk= 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 v2 04/20] ipa: rkisp2: stats: Add rkisp2 extensible statistics wrapper Date: Mon, 24 Aug 2026 18:06:21 +0900 Message-ID: <20260824090641.3705246-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20260824090641.3705246-1-paul.elder@ideasonboard.com> References: <20260824090641.3705246-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..1a63041ebe10 --- /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 */