[{"id":10986,"web_url":"https://patchwork.libcamera.org/comment/10986/","msgid":"<20200629204008.GS10681@pendragon.ideasonboard.com>","date":"2020-06-29T20:40:08","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: ipu3: Make it easier\n\tto read when a request may be completed","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Mon, Jun 29, 2020 at 05:35:17PM +0200, Niklas Söderlund wrote:\n> It's confusing to read the code and understand that a request is only\n> completed before being processed by the ImgU if it only contains a\n> single RAW buffer. Add a boolean variable with a explanatory name to\n> make this clearer, no functional change.\n\nBe careful, if you think the existing code lacks clarity here, I'll make\nyou document every single function of the pipeline handler classes :-)\n\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 11 +++++++----\n>  1 file changed, 7 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 1bdad209de6e47fb..4e75bd40c66f821a 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -874,10 +874,13 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)\n>  \t * If the request contains a buffer for the RAW stream only, complete it\n>  \t * now as there's no need for ImgU processing.\n>  \t */\n> -\tif (request->findBuffer(&rawStream_) &&\n> -\t    pipe_->completeBuffer(camera_, request, buffer)) {\n> -\t\tpipe_->completeRequest(camera_, request);\n> -\t\treturn;\n> +\tif (request->findBuffer(&rawStream_)) {\n> +\t\tbool requestComplete =\n> +\t\t\tpipe_->completeBuffer(camera_, request, buffer);\n\nI'd have named the variable complete or isComplete just to avoid the\nline break :-)\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\t\tif (requestComplete) {\n> +\t\t\tpipe_->completeRequest(camera_, request);\n> +\t\t\treturn;\n> +\t\t}\n>  \t}\n>  \n>  \timgu_->input_->queueBuffer(buffer);","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 B3398BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2020 20:40:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 31139609DD;\n\tMon, 29 Jun 2020 22:40:13 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A61E609C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 22:40:12 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A08F3299;\n\tMon, 29 Jun 2020 22:40:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"XwUkuP0J\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593463211;\n\tbh=v9FsIQNWPnlOJzwd8Gv2NjI5kFNDFKByPh1nmtEekGQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=XwUkuP0J9c84ep1jpSW1rc0XG0caQA/m/g8OYT40isVWvPVu0r8eLRn7vZD281rmQ\n\tyulCz9k5dnIPs20l2crT/Zkm6IdStteo0CHhx+sc1TFw7y42ZJ9Nf1jB6UiM2vu7pl\n\tZ6B5Y3IkELEeVGqB9LJAzTuNqEb4DQvqyv299l/8=","Date":"Mon, 29 Jun 2020 23:40:08 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200629204008.GS10681@pendragon.ideasonboard.com>","References":"<20200629153518.3734304-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200629153518.3734304-1-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: ipu3: Make it easier\n\tto read when a request may be completed","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","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]