From patchwork Wed Nov 16 00:17:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 17806 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 AFED3BD16B for ; Wed, 16 Nov 2022 00:17:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EF4F663092; Wed, 16 Nov 2022 01:17:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1668557850; bh=YfuA7rGCOmvoRukZEcG/QIFqwBK9eFmjG4afta9Ol/s=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l+7dMTFl9dN65tDZGOIIF5XbH5w2P8hQMnFt4LuZ5BvuYVprQYphyyL9m3Hx7rYuG pvZ2PkQwtc7lhRzyJO8MINaPWEXFLkTJVESPLWCHvAmFcKXkTl3TYTVriW0AXwzyr5 JU7PDRdS+CN5P8XEUAo5lxeFD/a+8yJPepqulADk3cyi+cHaNJ4FQs6ifP6EvwSIP4 C0zqnBxYcHbIRpSnkrWBnahkQert2EumhAScj7kOQWm6PCcMEBaTCKyriNRGMqayqx Hgqi+wAK3estIMfxfzinJ/IzdmlSGAafnw/vnf8YmnsayC6WGyna1rcoz+l6mG+eYa sXjSnGatqvWIg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 212EF63086 for ; Wed, 16 Nov 2022 01:17:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aAq/+Uuj"; dkim-atps=neutral Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8A25682C; Wed, 16 Nov 2022 01:17:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668557848; bh=YfuA7rGCOmvoRukZEcG/QIFqwBK9eFmjG4afta9Ol/s=; h=From:To:Cc:Subject:Date:From; b=aAq/+UujghWOuasT8xkwELhuYM7cwWTQDo1YzR7QTP4+eTlmN94PxNwNIq9PrVU3f DVJcHZUxQd1PDucBssJv3L0LCMvG6fvp6fUPHg0R1QG/wu5kjTdM4L507A3u7DdSzg 2SNezCjnZwiuDYxFCnDbQ57Ht0VDJNF+FIqIHzto= To: libcamera devel Date: Wed, 16 Nov 2022 00:17:22 +0000 Message-Id: <20221116001724.3938045-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] Support resource acquisition at 'acquire()' 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: , X-Patchwork-Original-From: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Pipeline handlers may benefit from being able to postpone resource acquisition until the acquire() operation, or even release any temporary resources used during initialisation and only use them when acquired. This series hopes to balance the updates to the PipelineHandler->release(Camera) call, with a corresponding PipelineHandler->acquire(camera) and facilitate pipeline handlers managing resources only when the camera is in use. While the pipeline patch could make some progress, the uvcvideo patch in this series is not working. I fear this may be a symptom of a bug in either our thread or fdNotifier / event mechanisms, but haven't been able to track it down yet. Kieran Bingham (2): libcamera: pipeline: Add an acquireDevice method [DNI/RFC] pipeline: uvcvideo: Only open devices upon acquire include/libcamera/internal/pipeline_handler.h | 3 +- src/libcamera/camera.cpp | 2 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 55 +++++++++++++++---- src/libcamera/pipeline_handler.cpp | 23 +++++++- 4 files changed, 69 insertions(+), 14 deletions(-)