[{"id":21005,"web_url":"https://patchwork.libcamera.org/comment/21005/","msgid":"<YZZJ7ZPUvqVoGF+j@pendragon.ideasonboard.com>","date":"2021-11-18T12:41:17","subject":"Re: [libcamera-devel] [PATCH v2 3/3] pipeline: raspberrypi:\n\tIncrease the V4L2BufferCache slot allocations","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Fri, Nov 12, 2021 at 10:03:05AM +0000, Naushir Patuck wrote:\n> If a stream is marked as external, double the number of V4L2BufferCache slots\n> that are allocated. This is to account for additional buffers that may be\n> allocated directly by the application.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/raspberrypi/rpi_stream.cpp | 8 ++++++++\n>  1 file changed, 8 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n> index b3265d0e8aab..67901936d6b6 100644\n> --- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp\n> @@ -107,6 +107,14 @@ int Stream::prepareBuffers(unsigned int count)\n>  \t\tcount = bufferMap_.size();\n>  \t}\n>  \n> +\t/*\n> +\t * If this is an external stream, we must allocate slots for buffers that\n> +\t * might be externally allocated. We have no indication of how many buffers\n> +\t * may be used, so this might overallocate slots in the buffer cache.\n\nWith\n\n\t * \\todo Find a better heuristic, or, even better, an exact solution to\n\t * this issue\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t */\n> +\tif (isExternal())\n> +\t\tcount = count * 2;\n> +\n>  \treturn dev_->importBuffers(count);\n>  }\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 C490FBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Nov 2021 12:41:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E042860371;\n\tThu, 18 Nov 2021 13:41:41 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 24E7860231\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Nov 2021 13:41:40 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 90632E7;\n\tThu, 18 Nov 2021 13:41:39 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YpAZTzJf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637239299;\n\tbh=qJ1XzmVQFXN106Z5sLW/Cx2UXulo/9Jn0inbYfOkH3A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YpAZTzJfMr4FqxxLY8DKjB19P4SVQdAfcT8M1vHsP0ZdKkIDO70ttJgGlzPCqniFc\n\tqud8w2C2628r6TLDyMquebizE+lt7z7WYM+5ueMeOsZNsRhA1g7zAM8w2jNYvuUGiy\n\t+RS5hgaMtDTpEzgYpR8Ehl9Ci1PwKzVqTcl7hNmg=","Date":"Thu, 18 Nov 2021 14:41:17 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YZZJ7ZPUvqVoGF+j@pendragon.ideasonboard.com>","References":"<20211112100305.2217099-1-naush@raspberrypi.com>\n\t<20211112100305.2217099-4-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211112100305.2217099-4-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2 3/3] pipeline: raspberrypi:\n\tIncrease the V4L2BufferCache slot allocations","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>","Cc":"libcamera-devel@lists.libcamera.org,\n\tRoman Stratiienko <r.stratiienko@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]