From patchwork Fri Oct 14 13:18:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17599 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 8CE22C0DA4 for ; Fri, 14 Oct 2022 13:18:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9E61562DCE; Fri, 14 Oct 2022 15:18:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665753538; bh=DmRt7iDdF3iU70iACpSbId932K7vjHRoNGMzbP27ZSY=; 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=wZvTznotwubP99cXOEOK5QXH2b9ZxVPrVCR0rXNtwe1OdHO/AIkfcG20Ic636wIdS XhwPppqA1F74hnckIVN7eejWWAbC3BLQ5/BnZNeNZBr7rAUuOsvbYygYH03M30wxHM /EwZFT6YOtk3C/o0vHG27nDOMXC4elD9pJsyLibShpmbwkoO9kzOL8Ac7CW4/smA+x DMcffYZ75QcXg5V4iLVF3iNORLty1iVJYUEqVPLwD64HJzG5YJBKPFqdta0OgoZSIV JAGHyHPjeX0G+q6FyHTJRX/bJ/WmoHEwklK3T4YVuPlV7FKsMykSBVpe5TrQ1ySHgb LSEmmlJxeoe0A== Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7FEEE62D8E for ; Fri, 14 Oct 2022 15:18:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="gF5hn0SG"; dkim-atps=neutral Received: by mail-wr1-x42d.google.com with SMTP id b4so7572980wrs.1 for ; Fri, 14 Oct 2022 06:18:54 -0700 (PDT) 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=jixBM/knBT5ddTo/kQAj1J1RKHqf2+VLhhPdXJMppwE=; b=gF5hn0SGw7VA8OeepQO46ofSnn3+1BuPEMrhwG8gk6dlgIL7gCrSucPYudJeInfpQC kkGz8IluVZn9SNkY6J3OMaO/pUmutYO78v7wPhBubLYHc0GIFPD7nTMU/k0jAIzq5kEz 3SPZZ615W7tF++Heb4EFeRDHXeVv2EwrE9O6Tuo5f/67FS7rkfAF5ZDeY0horMfBof0Y M3/30X5etbUyNI1Nr11AJOSW4kbsxmPGTAQceELWLsVxiXQ9mmnRZhmuO9OqoPIN9+PJ VCKXTjwBEoFafP9cuZuxUUXAhfPK5mtMw9Rscsvfl1I953UdztrvEUD0NyPDiOcPjnsg jXoQ== 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=jixBM/knBT5ddTo/kQAj1J1RKHqf2+VLhhPdXJMppwE=; b=wY1M5PoerfgK8jxTnCphIhEKxLm42cza5i5eQiPHPx28xBZ2pbh3tMojRqB9NOxLMO DPfPs/uQxIK2KKG5sUWU6Ej5Je8KIxPfQhvrdCIEaTCfolgT+ahbJ6uZqzAtrDsOqUbk Emb5lxRJvyutthQvYI4qyHxH8CGf5YEdZ18FNOaSCGypdmlrCfpI+WuOBOitJ4olACmz ERBQw06BRpbUvJZn64HCUnOro9oNYsjBXKzRlvTft1MXRtVDKA86kczHD+xKf756k7Ry CNDREK0B1etYZwbbowEPOKg9Iisstgw9yWfylAHUyIJ1bcPk16Kx+KIjmQphcVtnHhDj EWOw== X-Gm-Message-State: ACrzQf28f3YlYeDv7sS+pKFwzkWREGWf0PjNTnV44c3//9uqFYyrDjDV mDs/8KgTuFmjBk08fxxOfAeCK/L5PUGYXQ== X-Google-Smtp-Source: AMsMyM57oiF0CLza799DZ0gaJf4E3bwKce6VqG9nWwoYAit+QTPuf7HlQltmXEVow4xPmFsVzPDXhQ== X-Received: by 2002:adf:fd4a:0:b0:22d:d3aa:e004 with SMTP id h10-20020adffd4a000000b0022dd3aae004mr3362492wrs.173.1665753534058; Fri, 14 Oct 2022 06:18:54 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id g17-20020a05600c001100b003c6bbe910fdsm8282458wmc.9.2022.10.14.06.18.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 06:18:53 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 14 Oct 2022 14:18:39 +0100 Message-Id: <20221014131846.27169-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221014131846.27169-1-naush@raspberrypi.com> References: <20221014131846.27169-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 7d1e454cddcd..450029197b11 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -297,6 +297,7 @@ public: struct Config { unsigned int minUnicamBuffers; unsigned int minTotalUnicamBuffers; + unsigned int numOutput0Buffers; }; Config config_; @@ -1401,6 +1402,7 @@ int PipelineHandlerRPi::configurePipelineHandler(RPiCameraData *data) config = { .minUnicamBuffers = 2, .minTotalUnicamBuffers = 4, + .numOutput0Buffers = 1, }; return 0; @@ -1485,12 +1487,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; }