[{"id":20277,"web_url":"https://patchwork.libcamera.org/comment/20277/","msgid":"<20211018163323.hruk76ix74gagmry@uno.localdomain>","date":"2021-10-18T16:33:23","subject":"Re: [libcamera-devel] [PATCH 08/11] android: camera_device: Use\n\tabortRequest() instead of open-coding it","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Umang,\n\nOn Mon, Oct 18, 2021 at 06:59:20PM +0530, Umang Jain wrote:\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> Call abortRequest() in CameraDevice::requestComplete() instead of\n> open-coding it.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nIndeed it seems the code is the same\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> ---\n>  src/android/camera_device.cpp | 21 ++++++---------------\n>  1 file changed, 6 insertions(+), 15 deletions(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index cd9e9fe2..216f29c2 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -831,6 +831,11 @@ void CameraDevice::abortRequest(Camera3RequestDescriptor *descriptor) const\n>  \tnotifyError(descriptor->frameNumber_, nullptr, CAMERA3_MSG_ERROR_REQUEST);\n>\n>  \tfor (auto &buffer : descriptor->buffers_) {\n> +\t\t/*\n> +\t\t * Signal to the framework it has to handle fences that have not\n> +\t\t * been waited on by setting the release fence to the acquire\n> +\t\t * fence value.\n> +\t\t */\n>  \t\tbuffer.buffer.release_fence = buffer.buffer.acquire_fence;\n>  \t\tbuffer.buffer.acquire_fence = -1;\n>  \t\tbuffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR;\n> @@ -1111,21 +1116,7 @@ void CameraDevice::requestComplete(Request *request)\n>  \t\t\t\t<< \" not successfully completed: \"\n>  \t\t\t\t<< request->status();\n>\n> -\t\tnotifyError(descriptor->frameNumber_, nullptr,\n> -\t\t\t    CAMERA3_MSG_ERROR_REQUEST);\n> -\n> -\t\tfor (auto &buffer : descriptor->buffers_) {\n> -\t\t\t/*\n> -\t\t\t * Signal to the framework it has to handle fences that\n> -\t\t\t * have not been waited on by setting the release fence\n> -\t\t\t * to the acquire fence value.\n> -\t\t\t */\n> -\t\t\tbuffer.buffer.release_fence = buffer.buffer.acquire_fence;\n> -\t\t\tbuffer.buffer.acquire_fence = -1;\n> -\t\t\tbuffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR;\n> -\t\t}\n> -\n> -\t\tdescriptor->status_ = Camera3RequestDescriptor::Status::Error;\n> +\t\tabortRequest(descriptor);\n>  \t\tsendCaptureResults();\n>\n>  \t\treturn;\n> --\n> 2.31.0\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 483A2C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Oct 2021 16:32:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 254BD68F59;\n\tMon, 18 Oct 2021 18:32:36 +0200 (CEST)","from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C75F168F56\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Oct 2021 18:32:34 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 6EE86E0011;\n\tMon, 18 Oct 2021 16:32:34 +0000 (UTC)"],"Date":"Mon, 18 Oct 2021 18:33:23 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20211018163323.hruk76ix74gagmry@uno.localdomain>","References":"<20211018132923.476242-1-umang.jain@ideasonboard.com>\n\t<20211018132923.476242-9-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211018132923.476242-9-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 08/11] android: camera_device: Use\n\tabortRequest() instead of open-coding it","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20296,"web_url":"https://patchwork.libcamera.org/comment/20296/","msgid":"<73facd30-96fb-03a8-ceaa-4a85e7961b64@ideasonboard.com>","date":"2021-10-19T10:55:54","subject":"Re: [libcamera-devel] [PATCH 08/11] android: camera_device: Use\n\tabortRequest() instead of open-coding it","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nThank you for the patch,\n\nOn 10/18/21 6:59 PM, Umang Jain wrote:\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> Call abortRequest() in CameraDevice::requestComplete() instead of\n> open-coding it.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Umang Jain<umang.jain@ideasonboard.com>\n\n> ---\n>   src/android/camera_device.cpp | 21 ++++++---------------\n>   1 file changed, 6 insertions(+), 15 deletions(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index cd9e9fe2..216f29c2 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -831,6 +831,11 @@ void CameraDevice::abortRequest(Camera3RequestDescriptor *descriptor) const\n>   \tnotifyError(descriptor->frameNumber_, nullptr, CAMERA3_MSG_ERROR_REQUEST);\n>   \n>   \tfor (auto &buffer : descriptor->buffers_) {\n> +\t\t/*\n> +\t\t * Signal to the framework it has to handle fences that have not\n> +\t\t * been waited on by setting the release fence to the acquire\n> +\t\t * fence value.\n> +\t\t */\n>   \t\tbuffer.buffer.release_fence = buffer.buffer.acquire_fence;\n>   \t\tbuffer.buffer.acquire_fence = -1;\n>   \t\tbuffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR;\n> @@ -1111,21 +1116,7 @@ void CameraDevice::requestComplete(Request *request)\n>   \t\t\t\t<< \" not successfully completed: \"\n>   \t\t\t\t<< request->status();\n>   \n> -\t\tnotifyError(descriptor->frameNumber_, nullptr,\n> -\t\t\t    CAMERA3_MSG_ERROR_REQUEST);\n> -\n> -\t\tfor (auto &buffer : descriptor->buffers_) {\n> -\t\t\t/*\n> -\t\t\t * Signal to the framework it has to handle fences that\n> -\t\t\t * have not been waited on by setting the release fence\n> -\t\t\t * to the acquire fence value.\n> -\t\t\t */\n> -\t\t\tbuffer.buffer.release_fence = buffer.buffer.acquire_fence;\n> -\t\t\tbuffer.buffer.acquire_fence = -1;\n> -\t\t\tbuffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR;\n> -\t\t}\n> -\n> -\t\tdescriptor->status_ = Camera3RequestDescriptor::Status::Error;\n> +\t\tabortRequest(descriptor);\n>   \t\tsendCaptureResults();\n>   \n>   \t\treturn;","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 19C86C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Oct 2021 10:56:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4EEA268F59;\n\tTue, 19 Oct 2021 12:56:01 +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 76D79604FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Oct 2021 12:55:59 +0200 (CEST)","from [192.168.1.106] (unknown [103.251.226.98])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BAF5112A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Oct 2021 12:55:58 +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=\"OY1yW8/7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634640959;\n\tbh=ZrZpvrt6IVNnNMyGvcJC6Ci6emCFWpyR4W6ZCc244Oc=;\n\th=Subject:From:To:References:Date:In-Reply-To:From;\n\tb=OY1yW8/71646j6Yguk8t5rxDZ5viu+xopWXt9McWrRiwtmZq1se3K1iK2d3+/2AYs\n\tC1+HfpIyOeYTflqYGGjwvSRtOtDiJNEOQ4K7gNFV9g2qFNpYDOATecwiLd04PpABHH\n\tlNbvQMxTa2qcmTWCmkW70P1swoLuKLce+2Y77fw4=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","References":"<20211018132923.476242-1-umang.jain@ideasonboard.com>\n\t<20211018132923.476242-9-umang.jain@ideasonboard.com>","Message-ID":"<73facd30-96fb-03a8-ceaa-4a85e7961b64@ideasonboard.com>","Date":"Tue, 19 Oct 2021 16:25:54 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20211018132923.476242-9-umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 08/11] android: camera_device: Use\n\tabortRequest() instead of open-coding it","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>"}}]