[{"id":34800,"web_url":"https://patchwork.libcamera.org/comment/34800/","msgid":"<175188664368.2340557.17902346456725949554@ping.linuxembedded.co.uk>","date":"2025-07-07T11:10:43","subject":"Re: [PATCH v2 3/5] pipeline: rkisp1: Limit the maximum number of\n\tbuffers queued in","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-07-07 08:53:37)\n> To keep the regulation of the algorithms as short as possible and to\n> allow more buffers to be created than the v4l2 device allows to be queued,\n> limit the amount of buffers that get queued into the device to the pipeline depth.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> ---\n> \n> Changes in v1:\n> - Replaced function overload with constructor param\n\nThis looks easier/cleaner in fact!\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 8 +++++++-\n>  1 file changed, 7 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 675f0a7490a6..fff42359cbff 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -155,6 +155,12 @@ private:\n>         Transform combinedTransform_;\n>  };\n>  \n> +namespace {\n> +\n> +const unsigned int kPipelineDepth = 4;\n> +\n> +} // namespace\n> +\n>  class PipelineHandlerRkISP1 : public PipelineHandler\n>  {\n>  public:\n> @@ -684,7 +690,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n>   */\n>  \n>  PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager)\n> -       : PipelineHandler(manager), hasSelfPath_(true), useDewarper_(false)\n> +       : PipelineHandler(manager, kPipelineDepth), hasSelfPath_(true), useDewarper_(false)\n>  {\n>  }\n>  \n> -- \n> 2.48.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 C422FC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jul 2025 11:10:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E744D68EA4;\n\tMon,  7 Jul 2025 13:10:48 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B2D4768E92\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jul 2025 13:10:47 +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 90194524;\n\tMon,  7 Jul 2025 13:10:20 +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=\"FVtYWx9Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751886620;\n\tbh=wUFSR4RyZ19HLKiZgak65EozHC0uv1sIR8S7OQPzpbc=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=FVtYWx9YEE6eWgnentz2SHbHwMlOxNmPtL8Yu1ZrPwJ7Zpiu66Q9aQDixBRbQjqPc\n\t5EWIlOBqgq8IjTSd6OSfgEhMTTMOtWDFKTPWcK+1cgNZG593j4MDZoagQGZJ1kJ01a\n\tle+Qr50eJW/Wc16fZ7I+xVr92dCK2Y2Vd8O1c/4s=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250707075400.9079-4-stefan.klug@ideasonboard.com>","References":"<20250707075400.9079-1-stefan.klug@ideasonboard.com>\n\t<20250707075400.9079-4-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 3/5] pipeline: rkisp1: Limit the maximum number of\n\tbuffers queued in","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 07 Jul 2025 12:10:43 +0100","Message-ID":"<175188664368.2340557.17902346456725949554@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":34817,"web_url":"https://patchwork.libcamera.org/comment/34817/","msgid":"<ozykeofq42c4o5cvptfieqfivtjnj77thxjp66rr3l35aq5hll@avtoxo5tgqub>","date":"2025-07-08T05:05:11","subject":"Re: [PATCH v2 3/5] pipeline: rkisp1: Limit the maximum number of\n\tbuffers queued in","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Mon, Jul 07, 2025 at 09:53:37AM +0200, Stefan Klug wrote:\n> To keep the regulation of the algorithms as short as possible and to\n> allow more buffers to be created than the v4l2 device allows to be queued,\n> limit the amount of buffers that get queued into the device to the pipeline depth.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> ---\n> \n> Changes in v1:\n> - Replaced function overload with constructor param\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 8 +++++++-\n>  1 file changed, 7 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 675f0a7490a6..fff42359cbff 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -155,6 +155,12 @@ private:\n>  \tTransform combinedTransform_;\n>  };\n>  \n> +namespace {\n> +\n> +const unsigned int kPipelineDepth = 4;\n\npossibly `static constexpr unsigned int`\n\nI would not name this as kPipelineDepth and simply stick to\nkRkISPMaxQueuedRequests_ or something on those lines. The term \"Pipeline\nDepth\" in defined in draft controls as no. of stages a frame went\nthrough.\n\n> +\n> +} // namespace\n> +\n>  class PipelineHandlerRkISP1 : public PipelineHandler\n>  {\n>  public:\n> @@ -684,7 +690,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n>   */\n>  \n>  PipelineHandlerRkISP1::PipelineHandlerRkISP1(CameraManager *manager)\n> -\t: PipelineHandler(manager), hasSelfPath_(true), useDewarper_(false)\n> +\t: PipelineHandler(manager, kPipelineDepth), hasSelfPath_(true), useDewarper_(false)\n>  {\n>  }\n>  \n> -- \n> 2.48.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 753EFC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Jul 2025 05:05:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 492A068ECD;\n\tTue,  8 Jul 2025 07:05:12 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 30F176186C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Jul 2025 07:05:09 +0200 (CEST)","from [49.36.71.127] (helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uZ0Vv-00Dr93-U9; Tue, 08 Jul 2025 07:05:08 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"ryGtxsql\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=eBhEEw/Oukv+u72RqL76XnXBX/CFPL9eals5oSeJLb4=;\n\tb=ryGtxsql+iFUF3TRJo7Xp9UdqY\n\t5aJoknn9B53CwSoOvJIgiCURnsNMUIa98TOn/WsHbg+s4RcucLmgxJX59pkL5l1JzavDDMZ8hFvdx\n\tPJtI4ttDMbCq6GT6R5k5XNkIgfRujOVUIqsFxx/4fCBsdMzkrhwfJp0Boys+3V7yM+XV8iwxoIdIY\n\tUFYPyrKtWI6Kr/Anj78xbAkyV/FOyZCil5CKZkJ6uTV5WkyRytN/4sH5QCa01G3UEj9IvySEHcajR\n\tYvJ3MHQXu/XGe9Y4BHJkXIjwMDVhvauP+TEQLA6GvAp6IYNy6KIG5cHmXpckOLkzZq3nODij13y0v\n\t3aHOs5nA==;","Date":"Tue, 8 Jul 2025 10:35:11 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 3/5] pipeline: rkisp1: Limit the maximum number of\n\tbuffers queued in","Message-ID":"<ozykeofq42c4o5cvptfieqfivtjnj77thxjp66rr3l35aq5hll@avtoxo5tgqub>","References":"<20250707075400.9079-1-stefan.klug@ideasonboard.com>\n\t<20250707075400.9079-4-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20250707075400.9079-4-stefan.klug@ideasonboard.com>","User-Agent":"NeoMutt/20250510-dirty","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>"}}]