From patchwork Mon Aug 17 13:40:40 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: 27832 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 EBE4DC3264 for ; Mon, 17 Aug 2026 13:41:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 78C19682AC; Mon, 17 Aug 2026 15:41:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="eCZIXOta"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="fFIywvwR"; dkim-atps=neutral Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A1F168256 for ; Mon, 17 Aug 2026 15:40:56 +0200 (CEST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67HD62iO2329861 for ; Mon, 17 Aug 2026 13:40:54 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=NmvTy+3kYGj 2XuEradt72mdgEMtvezApmbnXkLn95o4=; b=eCZIXOtaFsv/54nkHgy0HnI3mP/ /lCGfVstR/RH/C0OQzNL4ZM84ujDFr62rvY0Yywgf/PIjYQg4+plCLSb0lN0mujA yIUdvUm3qae7V4OSEb4uGo29Ivo/7bVitQqJezjgbq6ia97Pns6QcPkuNIqPGaRM SyexgroAee/AJEHMXJHmFYitkutVO/HkrN+IO9bZeNZeNbv5a91u9LOqU0h9B6Vs qoDI/gPj0lcAqbcJ8wRKdXH5ACCGfXMfZPUqKI43dhXE9uay6On/KpJWSL4mPfSS DMhWdTOszcTiDAHD92TmLYAQSFNUI9JF3wAL7GzZ7EUkXZhp2PsI7TjRl5Q== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g3vghsvd7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 17 Aug 2026 13:40:54 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-9368b4c5964so279133285a.1 for ; Mon, 17 Aug 2026 06:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786974054; x=1787578854; 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=NmvTy+3kYGj2XuEradt72mdgEMtvezApmbnXkLn95o4=; b=fFIywvwRbvP6n47mLzFieusqQHz+WKIYiyzaT88kKyoWp1tJxt5lMPpgbqLtY8Hjp+ 8XZ8E8oHaVY3TPi+RlJ2fUPxjcA7iAeMPrHXev2JikL3/UjoOiejwdQZ/Mlfgfxb8B9o JQjJgTRyOUGjqo6K9EGyNmAD4y4c0kqi7tbroaBGntaxLRq7fE/2WBtoSbTuhel6WrTr gn+TtrtNCUHSK0kc0jwT68Ml+6y8EsXDBd305SHvTAUw6a/3vQq5nj4LZ7i6GnLn65N1 o4lh0ng4FuMMEvbY80Il1kPWJLSskjapfENQIN9kPz7nkkSDMmlF9aIeEYBCY55LkRFZ hlKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786974054; x=1787578854; 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=NmvTy+3kYGj2XuEradt72mdgEMtvezApmbnXkLn95o4=; b=NUppj8YkxgZSxnPS17nHdTRnxw0aQXwd0uhblGS28xt0Q5TmXWAiwEL8NWSVbF2lrM jo0cykMbXUg4RA02ijANXfxcYz/M4ytDKYFiokMS9+ErIuym93Ff40FSFqo30mLLMKAZ mMu8cJ2xTsCaGxXm0wugingg/OiGlhFV5AiWcAJlYyIMSRojZhe0RnHkKLZyedflS7HE BFicgj+SGIYCwcjn8bFNySVBgx/7IaQz53CiahTA8FIXXns8zn9fp3fsyGUsQdsSpzO+ zxg/K4Mp+jKCuVRdKeVRhpD9/Ww5i0yKI2a17PwcDkX1Lts6LdrfmnUeR0coRIJD/UJK dc9Q== X-Gm-Message-State: AOJu0Yz3AQblw/WTtckQ6rzPXApvz5OP41u9oQxa+I5EXrf6WArBh1m2 H5/IPyQPoRm+030EHw+0/KN6up8s4Se07XFAWhE8N3rnykl9nk3LLbzYTql2AQdxI+Pzu8Xkjf5 u1X8nNPHJhyDu8wo8Ga2ogdgoEOCCag/jeYuzv9+t1E1FYikpTBcLEM4sy4Q3CElwRZBuqYn4Q9 mdUSjiXeR7 X-Gm-Gg: AR+sD12YIkQDA+bdhgPzdLDrjq6CicfqkanZD2BMjYyn1WpdOCcqhTz9cLzFqxxbq1m I6gWxqe7slbF5SufhoKW8XvxF1iuA9RN769i66IZGlKiWmbEqV2qPADhRfv7TlZ7s34rGmp6dHv utvKmEtQEGJWEkCs02gEO/y689MSiSk/tVaRl7TsOy8ESHCfJKmdKfMbg85EjmJc+XcrUi6N2wa gKTDKUWFfszLFDn6CzfSdE2sAF+fNkYoaJhmiEvkF+iM2ybRdM2b+VzzsqSO6XXCEvQQMArqzhK eJUA3YMEjbxC1ySDQ4ZgIE/zcdrTguo6t1ahpUPkjLbkxKxG6rvSfDJ6v9lEKww1WzlqgxRVGox KB5LE72/J/aX+nC8mz2V1n2lkrtk4 X-Received: by 2002:a05:620a:2984:b0:92e:7733:e3ac with SMTP id af79cd13be357-93704b37d04mr67097385a.20.1786974053323; Mon, 17 Aug 2026 06:40:53 -0700 (PDT) X-Received: by 2002:a05:620a:2984:b0:92e:7733:e3ac with SMTP id af79cd13be357-93704b37d04mr67088985a.20.1786974052687; Mon, 17 Aug 2026 06:40:52 -0700 (PDT) Received: from t14s.vakwerkhuis.com ([78.108.130.194]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a3d8517181sm772179a12.1.2026.08.17.06.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 06:40:51 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , =?utf-8?q?Niklas_S=C3=B6?= =?utf-8?q?derlund?= , Loic Poulain , Hans de Goede Subject: [PATCH v8 6/8] ipa: softisp: Rename IPASoftSimple to IPASoftIsp Date: Mon, 17 Aug 2026 15:40:40 +0200 Message-ID: <20260817134042.277168-7-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817134042.277168-1-johannes.goede@oss.qualcomm.com> References: <20260817134042.277168-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=P9gKQCAu c=1 sm=1 tr=0 ts=6a830f66 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=rrvG0T/C2D967D07Ol03YQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=P1BnusSwAAAA:8 a=EUspDBNiAAAA:8 a=ITOby1vZJKKE0CwQNbMA:9 a=bTQJ7kPSJx9SKPbeHEYW:22 a=D0XLA9XvdZm18NrgonBM:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODE3MDEwNCBTYWx0ZWRfX2xiqjD6FSlMK /VxIhg4B9rqQfx37NxjbKA5D6c1ZYZJJl0pXCEKS63sSimfnys/0ETYI/6DRo+F1F+y4IV3S5Ph MvA9yLI+pW0CyYdILlSH8JEtyBtCQHM= X-Proofpoint-ORIG-GUID: sgHFf6a0Mrhhiovx4j2RHbNz5uvHMzw6 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE3MDEwNCBTYWx0ZWRfX5toeTMUQwIjz HV+L8StxU+qJjDYtz7xR9+jQlBNpZPWbHQRF59V2yPF6OlDaPAMCnjvTv4AU7chlVo1lENemh2x R5vxvJDGW2e1IO4Q6bHSdsERqeOllhW0YNbmXAzmUWZ2W2Y4vQ32d1W/buL3785X+uKyZUI49fm 9i+zBSZXS2hFaaUH1bk2vyhhWSpEhbjEmC/kp7jYghMH6v6GljA3wJ7H8y0tX8w9kN8ivfK5T7S lHQH9E2btO2tlzNBubm9wiEravQuvQA5cWp2JTXIe/3CAs9mssxkIlTV25k30IxQGcQJjppc50F tT8RxjFBltHBJP7021bTXiAQhczzAhEeoa+f8qePww0eCP+QqYZk+6uYnf8RnQBAJJjohW0rnUp t0iT6/QEQHraRxX2R+Li05sYeGwbFLXK+cLIuGxaopZF/Ewmx1ja7NgTg0RyiiADfW5aQbiqaC1 qT+hfUBshihgJ9t9keg== X-Proofpoint-GUID: sgHFf6a0Mrhhiovx4j2RHbNz5uvHMzw6 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-17_01,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608170104 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. Reviewed-by: Jacopo Mondi Signed-off-by: Hans de Goede --- Changes in v7: - New patch in v7 of this patch-series --- .../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";