From patchwork Mon Feb 16 20:30:22 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 26172 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 12F0FC0DA4 for ; Mon, 16 Feb 2026 20:30:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 97CC16220E; Mon, 16 Feb 2026 21:30:51 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="MtQo3kvF"; 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 1176C62205 for ; Mon, 16 Feb 2026 21:30:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771273848; 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=ty7Pl+oSdBnm4kdYhkv46mxz2PSFLMnGeRLtqMy2QL8=; b=MtQo3kvF4ifoCsSq4kTh3/dof8bZ0IDqOeUsXg+WNVaNTPXfuQqMux4UYGZMi+zyc0dAt0 AhLLQ86rNtyItFz+gCluOrIwLTxpFpXyP+SO1XTGAlqbGrV3rIYFKDo7j9LSh7U3qLaLhp anbm/sUN9FHqG4VgKgCdhUOZ7Fc6wIM= Received: from mx-prod-mc-01.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-130-WgpgWodQM1O9DgPM1_2r-A-1; Mon, 16 Feb 2026 15:30:47 -0500 X-MC-Unique: WgpgWodQM1O9DgPM1_2r-A-1 X-Mimecast-MFC-AGG-ID: WgpgWodQM1O9DgPM1_2r-A_1771273846 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B9BE1956094 for ; Mon, 16 Feb 2026 20:30:46 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.32.25]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 60AE518004AD; Mon, 16 Feb 2026 20:30:45 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [RFC PATCH v2 03/14] libcamera: software_isp: Separate allocation of the parameters buffer Date: Mon, 16 Feb 2026 21:30:22 +0100 Message-ID: <20260216203034.27558-4-mzamazal@redhat.com> In-Reply-To: <20260216203034.27558-1-mzamazal@redhat.com> References: <20260216203034.27558-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: dyg-1wE3eKow6gOVClPMHfW1VewQj3PP4zTOE7MCqqI_1771273846 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" There will be some additions to that code in followup patches and let's not blow the code in SoftwareIsp constructor even more. Signed-off-by: Milan Zamazal --- .../internal/software_isp/software_isp.h | 1 + src/libcamera/software_isp/software_isp.cpp | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h index 30b25cddf..dc6b6f7c1 100644 --- a/include/libcamera/internal/software_isp/software_isp.h +++ b/include/libcamera/internal/software_isp/software_isp.h @@ -98,6 +98,7 @@ private: Thread ispWorkerThread_; SharedMemObject sharedParams_; DebayerParams debayerParams_; + bool allocateParamsBuffers(); DmaBufAllocator dmaHeap_; bool ccmEnabled_; diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 0447d2171..dc0a8eb84 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -88,12 +88,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, LOG(SoftwareIsp, Error) << "Failed to create DmaBufAllocator object"; return; } - - sharedParams_ = SharedMemObject("softIsp_params"); - if (!sharedParams_) { - LOG(SoftwareIsp, Error) << "Failed to create shared memory for parameters"; + if (!allocateParamsBuffers()) return; - } const GlobalConfiguration &configuration = pipe->cameraManager()->_d()->configuration(); @@ -176,6 +172,17 @@ SoftwareIsp::~SoftwareIsp() debayer_.reset(); } +bool SoftwareIsp::allocateParamsBuffers() +{ + sharedParams_ = SharedMemObject("softIsp_params"); + if (!sharedParams_) { + LOG(SoftwareIsp, Error) << "Failed to create shared memory for parameters"; + return false; + } + + return true; +} + /** * \fn int SoftwareIsp::loadConfiguration([[maybe_unused]] const std::string &filename) * \brief Load a configuration from a file