[{"id":29936,"web_url":"https://patchwork.libcamera.org/comment/29936/","msgid":"<171830739962.2248009.8249147849491592624@ping.linuxembedded.co.uk>","date":"2024-06-13T19:36:39","subject":"Re: [PATCH 5/7] libcamera: mali-c55: Simplify bufferReady()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Daniel Scally (2024-06-13 16:59:47)\n> bufferReady() is needlessly complicated; simplify it.\n> \n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 8 ++------\n>  1 file changed, 2 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> index 2b1d766a..910eac5e 100644\n> --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> @@ -1028,12 +1028,8 @@ void PipelineHandlerMaliC55::bufferReady(FrameBuffer *buffer)\n>  {\n>         Request *request = buffer->request();\n>  \n> -       completeBuffer(request, buffer);\n> -\n> -       if (request->hasPendingBuffers())\n> -               return;\n> -\n> -       completeRequest(request);\n> +       if (completeBuffer(request, buffer))\n> +               completeRequest(request);\n\nis that just because there's only one stream supported currently?\n\nOr do I recall that completeBuffer tells us if there is still some\nbuffers on the request maybe?\n\nAha - right the PipelineHandlerBase does this for us and tells us if all\nthe buffers in the request are completed.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  }\n>  \n>  void PipelineHandlerMaliC55::registerMaliCamera(std::unique_ptr<MaliC55CameraData> data,\n> -- \n> 2.30.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 3E726BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Jun 2024 19:36:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFAD865490;\n\tThu, 13 Jun 2024 21:36:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22E6E6548D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Jun 2024 21:36:42 +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 C9E764CF;\n\tThu, 13 Jun 2024 21:36:27 +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=\"enEgsCVD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718307387;\n\tbh=vVcP0BnZIIldcOHG19VlmHBQtx3iab8OA/+jtCq8b8w=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=enEgsCVDekIh7HTWDRiKIAepDPnPm3eRP2lLiAo34m0FmLzKOEab3dIRrNCtojNUG\n\tcBPbUN/MkVIB5Kzqxpl+BC1bQGJ84bFMM5ftNVTYhi4Yqr38IJGHSdEboOOuzVY0/4\n\t28+9IIAUefLQUrK9dD3kba1K/r34SBSJ8byKEgeE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240613155949.1041061-6-dan.scally@ideasonboard.com>","References":"<20240613155949.1041061-1-dan.scally@ideasonboard.com>\n\t<20240613155949.1041061-6-dan.scally@ideasonboard.com>","Subject":"Re: [PATCH 5/7] libcamera: mali-c55: Simplify bufferReady()","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 13 Jun 2024 20:36:39 +0100","Message-ID":"<171830739962.2248009.8249147849491592624@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>"}},{"id":29966,"web_url":"https://patchwork.libcamera.org/comment/29966/","msgid":"<20240617051307.GG28126@pendragon.ideasonboard.com>","date":"2024-06-17T05:13:07","subject":"Re: [PATCH 5/7] libcamera: mali-c55: Simplify bufferReady()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jun 13, 2024 at 08:36:39PM +0100, Kieran Bingham wrote:\n> Quoting Daniel Scally (2024-06-13 16:59:47)\n> > bufferReady() is needlessly complicated; simplify it.\n> > \n> > Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> > ---\n> >  src/libcamera/pipeline/mali-c55/mali-c55.cpp | 8 ++------\n> >  1 file changed, 2 insertions(+), 6 deletions(-)\n> > \n> > diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > index 2b1d766a..910eac5e 100644\n> > --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n> > @@ -1028,12 +1028,8 @@ void PipelineHandlerMaliC55::bufferReady(FrameBuffer *buffer)\n> >  {\n> >         Request *request = buffer->request();\n> >  \n> > -       completeBuffer(request, buffer);\n> > -\n> > -       if (request->hasPendingBuffers())\n> > -               return;\n> > -\n> > -       completeRequest(request);\n> > +       if (completeBuffer(request, buffer))\n> > +               completeRequest(request);\n> \n> is that just because there's only one stream supported currently?\n> \n> Or do I recall that completeBuffer tells us if there is still some\n> buffers on the request maybe?\n> \n> Aha - right the PipelineHandlerBase does this for us and tells us if all\n> the buffers in the request are completed.\n\nA better commit message would have avoided researching that.\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >  }\n> >  \n> >  void PipelineHandlerMaliC55::registerMaliCamera(std::unique_ptr<MaliC55CameraData> data,","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 96789BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Jun 2024 05:13:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 372DB6548D;\n\tMon, 17 Jun 2024 07:13: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 4B0CC619F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jun 2024 07:13:28 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 936E49C1;\n\tMon, 17 Jun 2024 07:13:11 +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=\"j+3BRWGt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718601191;\n\tbh=PmSu/qZFaFw4L6VSrLRvgFkQu0Cv41eVozqlYOWkAgk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=j+3BRWGtNjr+cvsdP7bozXDPDhExlYZNdNDODPSlnYXFwJ7llxqOoE6ygbbUmil4Y\n\tGUSGHaGMYvfRQQ0uH5QSytkUHoQ2tSgzVo7TrOWosCIMpjE8AJoMwYYzHZhU02cZLy\n\tTHPBysHWGPTW08mdlhtYEAjSf0rfgosQZ5aqyj5Q=","Date":"Mon, 17 Jun 2024 08:13:07 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 5/7] libcamera: mali-c55: Simplify bufferReady()","Message-ID":"<20240617051307.GG28126@pendragon.ideasonboard.com>","References":"<20240613155949.1041061-1-dan.scally@ideasonboard.com>\n\t<20240613155949.1041061-6-dan.scally@ideasonboard.com>\n\t<171830739962.2248009.8249147849491592624@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<171830739962.2248009.8249147849491592624@ping.linuxembedded.co.uk>","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>"}}]