From patchwork Mon Oct 11 07:34:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 14075 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 E4927C323E for ; Mon, 11 Oct 2021 07:35:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4FC5768F4D; Mon, 11 Oct 2021 09:35:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="q/63JdDE"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 28F1D60502 for ; Mon, 11 Oct 2021 09:35:13 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.107]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DF9D12BD; Mon, 11 Oct 2021 09:35:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1633937712; bh=JUPiWMZ4iM3R7z+0CVb92N+9IMT8luCr1360FWAb8R8=; h=From:To:Cc:Subject:Date:From; b=q/63JdDEc+CjbqE/4uyPj2jGlkiXtIv3FRk3xZPns5AvRGWGcwWkWoWxlpSWdCY6j A5sW35PSMUahw2dgIaadcjUZiiKsjfjookhJqOtRM2gKpFw8ONcRzvQqDM+vlqrwWW YL1UgMHhNlFL3/pY34sGeWdcXIuXu5oT+KxwWYs8= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 11 Oct 2021 13:04:58 +0530 Message-Id: <20211011073505.243864-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/7] Async Post Processor 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" This series now entirely focuses on making the post-processor run async. The std::map=>queue rework of Camera3RequestDescriptor has been reworked separately and already merged in master: https://patchwork.libcamera.org/project/libcamera/list/?series=2586&state=* The v4 brings new design decisions from v3. Specifically: - We have a Post Processor request queue - The queue processes post-processor's requsts in FIFO manner - The queue is specifically maintained separately so that it can be purged on demand (think of flush()) rather than using thread's message-queue + ::invokeMethod() path, as we can't have any control over thread's queue from outside - Handle flush / stop scenarios Patch 1-4 brings up groundwork to make post-processor async. Patch 5 introduces a thread worker class and a post-processing queue. Patch 5 is the one where the post-processing starts happening asynchronously. Patch 6 fixes a small window of race on descriptor's status setting Patch 7 is geared towards understanding and handling stop()/flush() cases of the camera. Testing: - Series is functional and works as expected - CTS is regressed quite a bit. This will remain blocker for the merge Many "Multiple calls to OpenDevice()" fails the tests (~46-64 on average). I will be continuing to work towards fixing CTS complicance. Laurent Pinchart (1): android: camera_device: Protect descriptor status_ with lock Umang Jain (6): camera_device: Remove private scope of Camera3RequestDescriptor android: camera_stream: Plumb process() with Camera3RequestDescriptor android: Notify post processing completion via a signal android: camera_stream: Drop return value for process() android: post_processor: Make post processing async android: camera_device: Synchronise completion and cleanup of requests src/android/camera_device.cpp | 136 +++++++++++++++-------- src/android/camera_device.h | 65 ++++++----- src/android/camera_stream.cpp | 126 ++++++++++++++++++--- src/android/camera_stream.h | 48 +++++++- src/android/jpeg/post_processor_jpeg.cpp | 17 +-- src/android/jpeg/post_processor_jpeg.h | 7 +- src/android/post_processor.h | 18 ++- src/android/yuv/post_processor_yuv.cpp | 23 ++-- src/android/yuv/post_processor_yuv.h | 7 +- 9 files changed, 323 insertions(+), 124 deletions(-)