From patchwork Fri Nov 20 11:42:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danius Kalvaitis X-Patchwork-Id: 29060 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 5A814C3355 for ; Fri, 20 Nov 2026 11:43:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 835BE6A949; Fri, 20 Nov 2026 12:43:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=kurokesu.com header.i=@kurokesu.com header.b="qorW33tl"; dkim-atps=neutral Received: from srv2.kurokesu.com (srv2.kurokesu.com [89.47.166.45]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF9C56A7EA for ; Fri, 20 Nov 2026 12:42:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by srv2.kurokesu.com (Postfix) with ESMTP id 1E3227D2B; Fri, 20 Nov 2026 13:42:58 +0200 (EET) Authentication-Results: srv2.kurokesu.com (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=kurokesu.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurokesu.com; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:from:from; s=default; t=1795174977; x= 1796989378; bh=SwL408kTNhc7WvaJXWaeDTO9M1/fUUC19sCdLbbYd4Q=; b=q orW33tljSNSmHCjw03+yVkT+f7DYDgmyV1cbWeBiRuUG2fhUAvUlo3nOpTuQLqz4 omBtx7GK/Z3f/yHm/hw4tzLJ1I4ZPHJ7iwa9uqvQmRxcIQ+s+OgH2q3K2x1y5WE2 6Ljpc9RNGgUuQpkVglqHK8yyx4b5ZOKgzkt/xSWgIY= X-Virus-Scanned: Debian amavisd-new at srv2.kurokesu.com Received: from srv2.kurokesu.com ([127.0.0.1]) by localhost (srv2.kurokesu.com [127.0.0.1]) (amavisd-new, port 10026) with LMTP id Kt0dXz9nP74g; Fri, 20 Nov 2026 13:42:57 +0200 (EET) Received: from shelfpi.vpn2.kurokesu.com (unknown [84.15.183.117]) (Authenticated sender: danius@kurokesu.com) by srv2.kurokesu.com (Postfix) with ESMTPSA id ED7587D20; Fri, 20 Nov 2026 13:42:55 +0200 (EET) From: Danius Kalvaitis To: libcamera-devel@lists.libcamera.org Cc: naush@raspberrypi.com, david.plowman@raspberrypi.com, laurent.pinchart@ideasonboard.com, jai.luthra@ideasonboard.com, aso.fam429@gmail.com, Danius Kalvaitis Subject: [PATCH 0/2] Raspberry Pi: Sensor HDR and decompand curve from camera helper Date: Fri, 20 Nov 2026 13:42:31 +0200 Message-ID: <20261120114233.86270-1-danius@kurokesu.com> X-Mailer: git-send-email 2.47.3 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 everyone, It has been about a year since I last tried to get sensor HDR running natively through PiSP with its decompand block. The decompand series and its review [1] got my hopes up but no in-tree sensor uses decompand yet. I understand this is a chicken and egg situation, as it takes a kernel driver, a camera helper and libcamera support together. This series is the libcamera part. Some sensors switch HDR through V4L2_CID_WIDE_DYNAMIC_RANGE without changing mode size or bit depth, so the IPA cannot tell HDR and linear modes apart. Patch 1 passes that state on. Patch 2 lets camera helpers return a decompand curve per mode, as Laurent suggested in [1]. Tuning file curves remain as fallback. I have this working with imx585 Clear HDR and ar0822 eHDR. Both depend on my out-of-tree kernel drivers [2][3] and camera helpers [4], so there is no in-tree consumer yet. I would like to get all of it into mainline and would appreciate your guidance on how best to approach that: - Is V4L2_CID_WIDE_DYNAMIC_RANGE acceptable as the HDR signal for now? - Can these two patches go in ahead of a consumer? imx585 support recently landed in the generic Starvis 2 helper, which has no Clear HDR, so I am not sure where its curve should live. If hardware would help with review or testing, I can arrange imx585 and ar0822 modules through my employer. Thanks, Danius [1] https://lists.libcamera.org/pipermail/libcamera-devel/2025-October/053739.html [2] https://github.com/Kurokesu/imx585-rpi-driver [3] https://github.com/Kurokesu/ar0822-rpi-driver [4] https://github.com/Kurokesu/libcamera/tree/v0.8.0+rpt20261104+krks2/src/ipa/rpi/cam_helper Danius Kalvaitis (2): pipeline: rpi: Pass sensor HDR state to the IPA ipa: rpi: Get decompand curve from camera helper include/libcamera/ipa/raspberrypi.mojom | 1 + src/ipa/rpi/cam_helper/cam_helper.cpp | 5 ++++ src/ipa/rpi/cam_helper/cam_helper.h | 5 ++++ src/ipa/rpi/cam_helper/meson.build | 1 + src/ipa/rpi/common/ipa_base.cpp | 2 ++ src/ipa/rpi/common/meson.build | 1 + src/ipa/rpi/controller/camera_mode.h | 6 +++++ src/ipa/rpi/controller/rpi/decompand.cpp | 27 ++++++++++++------- src/ipa/rpi/controller/rpi/decompand.h | 2 +- .../pipeline/rpi/common/pipeline_base.cpp | 10 +++++++ 10 files changed, 50 insertions(+), 10 deletions(-)