From patchwork Mon May 10 10:52:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12240 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 05A5DBF831 for ; Mon, 10 May 2021 10:51:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 88E3D68919; Mon, 10 May 2021 12:51:56 +0200 (CEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5811B602BE for ; Mon, 10 May 2021 12:51:55 +0200 (CEST) X-Originating-IP: 82.59.136.116 Received: from uno.homenet.telecomitalia.it (host-82-59-136-116.retail.telecomitalia.it [82.59.136.116]) (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 78088E01D2; Mon, 10 May 2021 10:51:53 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 10 May 2021 12:52:27 +0200 Message-Id: <20210510105235.28319-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/8] android: Implement flush() camera operation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Implement the flush() camera operation in Android CameraDevice class. The series includes the already sent "android: Rework request completion notification" patch slightly modified: - set partial_results = 0 in case of error (as reported by cros_camera_test) - on fatal ERROR_DEVICE notify() to the framework first then call Fatal. Record with a \todo the on-going discussion on the requirement to close the camera to handle failures gracefully. To get to a successfull implementation of flush() a bit of preparatory work is required as currently Requests that fails to queue to the pipeline handler are not returned to the application. Add Request::cancel() and call it in the PipelineHandler base class when calling queueRequestDevice() fails to allow application to keep track of the queued requests. On top of that, prepare the CameraDevice to support flush with a few clean-up patches, then implement the operation. No regression detected when running CTS in LIMITED mode. Tested with cros_camera_test: # cros_camera_test --gtest_filter="Camera3FrameTest/Camera3FlushRequestsTest*" [==========] 12 tests from 1 test suite ran. (1380 ms total) [ PASSED ] 12 tests. Thanks j Jacopo Mondi (8): android: Rework request completion notification libcamera: request: Add Request::cancel() libcamera: pipeline_handler: Notify Request queueing failure android: camera_device: Replace running_ with CameraState android: Replace scoped_lock<> with libcamera::MutexLocker android: Guard access to the camera state android: Rename CameraDevice::mutex_ android: Implement flush() camera operation include/libcamera/request.h | 1 + src/android/camera_device.cpp | 235 ++++++++++++++++++++--------- src/android/camera_device.h | 21 ++- src/android/camera_ops.cpp | 8 +- src/libcamera/pipeline_handler.cpp | 15 +- src/libcamera/request.cpp | 30 ++++ 6 files changed, 237 insertions(+), 73 deletions(-) --- 2.31.1