[{"id":18465,"web_url":"https://patchwork.libcamera.org/comment/18465/","msgid":"<YQc1Q92uxXzPCNLw@pendragon.ideasonboard.com>","date":"2021-08-01T23:58:59","subject":"Re: [libcamera-devel] [PATCH v7 08/11] lc-compliance: Check that\n\trequests complete successfully","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nícolas,\n\nThank you for the patch.\n\nOn Thu, Jul 22, 2021 at 08:28:48PM -0300, Nícolas F. R. A. Prado wrote:\n> When a request fails to queue it is completed but with its status set to\n> RequestCancelled. Add a check in the requestComplete callback to make\n> sure that the request was completed successfully.\n\nDo those three tests ensure that there will be no frame queued when they\nstop() the camera ? Otherwise there could be requests that get cancelled\nat that point.\n\n> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> ---\n> \n> No changes in v7\n> \n> No changes in v6\n> \n> Added in v5\n> \n>  src/lc-compliance/simple_capture.cpp | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp\n> index 48ce8f088e71..691e5fdb2aca 100644\n> --- a/src/lc-compliance/simple_capture.cpp\n> +++ b/src/lc-compliance/simple_capture.cpp\n> @@ -178,6 +178,7 @@ int SimpleCaptureBalanced::queueRequest(Request *request)\n>  \n>  void SimpleCaptureBalanced::requestComplete(Request *request)\n>  {\n> +\tEXPECT_EQ(request->status(), Request::Status::RequestComplete) << \"Request didn't complete successfully\";\n\nLine wrap, and blank line after ? Same below.\n\n>  \tif (captureCompleted())\n>  \t\treturn;\n>  \n> @@ -213,6 +214,7 @@ void SimpleCaptureUnbalanced::capture(unsigned int numRequests)\n>  \n>  void SimpleCaptureUnbalanced::requestComplete(Request *request)\n>  {\n> +\tEXPECT_EQ(request->status(), Request::Status::RequestComplete) << \"Request didn't complete successfully\";\n>  \tif (captureCompleted())\n>  \t\treturn;\n>  \n> @@ -248,5 +250,6 @@ void SimpleCaptureOverflow::capture()\n>  \n>  void SimpleCaptureOverflow::requestComplete([[maybe_unused]] Request *request)\n>  {\n> +\tEXPECT_EQ(request->status(), Request::Status::RequestComplete) << \"Request didn't complete successfully\";\n>  \tcaptureCompleted();\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 EB2AFBD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  1 Aug 2021 23:59:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6DF43687B6;\n\tMon,  2 Aug 2021 01:59:10 +0200 (CEST)","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 3AACD687B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  2 Aug 2021 01:59:09 +0200 (CEST)","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 B091887C;\n\tMon,  2 Aug 2021 01:59:08 +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=\"Iampn8fW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1627862348;\n\tbh=tszzpEHW46smhLWAMNGDpNlOq60n2HwXDnGGZTDohiQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Iampn8fWkSyvjHCA1yfeVVCpu1EUnFTZBA5sy1wcIsY7niGvAszuxRSzDH/SFbB0G\n\t0UAkUQc1DXUBosBlpyi3wyXSJH/+jS/qiuPTB0J+BZxBTYTBEB1gX2WMXSDfcl71tK\n\tUvxnQJI2s9GNg6U2xZVWNkb+f2kIdsLYVkgHggDo=","Date":"Mon, 2 Aug 2021 02:58:59 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4=?= Prado <nfraprado@collabora.com>","Message-ID":"<YQc1Q92uxXzPCNLw@pendragon.ideasonboard.com>","References":"<20210722232851.747614-1-nfraprado@collabora.com>\n\t<20210722232851.747614-9-nfraprado@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20210722232851.747614-9-nfraprado@collabora.com>","Subject":"Re: [libcamera-devel] [PATCH v7 08/11] lc-compliance: Check that\n\trequests complete successfully","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, kernel@collabora.com, =?utf-8?q?A?=\n\t=?utf-8?b?bmRyw6k=?= Almeida <andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]