From patchwork Tue Nov 29 13:45:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17910 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 6D498BE08B for ; Tue, 29 Nov 2022 13:45:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D52E563343; Tue, 29 Nov 2022 14:45:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669729543; bh=OdbIBqn4LJOScBMWLFGppyDRgrAnWiPNTbPBcrFRT7o=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uZ6ped+lzcUybuvwe2NAYm4ileLDcIZ4rIPlzmKNq9ypjiKuEwXHMRUdjXGae7dIY wXpfVnIAKS/K7hSjK4pCXjQle2Jd1qTqeMmBEGrTPzI25yFgctGI/LSV5rfjoZlv9A FdM72IEM//uJMH5/xb0IQ2L6E75HmjUMuxEwIOZ48ircFGF6c7wLNuSKXCIt2q+dRQ rAlQS00I0Zh/oAvLW98nfMUdCEUut5MRJg4DUsT4nbPuWPzKZYVjD/U3MNlK2PI4BF Z94GGpmfxxnpK7t3+E+EJuVuyj+GrOZ8CeLpXSgjQqw2wrJhf6S74Vtg217tg0IjIH 1w4V4ww19BmJw== Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A3A2F63331 for ; Tue, 29 Nov 2022 14:45:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="mQWvgYWX"; dkim-atps=neutral Received: by mail-wm1-x332.google.com with SMTP id v7so10952786wmn.0 for ; Tue, 29 Nov 2022 05:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; 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; bh=vDUjikHxPpLQasRYd91iRpJMp4hp3BcRxTpdbCI0X+o=; b=mQWvgYWXwTzk6spK27NFa/IIdzY5oqFf1ukaVQqCQmpsNJ4RL32Vfi/zvEAvvQYSpY 97T/tIMM3cijJg8CnwLUGLyTMavULxZN9yhQ1leA/DLbPkIGrhoWuUnnNDcQ/LQIlotW f/vUmQ8sfuOaw6GqQhEalR2PDIF6j6WPiNdHKNe7emawX6Xmje0cnR+O/U8dhTFaSd+/ YeU9gq6hKSxxRYLQAoJXU8BWXegieK2VOjSfKu9tqNXKaes4zKMiY9q5UmVjqA4atXID Knb0EQyaAADHGX6UbNGd9ehoBGBsgrhTRQK30pYCFAnfbQac68LyEksDnDuur3wLdVwQ GqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vDUjikHxPpLQasRYd91iRpJMp4hp3BcRxTpdbCI0X+o=; b=gslMsdQRfw6oEwbXNQOCJMjxbMh0puGXcr2QlTFigUvYo+imk2VqxLeYTJlFTffX9i oQOTSe9tZBIj09G6M9Tk63wIpyc59RQ+V9ZcjkU97yF6oSz849qjqpnxE8n7n+h1y2FA JwKBOQV4qcbhhxbi3DBTtKdsEekd45CSWcfMTCgyg7pcZINfjvKe7+Gquq4+VOcOUmLM 7+Ak+Ov+7ZgV+vP+I27KkTRE7BD6LyXZss2rynv99wex7ctS5D08V3AnwGyi7dgzuJE9 5hLftz8eCxadple6jbKe35xeobbf6Ft9G94K1zYPjACuIiY7D+2Ri+kJ05wuLtQkTolc C2dQ== X-Gm-Message-State: ANoB5plknzzA+lsdTpcSVR8moFR6NAYzOdSegZNMEse0le4EujIcjFho 5f6DqvHTC9ejSSiqqC1rwFzPFnzXbecm2Q== X-Google-Smtp-Source: AA0mqf5jA6fyGJmROQtVj0wFrYgvE7UqEdvPVVgrpBKir0T2p/4938Jw0BNFic2VQt7YayQ+tBC0mg== X-Received: by 2002:a05:600c:2e0c:b0:3d0:6d87:7b44 with SMTP id o12-20020a05600c2e0c00b003d06d877b44mr909713wmf.106.1669729539950; Tue, 29 Nov 2022 05:45:39 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id n8-20020a05600c3b8800b003cfbbd54178sm3565636wms.2.2022.11.29.05.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 05:45:39 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 29 Nov 2022 13:45:27 +0000 Message-Id: <20221129134534.2933-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221129134534.2933-1-naush@raspberrypi.com> References: <20221129134534.2933-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 03/10] pipeline: raspberrypi: Split out ISP Output0 buffer allocation 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new config parameter numOutput0Buffers specifying the number of internally allocated ISP Output0 buffers. This parameter defaults to 1. Split out the buffer allocation logic so that the buffer count for ISP Output0 can be different from the ISP Output1 and Statistics streams. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- .../pipeline/raspberrypi/raspberrypi.cpp | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 4486d31ea78d..f2b695af2399 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -305,6 +305,11 @@ public: * the Unicam Image steram. */ unsigned int minTotalUnicamBuffers; + /* + * The number of internal buffers allocated for the ISP Output0 + * stream. + */ + unsigned int numOutput0Buffers; }; Config config_; @@ -1418,6 +1423,7 @@ int PipelineHandlerRPi::configurePipelineHandler(RPiCameraData *data) config = { .minUnicamBuffers = 2, .minTotalUnicamBuffers = 4, + .numOutput0Buffers = 1, }; return 0; @@ -1502,12 +1508,19 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera) * so allocate the minimum required to avoid frame drops. */ numBuffers = minBuffers; - } else { + } else if (stream == &data->isp_[Isp::Output0]) { /* * Since the ISP runs synchronous with the IPA and requests, - * we only ever need one set of internal buffers. Any buffers - * the application wants to hold onto will already be exported - * through PipelineHandlerRPi::exportFrameBuffers(). + * we only ever need a maximum of one internal buffer. Any + * buffers the application wants to hold onto will already + * be exported through PipelineHandlerRPi::exportFrameBuffers(). + */ + numBuffers = std::min(1u, data->config_.numOutput0Buffers); + } else { + /* + * Same reasoning as above, we only ever need a maximum + * of one internal buffer for Output1 (required for colour + * denoise) and ISP statistics. */ numBuffers = 1; }