[{"id":39185,"web_url":"https://patchwork.libcamera.org/comment/39185/","msgid":"<20260618203127.GG2890159@ragnatech.se>","date":"2026-06-18T20:31:27","subject":"Re: [PATCH 10/14] ipa: rppx1: Add RppX1Params and RppX1Stats","submitter":{"id":230,"url":"https://patchwork.libcamera.org/api/people/230/","name":"Niklas Söderlund","email":"niklas.soderlund+renesas@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2026-06-18 12:18:49 +0200, Jacopo Mondi wrote:\n> Add RppX1Params and RppX1Stats classes that implement V4L2Params and\n> V4L2Stats for the RPP-X1 ISP.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>\n\n> ---\n>  src/ipa/rppx1/params.h | 108 +++++++++++++++++++++++++++++++++++++++++++++++++\n>  src/ipa/rppx1/stats.h  |  62 ++++++++++++++++++++++++++++\n>  2 files changed, 170 insertions(+)\n> \n> diff --git a/src/ipa/rppx1/params.h b/src/ipa/rppx1/params.h\n> new file mode 100644\n> index 000000000000..a7f927372c1d\n> --- /dev/null\n> +++ b/src/ipa/rppx1/params.h\n> @@ -0,0 +1,108 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2026, Ideas On Board\n> + *\n> + * RPP-X1 ISP Parameters\n> + */\n> +\n> +#pragma once\n> +\n> +#include <linux/media/dreamchip/rppx1-config.h>\n> +\n> +#include <libipa/v4l2_params.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::rppx1 {\n> +\n> +enum class BlockType : uint16_t {\n> +\tBlsPre1,\n> +\tLinPre1,\n> +\tLscPre1,\n> +\tAwbgPre1,\n> +\tCcorPost,\n> +\tGaHv,\n> +\tWbmeasPost,\n> +\tHistPost,\n> +\tExmPre1,\n> +};\n> +\n> +namespace details {\n> +\n> +template<BlockType B>\n> +struct block_type {\n> +};\n> +\n> +#define RPPX1_DEFINE_BLOCK_TYPE(blkType, cfgType, id)\t\t\\\n> +template<>\t\t\t\t\t\t\t\\\n> +struct block_type<BlockType::blkType> {\t\t\t\\\n> +\tusing type = struct rppx1_##cfgType##_params;\t\\\n> +\tstatic constexpr rppx1_params_block_type blockType =\t\\\n> +\t\tRPPX1_PARAMS_BLOCK_TYPE_##id;\t\t\t\\\n> +};\n> +\n> +RPPX1_DEFINE_BLOCK_TYPE(BlsPre1, bls, BLS_PRE1)\n> +RPPX1_DEFINE_BLOCK_TYPE(LinPre1, lin, LIN_PRE1)\n> +RPPX1_DEFINE_BLOCK_TYPE(LscPre1, lsc, LSC_PRE1)\n> +RPPX1_DEFINE_BLOCK_TYPE(AwbgPre1, awbg, AWBG_PRE1)\n> +RPPX1_DEFINE_BLOCK_TYPE(CcorPost, ccor, CCOR_POST)\n> +RPPX1_DEFINE_BLOCK_TYPE(GaHv, ga, GA_HV)\n> +RPPX1_DEFINE_BLOCK_TYPE(WbmeasPost, wbmeas, WBMEAS_POST)\n> +RPPX1_DEFINE_BLOCK_TYPE(HistPost, hist, HIST_POST)\n> +RPPX1_DEFINE_BLOCK_TYPE(ExmPre1, exm, EXM_PRE1)\n> +\n> +struct params_traits {\n> +\tusing id_type = BlockType;\n> +\n> +\ttemplate<id_type Id>\n> +\tusing id_to_details = block_type<Id>;\n> +};\n> +\n> +} /* namespace details */\n> +\n> +template<typename T>\n> +class RppX1ParamsBlock final : public V4L2ParamsBlock<T>\n> +{\n> +public:\n> +\tRppX1ParamsBlock(const Span<uint8_t> data)\n> +\t\t: V4L2ParamsBlock<T>(data),\n> +\t\t  configData_(data.subspan(sizeof(v4l2_isp_block_header)))\n> +\t{\n> +\t}\n> +\n> +\tconst T *operator->() const override\n> +\t{\n> +\t\treturn reinterpret_cast<const T *>(configData_.data());\n> +\t}\n> +\n> +\tT *operator->() override\n> +\t{\n> +\t\treturn reinterpret_cast<T *>(configData_.data());\n> +\t}\n> +\n> +\tconst T &operator*() const override\n> +\t{\n> +\t\treturn *reinterpret_cast<const T *>(configData_.data());\n> +\t}\n> +\n> +\tT &operator*() override\n> +\t{\n> +\t\treturn *reinterpret_cast<T *>(configData_.data());\n> +\t}\n> +\n> +private:\n> +\tSpan<uint8_t> configData_;\n> +};\n> +\n> +class RppX1Params : public V4L2Params<details::params_traits>\n> +{\n> +public:\n> +\tRppX1Params(Span<uint8_t> data)\n> +\t\t: V4L2Params(data, V4L2_ISP_PARAMS_VERSION_V1)\n> +\t{\n> +\t}\n> +};\n> +\n> +} /* namespace ipa::rppx1 */\n> +\n> +} /* namespace libcamera */\n> diff --git a/src/ipa/rppx1/stats.h b/src/ipa/rppx1/stats.h\n> new file mode 100644\n> index 000000000000..71a3e1da505c\n> --- /dev/null\n> +++ b/src/ipa/rppx1/stats.h\n> @@ -0,0 +1,62 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2026, Ideas On Board\n> + *\n> + * RPP-X1 ISP Statistics\n> + */\n> +\n> +#pragma once\n> +\n> +#include <linux/media/dreamchip/rppx1-config.h>\n> +\n> +#include <libipa/v4l2_stats.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace ipa::rppx1 {\n> +\n> +enum class StatsType : uint16_t {\n> +\tHistPost,\n> +\tExmPre1,\n> +\tWbmeasPost,\n> +};\n> +\n> +namespace details {\n> +\n> +template<StatsType B>\n> +struct stats_type {\n> +};\n> +\n> +#define RPPX1_DEFINE_STATS_TYPE(blkType, cfgType, id)\t\t\\\n> +template<>\t\t\t\t\t\t\t\\\n> +struct stats_type<StatsType::blkType> {\t\t\t\t\\\n> +\tusing type = struct rppx1_##cfgType##_stats;\t\t\\\n> +\tstatic constexpr rppx1_stats_block_type blockType =\t\\\n> +\t\tRPPX1_STATS_BLOCK_TYPE_##id;\t\t\t\\\n> +};\n> +\n> +RPPX1_DEFINE_STATS_TYPE(HistPost, hist, HIST_POST)\n> +RPPX1_DEFINE_STATS_TYPE(ExmPre1, exm, EXM_PRE1)\n> +RPPX1_DEFINE_STATS_TYPE(WbmeasPost, wbmeas, WBMEAS_POST)\n> +\n> +struct stats_traits {\n> +\tusing id_type = StatsType;\n> +\n> +\ttemplate<id_type Id>\n> +\tusing id_to_details = stats_type<Id>;\n> +};\n> +\n> +} /* namespace details */\n> +\n> +class RppX1Stats : public V4L2Stats<details::stats_traits>\n> +{\n> +public:\n> +\tRppX1Stats(Span<uint8_t> data)\n> +\t\t: V4L2Stats(data, V4L2_ISP_VERSION_V1)\n> +\t{\n> +\t}\n> +};\n> +\n> +} /* namespace ipa::rppx1 */\n> +\n> +} /* namespace libcamera */\n> \n> -- \n> 2.54.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CEF71BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Jun 2026 20:31:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8DFF262FE1;\n\tThu, 18 Jun 2026 22:31:34 +0200 (CEST)","from fout-b6-smtp.messagingengine.com\n\t(fout-b6-smtp.messagingengine.com [202.12.124.149])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 26CFB61754\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Jun 2026 22:31:32 +0200 (CEST)","from phl-compute-01.internal (phl-compute-01.internal\n\t[10.202.2.41])\n\tby mailfout.stl.internal (Postfix) with ESMTP id 955A01D00012;\n\tThu, 18 Jun 2026 16:31:30 -0400 (EDT)","from phl-frontend-04 ([10.202.2.163])\n\tby phl-compute-01.internal (MEProxy); Thu, 18 Jun 2026 16:31:30 -0400","by mail.messagingengine.com (Postfix) with ESMTPA; Thu,\n\t18 Jun 2026 16:31:29 -0400 (EDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ragnatech.se header.i=@ragnatech.se\n\theader.b=\"LM17OLs3\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"DZxMNbKd\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h=\n\tcc:cc:content-transfer-encoding:content-type:content-type:date\n\t:date:from:from:in-reply-to:in-reply-to:message-id:mime-version\n\t:references:reply-to:subject:subject:to:to; s=fm3; t=1781814690;\n\tx=1781901090; bh=2FkvpSnwvpukhtyQmXuPfC+Dad9fSBYgAfCy3UhHuuQ=; b=\n\tLM17OLs3en8EGWqxoT6WKDiUJsjFp9JyPYgIRBIqOG0PYW/SUFCTNQRq3tSNPOZe\n\tpbBWp6tROMLbN9i0hXzjQvynbch53U+A7TUhFmYq8ArXuDCEXV/Uz0p1U1Ex/PKN\n\tMz2Gqm5SMWiE86dva15i/bQ2HlN+h6/qKN1IMiWwMUAlvgdthcpb4PmuCmDxI+9z\n\tQfkfUk7Ek5g24RBihPt+4VJKJkW4mNYI5SJsaL42AkRDqpkHGFAkCu0e6eZqeLk6\n\tOUNLDSgC5prAlQ9JXbPREY/AeJreWgreZGK+NKNtf52vlpDeOZJZBVzZ8T3Ycs/g\n\tt6ArKBJm3yman7GUlu1Y8A==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:cc:content-transfer-encoding\n\t:content-type:content-type:date:date:feedback-id:feedback-id\n\t:from:from:in-reply-to:in-reply-to:message-id:mime-version\n\t:references:reply-to:subject:subject:to:to:x-me-proxy\n\t:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1781814690; x=\n\t1781901090; bh=2FkvpSnwvpukhtyQmXuPfC+Dad9fSBYgAfCy3UhHuuQ=; b=D\n\tZxMNbKdXsR6devS2YEmMq4Ig75lTGd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oSitSnJD0hJ52YLViqK/f3lcJvDSY\n\txcU1cB0hcIozbByJQKeOv9PvbzvatwQxNZ70K2JNjdO/RE4gwGL1rojFcwV3fCACvzCm5W\n\tRjHt6GjjsyAws2xFM9cXXLYrQQEDWz/Sew1bvbd35v47funDS7V+3389spDBFE+tVx6rdy\n\tyTIiTQc5gZIWfJIx5HdLUhj3eJZpTtSkyD71ytXpoHXTkwseWuS2BwUQJulFfg82env3tq\n\t4+7ORZptndjV0U/BuQlJJJLebRqdhj82YYe5pUEUgy/VB0lt4uF714CI47Hg","X-ME-Proxy":"<xmx:oVU0at6QyETkk12QdqiwbK5zDEhTqoToHLsLvV07OFOmCdYhtfOYbA>\n\t<xmx:oVU0aj2g-3Wsa5GZt2iYoq7dzz6yRzXXY7qJqSvKZuHtaqCN_R2Qog>\n\t<xmx:oVU0ambz7YkTNRQW9_t4RvNuOBQT6YEyj6HqJS9U7dL4Qv575YUPIg>\n\t<xmx:oVU0ajD5mjQoQteo8aRCHfz3o92NP9NGKMM4GliNtDwxLEu0hR_qyA>\n\t<xmx:olU0aoU9cNMobHyOMscMi81vkJITqppUWjONRAoZCTydG-tQxjRDOdu5>","Feedback-ID":"i80c9496c:Fastmail","Date":"Thu, 18 Jun 2026 22:31:27 +0200","From":"Niklas =?utf-8?q?S=C3=B6derlund?=\n\t<niklas.soderlund+renesas@ragnatech.se>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 10/14] ipa: rppx1: Add RppX1Params and RppX1Stats","Message-ID":"<20260618203127.GG2890159@ragnatech.se>","References":"<20260618-rppx1-ipa-v1-0-32337264cfcd@ideasonboard.com>\n\t<20260618-rppx1-ipa-v1-10-32337264cfcd@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260618-rppx1-ipa-v1-10-32337264cfcd@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]