From patchwork Mon Aug 24 09:06:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 28011 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 18D0CC3339 for ; Mon, 24 Aug 2026 09:06:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 51C3D68382; Mon, 24 Aug 2026 11:06:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lSi5D37N"; dkim-atps=neutral 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 899F467FEC for ; Mon, 24 Aug 2026 11:06:52 +0200 (CEST) Received: from neptunite.hamster-moth.ts.net (unknown [IPv6:2400:2411:160:2f00:e616:f172:fe90:f1b5]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CCDE4C23; Mon, 24 Aug 2026 11:05:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1787562327; bh=eoJFPYzHbk3vq45VnqjnyIAH33ClnK3amdozrjiUo64=; h=From:To:Cc:Subject:Date:From; b=lSi5D37NfKmBXoOo6Ppud2Jf6I1B8F4pPis2aQeTj4trwJ7SlQp689n1mclIBJ9Pd CKfOPyYxMndv3hVWafYKKjXww0UIKNv9TTptV2+8JcBskObnCgqCCAa8PL2iaGhqAq W+oa4Mq0K5OCuo14aX0rr1s4RkTn5ysKoZbLnZnU= From: Paul Elder To: laurent.pinchart@ideasonboard.com Cc: Paul Elder , michael.riesch@collabora.com, xuhf@rock-chips.com, stefan.klug@ideasonboard.com, kieran.bingham@ideasonboard.com, dan.scally@ideasonboard.com, jacopo.mondi@ideasonboard.com, nicolas.dufresne@collabora.com, mehdi.djait@linux.intel.com, libcamera-devel@lists.libcamera.org Subject: [PATCH v2 00/20] Add support for rkisp2 Date: Mon, 24 Aug 2026 18:06:17 +0900 Message-ID: <20260824090641.3705246-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 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" This series adds support for the rkisp2 pipeline handler and its IPA. It supports versions of the ISP supported by the rkisp2 driver (hence the name) in conjuction with the rkcif driver. The rkisp2 driver is posted on the list (currently v2) [0] and currently supports the RK3588. This pipeline handler implementation only supports memory-to-memory mode. The RFC version had a patch [1] to support inline mode using shared media graph [2] which I have removed in v2 to simplify things a little. See the patch list below for the list of control algorithms that are supported in the current version. This series depends on: - v2 of "rkisp1: pipeline rework for PFC" (patches 1~24 inclusive) [3] I've merged these together into a base branch here [4] and I have a branch including this series here [5]. On the kernel side, this series depends on: - v2 of "media: rockchip: rkisp2: Add driver for ISP on Rk3588" [0] Of which I have a branch here [6] I've added the IPA before the pipeline handler to not break compilation/execution and without having to replumb the pipeline handler. Otherwise I think the patchlist below is self-explanatory. Compared to the RFC version, not much has changed specifically on the libcamera side. Most of the changes are to match the changes in the driver, which are: - split DMA RX and main/self path pads on the ISP subdev - no more crop rectangles on subdev, as all crop and scaling configuration has moved to parameters buffers - use extensible stats The one libcamera-specific change is that the ScalerCrop control has now been implemented in a crop algorithm module. See the specific patch for more details. [0] https://lore.kernel.org/all/20260824090406.3695880-1-paul.elder@ideasonboard.com/T/#u [1] https://patchwork.libcamera.org/patch/27166/ [2] https://lore.kernel.org/all/20260619052637.1110672-1-paul.elder@ideasonboard.com/ [3] https://patchwork.libcamera.org/project/libcamera/list/?series=5849 [4] https://git.ideasonboard.com/epaul/libcamera/src/branch/epaul/dev/rkisp2/base [5] https://git.ideasonboard.com/epaul/libcamera/src/branch/epaul/dev/rkisp2/upstream-v2 [6] https://git.ideasonboard.com/epaul/linux/commits/branch/epaul/v7.2-rc1/rk3588/rkisp2/upstream-v2 Paul Elder (20): utils: update-kernel-headers: Add rkisp2-config.h include: linux: rkisp2-config.h: update to v7.2-rc1 ipa: rkisp2: params: Add rkisp2 extensible parameters wrapper ipa: rkisp2: stats: Add rkisp2 extensible statistics wrapper include: ipa: rkisp2: Add rkisp2 ipa interface ipa: rkisp2: Add rkisp2 ipa pipeline: rkisp2: Implement pipeline handler for rkisp2 ipa: rkisp2: algo: bls: Implement black level subtraction ipa: rkisp2: algo: awb: Implement automatic white balance control ipa: rkisp2: algo: agc: Implement automatic gain control ipa: rkisp2: algo: ccm: Implement color correction matrix ipa: rkisp2: algo: csm: Implement color space conversion ipa: rkisp2: algo: goc: Implement gamma out correction ipa: rkisp2: algo: lsc: Implement lens shading correction ipa: rkisp2: algo: crop: Implement scaler crop utils: tuning: libtuning: image: Enable images missing some metadata utils: tuning: rkisp2.py: Add tuning script for rkisp2 ipa: rkisp2: data: Add uncalibrated tuning file ipa: rkisp2: data: Add rudimentary tuning file for imx219 ipa: rkisp2: data: Add tuning file for imx708 Documentation/runtime_configuration.rst | 9 + include/libcamera/ipa/meson.build | 1 + include/libcamera/ipa/rkisp2.mojom | 47 + include/linux/README | 2 +- include/linux/rkisp2-config.h | 602 ++++++++++ include/linux/videodev2.h | 4 + meson.build | 1 + meson_options.txt | 3 +- src/ipa/meson.build | 1 + src/ipa/rkisp2/algorithms/agc.cpp | 479 ++++++++ src/ipa/rkisp2/algorithms/agc.h | 58 + src/ipa/rkisp2/algorithms/algorithm.h | 27 + src/ipa/rkisp2/algorithms/awb.cpp | 211 ++++ src/ipa/rkisp2/algorithms/awb.h | 56 + src/ipa/rkisp2/algorithms/bls.cpp | 154 +++ src/ipa/rkisp2/algorithms/bls.h | 41 + src/ipa/rkisp2/algorithms/ccm.cpp | 126 ++ src/ipa/rkisp2/algorithms/ccm.h | 57 + src/ipa/rkisp2/algorithms/crop.cpp | 99 ++ src/ipa/rkisp2/algorithms/crop.h | 39 + src/ipa/rkisp2/algorithms/csm.cpp | 177 +++ src/ipa/rkisp2/algorithms/csm.h | 34 + src/ipa/rkisp2/algorithms/goc.cpp | 143 +++ src/ipa/rkisp2/algorithms/goc.h | 42 + src/ipa/rkisp2/algorithms/lsc.cpp | 263 +++++ src/ipa/rkisp2/algorithms/lsc.h | 71 ++ src/ipa/rkisp2/algorithms/meson.build | 13 + src/ipa/rkisp2/algorithms/module.h | 29 + src/ipa/rkisp2/data/imx219.yaml | 139 +++ src/ipa/rkisp2/data/imx708.yaml | 155 +++ src/ipa/rkisp2/data/meson.build | 12 + src/ipa/rkisp2/data/uncalibrated.yaml | 7 + src/ipa/rkisp2/ipa_context.h | 211 ++++ src/ipa/rkisp2/meson.build | 30 + src/ipa/rkisp2/params.h | 85 ++ src/ipa/rkisp2/rkisp2.cpp | 440 +++++++ src/ipa/rkisp2/stats.h | 65 ++ src/libcamera/pipeline/rkisp2/meson.build | 5 + src/libcamera/pipeline/rkisp2/rkisp2.cpp | 1293 +++++++++++++++++++++ utils/tuning/libtuning/image.py | 25 +- utils/tuning/rkisp2.py | 42 + utils/update-kernel-headers.sh | 1 + 42 files changed, 5292 insertions(+), 7 deletions(-) create mode 100644 include/libcamera/ipa/rkisp2.mojom create mode 100644 include/linux/rkisp2-config.h create mode 100644 src/ipa/rkisp2/algorithms/agc.cpp create mode 100644 src/ipa/rkisp2/algorithms/agc.h create mode 100644 src/ipa/rkisp2/algorithms/algorithm.h create mode 100644 src/ipa/rkisp2/algorithms/awb.cpp create mode 100644 src/ipa/rkisp2/algorithms/awb.h create mode 100644 src/ipa/rkisp2/algorithms/bls.cpp create mode 100644 src/ipa/rkisp2/algorithms/bls.h create mode 100644 src/ipa/rkisp2/algorithms/ccm.cpp create mode 100644 src/ipa/rkisp2/algorithms/ccm.h create mode 100644 src/ipa/rkisp2/algorithms/crop.cpp create mode 100644 src/ipa/rkisp2/algorithms/crop.h create mode 100644 src/ipa/rkisp2/algorithms/csm.cpp create mode 100644 src/ipa/rkisp2/algorithms/csm.h create mode 100644 src/ipa/rkisp2/algorithms/goc.cpp create mode 100644 src/ipa/rkisp2/algorithms/goc.h create mode 100644 src/ipa/rkisp2/algorithms/lsc.cpp create mode 100644 src/ipa/rkisp2/algorithms/lsc.h create mode 100644 src/ipa/rkisp2/algorithms/meson.build create mode 100644 src/ipa/rkisp2/algorithms/module.h create mode 100644 src/ipa/rkisp2/data/imx219.yaml create mode 100644 src/ipa/rkisp2/data/imx708.yaml create mode 100644 src/ipa/rkisp2/data/meson.build create mode 100644 src/ipa/rkisp2/data/uncalibrated.yaml create mode 100644 src/ipa/rkisp2/ipa_context.h create mode 100644 src/ipa/rkisp2/meson.build create mode 100644 src/ipa/rkisp2/params.h create mode 100644 src/ipa/rkisp2/rkisp2.cpp create mode 100644 src/ipa/rkisp2/stats.h create mode 100644 src/libcamera/pipeline/rkisp2/meson.build create mode 100644 src/libcamera/pipeline/rkisp2/rkisp2.cpp create mode 100755 utils/tuning/rkisp2.py