From patchwork Wed Aug 12 18:50:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 27770 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 75EDFC3264 for ; Wed, 12 Aug 2026 18:51:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B54C682EA; Wed, 12 Aug 2026 20:51:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="JQeYe32o"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SZuIUAf8"; dkim-atps=neutral Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 13377682CE for ; Wed, 12 Aug 2026 20:51:17 +0200 (CEST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67CI8ghO3792113 for ; Wed, 12 Aug 2026 18:51:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=l6dvLbPX2V+ 4hQX1ASu7VVX9ViA2ha2KThfg2/Vz4FE=; b=JQeYe32oEtsFwb0pQbHsoQbhna2 cajj17oFei2n06f8Syfp5oXEzBhfsRn7XIpN4L3YhLRffj0bVX8/1N7ueFxM2L0F ZOuw9fdvvNe5CrP85osp7G8iDv9BNLSXpFDXtUzArYSQZPfb8C90EDzPy907AN4i iDOu3bLGSNg+n1t0+4Xg4ksB7xrwLKmTET51XOkXTDVci6UaRXQLOnJmY/leyoCh B52WZlOC871+W6zwFODcyS/JoMM++toFdt3tsAu4Ry4wMr8Ly2oF5ypYxaxOqwPa rcoiSm8H8Q9X2Hr6rH/eEZH4PUxXLWVlOcGtqDGQ5SRaQJ2ikjiRoFC4YCw== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g0mndawja-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 12 Aug 2026 18:51:16 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c1d7886cdso23049641cf.1 for ; Wed, 12 Aug 2026 11:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786560675; x=1787165475; 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:content-type; bh=l6dvLbPX2V+4hQX1ASu7VVX9ViA2ha2KThfg2/Vz4FE=; b=SZuIUAf8WDzagF4bTAloVbmwlw03d//gBwniH+WRzFT5xSV2VCMUtiCKfllj/Jqh79 4DM7O/hPntk1ACKBBSkz24OlQ0AdrCq6jNZx2aMJVRw2TB7OF5eRZ2knS6cub+vuqZNx KdfpDnP2RKWPWuMhEPItlvOH37CXtiFnEMg2G0KxUQFhLIBjaroqEEp/yaboGqrmncoH 7/l2lExgiFaQxekuGVM6ftelZ6yZGQatNcG2w+67iPKVrWNJyfcFihvLgzrsuLplwt+E Ea4V+dowGIoY2S3dMXepHrKO/GnmojjDLiC3o2Cwz2cl16MZcPsKFiC0qnqO3N486iVA Zq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786560675; x=1787165475; 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:content-type; bh=l6dvLbPX2V+4hQX1ASu7VVX9ViA2ha2KThfg2/Vz4FE=; b=SlZkCEA2QzfzmeaDGsOjDREpQQ+OtOKLeeHN6UGsJtmi4hAjxMxqw1YnKhln/zN5rP 6gUUQd7YJ7mWujWtnkIbiSRER6teJZiDT9FcW/+8NOtPRevGHT0II0Uk6XGBCZCVFUV3 J0CKgrlYB177JUf/y6HhtBRpUHzynVjK6gyCSewxUTSUZ0nThoPx/8r2/3huPhQaI07Z V0DaVsOqlhJzs6B8YaG5uwPjYl8ZUD82M6TOjGsTldP2jv+FL3/lcT6TeDN/QScWvT+r Ur56RaBV3z0w2w12ASXXoZe/izqeaNQsVnXEcpqTUnjYXBODMrOpWfsEBE3aMb5Up1Sq N5KQ== X-Gm-Message-State: AOJu0Yxxh2xI6wVs4ITD+EGWqQ5MlFTeiahIMnvntvtgjQxfUhEV0kwe to89AFZdUdl07ry0wxBW/oP3MLwpS6GZV8eRJLHKiPpnsaxOcneb5FoUf65EwqbWoxoxVFAMM7t K1yQDjM/2Zqohm+5Q0lQUNKhAGcoix0mDJ0pDFNFiH0PYPt8YUavnH457xF5pvCQ782A5ybyur2 dEUK3VS3/3 X-Gm-Gg: AR+sD10P/VkAqRykEUTe5zl8Fl0ihTMQWbDXBjOD8vASWWhqaczbEkAO4RDfMz36GHK qW8vHObAcgmNK68bYgCP+nIh7UqdIuP0bWaTcW/9uBuiRClh78FSQJ2FEaxX1+LRbSV57tm7nQj Mg8y66k3dz1lreqvO5z4zKTg7ZlOOFF/J+jh/v2T5uEtZGuiq/9oY9Y4ItRoF8etgAN4mND2h+9 n8d9HrcGmdyreBtNrVzEtXhoQnFqNKY77GXQeIEz4ZVyMvX3LuGqut0DxmJiF0++JGeY7lGmg2y A3mYcodN6WjGws0dk/sHyLxsSH0zJgo75Hs6IhaSL/sMZ90FlAlicOxWQdU27vmJyaKwiQX8wZ8 5oHDTnvRLHwwxZuLVNcwyormKFXRWVlMeZ0JlIHyUSXrN1Lnii1n78CCr07XXiR3yGsvHkwH5DE QycqbYGkRG0L0e5sc= X-Received: by 2002:ac8:5809:0:b0:51a:8bc9:2915 with SMTP id d75a77b69052e-52d73c36b8cmr3331351cf.8.1786560674987; Wed, 12 Aug 2026 11:51:14 -0700 (PDT) X-Received: by 2002:ac8:5809:0:b0:51a:8bc9:2915 with SMTP id d75a77b69052e-52d73c36b8cmr3330901cf.8.1786560674413; Wed, 12 Aug 2026 11:51:14 -0700 (PDT) Received: from shalem (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a37f8cd810sm47977a12.26.2026.08.12.11.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 11:51:12 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Loic Poulain , Hans de Goede Subject: [PATCH v7 6/8] ipa: softisp: Rename IPASoftSimple to IPASoftIsp Date: Wed, 12 Aug 2026 20:50:53 +0200 Message-ID: <20260812185055.289021-7-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260812185055.289021-1-johannes.goede@oss.qualcomm.com> References: <20260812185055.289021-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Spam-Info: AW1haW4tMjYwODEyMDE1MSBTYWx0ZWRfX9AJzlB8naCzF 82OLYwMkCiqcghJg4XR3YHRmIb2Ej0/5wpfAZCqEnDTSNp4Pi30EY8dVQXFuLvi42c3I5l8UQby 2Rq9pjDkR+F9LVZwlLN9jpJ/UselC5A= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODEyMDE1MSBTYWx0ZWRfX14i+tD+UvHY7 z6N2AyeN90qLZkABunPUuxl9Zu2Hq9d7kTsNfhN3wX38665VxoANLuTjLG/ak9dgEIGcWwurR36 Q+X4n+Pb+IrijAZ/BgiDrnHmrHq4FOllaCAsmThUoUC97PT1blaQx5hXOmZnkPUBhhJk00u/msZ qd0215kjiPaNrVzhJUSqDUMzJz8sRd/Vcy/1L3nFK8jubDVuTtDBTFymmatrKozRFRV6/D6Yz7N cDiCEaNyjKjwfBGubRF4vdMWWsiZ2I5Mxx00G502/hJfca8VxqVBFiKZ8aNARLvSl2QlM6+9CrQ nZO+Y3oVF2ff8z5V2ofsx4EaxDRGQwJJ4p4SWo4WQihaKolIj3YRcpNZY7rQlwNGQRI9I6nxuj8 tOlgJ5142jJVOS5Vg8LrBhXEv9KUzMhBP9Qci5ZZuQVM5AHYCCRyO7RILp/Zy7rdBs8KFsLLFaz FTrG471mye7kGNFruOA== X-Proofpoint-GUID: GcNNdiutKUXYs77vSZ2xhaRacAzVX6EV X-Authority-Analysis: v=2.4 cv=C87ZDwP+ c=1 sm=1 tr=0 ts=6a7cc0a4 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=ITOby1vZJKKE0CwQNbMA:9 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-ORIG-GUID: GcNNdiutKUXYs77vSZ2xhaRacAzVX6EV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1176, Hydra:6.1.134, FMLib:17.12.100.49 definitions=2026-08-12_05,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608120151 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" The simple_soft IPA is the IPA for the software ISP and the software ISP may be plugged into any pipeline, drop the Simple part from the class names and replace Soft with SoftIsp. Also rename the IPA.so file from soft_simple to softisp. Signed-off-by: Hans de Goede --- .../internal/software_isp/software_isp.h | 2 +- include/libcamera/ipa/softisp.mojom | 4 +- src/ipa/softisp/algorithms/adjust.cpp | 8 +- src/ipa/softisp/algorithms/agc.cpp | 8 +- src/ipa/softisp/algorithms/awb.cpp | 16 ++-- src/ipa/softisp/algorithms/awb.h | 6 +- src/ipa/softisp/algorithms/blc.cpp | 6 +- src/ipa/softisp/algorithms/ccm.cpp | 2 +- src/ipa/softisp/algorithms/meson.build | 2 +- src/ipa/softisp/ipa_context.h | 2 +- src/ipa/softisp/meson.build | 10 +-- .../softisp/{soft_simple.cpp => softisp.cpp} | 74 +++++++++---------- src/libcamera/software_isp/software_isp.cpp | 2 +- 13 files changed, 71 insertions(+), 71 deletions(-) rename src/ipa/softisp/{soft_simple.cpp => softisp.cpp} (83%) diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h index 3205a2e14..2363a91c8 100644 --- a/include/libcamera/internal/software_isp/software_isp.h +++ b/include/libcamera/internal/software_isp/software_isp.h @@ -101,7 +101,7 @@ private: DmaBufAllocator dmaHeap_; bool ccmEnabled_; - std::unique_ptr ipa_; + std::unique_ptr ipa_; std::deque queuedInputBuffers_; std::deque queuedOutputBuffers_; }; diff --git a/include/libcamera/ipa/softisp.mojom b/include/libcamera/ipa/softisp.mojom index 77328c5fd..66cf311b3 100644 --- a/include/libcamera/ipa/softisp.mojom +++ b/include/libcamera/ipa/softisp.mojom @@ -12,7 +12,7 @@ struct IPAConfigInfo { libcamera.ControlInfoMap sensorControls; }; -interface IPASoftInterface { +interface IPASoftIspInterface { init(libcamera.IPASettings settings, libcamera.SharedFD fdStats, libcamera.SharedFD fdParams, @@ -31,7 +31,7 @@ interface IPASoftInterface { libcamera.ControlList sensorControls); }; -interface IPASoftEventInterface { +interface IPASoftIspEventInterface { setSensorControls(libcamera.ControlList sensorControls); setIspParams(); metadataReady(uint32 frame, libcamera.ControlList metadata); diff --git a/src/ipa/softisp/algorithms/adjust.cpp b/src/ipa/softisp/algorithms/adjust.cpp index 8bf39c4c8..52eb81d76 100644 --- a/src/ipa/softisp/algorithms/adjust.cpp +++ b/src/ipa/softisp/algorithms/adjust.cpp @@ -22,7 +22,7 @@ namespace ipa::soft::algorithms { constexpr float kDefaultContrast = 1.0f; constexpr float kDefaultSaturation = 1.0f; -LOG_DEFINE_CATEGORY(IPASoftAdjust) +LOG_DEFINE_CATEGORY(IPASoftIspAdjust) int Adjust::init(IPAContext &context, [[maybe_unused]] const ValueNode &tuningData) { @@ -54,19 +54,19 @@ void Adjust::queueRequest(typename Module::Context &context, const auto &gamma = controls.get(controls::Gamma); if (gamma.has_value()) { context.activeState.knobs.gamma = gamma.value(); - LOG(IPASoftAdjust, Debug) << "Setting gamma to " << gamma.value(); + LOG(IPASoftIspAdjust, Debug) << "Setting gamma to " << gamma.value(); } const auto &contrast = controls.get(controls::Contrast); if (contrast.has_value()) { context.activeState.knobs.contrast = contrast; - LOG(IPASoftAdjust, Debug) << "Setting contrast to " << contrast.value(); + LOG(IPASoftIspAdjust, Debug) << "Setting contrast to " << contrast.value(); } const auto &saturation = controls.get(controls::Saturation); if (saturation.has_value()) { context.activeState.knobs.saturation = saturation; - LOG(IPASoftAdjust, Debug) << "Setting saturation to " << saturation.value(); + LOG(IPASoftIspAdjust, Debug) << "Setting saturation to " << saturation.value(); } } diff --git a/src/ipa/softisp/algorithms/agc.cpp b/src/ipa/softisp/algorithms/agc.cpp index a13a75528..72f000628 100644 --- a/src/ipa/softisp/algorithms/agc.cpp +++ b/src/ipa/softisp/algorithms/agc.cpp @@ -17,7 +17,7 @@ namespace libcamera { -LOG_DEFINE_CATEGORY(IPASoftExposure) +LOG_DEFINE_CATEGORY(IPASoftIspExposure) namespace ipa::soft::algorithms { @@ -118,7 +118,7 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou context.activeState.agc.exposure = exposure; context.activeState.agc.again = again; - LOG(IPASoftExposure, Debug) + LOG(IPASoftIspExposure, Debug) << "exposureMSV " << exposureMSV << " error " << error << " factor " << factor << " exp " << exposure << " again " << again; @@ -172,7 +172,7 @@ void Agc::process(IPAContext &context, unsigned int num = 0; if (yHistValsPerBin == 0) { - LOG(IPASoftExposure, Debug) + LOG(IPASoftIspExposure, Debug) << "Not adjusting exposure due to insufficient histogram data"; return; } @@ -183,7 +183,7 @@ void Agc::process(IPAContext &context, } for (unsigned int i = 0; i < kExposureBinsCount; i++) { - LOG(IPASoftExposure, Debug) << i << ": " << exposureBins[i]; + LOG(IPASoftIspExposure, Debug) << i << ": " << exposureBins[i]; denom += exposureBins[i]; num += exposureBins[i] * (i + 1); } diff --git a/src/ipa/softisp/algorithms/awb.cpp b/src/ipa/softisp/algorithms/awb.cpp index 0bd6b66ce..84f01b832 100644 --- a/src/ipa/softisp/algorithms/awb.cpp +++ b/src/ipa/softisp/algorithms/awb.cpp @@ -16,7 +16,7 @@ namespace libcamera { -LOG_DEFINE_CATEGORY(IPASoftAwb) +LOG_DEFINE_CATEGORY(IPASoftIspAwb) namespace ipa::soft::algorithms { @@ -25,12 +25,12 @@ namespace ipa::soft::algorithms { */ static constexpr unsigned int kDefaultLux = 500; -class SimpleAwbStats final : public AwbStats +class SoftIspAwbStats final : public AwbStats { public: - SimpleAwbStats() = default; + SoftIspAwbStats() = default; - SimpleAwbStats(const RGB &rgbMeans) + SoftIspAwbStats(const RGB &rgbMeans) { rgbMeans_ = rgbMeans; @@ -112,8 +112,8 @@ void Awb::prepare(IPAContext &context, params->gains = frameContext.awb.gains; } -SimpleAwbStats Awb::calculateRgbMeans(IPAContext &context, - const SwIspStats *stats) const +SoftIspAwbStats Awb::calculateRgbMeans(IPAContext &context, + const SwIspStats *stats) const { if (!stats->valid) return {}; @@ -141,7 +141,7 @@ SimpleAwbStats Awb::calculateRgbMeans(IPAContext &context, static_cast(sum.g()) / nPixels, static_cast(sum.b()) / nPixels } }; - return SimpleAwbStats(rgbMeans); + return SoftIspAwbStats(rgbMeans); } /** @@ -151,7 +151,7 @@ void Awb::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, IPAFrameContext &frameContext, const SwIspStats *stats, ControlList &metadata) { - SimpleAwbStats awbStats = calculateRgbMeans(context, stats); + SoftIspAwbStats awbStats = calculateRgbMeans(context, stats); awbAlgo_.process(context.activeState.awb, frameContext.awb, awbStats, kDefaultLux, metadata); diff --git a/src/ipa/softisp/algorithms/awb.h b/src/ipa/softisp/algorithms/awb.h index 59ab6fd79..37893932b 100644 --- a/src/ipa/softisp/algorithms/awb.h +++ b/src/ipa/softisp/algorithms/awb.h @@ -22,7 +22,7 @@ namespace libcamera { namespace ipa::soft::algorithms { -class SimpleAwbStats; +class SoftIspAwbStats; class Awb : public Algorithm { @@ -48,8 +48,8 @@ public: ControlList &metadata) override; private: - SimpleAwbStats calculateRgbMeans(IPAContext &context, - const SwIspStats *stats) const; + SoftIspAwbStats calculateRgbMeans(IPAContext &context, + const SwIspStats *stats) const; /* * There actually is no Q register format for SoftISP, but allow the diff --git a/src/ipa/softisp/algorithms/blc.cpp b/src/ipa/softisp/algorithms/blc.cpp index e45a913cd..fca76f442 100644 --- a/src/ipa/softisp/algorithms/blc.cpp +++ b/src/ipa/softisp/algorithms/blc.cpp @@ -17,7 +17,7 @@ namespace libcamera { namespace ipa::soft::algorithms { -LOG_DEFINE_CATEGORY(IPASoftBL) +LOG_DEFINE_CATEGORY(IPASoftIspBL) BlackLevel::BlackLevel() { @@ -90,7 +90,7 @@ void BlackLevel::process(IPAContext &context, const unsigned int total = std::accumulate(begin(histogram), end(histogram), 0); if (total == 0) { - LOG(IPASoftBL, Debug) << "Not guessing black level, histogram is empty"; + LOG(IPASoftIspBL, Debug) << "Not guessing black level, histogram is empty"; return; } @@ -107,7 +107,7 @@ void BlackLevel::process(IPAContext &context, context.activeState.blc.level = i * histogramRatio; context.activeState.blc.lastExposure = frameContext.sensor.exposure; context.activeState.blc.lastGain = frameContext.sensor.gain; - LOG(IPASoftBL, Debug) + LOG(IPASoftIspBL, Debug) << "Auto-set black level: " << i << "/" << SwIspStats::kYHistogramSize << " (" << 100 * (seen - histogram[i]) / total << "% below, " diff --git a/src/ipa/softisp/algorithms/ccm.cpp b/src/ipa/softisp/algorithms/ccm.cpp index 8b6da543a..58e17bbeb 100644 --- a/src/ipa/softisp/algorithms/ccm.cpp +++ b/src/ipa/softisp/algorithms/ccm.cpp @@ -14,7 +14,7 @@ namespace libcamera { namespace ipa::soft::algorithms { -LOG_DEFINE_CATEGORY(IPASoftCcm) +LOG_DEFINE_CATEGORY(IPASoftIspCcm) /** * \copydoc libcamera::ipa::Algorithm::init diff --git a/src/ipa/softisp/algorithms/meson.build b/src/ipa/softisp/algorithms/meson.build index 73c637220..d240409e5 100644 --- a/src/ipa/softisp/algorithms/meson.build +++ b/src/ipa/softisp/algorithms/meson.build @@ -1,6 +1,6 @@ # SPDX-License-Identifier: CC0-1.0 -soft_simple_ipa_algorithms = files([ +softisp_ipa_algorithms = files([ 'adjust.cpp', 'awb.cpp', 'agc.cpp', diff --git a/src/ipa/softisp/ipa_context.h b/src/ipa/softisp/ipa_context.h index ff312ae8f..bccf95775 100644 --- a/src/ipa/softisp/ipa_context.h +++ b/src/ipa/softisp/ipa_context.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2024-2026 Red Hat, Inc. * - * Simple pipeline IPA Context + * Software ISP IPA Context */ #pragma once diff --git a/src/ipa/softisp/meson.build b/src/ipa/softisp/meson.build index 2f9f15f4a..755b7eaab 100644 --- a/src/ipa/softisp/meson.build +++ b/src/ipa/softisp/meson.build @@ -3,16 +3,16 @@ subdir('algorithms') subdir('data') -ipa_name = 'ipa_soft_simple' +ipa_name = 'ipa_softisp' -soft_simple_sources = files([ +softisp_sources = files([ 'ipa_context.cpp', - 'soft_simple.cpp', + 'softisp.cpp', ]) -soft_simple_sources += soft_simple_ipa_algorithms +softisp_sources += softisp_ipa_algorithms -mod = shared_module(ipa_name, soft_simple_sources, +mod = shared_module(ipa_name, softisp_sources, name_prefix : '', include_directories : [ipa_includes], dependencies : [libcamera_private, libipa_dep], diff --git a/src/ipa/softisp/soft_simple.cpp b/src/ipa/softisp/softisp.cpp similarity index 83% rename from src/ipa/softisp/soft_simple.cpp rename to src/ipa/softisp/softisp.cpp index e84feeea7..111325d7d 100644 --- a/src/ipa/softisp/soft_simple.cpp +++ b/src/ipa/softisp/softisp.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2023, Linaro Ltd * - * Simple Software Image Processing Algorithm module + * Software ISP Image Processing Algorithm module */ #include @@ -32,7 +32,7 @@ #include "module.h" namespace libcamera { -LOG_DEFINE_CATEGORY(IPASoft) +LOG_DEFINE_CATEGORY(IPASoftIsp) using namespace std::literals::chrono_literals; @@ -41,15 +41,15 @@ namespace ipa::soft { /* Maximum number of frame contexts to be held */ static constexpr uint32_t kMaxFrameContexts = 16; -class IPASoftSimple : public ipa::soft::IPASoftInterface, public Module +class IPASoftIsp : public ipa::soft::IPASoftIspInterface, public Module { public: - IPASoftSimple() + IPASoftIsp() : context_(kMaxFrameContexts) { } - ~IPASoftSimple(); + ~IPASoftIsp(); int init(const IPASettings &settings, const SharedFD &fdStats, @@ -83,7 +83,7 @@ private: struct IPAContext context_; }; -IPASoftSimple::~IPASoftSimple() +IPASoftIsp::~IPASoftIsp() { if (stats_) munmap(stats_, sizeof(SwIspStats)); @@ -91,17 +91,17 @@ IPASoftSimple::~IPASoftSimple() munmap(params_, sizeof(DebayerParams)); } -int IPASoftSimple::init(const IPASettings &settings, - const SharedFD &fdStats, - const SharedFD &fdParams, - const IPACameraSensorInfo &sensorInfo, - const ControlInfoMap &sensorControls, - ControlInfoMap *ipaControls, - bool *ccmEnabled) +int IPASoftIsp::init(const IPASettings &settings, + const SharedFD &fdStats, + const SharedFD &fdParams, + const IPACameraSensorInfo &sensorInfo, + const ControlInfoMap &sensorControls, + ControlInfoMap *ipaControls, + bool *ccmEnabled) { camHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel); if (!camHelper_) { - LOG(IPASoft, Warning) + LOG(IPASoftIsp, Warning) << "Failed to create camera sensor helper for " << settings.sensorModel; } @@ -112,7 +112,7 @@ int IPASoftSimple::init(const IPASettings &settings, File file(settings.configurationFile); if (!file.open(File::OpenModeFlag::ReadOnly)) { int ret = file.error(); - LOG(IPASoft, Error) + LOG(IPASoftIsp, Error) << "Failed to open configuration file " << settings.configurationFile << ": " << strerror(-ret); return ret; @@ -124,10 +124,10 @@ int IPASoftSimple::init(const IPASettings &settings, /* \todo Use the IPA configuration file for real. */ unsigned int version = (*data)["version"].get(0); - LOG(IPASoft, Debug) << "Tuning file version " << version; + LOG(IPASoftIsp, Debug) << "Tuning file version " << version; if (!data->contains("algorithms")) { - LOG(IPASoft, Error) << "Tuning file doesn't contain algorithms"; + LOG(IPASoftIsp, Error) << "Tuning file doesn't contain algorithms"; return -EINVAL; } @@ -141,12 +141,12 @@ int IPASoftSimple::init(const IPASettings &settings, stats_ = nullptr; if (!fdStats.isValid()) { - LOG(IPASoft, Error) << "Invalid Statistics handle"; + LOG(IPASoftIsp, Error) << "Invalid Statistics handle"; return -ENODEV; } if (!fdParams.isValid()) { - LOG(IPASoft, Error) << "Invalid Parameters handle"; + LOG(IPASoftIsp, Error) << "Invalid Parameters handle"; return -ENODEV; } @@ -154,7 +154,7 @@ int IPASoftSimple::init(const IPASettings &settings, void *mem = mmap(nullptr, sizeof(DebayerParams), PROT_WRITE, MAP_SHARED, fdParams.get(), 0); if (mem == MAP_FAILED) { - LOG(IPASoft, Error) << "Unable to map Parameters"; + LOG(IPASoftIsp, Error) << "Unable to map Parameters"; return -errno; } @@ -170,7 +170,7 @@ int IPASoftSimple::init(const IPASettings &settings, void *mem = mmap(nullptr, sizeof(SwIspStats), PROT_READ, MAP_SHARED, fdStats.get(), 0); if (mem == MAP_FAILED) { - LOG(IPASoft, Error) << "Unable to map Statistics"; + LOG(IPASoftIsp, Error) << "Unable to map Statistics"; return -errno; } @@ -187,19 +187,19 @@ int IPASoftSimple::init(const IPASettings &settings, * for V4L2_CID_EXPOSURE depend on the configured sensor resolution. */ if (sensorControls.find(V4L2_CID_EXPOSURE) == sensorControls.end()) { - LOG(IPASoft, Error) << "Don't have exposure control"; + LOG(IPASoftIsp, Error) << "Don't have exposure control"; return -EINVAL; } if (sensorControls.find(V4L2_CID_ANALOGUE_GAIN) == sensorControls.end()) { - LOG(IPASoft, Error) << "Don't have gain control"; + LOG(IPASoftIsp, Error) << "Don't have gain control"; return -EINVAL; } return 0; } -int IPASoftSimple::configure(const IPAConfigInfo &configInfo) +int IPASoftIsp::configure(const IPAConfigInfo &configInfo) { sensorInfoMap_ = configInfo.sensorControls; @@ -216,7 +216,7 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo) context_.configuration.agc.exposureMin = exposureInfo.min().get(); context_.configuration.agc.exposureMax = exposureInfo.max().get(); if (!context_.configuration.agc.exposureMin) { - LOG(IPASoft, Warning) << "Minimum exposure is zero, that can't be linear"; + LOG(IPASoftIsp, Warning) << "Minimum exposure is zero, that can't be linear"; context_.configuration.agc.exposureMin = 1; } @@ -255,7 +255,7 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo) return ret; } - LOG(IPASoft, Info) + LOG(IPASoftIsp, Info) << "Exposure " << context_.configuration.agc.exposureMin << "-" << context_.configuration.agc.exposureMax << ", gain " << context_.configuration.agc.againMin << "-" @@ -265,17 +265,17 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo) return 0; } -int IPASoftSimple::start() +int IPASoftIsp::start() { return 0; } -void IPASoftSimple::stop() +void IPASoftIsp::stop() { context_.frameContexts.clear(); } -void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &controls) +void IPASoftIsp::queueRequest(const uint32_t frame, const ControlList &controls) { IPAFrameContext &frameContext = context_.frameContexts.alloc(frame); @@ -283,7 +283,7 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro algo->queueRequest(context_, frame, frameContext, controls); } -void IPASoftSimple::computeParams(const uint32_t frame) +void IPASoftIsp::computeParams(const uint32_t frame) { context_.activeState.combinedMatrix = Matrix::identity(); @@ -295,9 +295,9 @@ void IPASoftSimple::computeParams(const uint32_t frame) setIspParams.emit(); } -void IPASoftSimple::processStats(const uint32_t frame, - [[maybe_unused]] const uint32_t bufferId, - const ControlList &sensorControls) +void IPASoftIsp::processStats(const uint32_t frame, + [[maybe_unused]] const uint32_t bufferId, + const ControlList &sensorControls) { IPAFrameContext &frameContext = context_.frameContexts.get(frame); @@ -314,7 +314,7 @@ void IPASoftSimple::processStats(const uint32_t frame, /* Sanity check */ if (!sensorControls.contains(V4L2_CID_EXPOSURE) || !sensorControls.contains(V4L2_CID_ANALOGUE_GAIN)) { - LOG(IPASoft, Error) << "Control(s) missing"; + LOG(IPASoftIsp, Error) << "Control(s) missing"; return; } @@ -328,9 +328,9 @@ void IPASoftSimple::processStats(const uint32_t frame, setSensorControls.emit(ctrls); } -std::string IPASoftSimple::logPrefix() const +std::string IPASoftIsp::logPrefix() const { - return "IPASoft"; + return "IPASoftIsp"; } } /* namespace ipa::soft */ @@ -347,7 +347,7 @@ const struct IPAModuleInfo ipaModuleInfo = { IPAInterface *ipaCreate() { - return new ipa::soft::IPASoftSimple(); + return new ipa::soft::IPASoftIsp(); } } /* extern "C" */ diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index c7165771c..d1fe02a2e 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -136,7 +136,7 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, debayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady); debayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady); - ipa_ = pipe->createIPA(0, 0); + ipa_ = pipe->createIPA(0, 0); if (!ipa_) { LOG(SoftwareIsp, Error) << "Creating IPA for software ISP failed";