From patchwork Sun Nov 29 15:24:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alain_Cousini=C3=A9?= X-Patchwork-Id: 29103 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 61B75C3355 for ; Sun, 29 Nov 2026 15:24:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6BFE16AA4A; Sun, 29 Nov 2026 16:24:48 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=laposte.net header.i=@laposte.net header.b="Bk3kz7uR"; dkim-atps=neutral Received: from smtp-outgoing-2001.laposte.net (smtp-outgoing-2001.laposte.net [160.92.124.108]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A3E696AA33 for ; Sun, 29 Nov 2026 16:24:43 +0100 (CET) X-mail-filterd: {"version":"1.9.7", "queueID":"4jcrYQ2SYjz10MQ4", "contextId": "627d66e3-b458-44f1-ac40-ac396829c45c"} Received: from outgoing-mail.laposte.net (localhost.localdomain [127.0.0.1]) by mlpnf0120.laposte.net (SMTP Server) with ESMTP id 4jcrYQ2SYjz10MQ4; Sun, 29 Nov 2026 16:24:42 +0100 (CET) X-mail-filterd: {"version":"1.9.7", "queueID":"4jcrYQ0qWpz10MQN", "contextId": "8786b6ea-21b3-4deb-b685-9bd3ce1ef0de"} X-lpn-mailing: LEGIT X-lpn-spamrating: 36 X-lpn-spamlevel: not-spam Received: from debian.home (m-dj.hd.free.fr [82.67.82.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mlpnf0120.laposte.net (SMTP Server) with ESMTPSA id 4jcrYQ0qWpz10MQN; Sun, 29 Nov 2026 16:24:42 +0100 (CET) From: =?utf-8?q?Alain_Cousini=C3=A9?= To: libcamera-devel@lists.libcamera.org, Milan Zamazal Cc: Hans de Goede , Bryan O'Donoghue , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Laurent Pinchart , Jai Luthra , =?utf-8?q?Alain_Cousini=C3=A9?= Subject: [PATCH v8 5/6] libcamera: software_isp: Add support for monochrome formats - SOFT Date: Sun, 29 Nov 2026 16:24:15 +0100 Message-ID: <20261129152416.174279-6-alain.cousinie@laposte.net> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261129152416.174279-1-alain.cousinie@laposte.net> References: <20261129152416.174279-1-alain.cousinie@laposte.net> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laposte.net; s=lpn-wlmd; t=1795965883; bh=6uN1Z1Upsyo9ksWFTF2bgxXHzQOnnt6e4dWTQC5rfAA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Bk3kz7uRM4RO90QfVGOXlNyDK0EVxqjpNAv3gc2FQ/oIKDSjZkFySHsOZI5Y5B33jCnlXlfNubn2MZiQ91Vwvn2Xon1odK4Jtcfv6ka19fcQup1xAHHSrcezHV8uXjU54hHh7O1ML/Prn6CKaS105XgGwHlk3YTy+BZhikv12i8nXDpRO9sLQ9XpZzTvxRYgMqWrRhcznBfJPwtA4IjEjBBQnbxFZkhXeTOdS5+dm74V5nXBo1nE0hQlTTB9ChVatF5byynn5XDDLuRIcoqMV6ub6HMe3ckYMxgIXi8uvdeopJb9nRK3zk9ZxbE6PXZFNtkh7gHy32zgtRduTKfzwQ==; 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 A monochrome sensor has no colour channels, so there is nothing for the colour correction matrix to correct. Skip the CCM in SoftwareIsp::configure() when the input format is monochrome. The CCM and LSC settings are left untouched for Bayer formats: the colour path behaves exactly as before. Signed-off-by: Alain CousiniƩ --- src/libcamera/software_isp/software_isp.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 627625b4f..39d271728 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -294,7 +294,14 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg, if (ret < 0) return ret; - ret = debayer_->configure(inputCfg, outputCfgs, ccmEnabled_, lscEnabled_); + BayerFormat bayerFormat = BayerFormat::fromPixelFormat(inputCfg.pixelFormat); + bool runCcm = ccmEnabled_; + + /* A monochrome sensor has no colour channels: skip the CCM. */ + if (bayerFormat.order == BayerFormat::Order::MONO) + runCcm = false; + + ret = debayer_->configure(inputCfg, outputCfgs, runCcm, lscEnabled_); if (ret < 0) return ret;