[{"id":4431,"web_url":"https://patchwork.libcamera.org/comment/4431/","msgid":"<20200411114121.GB4871@pendragon.ideasonboard.com>","date":"2020-04-11T11:41:21","subject":"Re: [libcamera-devel] [PATCH v3 4/7] libcamera: pipeline: rkisp1:\n\tDo not try to process cancelled frames","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 Sat, Apr 11, 2020 at 02:19:08AM +0200, Niklas Söderlund wrote:\n> There is no need to try and process cancelled frames, try to finish as\n> quickly as possible.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n> * Changes since v2\n> - If the buffer intended for the application is canceled complete it and\n>   the request as to not lockup applications.\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 ++++++++++++\n>  1 file changed, 12 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index de90615edf217cca..daf84b5ac129efc8 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -1015,6 +1015,12 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)\n>  \tRkISP1CameraData *data = cameraData(activeCamera_);\n>  \tRequest *request = buffer->request();\n>  \n> +\tif (buffer->metadata().status == FrameMetadata::FrameCancelled) {\n> +\t\tcompleteBuffer(activeCamera_, request, buffer);\n> +\t\tcompleteRequest(activeCamera_, request);\n> +\t\treturn;\n> +\t}\n> +\n>  \tdata->timeline_.bufferReady(buffer);\n>  \n>  \tif (data->frame_ <= buffer->metadata().sequence)\n> @@ -1026,6 +1032,9 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)\n>  \n>  void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)\n>  {\n> +\tif (buffer->metadata().status == FrameMetadata::FrameCancelled)\n> +\t\treturn;\n> +\n>  \tASSERT(activeCamera_);\n>  \tRkISP1CameraData *data = cameraData(activeCamera_);\n>  \n> @@ -1037,6 +1046,9 @@ void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)\n>  \n>  void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)\n>  {\n> +\tif (buffer->metadata().status == FrameMetadata::FrameCancelled)\n> +\t\treturn;\n> +\n\nThis looks fine, but will keep data in frameInfo_ after stop(). I think\nyou need to add a clear() operation to RkISP1Frames() and call it in\nstop(). It can be done in a separate patch, so\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \tASSERT(activeCamera_);\n>  \tRkISP1CameraData *data = cameraData(activeCamera_);\n>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3EBFA600EC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 Apr 2020 13:41:32 +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 ACB8524B;\n\tSat, 11 Apr 2020 13:41:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"PajOdLgr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1586605291;\n\tbh=wPZtCpDQ4Xzp+szUXYRP29C0cVfbZYIqBaxTIP7aIm4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=PajOdLgrCaUMhxzUBSs7fC/HR+87/y0YRdhbb7JVcPQ7ryWubtSBWh7UZ6F4qlkX2\n\tzU+UUGu1E3WqRp6Tq9iLp9LqprPvWtovhCD6xWOgJTHVRbkkZ7kuF6BCHoRmbCx02b\n\touRz6fPIhjKCm6VMQnTJhz5OAde4sKGINShX1z5c=","Date":"Sat, 11 Apr 2020 14:41:21 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200411114121.GB4871@pendragon.ideasonboard.com>","References":"<20200411001911.1143155-1-niklas.soderlund@ragnatech.se>\n\t<20200411001911.1143155-5-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200411001911.1143155-5-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v3 4/7] libcamera: pipeline: rkisp1:\n\tDo not try to process cancelled frames","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>","X-List-Received-Date":"Sat, 11 Apr 2020 11:41:32 -0000"}}]