[{"id":25704,"web_url":"https://patchwork.libcamera.org/comment/25704/","msgid":"<CAHW6GYJ2o-5B3thiRQBAM4UWe_FB7OEZWtVHBT45V7DffEP3BQ@mail.gmail.com>","date":"2022-11-01T11:52:05","subject":"Re: [libcamera-devel] [PATCH v1 03/10] pipeline: raspberrypi: Split\n\tout ISP Output0 buffer allocation","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch!\n\nOn Fri, 14 Oct 2022 at 14:18, Naushir Patuck via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> Add a new config parameter numOutput0Buffers specifying the number of internally\n> allocated ISP Output0 buffers. This parameter defaults to 1.\n>\n> Split out the buffer allocation logic so that the buffer count for ISP Output0\n> can be different from the ISP Output1 and Statistics streams.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n> ---\n>  .../pipeline/raspberrypi/raspberrypi.cpp        | 17 +++++++++++++----\n>  1 file changed, 13 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 7d1e454cddcd..450029197b11 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -297,6 +297,7 @@ public:\n>         struct Config {\n>                 unsigned int minUnicamBuffers;\n>                 unsigned int minTotalUnicamBuffers;\n> +               unsigned int numOutput0Buffers;\n>         };\n>\n>         Config config_;\n> @@ -1401,6 +1402,7 @@ int PipelineHandlerRPi::configurePipelineHandler(RPiCameraData *data)\n>         config = {\n>                 .minUnicamBuffers = 2,\n>                 .minTotalUnicamBuffers = 4,\n> +               .numOutput0Buffers = 1,\n>         };\n>\n>         return 0;\n> @@ -1485,12 +1487,19 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n>                          * so allocate the minimum required to avoid frame drops.\n>                          */\n>                         numBuffers = minBuffers;\n> -               } else {\n> +               } else if (stream == &data->isp_[Isp::Output0]) {\n>                         /*\n>                          * Since the ISP runs synchronous with the IPA and requests,\n> -                        * we only ever need one set of internal buffers. Any buffers\n> -                        * the application wants to hold onto will already be exported\n> -                        * through PipelineHandlerRPi::exportFrameBuffers().\n> +                        * we only ever need a maximum of one internal buffer. Any\n> +                        * buffers the application wants to hold onto will already\n> +                        * be exported through PipelineHandlerRPi::exportFrameBuffers().\n> +                        */\n> +                       numBuffers = std::min(1u, data->config_.numOutput0Buffers);\n> +               } else {\n> +                       /*\n> +                        * Same reasoning as above, we only ever need a maximum\n> +                        * of one internal buffer for Output1 (required for colour\n> +                        * denoise) and ISP statistics.\n>                          */\n>                         numBuffers = 1;\n>                 }\n> --\n> 2.25.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 23D5EBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Nov 2022 11:52:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 861A563031;\n\tTue,  1 Nov 2022 12:52:19 +0100 (CET)","from mail-pf1-x431.google.com (mail-pf1-x431.google.com\n\t[IPv6:2607:f8b0:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EEC7763009\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Nov 2022 12:52:17 +0100 (CET)","by mail-pf1-x431.google.com with SMTP id v28so13058594pfi.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 01 Nov 2022 04:52:17 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1667303539;\n\tbh=Mbi+jLD17XshN6Kw9js/GlpvOaGkaLq6ZBP/yi5Jfa8=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=4UjvJOqqHSDlfURGq9YEpnm4jqzj/rHzivH17OAkoYvM5UPR7oY+ADdKyjlvO7RJ0\n\tGFsVKqULzsCs2gZjn47NyXdwcPBC+JssQeEcfVS+27LAUbsukAFflBmXyDhf6u1fQB\n\tjx+9igKCgVBoqTVayOcu9YFcWECfGx5htrYkF/e9AoolqVKuKV7YGHWVUPJRZMP+CL\n\tTXluli569proqz4nk4nWb5y0y+JnWF2IFLimPh8IAvVynP9DdCBm8gEu3iXYeJbyJ7\n\tM+pagDIjyYywZrcFq5z/1WBB3g4EOA8v9q1QkIRbRGDTc2toGCgXy3JyJ23mWQawAY\n\t/WEQexsZqYRgw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=ZbS2ZziDvgdD8C9OFTXdDo3IAZqI4shi9B3GU6jN3rw=;\n\tb=ORD1OhnwkRuFiQrEQjQpz8QuxN67kARZ7Q4r4fzgZE+vpdc98MFNZOlWLt0vJZKSud\n\tjeCCsjwXBdQdDZJT0PhGkXpwVI6jSilyzXCwbTdRGYS9AEDLO9jejfUaALIxdgCO4dxA\n\trOLSg5vkqV77jcZNYo3k3vGiXkVDc9gF4nDK31gM47ObtpUhLPdE3Z/B/k6wPOaWzPyH\n\tmVkO4+dZkdGZQs4uciq0kJwIXA38u/VXg85goTFkrlJyyVB3XKCW6MWXIm9HsKau6BZb\n\tO7qko6NolckuZtWw0T7Ob9va5jAg4tgaCAyNWy7hkDA0Ad4geTGBTJcyPm32EKSoqmpp\n\tj3wQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ORD1Ohnw\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=ZbS2ZziDvgdD8C9OFTXdDo3IAZqI4shi9B3GU6jN3rw=;\n\tb=H7d/4RZSZx8o4UoVScbeZY8vYNAbCoTN5PN7fbGcBHwSz6tznVJLSdW11zhLsoz4J7\n\tmmj4VXxCH/HxdxZ1jVnI9LjEnnv4RFDfplVsBoOlkt6xkz+XdD7TiPxGNWtWG6hXzdyu\n\tD6jKWyRVQFE4ns0+v9F5Rx7QXBOi90dxtNoYgnWWZLc+/0E5YLwrgD6EzCd1B8H2wGB/\n\t4d5Tor0HzQ5SqFgFaO26QiuCH55us2z3z8sn8hUPTYZwtSMn0VZdqGJaF3TAXLCX/v2R\n\t2hHgH6PWuIiOHkQbSVxHuUYrli6iQKV5IDdCXyJQjc4iOp+LMNE++utq6jVMJVk8lD3A\n\t/MIw==","X-Gm-Message-State":"ACrzQf0ikBSLlrcpDeRB8fKW9x1S7zyIKAzagV93DMPM8R/Gvx1ky3oo\n\tBX92bWQCX6YMql11R9lEVw76ixrdxf/AS8bQaoXfoy3S1vs=","X-Google-Smtp-Source":"AMsMyM52dVWBFSTUa9wWNfWzBiR7IKMoJFxJxuspexYurvq9PhJWvjfpaoH1SHkWRPdcTpQwBf7Mqc91tQnIb5CpQpw=","X-Received":"by 2002:a63:f103:0:b0:439:398f:80f8 with SMTP id\n\tf3-20020a63f103000000b00439398f80f8mr16656046pgi.494.1667303536214;\n\tTue, 01 Nov 2022 04:52:16 -0700 (PDT)","MIME-Version":"1.0","References":"<20221014131846.27169-1-naush@raspberrypi.com>\n\t<20221014131846.27169-4-naush@raspberrypi.com>","In-Reply-To":"<20221014131846.27169-4-naush@raspberrypi.com>","Date":"Tue, 1 Nov 2022 11:52:05 +0000","Message-ID":"<CAHW6GYJ2o-5B3thiRQBAM4UWe_FB7OEZWtVHBT45V7DffEP3BQ@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1 03/10] pipeline: raspberrypi: Split\n\tout ISP Output0 buffer allocation","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]