From patchwork Tue Jun 17 10:46:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 23592 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 8137CBDE6B for ; Tue, 17 Jun 2025 10:47:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3DB6568DCC; Tue, 17 Jun 2025 12:46:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.b="IR9xG8MR"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nKyTts63"; dkim-atps=neutral Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BE5A468DC3 for ; Tue, 17 Jun 2025 12:46:56 +0200 (CEST) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id C14212540183; Tue, 17 Jun 2025 06:46:55 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Tue, 17 Jun 2025 06:46:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1750157215; x=1750243615; bh=FieoyiWHCHxAErHZsrXqjLJl0EJf/xOouLXHYuh2NHs=; b= IR9xG8MR60ux0iSLDkB4GMXWMrX64ZV6sl2c21HnrloPrasosYJmIA4R4wyPMRuF mhMi+k1MtM8aUWB42dRV6HwwJHXvHG1kf1AnjXyFsGZ26hYf66sWXfMwJFnEgE+1 UVGcj8rjXFoTUhoMXaXY3ARhfM+NfNab6kXUdSx8FMC4ZMHcs+DCnYhge0bhDTEq EOJjdYLmgWxm5nSbgYegOdgL11mQmtmEa7f1Uv8svWy8GZllwKpyh53nvSrcjWDi Bud0nVMdf6k1hsocAodbYfDeV/6DOATDQf90wPRw/GNHabieX3LoIaCQ5yPGpCi+ vr1uynX16KuvFv4TpB44+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1750157215; x= 1750243615; bh=FieoyiWHCHxAErHZsrXqjLJl0EJf/xOouLXHYuh2NHs=; b=n KyTts630zKN2W1Y2f9zi0vCff41nv1O3183+kmNZ7qlPeFAuomjkhUEqVbVYLoQy wqiOJ36XiwywtSVxrLmreg8fEmwkt6r2PfdR0RPVBMwWpYbYcbrzl89RJYBeTaRB gtGLMiXjQq8WUu+3BpPkJDxPYHTLThUQ98yvZk3/f8FcZdFZ5sCSEIE1lzG2o+L1 ru43EgEaqUiNckNiy+KdauWLoQXlbVywOwX1XmHQAg2YL5CxYCyj7ed4mIsgfs0l uUnNscaw1ZwA86ZNuN9YTk5RfxQ/eM0I+oq+VA4r/aqldq1tAfXq1SVbHr8b310L bY3ukZ4NTOV1tkkBUnIpA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddvledtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredt jeenucfhrhhomheppfhikhhlrghsucfunpguvghrlhhunhguuceonhhikhhlrghsrdhsoh guvghrlhhunhguodhrvghnvghsrghssehrrghgnhgrthgvtghhrdhsvgeqnecuggftrfgr thhtvghrnhepheeigfeuveeutdefhfehgeekvedtleeuueekveefudehhffhjeffgfegff elfeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep nhhikhhlrghsrdhsohguvghrlhhunhgusehrrghgnhgrthgvtghhrdhsvgdpnhgspghrtg hpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhgrtghophhordhm ohhnughisehiuggvrghsohhnsghorghrugdrtghomhdprhgtphhtthhopehlrghurhgvnh htrdhpihhntghhrghrthesihguvggrshhonhgsohgrrhgurdgtohhmpdhrtghpthhtohep lhhisggtrghmvghrrgdquggvvhgvlheslhhishhtshdrlhhisggtrghmvghrrgdrohhrgh dprhgtphhtthhopehnihhklhgrshdrshhouggvrhhluhhnugdorhgvnhgvshgrshesrhgr ghhnrghtvggthhdrshgv X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Jun 2025 06:46:54 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Jacopo Mondi , Laurent Pinchart , libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 1/2] ipa: rkisp1: Add settings for DreamChip RPPX1 ISP Date: Tue, 17 Jun 2025 12:46:41 +0200 Message-ID: <20250617104642.1607118-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250617104642.1607118-1-niklas.soderlund+renesas@ragnatech.se> References: <20250617104642.1607118-1-niklas.soderlund+renesas@ragnatech.se> 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" The DreamChip RPPX1 ISP appears to be a superset of the Rockchip RkISP1 ISP V10. The RkISP1 interface and hardware operates at 8-bits color depth, while the RPPX1 operates at 24-bits. For this reason the RkISP1 parameter and buffer formats are deigned around 8-bits. The kernel driver for RPPX1 can however compensate for this and scale down it's internal data structures to 8-bits and produce parameter buffers (RK1E) and output statistics (RK1S) that is compatible with the RkISP1 IPA. The one difference is that the RPPX1 have 32 histogram buckets compared to RkISP1 V10 16. Add a dedicated hardware revisions descriptor for the RPPX1 device so it can reuse the existing IPA. Signed-off-by: Niklas Söderlund --- include/libcamera/ipa/rkisp1.mojom | 8 ++++++++ src/ipa/rkisp1/rkisp1.cpp | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom index 043ad27ea199..608ba82a0091 100644 --- a/include/libcamera/ipa/rkisp1.mojom +++ b/include/libcamera/ipa/rkisp1.mojom @@ -8,6 +8,14 @@ module ipa.rkisp1; import "include/libcamera/ipa/core.mojom"; +/* + * Hardware revisions in rkisp1-config.h (enum rkisp1_cif_isp_version) start at + * 10 and increment sequentially. Add a namespace starting at 0x80000000 for + * devices not cover by the kernel rkisp1 implementation but still supported + * by the IPA. + */ +const uint32 HwRevisionExternalRppX1 = 0x80000001; + struct IPAConfigInfo { libcamera.IPACameraSensorInfo sensorInfo; libcamera.ControlInfoMap sensorControls; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 1ed7d7d92166..00281404a9a0 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -113,6 +113,14 @@ const IPAHwSettings ipaHwSettingsV12{ false, }; +const IPAHwSettings ipaHwSettingsRPPX1{ + RKISP1_CIF_ISP_AE_MEAN_MAX_V10, + RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12, + RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10, + RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10, + false, +}; + /* List of controls handled by the RkISP1 IPA */ const ControlInfoMap::Map rkisp1Controls{ { &controls::DebugMetadataEnable, ControlInfo(false, true, false) }, @@ -148,6 +156,9 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision, case RKISP1_V12: context_.hw = &ipaHwSettingsV12; break; + case HwRevisionExternalRppX1: + context_.hw = &ipaHwSettingsRPPX1; + break; default: LOG(IPARkISP1, Error) << "Hardware revision " << hwRevision