From patchwork Tue Nov 23 13:10:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 14711 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 E3BE2BF415 for ; Tue, 23 Nov 2021 13:11:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9CAD66039C; Tue, 23 Nov 2021 14:11:19 +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="grSW6ikL"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E48160121 for ; Tue, 23 Nov 2021 14:11:15 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id i8-20020a7bc948000000b0030db7b70b6bso2204757wml.1 for ; Tue, 23 Nov 2021 05:11:15 -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=c+DaaEB0OradqvdNNgMUiPLcQhdP5VfIfypiBu6Wn/A=; b=grSW6ikLFwsAOweut/65X1EBYCFbiSUyp5H4KpGwaqmxvZqKAX3yGzUAB5k25xmPrL jIFVNcvIvi5o4CVOdD7ZLZyAIABYaFzxaPLqaw4rbBd3LwBgQAlk/7A3yf9BdvqJDABA Sv32ayjVsdFIkEBDg8eMfhBOJ3186j2KiDZj/6Whb5bvOfY19DuBkE+p1r5VFI2VRaAi gAosBk4YWz0gek2plNNGzxQMB2NA+EytPQw41egHa2IzwTdRxhRwoyj0hgrqihnSr5J/ LcwaEAimBVkcVx010MMzhcV4aTnW8ySZ5wYuCb4tyis7a0gQsXA4euqi63M3I1cq5Weh /6sQ== 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=c+DaaEB0OradqvdNNgMUiPLcQhdP5VfIfypiBu6Wn/A=; b=njsd+LnUouT3USJ/UwGF7Gmjj7/MVSxH46Av4SLlnMYJPlGG+AZpC4UyY5yc6VGoMO rridHz75bguJoXKanLnwFBxFPmPMIq+g3wHtuLaAWcXx6XmWXGUE4kU0ykKN9MjKyRYB DdtkITKt2Irc/Jjgz5m+uQtdetqNOpNI4SSYU0i8yQGFjCakIjzC/ajPc+l4wss8UTmW rGSq9SA+hWAqyL31xP26u4G+2+xdhe9dOxStw3jc50aYD+4QHAguVGn1sC0PSLg1OQkj v0h+cbBXwXKVqKJpNnvFORPkmgtMJmZFLrbth3IhOUNKJtAPo39QPApudOFWLYyxqLR6 Y2wA== X-Gm-Message-State: AOAM533sTPE1orf/bgQ44BU8AQqhYCJ9KaLNRjNUGWu/PI+H7Ymie5SB Thl8ZGPUiCvErOcbN03sQ9YQ8mapuhxLFl30 X-Google-Smtp-Source: ABdhPJwbOlhPp2+a5glelRtvUWCEgudQ3cAJAhGIh/qx0r/YHacKcFC1/QiaQBh1DuRN/rrtCdppVw== X-Received: by 2002:a1c:8002:: with SMTP id b2mr3093672wmd.2.1637673074891; Tue, 23 Nov 2021 05:11:14 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:34c6:a31e:c2e1:260d]) by smtp.gmail.com with ESMTPSA id b197sm1106142wmb.24.2021.11.23.05.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 05:11:13 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Nov 2021 13:10:39 +0000 Message-Id: <20211123131040.1542581-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211123131040.1542581-1-naush@raspberrypi.com> References: <20211123131040.1542581-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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::registerCamera() member function. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 4f6c699a4379..12fd38061241 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 registerCamera(); 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 registerCamera(); +} + +bool PipelineHandlerRPi::registerCamera() +{ std::unique_ptr data = std::make_unique(this); if (!data->dmaHeap_.isValid()) return false; @@ -1170,7 +1176,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator) const std::string &id = data->sensor_->id(); std::shared_ptr camera = Camera::create(std::move(data), id, streams); - registerCamera(std::move(camera)); + PipelineHandler::registerCamera(std::move(camera)); return true; }