From patchwork Thu Nov 28 12:52:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 22129 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 442C1BD78E for ; Thu, 28 Nov 2024 12:52:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 013BF65F78; Thu, 28 Nov 2024 13:52:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="FaXKehFN"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0038765F56 for ; Thu, 28 Nov 2024 13:52:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732798363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0tHm8A2qd3mgfgmgEqh1hPWpWr0yETjUehpM0UuI6cM=; b=FaXKehFNJWEp0pnNBusIG5EceP+b/OkUBifPUjnMEmT+5lGZ1GQVbyOf8msuq+tsV5ky7R 3iaOFIdA9aNOuxft/u/sNqgT4UFqZtSeRZ5Q3lM8KVMs/pNfD8J+VwLcbKaDdjsLSXbjY9 tvSFLh4/xXA24h+zXLoFRdsqtMKKFd8= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-OxsALaatNhS9soSPhSbiDQ-1; Thu, 28 Nov 2024 07:52:39 -0500 X-MC-Unique: OxsALaatNhS9soSPhSbiDQ-1 X-Mimecast-MFC-AGG-ID: OxsALaatNhS9soSPhSbiDQ Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A42231944DD3; Thu, 28 Nov 2024 12:52:38 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.146]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AA2AF1955D45; Thu, 28 Nov 2024 12:52:36 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Kieran Bingham , Laurent Pinchart , Stefan Klug Subject: [PATCH v5 2/4] ipa: ipu3: Add constructor to the IPA context Date: Thu, 28 Nov 2024 13:52:23 +0100 Message-ID: <20241128125226.683249-3-mzamazal@redhat.com> In-Reply-To: <20241128125226.683249-1-mzamazal@redhat.com> References: <20241128125226.683249-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5h1LI4CC4RaiccUs_ADE01gMvrar_LfNAae9nhgpX2I_1732798358 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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" Let's have a constructor that takes just the non-default argument, without the need to specify the defaults. Signed-off-by: Milan Zamazal Reviewed-by: Kieran Bingham --- src/ipa/ipu3/ipa_context.cpp | 4 ++++ src/ipa/ipu3/ipa_context.h | 5 +++++ src/ipa/ipu3/ipu3.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp index fe455e07..3b22f791 100644 --- a/src/ipa/ipu3/ipa_context.cpp +++ b/src/ipa/ipu3/ipa_context.cpp @@ -39,6 +39,10 @@ namespace libcamera::ipa::ipu3 { * \struct IPAContext * \brief Global IPA context data shared between all algorithms * + * \fn IPAContext::IPAContext + * \brief Initialize the instance with the given number of frame contexts + * \param[in] frameContextSize Size of the frame context ring buffer + * * \var IPAContext::configuration * \brief The IPA session configuration, immutable during the session * diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index 29f38b36..97fcf06c 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -84,6 +84,11 @@ struct IPAFrameContext : public FrameContext { }; struct IPAContext { + IPAContext(unsigned int frameContextSize) + : frameContexts(frameContextSize) + { + } + IPASessionConfiguration configuration; IPAActiveState activeState; diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 44c98cbf..1cae08bf 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -187,7 +187,7 @@ private: }; IPAIPU3::IPAIPU3() - : context_({ {}, {}, { kMaxFrameContexts }, {} }) + : context_(kMaxFrameContexts) { }