{"id":23591,"url":"https://patchwork.libcamera.org/api/1.1/covers/23591/?format=json","web_url":"https://patchwork.libcamera.org/cover/23591/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250617104642.1607118-1-niklas.soderlund+renesas@ragnatech.se>","date":"2025-06-17T10:46:40","name":"[0/2] Add Renesas R-Car Gen4 pipeline with IPA support","submitter":{"id":230,"url":"https://patchwork.libcamera.org/api/1.1/people/230/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund+renesas@ragnatech.se"},"mbox":"https://patchwork.libcamera.org/cover/23591/mbox/","series":[{"id":5226,"url":"https://patchwork.libcamera.org/api/1.1/series/5226/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5226","date":"2025-06-17T10:46:40","name":"Add Renesas R-Car Gen4 pipeline with IPA support","version":1,"mbox":"https://patchwork.libcamera.org/series/5226/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/23591/comments/","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7786BBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Jun 2025 10:46:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2270768DCE;\n\tTue, 17 Jun 2025 12:46:57 +0200 (CEST)","from fhigh-b4-smtp.messagingengine.com\n\t(fhigh-b4-smtp.messagingengine.com [202.12.124.155])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8620168DB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Jun 2025 12:46:54 +0200 (CEST)","from phl-compute-06.internal (phl-compute-06.phl.internal\n\t[10.202.2.46])\n\tby mailfhigh.stl.internal (Postfix) with ESMTP id 5A1A32540183;\n\tTue, 17 Jun 2025 06:46:53 -0400 (EDT)","from phl-mailfrontend-01 ([10.202.2.162])\n\tby phl-compute-06.internal (MEProxy); Tue, 17 Jun 2025 06:46:53 -0400","by mail.messagingengine.com (Postfix) with ESMTPA; Tue,\n\t17 Jun 2025 06:46:52 -0400 (EDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ragnatech.se header.i=@ragnatech.se\n\theader.b=\"Mlc4l9F3\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"dbj2ObHE\"; \n\tdkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h=\n\tcc:cc:content-transfer-encoding:content-type:content-type:date\n\t:date:from:from:in-reply-to:message-id:mime-version:reply-to\n\t:subject:subject:to:to; s=fm3; t=1750157213; x=1750243613; bh=Wm\n\t/LeTP0WbDNOM2qnhyohuK2Ov1/gvXgDw9HkdJX8uo=; b=Mlc4l9F3JlARG9AUb0\n\teqX+4wDUqrOvb3RcTnnwDpEXPePLpasZDq8DfNu+LtNJzsnSNE4DkUktTDMf2mXz\n\t0yhXXVmgWbPlzVBNQZ7Vh0uv42GxVviyHd3yghTH3FUPbCfr5ixe11BIQiOJmGWr\n\tnvKb1mOQbFORGElgfGq14lsaMuo+/RLScHsqzpx7qUeKMAORLNfwlz9ovgga9vFm\n\tNoJ2LbDYMOaP6hma18juOmTw+gZIyLa0NpriCEQy4NRZ+Gixb9fL4S0sv9jKLOTi\n\tRg+b8X1UzYQTLnuUpyznYZEV604NwZHXE7KIDyvoYRsQBMzBz2GUGVlb2F9U/aFQ\n\tNz7A==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:cc:content-transfer-encoding\n\t:content-type:content-type:date:date:feedback-id:feedback-id\n\t:from:from:in-reply-to:message-id:mime-version:reply-to:subject\n\t:subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n\tfm1; t=1750157213; x=1750243613; bh=Wm/LeTP0WbDNOM2qnhyohuK2Ov1/\n\tgvXgDw9HkdJX8uo=; b=dbj2ObHECTNz2ARNYEaOHPnoshpf2T8O5OUIL2ssUHOd\n\tzVz6cZKHx44O/2KtlGk0e3K+licu7JcQ4LSNzdu3HatIZF5dZxeI9zDOYBSeVJ0U\n\tVKT6H8xC7XUoLzDGPSmvE8xKOT+wuyrkGgKDIbLC7pN85JEdqAu9Z1Y1WX32qx3/\n\t3vUJKBPB8MSq8VdfpgEP2mAFYv5moXoDeYKJSYFVuInDP/TSFQ//WQ4PQ240c5HA\n\tok1RBDlLpXklG+eESJHfV1MBA17GfmbPN0Fmp1s7wEin3DT2ez3uUpv6TZWd8gyJ\n\tH5ZUvfWKkqsnhr54heTVHT+k/gVf/2WHoQJtaLVOWA=="],"X-ME-Sender":"<xms:nUdRaASUN9KlUitcqV2-uejKkwTBnWi41uV9QhqfBP7khJbqUgI7SQ>\n\t<xme:nUdRaNy5S6Sa_9wgsLacmTmOAJys95t7DXvoXk_pCk42O2mttH7ourNmJwynGgBVX\n\ttsBdlbqDiV9cgV3Msc>","X-ME-Received":"<xmr:nUdRaN0iahPsk1Eln1-6dTXDuKQ8k1ADlHOOSNivgnXum7x4hNWzf64lZFOP0utdmQfGkvTITLrJ8k0fNqbk39fAyw>","X-ME-Proxy-Cause":"gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddvledtfecutefuodetggdotefrod\n\tftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp\n\tuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg\n\thnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeen\n\tucfhrhhomheppfhikhhlrghsucfunpguvghrlhhunhguuceonhhikhhlrghsrdhsohguvg\n\thrlhhunhguodhrvghnvghsrghssehrrghgnhgrthgvtghhrdhsvgeqnecuggftrfgrthht\n\tvghrnhephfeghfevgefhteduheffhfejieelheekvdevffdutdelgedugeejueeffeevff\n\tdtnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedt\n\tnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnihhklhgrshdrshhouggvrhhluhhnugesrh\n\tgrghhnrghtvggthhdrshgvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhu\n\tthdprhgtphhtthhopehjrggtohhpohdrmhhonhguihesihguvggrshhonhgsohgrrhgurd\n\tgtohhmpdhrtghpthhtoheplhgruhhrvghnthdrphhinhgthhgrrhhtsehiuggvrghsohhn\n\tsghorghrugdrtghomhdprhgtphhtthhopehlihgstggrmhgvrhgrqdguvghvvghlsehlih\n\thsthhsrdhlihgstggrmhgvrhgrrdhorhhgpdhrtghpthhtohepnhhikhhlrghsrdhsohgu\n\tvghrlhhunhguodhrvghnvghsrghssehrrghgnhgrthgvtghhrdhsvg","X-ME-Proxy":"<xmx:nUdRaEDSIq553pjmiZZ-LCkVwI6-WRELA_mJz7yb9t4_aUuwYLxPOA>\n\t<xmx:nUdRaJjJ_Pz1S-LGqRD-_KaiQmQ-PKsDS-YASY9LeOQOUZUjubIJnQ>\n\t<xmx:nUdRaAoCx_189XDptFE-xLhSSVmvadIf-nouP-7-ptjDtgiMwTfIhQ>\n\t<xmx:nUdRaMhrZtkVeB_AeGtY6A1b5xZKrFSRUVcfvJVWoBIcTt2artTv-Q>\n\t<xmx:nUdRaPNYPcLQ_wdZezsKvJHlpMHjJ1nNuvTVeAuW4p3Zexknx3yj-l7L>","Feedback-ID":"i80c9496c:Fastmail","From":"=?utf-8?q?Niklas_S=C3=B6derlund?=\n\t<niklas.soderlund+renesas@ragnatech.se>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund+renesas@ragnatech.se>","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","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hello,\n\nThese two patches adds support for Renesas R-Car Gen4 devices. A new \nR-Car Gen4 specific pipeline handler is needed to support capture and \nDMA to/from the ISP. The IPA functionality can however (in user-space) \npiggy back on the existing RkISP1 IPA implementation.\n\nThe architect of the hardware consist of two different blocks. There is \none capture block (VIN) that is responsible for the interactions with \nthe sensor and get RAW frames to user-space. And a ISP block acting in \nmem-to-mem mode responsible to process the RAW frames into statistic's \nand debayerd images. One notable thing about the hardware is that there \nare no scaler available anywhere in either of the blocks (that can scale \nRAW, VIN can scale non-RAW image data).\n\nThe ISP is based on Dream Chip RPP which is similar to the V10 variant \nof RkISP1. For this reason the kernel driver was designed to reuse the \nRK1S and RK1E pixel formats. For libcamera this means the RkISP1 IPA can \nbe re-used (almost) as is.\n\nPatch 1/2 adds a ID for the Dream Chip RPP ISP for the RkISP1 IPA. It's \nvery similar to V10, but the histogram have more buckets so a distinct \nID was needed. Patch 2/2 adds the new pipeline handler and wires it up \nto the RkISP1 IPA.\n\nThis work have been tested with IMX219 and IMX462 on R-Car V4H. All \nlibcamera compliance test pass. For IPA extensive testing with camshark \nhave been done, and the RkISP1 uncalibrated.yaml hardware blocks \nfunction as expected and gives a good image.\n\nPlease note, not all RK1E blocks are yet supported by the kernel driver, \nso using imx219.yaml will enable some parts of the IPA the kernel driver \ndo not yet support. The plan on the kernel side is to add support for \nthese blocks. Doing so will (hopefully) not require any changes to \nlibcamera.\n\nThis series depends on a patch from Hans de Goede [1] to allow more then \none pipeline handler to use the same IPA. While on the kernel side this \nworks depends on the still out-of-tree patches for the R-Car ISP [2].\n\nPatches to add RkISP1 IPA debug meta data from Stefan have been used to \nverify proper operation of the hardware blocks supported by the kernel \ndriver. Thanks for all your nice utilities Stefan, it made this work so \nmuch more enjoyable!\n\n1. [PATCH v2 7/8] libcamera: ipa_manager: createIPA: Allow matching by IPA name instead of by pipeline\n   20250510141220.54872-8-hdegoede@redhat.com\n\n2. [PATCH 0/7] media: Add support for R-Car ISP using Dreamchip RPPX1 ISP\n   https://lore.kernel.org/linux-renesas-soc/20250617103201.1594152-1-niklas.soderlund%2Brenesas@ragnatech.se/\n\nNiklas Söderlund (2):\n  ipa: rkisp1: Add settings for DreamChip RPPX1 ISP\n  libcamera: pipeline: Add R-Car Gen4 ISP pipeline\n\n include/libcamera/ipa/rkisp1.mojom            |   8 +\n meson.build                                   |   1 +\n meson_options.txt                             |   1 +\n src/ipa/rkisp1/rkisp1.cpp                     |  11 +\n src/libcamera/pipeline/rcar-gen4/frames.cpp   | 283 ++++++\n src/libcamera/pipeline/rcar-gen4/frames.h     |  87 ++\n src/libcamera/pipeline/rcar-gen4/isp.cpp      | 227 +++++\n src/libcamera/pipeline/rcar-gen4/isp.h        |  44 +\n src/libcamera/pipeline/rcar-gen4/meson.build  |   8 +\n .../pipeline/rcar-gen4/rcar-gen4.cpp          | 816 ++++++++++++++++++\n src/libcamera/pipeline/rcar-gen4/vin.cpp      | 386 +++++++++\n src/libcamera/pipeline/rcar-gen4/vin.h        |  68 ++\n 12 files changed, 1940 insertions(+)\n create mode 100644 src/libcamera/pipeline/rcar-gen4/frames.cpp\n create mode 100644 src/libcamera/pipeline/rcar-gen4/frames.h\n create mode 100644 src/libcamera/pipeline/rcar-gen4/isp.cpp\n create mode 100644 src/libcamera/pipeline/rcar-gen4/isp.h\n create mode 100644 src/libcamera/pipeline/rcar-gen4/meson.build\n create mode 100644 src/libcamera/pipeline/rcar-gen4/rcar-gen4.cpp\n create mode 100644 src/libcamera/pipeline/rcar-gen4/vin.cpp\n create mode 100644 src/libcamera/pipeline/rcar-gen4/vin.h"}