From patchwork Fri Dec 12 00:29:33 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: 25537 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 2094ABD1F1 for ; Fri, 12 Dec 2025 00:34:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C411E6191A; Fri, 12 Dec 2025 01:34:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Jmu2sQwh"; dkim-atps=neutral Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 750E761899 for ; Fri, 12 Dec 2025 01:34:32 +0100 (CET) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7e1651ae0d5so592571b3a.1 for ; Thu, 11 Dec 2025 16:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765499671; x=1766104471; 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=Jmu2sQwhj+KSwMr5a4pSMQn3Ucy6unGtn+CPwiqpbHw50swdmzdIWoC55QpDqeJXmy YOIRk2vb8PA4sD0+jDvnH96fMFyA87Dff7tftC9z8BUksKHd/JGB7S/om9PzAs8IiXS1 07q3KFcibXhFJQJBaNHdPUZMP/BALukTwn7YvLSXi4KW507HMzdVS69/Askrr6BadXEZ O9rrcK7rpjjTDhO2DLgoO/4854qpoaqN1azJNYOlS+drJu5k/NqoIUs4GaOST0RHcq/d O7qDgRumjsATvI8OtoD6NmArcsCqVOMFKlZh1dK7g6lW66tPmP+MaCYqhh5wnSibf3Lf PCZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765499671; x=1766104471; 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=aPcocLd2zCDx1ZVM6TkZez2FiZmryTOoYsc+7ca2WWhy8TgJ/b/Xtq33QB+fs3CBuu SgUFGTCxYmx/I43pYlb0l/fqJJHORb9NAJd4slYNsG+bSfQhYUvh4GJJ9G8wloBa2mqy vVmWY9wscQNfM2Pf5vIQjKKIiqYmF8+TLaTcOaufkiZ7IY8N/qF0TnLgoXMTJ87IKpe4 /fwFcFwpJvLEoSFxuZ0LZgowN2nhh+CL1ub+86sLABNjyd8YI4wBd5u3+wkvFwPNgi10 PWR4QS4bx9SPUpqazBxUh4gLaxfoRNGIkxxOCudEkZ2kVgVDnAeKTzHT3VMR1QWHND+1 qA6w== X-Gm-Message-State: AOJu0Yx4ON6pe2RCNSvBfioWry+aUqITHvb3l3Y85npDN6jjedStCIeJ mNf8/kEOtFjbNT59P8v5BTT1MqT+2TZdcFHKe7V3LqPSSwx4Gnnw0MnyxPoesrB/nYVnrPpFz7M mEPWJ X-Gm-Gg: AY/fxX4nLrDHbFl1gapB42e/uUNbvxFPRV3AtLfaRP2HBNhCCf3i/tbebenAdMfKv4D qR+DdfWvLpbOQDLNgiiSqwgk+gASv43gjWHDvbfapyY0LV04IB7CJlKdCg2Tzo2Px04rmg9tvB/ s74QteuCL3EJoVLJZeSU1hjecr7HKUM6Zx7h9G+yc/19fa3AMIbnzagE4MzZ31OmUUplCv55fN7 vo7sxd3HjyeDwm7yIOtvFRCuiG38x4FtI8V0APPlpZUibljc/Gz08cRxjGrj9HOe5ewuILkn5vQ I8HhUGTMo9WqZsn0vU+p9K02pcIISNb3RUbajk0+2jeJ5/Xa3qWfE5DoxoOKpMa8fJT+zJhLv/m FZdwfrhDJLSDSY7q3OT3n+De078+XgpXPIjszMTsRDATLM1/ug3W7rDbOO/h6184F7JjKpY+ohH 0YRyXpmz9JIUK7gSAh20sbEokK+atmOXgizJGUFf8XX8NNEVFBkmDvWQt7TWs= X-Google-Smtp-Source: AGHT+IHqwt5CAVe7ZDyfevN6c7WNCwRiQ1GiRyTnazLeT2F9Ubh2ivAeCIGvuB2HIlVsB+2En/YlNg== X-Received: by 2002:a05:6a20:7f86:b0:366:14b2:30d with SMTP id adf61e73a8af0-369afff1ea6mr312858637.64.1765499670778; Thu, 11 Dec 2025 16:34:30 -0800 (PST) Received: from inspiron14p-linux (p99250-ipoefx.ipoe.ocn.ne.jp. [153.246.134.249]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c0c26eb0f6bsm3317282a12.14.2025.12.11.16.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 16:34:30 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue , Milan Zamazal Subject: [PATCH v8 22/26] ipa: simple: Add a flag to indicate gpuIspEnabled Date: Fri, 12 Dec 2025 00:29:33 +0000 Message-ID: <20251212002937.3118-23-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251212002937.3118-1-bryan.odonoghue@linaro.org> References: <20251212002937.3118-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) {