[{"id":31430,"web_url":"https://patchwork.libcamera.org/comment/31430/","msgid":"<fc4464d0-32f4-4fbd-9dd7-9aef5c7ecb8f@ideasonboard.com>","date":"2024-09-27T07:09:48","subject":"Re: [PATCH] pipeline: simple: Increase buffer count to four","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Robert,\n\nThank you for the patch.\n\nOn 27/09/24 2:37 am, Robert Mader wrote:\n> Which is not only what many other pipeline handlers use, but also a good\n> lower limit when dealing with DRM and similar APIs. Even Mesas EGL and\n> Vulkan WSI implementations use for the reason outlined in mesa commit\n> 992a2dbba80aba35efe83202e1013bd6143f0dba:\n>> When the compositor is directly scanning out from the application's buffer it\n>> may end up holding on to three buffers. These are the one that is is currently\n>> scanning out from, one that has been given to DRM as the next buffer to flip\n>> to, and one that has been attached and will be given to DRM as soon as the\n>> previous flip completes. When we attach a fourth buffer to the compositor it\n>> should replace that third buffer so we should get a release event immediately\n>> after that. This patch therefore also changes the number of buffer slots to 4\n>> so that we can accomodate that situation.\n> Given the popularity of this buffer number the bump should be unlikely\n> to cause problems. At the same time it may help with performance or\n> even work around glitches.\n>\n> The previous number was introduced in commit\n> a8964c28c80fb520ee3c7b10143371081d41405a without mentioning a specific\n> reason against the change at hand.\n>\n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n\nLet's add to popularity then,\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>   src/libcamera/pipeline/simple/simple.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 81915573..78ce9232 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -1135,7 +1135,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n>   \t\t\tcfg.frameSize = format.planes[0].size;\n>   \t\t}\n>   \n> -\t\tcfg.bufferCount = 3;\n> +\t\tcfg.bufferCount = 4;\n>   \t}\n>   \n>   \treturn status;","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 29F16C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Sep 2024 07:09:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 530A66350F;\n\tFri, 27 Sep 2024 09:09:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C4EE6618DB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Sep 2024 09:09:53 +0200 (CEST)","from [IPV6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f] (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8E93E8BF;\n\tFri, 27 Sep 2024 09:08:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"BJ14Tycl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727420905;\n\tbh=jjGxGKyAdz8GjVvgbRJ50QP9krSr/wZj9bvg9nt+Nog=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=BJ14Tycl2hhDbnzmlDxW1lC8g0+0bsYHWD1DxoyaQDZvfRIJ2kP8/ZtXNI7eBmFA4\n\t/SZnMUQwItK7pVpTADMZYGRO7OQSzkfE9dmRdfyDLD54dq2VyuatXgt6Zxv0IJSOon\n\tFLjWlMZAQcl1f9lB2y3wHN5uw1g5u50YMCZYHwtc=","Message-ID":"<fc4464d0-32f4-4fbd-9dd7-9aef5c7ecb8f@ideasonboard.com>","Date":"Fri, 27 Sep 2024 12:39:48 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] pipeline: simple: Increase buffer count to four","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20240926210739.27480-1-robert.mader@collabora.com>","Content-Language":"en-US","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<20240926210739.27480-1-robert.mader@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31436,"web_url":"https://patchwork.libcamera.org/comment/31436/","msgid":"<172742444396.532453.1383709195427644817@ping.linuxembedded.co.uk>","date":"2024-09-27T08:07:23","subject":"Re: [PATCH] pipeline: simple: Increase buffer count to four","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain (2024-09-27 08:09:48)\n> Hi Robert,\n> \n> Thank you for the patch.\n> \n> On 27/09/24 2:37 am, Robert Mader wrote:\n> > Which is not only what many other pipeline handlers use, but also a good\n> > lower limit when dealing with DRM and similar APIs. Even Mesas EGL and\n> > Vulkan WSI implementations use for the reason outlined in mesa commit\n> > 992a2dbba80aba35efe83202e1013bd6143f0dba:\n> >> When the compositor is directly scanning out from the application's buffer it\n> >> may end up holding on to three buffers. These are the one that is is currently\n> >> scanning out from, one that has been given to DRM as the next buffer to flip\n> >> to, and one that has been attached and will be given to DRM as soon as the\n> >> previous flip completes. When we attach a fourth buffer to the compositor it\n> >> should replace that third buffer so we should get a release event immediately\n> >> after that. This patch therefore also changes the number of buffer slots to 4\n> >> so that we can accomodate that situation.\n> > Given the popularity of this buffer number the bump should be unlikely\n> > to cause problems. At the same time it may help with performance or\n> > even work around glitches.\n> >\n> > The previous number was introduced in commit\n> > a8964c28c80fb520ee3c7b10143371081d41405a without mentioning a specific\n> > reason against the change at hand.\n> >\n> > Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> \n> Let's add to popularity then,\n> \n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\nThis is fine for me too.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> > ---\n> >   src/libcamera/pipeline/simple/simple.cpp | 2 +-\n> >   1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> > index 81915573..78ce9232 100644\n> > --- a/src/libcamera/pipeline/simple/simple.cpp\n> > +++ b/src/libcamera/pipeline/simple/simple.cpp\n> > @@ -1135,7 +1135,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n> >                       cfg.frameSize = format.planes[0].size;\n> >               }\n> >   \n> > -             cfg.bufferCount = 3;\n> > +             cfg.bufferCount = 4;\n> >       }\n> >   \n> >       return status;\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 6EE4BC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Sep 2024 08:07:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 89A7C6350F;\n\tFri, 27 Sep 2024 10:07:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E29536350C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Sep 2024 10:07:27 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A15183D;\n\tFri, 27 Sep 2024 10:05:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"JCfxPmRe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727424359;\n\tbh=8sRPSw72/eVfNIwlMnFCzzfYd46780fiKnfoZPCyazk=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=JCfxPmReH2/OTPd3wl8yB3VwAyDkGuOy7xkhEnJJv+KeM9EqStvD06bt5YLdr+ziu\n\tqaCQ8RXxZGBofNWHI6yRNi2r6KkD4UN7qwzN2ajJgJPwjgZa9qB28fhJ5cIL4YJxEJ\n\tEFSqXvseeLHYv0dt7lAn6Bo3iyptFZA24ICrRR+E=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<fc4464d0-32f4-4fbd-9dd7-9aef5c7ecb8f@ideasonboard.com>","References":"<20240926210739.27480-1-robert.mader@collabora.com>\n\t<fc4464d0-32f4-4fbd-9dd7-9aef5c7ecb8f@ideasonboard.com>","Subject":"Re: [PATCH] pipeline: simple: Increase buffer count to four","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Robert Mader <robert.mader@collabora.com>,\n\tUmang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 27 Sep 2024 09:07:23 +0100","Message-ID":"<172742444396.532453.1383709195427644817@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]