From patchwork Mon Nov 22 12:34:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 14682 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 12E89BF415 for ; Mon, 22 Nov 2021 12:34:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8357D6038A; Mon, 22 Nov 2021 13:34:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="brUUvbf+"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6222E60230 for ; Mon, 22 Nov 2021 13:34:33 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id u18so32434854wrg.5 for ; Mon, 22 Nov 2021 04:34:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZfpMXzbl3q5XsQMWg0BIa1Ijw3X2uxtGb5zZvcNBtDk=; b=brUUvbf+Az/3yypkXBp+I0s+gqsT/ciklj/TF4IrRIyFSaeE4MXCSRTLtih44p8d2o gXUp7UqfIsECBLabLXDSB/5RU/U/KwFzXipIVBq5PvOTi/ZiSxKt2UtHpS/fIkuziPIB ypWG0+3LJzGXk/IHal+6a61LvVCCDa3fTzqUFXRpzEAanhKb/kmPuqWvbYLn2bijknIc Sd3TwW/qwIQR4LZXbB5nvSy0LVa66121dJbMju18XS0uidJhd+QLnh6tu+qs9DLmkZwp vDZ7b8m78QsQZDvnUH7l5h03Lxbxn2tEnfCbOyJH+lieSQhZ1dPvEH5oy92S7rHUlOq7 GeKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZfpMXzbl3q5XsQMWg0BIa1Ijw3X2uxtGb5zZvcNBtDk=; b=7hG08NhrdrrH31DMvoq/PIqWDhYTfZ6JRmhbVEAEa/z3faSgUvfT/lLid5k4LKdpD2 TEAWe+XjHH3MUraqDFOW27sc2zEv5tyNHO3yZ+UTblkdsJsnOaulZJACRl09QpYcbyr3 auAiFBiQ8Qt+SnW4FuVWgzQqOWtEENOBl2zKBT1o8kjhjfw9zYpJvn+q0/ZdJ429VCI5 JtZGueG8dfm5Y0MvrPT3tvAXyVpObjsFr3keEToXdOUddsW0S4kE/V9ssSzmcNmotgRf ULqg8JyIJYU3l9ZoWdMBUovz8+7H7M7lnAL2vMWNj05XA36z6kOSKitW6+Qd99zN+ISW NOvQ== X-Gm-Message-State: AOAM532nJBL+6qu3tScE8j/RTlC3HDQ1PXZuZFOI8a7D/brUkE+OGV5D c1B87ALRUhItGb3r1dBkbrT1VJcjoOUcwNzS X-Google-Smtp-Source: ABdhPJwBqXp6hzA6Q7paT5cMA4kW1vIT3eVZdd0JnjI5zCcjGb0PAalWzWIY9+VTOQ7WrjCGPqaU0g== X-Received: by 2002:a5d:628f:: with SMTP id k15mr38232826wru.363.1637584472925; Mon, 22 Nov 2021 04:34:32 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:eb05:dcc9:77a0:2542]) by smtp.gmail.com with ESMTPSA id h7sm8482231wrt.64.2021.11.22.04.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 04:34:32 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 22 Nov 2021 12:34:26 +0000 Message-Id: <20211122123427.808484-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122123427.808484-1-naush@raspberrypi.com> References: <20211122123427.808484-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] pipeline: raspberrypi: Split out device enumeration and camera registration 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" Split out PipelineHandlerRPi::match() so that media device enumeration and acquisition is separated from camera registration. The former logic remains in PipelineHandlerRPi::match(), whereas the latter logic is moved into a new PipelineHandlerRPi::registerCameras() member function. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 4f6c699a4379..9aa7e9eef5e7 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -311,6 +311,7 @@ private: return static_cast(camera->_d()); } + bool registerCameras(); int queueAllBuffers(Camera *camera); int prepareBuffers(Camera *camera); void freeBuffers(Camera *camera); @@ -1010,6 +1011,11 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator) if (!isp_) return false; + return registerCameras(); +} + +bool PipelineHandlerRPi::registerCameras() +{ std::unique_ptr data = std::make_unique(this); if (!data->dmaHeap_.isValid()) return false;