{"id":12262,"url":"https://patchwork.libcamera.org/api/1.1/covers/12262/?format=json","web_url":"https://patchwork.libcamera.org/cover/12262/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210513092246.42847-1-jacopo@jmondi.org>","date":"2021-05-13T09:22:38","name":"[libcamera-devel,v2,0/8] Implement flush() camera operation","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/12262/mbox/","series":[{"id":2025,"url":"https://patchwork.libcamera.org/api/1.1/series/2025/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2025","date":"2021-05-13T09:22:38","name":"Implement flush() camera operation","version":2,"mbox":"https://patchwork.libcamera.org/series/2025/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/12262/comments/","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 7FEFAC31EE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 May 2021 09:22:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E04056891A;\n\tThu, 13 May 2021 11:22:07 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B8E2E68919\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 May 2021 11:22:06 +0200 (CEST)","from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id EB4BB240002;\n\tThu, 13 May 2021 09:22:05 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 13 May 2021 11:22:38 +0200","Message-Id":"<20210513092246.42847-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.31.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 0/8] Implement flush() camera operation","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Implement the flush() camera operation in Android CameraDevice class.\n\nThe series includes the already sent\n\"android: Rework request completion notification\" patch slightly modified:\n\n- set partial_results = 0 in case of error (as reported by cros_camera_test)\n- on fatal ERROR_DEVICE notify() to the framework first then call Fatal. Record\n  with a \\todo the on-going discussion on the requirement to close the camera\n  to handle failures gracefully.\n\nTo get to a successfull implementation of flush() a bit of preparatory work is\nrequired as currently Requests that fails to queue to the pipeline handler are\nnot returned to the application. Add Request::cancel() and call it in the\nPipelineHandler base class when calling queueRequestDevice() fails to allow\napplication to keep track of the queued requests.\n\nOn top of that, prepare the CameraDevice to support flush with a few clean-up\npatches, then implement the operation.\n\nNo regression detected when running CTS in LIMITED mode.\n\nTested with cros_camera_test:\n\n   # cros_camera_test --gtest_filter=\"Camera3FrameTest/Camera3FlushRequestsTest*\"\n   [==========] 12 tests from 1 test suite ran. (1380 ms total)\n   [  PASSED  ] 12 tests.\n\nv1->v2:\n - The majority of patches in the series have not been changed if not for\n   collecting tags. However 8/8 which implement the actual flush() has been\n   changed to address Hiro's comment about protecting close() and\n   configureStreams() from being concurrently run with flush().\n\n   - 8/8:\n     - Introduce a new flushed_ condition variable to be used by close() and\n       configureStreams() to be unlocked when flushing has terminated.\n\n- The patches that introduce Request::cancel() has pending discussion with\n  Hiro and Niklas. As they impact the libcamera API I'll wait for Laurent to\n  chime-in.\n\nJacopo Mondi (8):\n  android: Rework request completion notification\n  libcamera: request: Add Request::cancel()\n  libcamera: pipeline_handler: Notify Request queueing failure\n  android: camera_device: Replace running_ with CameraState\n  android: Replace scoped_lock<> with libcamera::MutexLocker\n  android: Guard access to the camera state\n  android: Rename CameraDevice::mutex_\n  android: Implement flush() camera operation\n\n include/libcamera/request.h        |   1 +\n src/android/camera_device.cpp      | 261 +++++++++++++++++++++--------\n src/android/camera_device.h        |  22 ++-\n src/android/camera_ops.cpp         |   8 +-\n src/libcamera/pipeline_handler.cpp |  15 +-\n src/libcamera/request.cpp          |  30 ++++\n 6 files changed, 261 insertions(+), 76 deletions(-)\n\n--\n2.31.1"}