From patchwork Fri Sep 12 08:15:10 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: 24347 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 5B705BDB13 for ; Fri, 12 Sep 2025 08:15:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 51CDA69367; Fri, 12 Sep 2025 10:15:21 +0200 (CEST) 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 5EE6E613A3 for ; Fri, 12 Sep 2025 10:15:19 +0200 (CEST) Received: from neptunite.rasen.tech (unknown [IPv6:2404:7a81:160:2100:5c83:71e0:e0c7:1670]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A12F7166D; Fri, 12 Sep 2025 10:14:03 +0200 (CEST) MIME-Version: 1.0 In-Reply-To: <20250911090547.1860863-1-niklas.soderlund+renesas@ragnatech.se> References: <20250911090547.1860863-1-niklas.soderlund+renesas@ragnatech.se> Subject: [PATCH v2 1/2] ipa: rkisp1: Add settings for DreamChip RPPX1 ISP From: Niklas =?utf-8?q?S=C3=B6derlund?= To: Jacopo Mondi , Laurent Pinchart , libcamera-devel@lists.libcamera.org Cc: Niklas =?utf-8?q?S=C3=B6derlund?= Date: Fri, 12 Sep 2025 17:15:10 +0900 Message-ID: <175766491057.2722520.11015700389987728544@neptunite.rasen.tech> User-Agent: alot/0.0.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 Looks good to me. Reviewed-by: Paul Elder --- 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