[{"id":27978,"web_url":"https://patchwork.libcamera.org/comment/27978/","msgid":"<169763498661.630990.1276288888125113889@ping.linuxembedded.co.uk>","date":"2023-10-18T13:16:26","subject":"Re: [libcamera-devel] [PATCH v2] pipeline: rpi: vc4: Allocate more\n\tembedded data buffers","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting William Vinnicombe via libcamera-devel (2023-10-18 13:52:41)\n> If the pipeline runs out of embedded data buffers, then it will pass\n> the frame to the IPA without the metadata. The IPA then has to use the\n> delayed controls as inputs to the algorithms. This can cause problems\n> with the subsequent algorithms if the sensor did not action the\n> controls, especially with the autofocus as that doesn't have controls\n> which can be passed in lieu of the metadata.\n> \n> Reduce the likelihood of this by increasing the number of embedded data\n> buffers, as they are small so a generous number can be allocated.\n> \n> Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nApplying...\n\n\n> ---\n>  src/libcamera/pipeline/rpi/vc4/vc4.cpp | 17 ++++++++++++++---\n>  1 file changed, 14 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> index 425ab9ae..d7279d02 100644\n> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> @@ -258,10 +258,21 @@ int PipelineHandlerVc4::prepareBuffers(Camera *camera)\n>  \n>                 } else if (stream == &data->unicam_[Unicam::Embedded]) {\n>                         /*\n> -                        * Embedded data buffers are (currently) for internal use,\n> -                        * so allocate the minimum required to avoid frame drops.\n> +                        * Embedded data buffers are (currently) for internal use, and\n> +                        * are small enough (typically 1-2KB) that we can\n> +                        * allocate them generously to avoid causing problems in the\n> +                        * IPA when we cannot supply the metadata.\n> +                        * \n> +                        * 12 are allocated as a typical application will have 8-10\n> +                        * input buffers, so allocating more embedded buffers than that\n> +                        * is a sensible choice.\n> +                        * \n> +                        * The lifetimes of these buffers are smaller than those of the\n> +                        * raw buffers, so allocating a fixed number will still suffice\n> +                        * if the application requests a greater number of raw\n> +                        * buffers, as these will be recycled quicker.\n>                          */\n> -                       numBuffers = minBuffers;\n> +                       numBuffers = 12;\n>                 } else {\n>                         /*\n>                          * Since the ISP runs synchronous with the IPA and requests,\n> -- \n> 2.39.2\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 6B3B5BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Oct 2023 13:16:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE5C66296F;\n\tWed, 18 Oct 2023 15:16:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22F2761DD1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Oct 2023 15:16:29 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C318F2B3;\n\tWed, 18 Oct 2023 15:16:21 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1697634990;\n\tbh=vxUOBNZ3t0Gt3Dv1o+5W4/hJWLSAlOaqU04AnhvshF0=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=AJkgVnVtoORdlk5vnPx0y46lZ77w34WAyeVj8TtsKmH9yeUmXYIAuTUR+CvYZyum3\n\tSvEH4CSb2VZpfkq0PAbIi+FuyMj9lOj6iGMlEAIY1+R50i+CiURs5vNPM3UyktDqXh\n\tp85B581O+antXYLRr5zntrQRiEKBsSfO4VV8LOSa/DsZDYAGljkp6m0Rd+O+8IKija\n\t9NWgZ0PIlcrCXbCtXUrdNDWvWW9KNtTQ4e+pPbc6v9aUlmd6ftaK/cs1AxTvNr8U7M\n\tBPpi4FKy1qaiqViHOEj04y58mWDoL5omtSeJD5sQXUoSCEfoKuz3SAI0GSNum6C0AS\n\t2ZHMFJ4vaY5tQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1697634981;\n\tbh=vxUOBNZ3t0Gt3Dv1o+5W4/hJWLSAlOaqU04AnhvshF0=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=AnUvGx57FH68bupZhIXWUldIBKY1+CIZsTKuF/ulgQuaBnkJu4k9urkby02S8YVnm\n\tUEuPrXUlogB9ocPpVRmUlw5vC9CCI9R+ltNZTBtTunPnS4Iz4VirI+DRZY8glNdvlA\n\t1gSd0TmMH2Od6lmU2J2/k+Goio0+ogfxZGadBz8Q="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AnUvGx57\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20231018125241.17838-1-william.vinnicombe@raspberrypi.com>","References":"<20231018125241.17838-1-william.vinnicombe@raspberrypi.com>","To":"William Vinnicombe <william.vinnicombe@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 18 Oct 2023 14:16:26 +0100","Message-ID":"<169763498661.630990.1276288888125113889@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2] pipeline: rpi: vc4: Allocate more\n\tembedded data buffers","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]