From patchwork Tue Jun 17 10:46:40 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: 23591 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 7786BBDE6B for ; Tue, 17 Jun 2025 10:46:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2270768DCE; Tue, 17 Jun 2025 12:46:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.b="Mlc4l9F3"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="dbj2ObHE"; 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 8620168DB1 for ; Tue, 17 Jun 2025 12:46:54 +0200 (CEST) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5A1A32540183; Tue, 17 Jun 2025 06:46:53 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 17 Jun 2025 06:46:53 -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=1750157213; x=1750243613; bh=Wm /LeTP0WbDNOM2qnhyohuK2Ov1/gvXgDw9HkdJX8uo=; b=Mlc4l9F3JlARG9AUb0 eqX+4wDUqrOvb3RcTnnwDpEXPePLpasZDq8DfNu+LtNJzsnSNE4DkUktTDMf2mXz 0yhXXVmgWbPlzVBNQZ7Vh0uv42GxVviyHd3yghTH3FUPbCfr5ixe11BIQiOJmGWr nvKb1mOQbFORGElgfGq14lsaMuo+/RLScHsqzpx7qUeKMAORLNfwlz9ovgga9vFm NoJ2LbDYMOaP6hma18juOmTw+gZIyLa0NpriCEQy4NRZ+Gixb9fL4S0sv9jKLOTi Rg+b8X1UzYQTLnuUpyznYZEV604NwZHXE7KIDyvoYRsQBMzBz2GUGVlb2F9U/aFQ Nz7A== 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=1750157213; x=1750243613; bh=Wm/LeTP0WbDNOM2qnhyohuK2Ov1/ gvXgDw9HkdJX8uo=; b=dbj2ObHECTNz2ARNYEaOHPnoshpf2T8O5OUIL2ssUHOd zVz6cZKHx44O/2KtlGk0e3K+licu7JcQ4LSNzdu3HatIZF5dZxeI9zDOYBSeVJ0U VKT6H8xC7XUoLzDGPSmvE8xKOT+wuyrkGgKDIbLC7pN85JEdqAu9Z1Y1WX32qx3/ 3vUJKBPB8MSq8VdfpgEP2mAFYv5moXoDeYKJSYFVuInDP/TSFQ//WQ4PQ240c5HA ok1RBDlLpXklG+eESJHfV1MBA17GfmbPN0Fmp1s7wEin3DT2ez3uUpv6TZWd8gyJ H5ZUvfWKkqsnhr54heTVHT+k/gVf/2WHoQJtaLVOWA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddvledtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeen ucfhrhhomheppfhikhhlrghsucfunpguvghrlhhunhguuceonhhikhhlrghsrdhsohguvg hrlhhunhguodhrvghnvghsrghssehrrghgnhgrthgvtghhrdhsvgeqnecuggftrfgrthht vghrnhephfeghfevgefhteduheffhfejieelheekvdevffdutdelgedugeejueeffeevff dtnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehnihhklhgrshdrshhouggvrhhluhhnugesrh grghhnrghtvggthhdrshgvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehjrggtohhpohdrmhhonhguihesihguvggrshhonhgsohgrrhgurd gtohhmpdhrtghpthhtoheplhgruhhrvghnthdrphhinhgthhgrrhhtsehiuggvrghsohhn sghorghrugdrtghomhdprhgtphhtthhopehlihgstggrmhgvrhgrqdguvghvvghlsehlih hsthhsrdhlihgstggrmhgvrhgrrdhorhhgpdhrtghpthhtohepnhhikhhlrghsrdhsohgu vghrlhhunhguodhrvghnvghsrghssehrrghgnhgrthgvtghhrdhsvg X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Jun 2025 06:46:52 -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 0/2] Add Renesas R-Car Gen4 pipeline with IPA support Date: Tue, 17 Jun 2025 12:46:40 +0200 Message-ID: <20250617104642.1607118-1-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.49.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! 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/rkisp1.mojom | 8 + meson.build | 1 + meson_options.txt | 1 + src/ipa/rkisp1/rkisp1.cpp | 11 + src/libcamera/pipeline/rcar-gen4/frames.cpp | 283 ++++++ src/libcamera/pipeline/rcar-gen4/frames.h | 87 ++ 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 | 816 ++++++++++++++++++ src/libcamera/pipeline/rcar-gen4/vin.cpp | 386 +++++++++ src/libcamera/pipeline/rcar-gen4/vin.h | 68 ++ 12 files changed, 1940 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