From patchwork Wed Jul 16 14:20:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 23822 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 A9367C3237 for ; Wed, 16 Jul 2025 14:20:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4931B68F6A; Wed, 16 Jul 2025 16:20:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="TopTQ4Gh"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D76DE68F35 for ; Wed, 16 Jul 2025 16:20:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9VZdOFfGmvs9e0K84SjEmfwrVV97MyVAnBjtT6x6T+8=; b=TopTQ4Gh4CvfEVjRiDWEW3esHM yqSuhcxrzfUVYlFAAS+pSQMA9DNBwE/TL8rkXfW7i16kflOhfkd71burz/6XVB8quZciiMr9GbLvZ 0HJBPHGQyDW3pQtC8d0SOHJmSs7g5LNfmhlb3vPbSPTegNHFYPv2zsJ0aJFyes+DsBfAj+bc2o+an FZgdA6X98ZEYv/RUzEC075isgoou0GZJ/udiAIKRTOOrIgf65SDoIqf+jiV2T0iJwYHn85/TSG2Ww WRP67DP+f6A2RhPE2+l0Xn88MM7iCO3/K+YZRZPEwoJSfv6fXbnEwDxpIMRmXeervmAxfEujhIXG3 R6IW2b1A==; Received: from [49.36.69.57] (helo=uajain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1uc2ze-00HLf5-Py; Wed, 16 Jul 2025 16:20:23 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Robert Mader , Umang Jain Subject: [RFC PATCH 1/6] libcamera: simple: Set the number of software ISP streams to 2 Date: Wed, 16 Jul 2025 19:50:21 +0530 Message-ID: <20250716142027.236277-2-uajain@igalia.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250716142027.236277-1-uajain@igalia.com> References: <20250716142027.236277-1-uajain@igalia.com> 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" From: Milan Zamazal When software ISP is enabled, we want to be able to provide a raw stream in addition to the processed stream. For this purpose, we need two streams. If only the processed stream is requested, it doesn't harm to allocate two. This is a hack for the lack of a better easy option. The number of streams is determined as a camera property in the pipeline matching. The actual number of streams needed (one or two) is determined only when examining roles in SimplePipelineHandler::generateConfiguration. In theory, software ISP could produce multiple processed streams but this is out of scope of this patch series. Hence two streams are sufficient at the moment. When software ISP is not enabled, the camera won't be able to produce multiple streams (assuming there's no hardware converter) and only single stream should be allocated as before. The simple pipeline handler assumes there's a linear pipeline from the camera sensor to a video capture device, and only supports a single stream. Branches in the hardware pipeline that would allow capturing multiple streams from the same camera sensor are not supported. We have no plan to change that, as a device that can produce multiple streams will likely be better supported by a dedicated pipeline handler. Signed-off-by: Milan Zamazal Signed-off-by: Umang Jain --- src/libcamera/pipeline/simple/simple.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index efb07051..de6b29ab 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1265,7 +1265,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate() */ SimplePipelineHandler::SimplePipelineHandler(CameraManager *manager) - : PipelineHandler(manager), converter_(nullptr) + : PipelineHandler(manager), converter_(nullptr), swIspEnabled_(false) { } @@ -1687,7 +1687,16 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator) } } - swIspEnabled_ = info->swIspEnabled; + if (info->swIspEnabled) { + /* + * When the software ISP is enabled, the simple pipeline handler + * exposes the raw stream, giving a total of two streams. This + * is mutally exclusive with the presence of a converter. + */ + ASSERT(!converter_); + numStreams = 2; + swIspEnabled_ = true; + } /* Locate the sensors. */ std::vector sensors = locateSensors(media);