From patchwork Wed Dec 17 10:01:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 25595 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 8B6E2C3257 for ; Wed, 17 Dec 2025 10:02:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 24E9161F63; Wed, 17 Dec 2025 11:02:26 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="blwBRU2r"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7DB7161A4B for ; Wed, 17 Dec 2025 11:02:10 +0100 (CET) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-477aa218f20so37299185e9.0 for ; Wed, 17 Dec 2025 02:02:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765965730; x=1766570530; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vdieV2jp4Gung7/4hWVYp0Lav9rda27DBFfiiAcRIr4=; b=blwBRU2r7XJATb8u1M6QgZc+b9WalB40SwMqoj8T/LAWm+fnyFxzEXTBewaXVUqV4L 62KWr08w3Pji/TOBVYqFhBiaP7BqPr1LLL1u0oNyS0O8TCaWD9vdHIMsqIy7XPfM4pHN qQ+6b/4QTt8iSjIti21SPCBXe5HBhpP3NhTAhWC8FPvh619VNgnt8LPdFGoWnqxFL5aD rb0izc67QGuuGPkMGtF7AGduwK2tv8hCl1G8uy+vZOIbbf72a3pw2iegYT1Uqmu5UJmZ ITzgVTkr7buNzieRogo96kVRV5STCjACLAS0KT++lDUAaabih7TcteRNIkesE2R+G/LE DuSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765965730; x=1766570530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vdieV2jp4Gung7/4hWVYp0Lav9rda27DBFfiiAcRIr4=; b=NQfwpb1/F5GhDSYdKfVAQagxf4zqpiK6AHkathOWxVZ1eIkVsiWy7rOtDRW6wUk22j /rpkzMpU1Daj+6bMz8E7Ly9agOr8dFd3Z52kr5LnbkUGWgUWmdy8P0SuhGoqUwkK0NUu rcK7RxthOr8e5idQsHcHSM7lIkfwVynB1yV/I25cjhOlUB9YFHw7uyG0MWu8O2GjDp+3 6gIpIdaehaDSJ6pfzaE+c/2ttSEER8WNjmoeDZo+94oF3b39pBz+1z9rwDNIS+8+ExZ4 ukmT+U1hjT/fGzYGAAjvsNOkxXsOPpyIAexZTx6thA59EmXn/GzA6MpfqGm6IIHgFzvc OUvw== X-Gm-Message-State: AOJu0Ywm0XI6nzFSI5wEJ9Sx9dpOvRUe2dO/lONetWjJgdLwnGO9zqNz VFeflM3akGrzf6aKTEn71bXpu694UmGnWrDsRMQFGNG2xeVzgL81AOAmhczIMAiIGJcLHqG+IAJ xEIsN X-Gm-Gg: AY/fxX6WM7Ns5Qk4Zgc/w8vraL+w7EzRi5XYDHYxExcZNsVFoJpQWlx8V18f7VW1JWL 8b+gPJ3N1pzdc0CTxnKzcAqRnBCdft4lIsP1iCWRicQ8bFMsKOF0MQFIgLPY2erRFvgu+bc2o6w Q2UPvApD2u0utRRo8OaLBT4ojvi82wTrMfVNOWxGC1PGSYINByPeWKNHXfvkWId60DholCHix0y DI6W/klEtTx9vFtWZNLeLWiZpUhrU0+t78onBAX6WimjLGSPXp+N9Eo2t2kM++1B9YuLOOl7VNO QzJ7eo/VqU1dKxd5R+WqoWMnoYh4YFX56wtrrwPz55feurgDTgNkUvxUMdjdkjFuKK9bodbjFgU 3Z+4SsxfZSimAzRu626MrsGMSUI8DA/Mav7pVAuQMS3URzzT+9Ymkl1fwKYYip0Z409LXQV87qO VwOwwbO9RPHEwKrmYnrlBEtpv9ooFrCn1bZ2gGhxf96jtyj0cJj2UD2ZoDa9ueaf1ws3bq5iaEI Ks88A== X-Google-Smtp-Source: AGHT+IEaVqNhnq8D117Qfkm3+apb0IZjEoM3nrxsjtOLpNIOZzK5kKo9L9LoSsDmbhqpL7wRX0bYKQ== X-Received: by 2002:a05:600c:524b:b0:477:bb0:751b with SMTP id 5b1f17b1804b1-47a8f90d716mr184082475e9.27.1765965729593; Wed, 17 Dec 2025 02:02:09 -0800 (PST) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bdc1583fbsm32292585e9.0.2025.12.17.02.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 02:02:09 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Milan Zamazal Subject: [PATCH v9 22/26] ipa: simple: Add a flag to indicate gpuIspEnabled Date: Wed, 17 Dec 2025 10:01:34 +0000 Message-ID: <20251217100138.82525-23-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251217100138.82525-1-bryan.odonoghue@linaro.org> References: <20251217100138.82525-1-bryan.odonoghue@linaro.org> 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" Flag gpuIspEnabled in the simple IPA context. This flag will allow to selectively avoid some calculations or to generate a default CCM. Reviewed-by: Milan Zamazal Signed-off-by: Bryan O'Donoghue --- include/libcamera/ipa/soft.mojom | 3 ++- src/ipa/simple/ipa_context.h | 1 + src/ipa/simple/soft_simple.cpp | 3 +++ src/libcamera/software_isp/software_isp.cpp | 8 +++++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/libcamera/ipa/soft.mojom b/include/libcamera/ipa/soft.mojom index 77328c5fd..aff8fcbd3 100644 --- a/include/libcamera/ipa/soft.mojom +++ b/include/libcamera/ipa/soft.mojom @@ -17,7 +17,8 @@ interface IPASoftInterface { libcamera.SharedFD fdStats, libcamera.SharedFD fdParams, libcamera.IPACameraSensorInfo sensorInfo, - libcamera.ControlInfoMap sensorControls) + libcamera.ControlInfoMap sensorControls, + bool gpuIspEnabled) => (int32 ret, libcamera.ControlInfoMap ipaControls, bool ccmEnabled); start() => (int32 ret); stop(); diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h index 03d8007ea..20c75de4e 100644 --- a/src/ipa/simple/ipa_context.h +++ b/src/ipa/simple/ipa_context.h @@ -104,6 +104,7 @@ struct IPAContext { ControlInfoMap::Map ctrlMap; bool ccmEnabled = false; bool selfInitialising = false; + bool gpuIspEnabled = false; }; } /* namespace ipa::soft */ diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp index b147aca2e..2bbe271d9 100644 --- a/src/ipa/simple/soft_simple.cpp +++ b/src/ipa/simple/soft_simple.cpp @@ -55,6 +55,7 @@ public: const SharedFD &fdParams, const IPACameraSensorInfo &sensorInfo, const ControlInfoMap &sensorControls, + bool gpuIspEnabled, ControlInfoMap *ipaControls, bool *ccmEnabled) override; int configure(const IPAConfigInfo &configInfo) override; @@ -95,6 +96,7 @@ int IPASoftSimple::init(const IPASettings &settings, const SharedFD &fdParams, const IPACameraSensorInfo &sensorInfo, const ControlInfoMap &sensorControls, + bool gpuIspEnabled, ControlInfoMap *ipaControls, bool *ccmEnabled) { @@ -106,6 +108,7 @@ int IPASoftSimple::init(const IPASettings &settings, } context_.sensorInfo = sensorInfo; + context_.gpuIspEnabled = gpuIspEnabled; /* Load the tuning data file */ File file(settings.configurationFile); diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 7fde57aec..5dbb0e3d6 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -121,6 +121,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, } stats->statsReady.connect(this, &SoftwareIsp::statsReady); + bool gpuIspEnabled; + #if HAVE_DEBAYER_EGL std::optional softISPMode = configuration.envOption("LIBCAMERA_SOFTISP_MODE", { "software_isp", "mode" }); if (softISPMode) { @@ -137,10 +139,13 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, LOG(SoftwareIsp, Error) << "Failed to instantiate GPUISP"; return; } + gpuIspEnabled = true; } #endif - if (!debayer_) + if (!debayer_) { debayer_ = std::make_unique(std::move(stats), configuration); + gpuIspEnabled = false; + } if (!debayer_) { LOG(SoftwareIsp, Error) << "Failed to create Debayer object"; @@ -177,6 +182,7 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, sharedParams_.fd(), sensorInfo, sensor->controls(), + gpuIspEnabled, ipaControls, &ccmEnabled_); if (ret) {