From patchwork Wed Sep 29 13:30:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13978 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 BDC5AC3243 for ; Wed, 29 Sep 2021 13:30:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1F4B2691AA; Wed, 29 Sep 2021 15:30:40 +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="qghG+fE3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B336269185 for ; Wed, 29 Sep 2021 15:30:38 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.9]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A3D2F3F0; Wed, 29 Sep 2021 15:30:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1632922238; bh=e1K/z4HQYKEucq4lczmeeuBcQMMe7DM2Y9tAB7QhvVw=; h=From:To:Cc:Subject:Date:From; b=qghG+fE3mWjlGryHrmCcWWIYk2glxnym4DBYNZjUzWVBEEZTF63V5CKitvlyXeDG0 HeNjCajQnPCcolT1lOeHzn9KDGX8hpw+yoVOk9j6HtlcwL0GfhA30OsHPsxfn0EQL7 MBE/iABwvHSzGftIgIx7S/zDPFmHjDroLeTOgjqc= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Wed, 29 Sep 2021 19:00:26 +0530 Message-Id: <20210929133030.401961-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/4] Camera3RequestDescriptors std::map => std::queue 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" As per the extended design discussion for libcamera HAL, this series addresses the part I of the design that will lead to new iterations for async post-processor eventually. The series mainly ports storage of Camera3RequestDescriptor from std::map => queue while fixing out-of-order request completion from abortRequest(). The series also accounts for a singular location to send back capture results to the framework (find sendCaptureResults()). The series has been validated on CTS: 230 / 231 (carrying [PATCH v3 0/1] android: Wait on acquisition fences in CameraStream) Changes in v4: - New patch 3/4, makes abortRequest() and notifyError() as const - Pop descriptor even on Fatal logging - Fix a missing mutex lock - spacing around sendCaptureResults() - add a \todo on measuring perf impact on grain-vs-coarse locking Changes in v3: - Change abortRequest to accept a descriptor only, in 3/3 - Fix wrong logic around abortRequest() descriptor selection - Last request descriptor was selected instead of current one - Use of `auto` whereever applicable - simplify descriptors_ clearance on stop() Changes in v2: - Use queue instead of deque - Fix a race between abortRequest() and queuing a descriptor in 2/3 - address general comments in v1 review. Umang Jain (4): android: camera_worker: Use Camera3RequestDescriptor as cookie android: camera_device: Transform descriptors_ map to queue android: camera_device: Mark abortRequest() and notifyError() as const android: camera_device: Send capture results by inspecting the queue src/android/camera_device.cpp | 149 +++++++++++++++++++++------------- src/android/camera_device.h | 19 ++++- src/android/camera_worker.cpp | 4 +- src/android/camera_worker.h | 3 +- 4 files changed, 111 insertions(+), 64 deletions(-)