From patchwork Thu Sep 11 09:05:45 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: 24304 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 94BFDBDB13 for ; Thu, 11 Sep 2025 09:06:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D63616936F; Thu, 11 Sep 2025 11:06:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.b="rq0g8Xe6"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YDlMw1B7"; dkim-atps=neutral Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F066E6935A for ; Thu, 11 Sep 2025 11:06:34 +0200 (CEST) Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 97F1C1D000EC; Thu, 11 Sep 2025 05:06:33 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Thu, 11 Sep 2025 05:06:33 -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:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1757581593; x=1757667993; bh=7K zXZNoE3f3DLWHiRWNNR7JlP5EQc4UuObCJEZqrLf0=; b=rq0g8Xe6JI1NqUJCez 9UUuQk+3MfrE3vVEp/40R448cpap9YiAUS6oASJPBAkkKBILOJ1YRfvg1VHPYc40 dbkbPaOUBPGtpJo79BonVQCLmMxcu6z2nwvd9IC98wQO4QOrZIZeHaRDbEVEHR0h 91UoJbsiVJ9sVGbBTPhQ0PW5diiia9UoWrjig8vFSsYJYSBUOKaa2UbuFiBJjDCV FMGpwF33zJcgLuV6hAL9rPaMnEzJ7tb86ZjeBuVDBufvcOurOebg68V7f9mAHeYn G2u3QgxQ+HlZpIgPugTzh05wtBITER0MR7voLeQv2Y4sj3qTNdYJKpSQncktrlps iGyw== 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:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1757581593; x=1757667993; bh=7KzXZNoE3f3DLWHiRWNNR7JlP5EQ c4UuObCJEZqrLf0=; b=YDlMw1B75HQnxmbHCmnLj4buKyLOy29FWXuzUmortuyN 8e4DXGsGFjN3fkQZPWK7P10zm6UJD3DtuGgMlsoEl24SQYXSzMqrVKWzPTcSkHWI rfLBrQKsesmm0DR2WMISbdte/Nxp0SMdrromoueXrdZWGcddte1HMngviiKng6XB oCLBSiQChT1xunVAUTxaoxtYbR06A9xCFnz1xWLu+1wcFojjMGiAffhzOI+43ZTG Zw9QSDbz1FfLFhNt0qDLtCIfPsJOC9pUBNQl4B77Gq5nx6Hj0ugg3hxb/jPWu9lN W9hVXF5i106q6LS6BhBDyuFvVkyBT1B6aXErgtN2Cw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheejiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhikhhlrghsucfu npguvghrlhhunhguuceonhhikhhlrghsrdhsohguvghrlhhunhguodhrvghnvghsrghsse hrrghgnhgrthgvtghhrdhsvgeqnecuggftrfgrthhtvghrnhephfeghfevgefhteduheff hfejieelheekvdevffdutdelgedugeejueeffeevffdtnecuffhomhgrihhnpehkvghrnh gvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehnihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvpdhnsg gprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjrggtohhp ohdrmhhonhguihesihguvggrshhonhgsohgrrhgurdgtohhmpdhrtghpthhtoheplhgruh hrvghnthdrphhinhgthhgrrhhtsehiuggvrghsohhnsghorghrugdrtghomhdprhgtphht thhopehlihgstggrmhgvrhgrqdguvghvvghlsehlihhsthhsrdhlihgstggrmhgvrhgrrd horhhgpdhrtghpthhtohepnhhikhhlrghsrdhsohguvghrlhhunhguodhrvghnvghsrghs sehrrghgnhgrthgvtghhrdhsvg X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Sep 2025 05:06:32 -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 0/2] Add Renesas R-Car Gen4 pipeline with IPA support Date: Thu, 11 Sep 2025 11:05:45 +0200 Message-ID: <20250911090547.1860863-1-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.51.0 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" Hello, These two patches adds support for Renesas R-Car Gen4 devices. A new R-Car Gen4 specific pipeline handler is needed to support capture and DMA to/from the ISP. The IPA functionality can however (in user-space) piggy back on the existing RkISP1 IPA implementation. The architect of the hardware consist of two different blocks. There is one capture block (VIN) that is responsible for the interactions with the sensor and get RAW frames to user-space. And a ISP block acting in mem-to-mem mode responsible to process the RAW frames into statistic's and debayerd images. One notable thing about the hardware is that there are no scaler available anywhere in either of the blocks (that can scale RAW, VIN can scale non-RAW image data). The ISP is based on Dream Chip RPP which is similar to the V10 variant of RkISP1. For this reason the kernel driver was designed to reuse the RK1S and RK1E pixel formats. For libcamera this means the RkISP1 IPA can be re-used (almost) as is. Patch 1/2 adds a ID for the Dream Chip RPP ISP for the RkISP1 IPA. It's very similar to V10, but the histogram have more buckets so a distinct ID was needed. Patch 2/2 adds the new pipeline handler and wires it up to the RkISP1 IPA. This work have been tested with IMX219 and IMX462 on R-Car V4H. All libcamera compliance test pass. For IPA extensive testing with camshark have been done, and the RkISP1 uncalibrated.yaml hardware blocks function as expected and gives a good image. Please note, not all RK1E blocks are yet supported by the kernel driver, so using imx219.yaml will enable some parts of the IPA the kernel driver do not yet support. The plan on the kernel side is to add support for these blocks. Doing so will (hopefully) not require any changes to libcamera. This series depends on a patch from Hans de Goede [1] to allow more then one pipeline handler to use the same IPA. While on the kernel side this works depends on the still out-of-tree patches for the R-Car ISP [2]. Patches to add RkISP1 IPA debug meta data from Stefan have been used to verify proper operation of the hardware blocks supported by the kernel driver. Thanks for all your nice utilities Stefan, it made this work so much more enjoyable! Largest change since v1 is updating internal interfaces as v1 no longer compiles on-top of master. See individual patches for changelog. 1. [PATCH v2 7/8] libcamera: ipa_manager: createIPA: Allow matching by IPA name instead of by pipeline 20250510141220.54872-8-hdegoede@redhat.com 2. [PATCH 0/7] media: Add support for R-Car ISP using Dreamchip RPPX1 ISP https://lore.kernel.org/linux-renesas-soc/20250617103201.1594152-1-niklas.soderlund%2Brenesas@ragnatech.se/ Niklas Söderlund (2): ipa: rkisp1: Add settings for DreamChip RPPX1 ISP libcamera: pipeline: Add R-Car Gen4 ISP pipeline include/libcamera/ipa/meson.build | 1 + include/libcamera/ipa/rkisp1.mojom | 8 + meson.build | 1 + meson_options.txt | 1 + src/ipa/rkisp1/rkisp1.cpp | 11 + src/libcamera/pipeline/rcar-gen4/frames.cpp | 280 ++++++ src/libcamera/pipeline/rcar-gen4/frames.h | 85 ++ src/libcamera/pipeline/rcar-gen4/isp.cpp | 227 +++++ src/libcamera/pipeline/rcar-gen4/isp.h | 44 + src/libcamera/pipeline/rcar-gen4/meson.build | 8 + .../pipeline/rcar-gen4/rcar-gen4.cpp | 814 ++++++++++++++++++ src/libcamera/pipeline/rcar-gen4/vin.cpp | 391 +++++++++ src/libcamera/pipeline/rcar-gen4/vin.h | 66 ++ 13 files changed, 1937 insertions(+) create mode 100644 src/libcamera/pipeline/rcar-gen4/frames.cpp create mode 100644 src/libcamera/pipeline/rcar-gen4/frames.h create mode 100644 src/libcamera/pipeline/rcar-gen4/isp.cpp create mode 100644 src/libcamera/pipeline/rcar-gen4/isp.h create mode 100644 src/libcamera/pipeline/rcar-gen4/meson.build create mode 100644 src/libcamera/pipeline/rcar-gen4/rcar-gen4.cpp create mode 100644 src/libcamera/pipeline/rcar-gen4/vin.cpp create mode 100644 src/libcamera/pipeline/rcar-gen4/vin.h