From patchwork Thu Sep 11 09:05:46 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: 24305 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 8D057BDB13 for ; Thu, 11 Sep 2025 09:06:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3538069372; Thu, 11 Sep 2025 11:06:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.b="ks5WXvw7"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="RXNVmzjt"; dkim-atps=neutral Received: from fhigh-b3-smtp.messagingengine.com (fhigh-b3-smtp.messagingengine.com [202.12.124.154]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 447276935A for ; Thu, 11 Sep 2025 11:06:37 +0200 (CEST) Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0B2657A0010; Thu, 11 Sep 2025 05:06:36 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Thu, 11 Sep 2025 05:06:36 -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=1757581595; x=1757667995; bh=DjwXwJbtlgnSg4sO3UddRtGsoB4bpNQ9hqmd0f1RifU=; b= ks5WXvw7IeaFO9ph64Y4gZmvRvD6ruQh8u7qpRLEpYHeJs8Bzq4Teg8psiNQOoa+ qhlccSFApudKX79dyHowWSS97NBsVD0gIoYl1yYoNrdHz8gaDUqRqFhPZ16EyoYe Q+VOiDIz5ZvwcqFAEu2u7Aj8seO1xhScWG66MFw0CBs2Dq2SqnwL7Uu3kElToH9k NRrbO61p/QIxekW3CUXXpxoRoQmlhtuGWRIoLQr4fKnzrVfVaMhTMjGTlus8rftn VooSaaijqVJJ87SuEPYKceqjQOZoOM/qrjCK1Dd3ejs5dElgQ9sJ7KJWcXJvqEDB a2tn4+9mLco6KWiDvVR5SQ== 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=1757581595; x= 1757667995; bh=DjwXwJbtlgnSg4sO3UddRtGsoB4bpNQ9hqmd0f1RifU=; b=R XNVmzjtJFsdJp9IQeRmFFu1vEVxIEGmTmJfPb7i3D7kNKB5jmdXMeAtDWI6pc8mu hiKV1n2svjzta/KxEDEtydNkdhf7SpOtLSNfZYwHi61ybblnNIST01amTdTXvsKt pUHC8NDsGi5AfR+XORXRGMDUNlJWzYSZIWy3eHw4s8UVWUrB4c6fxmFMo2t2Dapy Imvcv4snIT2Bw3ANBU5msmXD2lINTEUwG7GKFk1A74BTc6Bj8SQUuA4jeZOVgMQb cLkSSlX7TRabXMm9aQZg1nmsGuaH7jAgp73np8aZ0eq1rmT2vLpsibTf0Om9PtSe UkPE0IxySlv7lhFTOxQDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheejjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhikhhlrghs ucfunpguvghrlhhunhguuceonhhikhhlrghsrdhsohguvghrlhhunhguodhrvghnvghsrg hssehrrghgnhgrthgvtghhrdhsvgeqnecuggftrfgrthhtvghrnhepheeigfeuveeutdef hfehgeekvedtleeuueekveefudehhffhjeffgfegffelfeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepnhhikhhlrghsrdhsohguvghrlhhu nhgusehrrghgnhgrthgvtghhrdhsvgdpnhgspghrtghpthhtohepgedpmhhouggvpehsmh htphhouhhtpdhrtghpthhtohepjhgrtghophhordhmohhnughisehiuggvrghsohhnsgho rghrugdrtghomhdprhgtphhtthhopehlrghurhgvnhhtrdhpihhntghhrghrthesihguvg grshhonhgsohgrrhgurdgtohhmpdhrtghpthhtoheplhhisggtrghmvghrrgdquggvvhgv lheslhhishhtshdrlhhisggtrghmvghrrgdrohhrghdprhgtphhtthhopehnihhklhgrsh drshhouggvrhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgv X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Sep 2025 05:06:35 -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 v2 1/2] ipa: rkisp1: Add settings for DreamChip RPPX1 ISP Date: Thu, 11 Sep 2025 11:05:46 +0200 Message-ID: <20250911090547.1860863-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250911090547.1860863-1-niklas.soderlund+renesas@ragnatech.se> References: <20250911090547.1860863-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 cf66d5553dcd..14600251dfe5 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) }, @@ -147,6 +155,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