From patchwork Fri Mar 8 11:00:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Vuillaumier X-Patchwork-Id: 19644 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 AA192C0F2A for ; Fri, 8 Mar 2024 11:01:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 42CAF6286F; Fri, 8 Mar 2024 12:01:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="l3ulM+oZ"; dkim-atps=neutral Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2611::600]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1EF7061C89 for ; Fri, 8 Mar 2024 12:01:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPqiaHqf+zUuXLYc3MZri7jMwtGmD31neVO1YWaL9jGrwtSjn3GIdACgBbNPaDyN9fCfT+AYgZMIno5jBh84zSbqqhVoYAuYZfaryjVPWv+/2oL1mB8Vi/IofNH0E0Rm14Qi7dG59XBjO1+yU7OfLkthM9WCtvXMNuzdY6xTNWXXJTly0bL3ZyvW9DJoyXxmYWxU7PUqKyKA48MJAA9B5BkpNo63bbpspf/uxCg5p2Jov48GwP6ym92JMfv3ofMzzmLA5js9RJK9yaA6czanwjYnsWmWmMM0Uhw3HvkSVz+B1uv+m/C3F6Dbmhtchbk3/YXMNWX5QIC5NIrAk/bZog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MMIe6IBuwQ+qrYVfY9/Pg44/UJCYLopG7LrTL3yHAAg=; b=bjD9q5VWaJQ6AZjL3VmxhiG3vI3R+TzPHUnQJe9FAgfK78d4zsKjZY6SS8kYs9bhGgO8Sh3cIOuFpI9ZRkFlQhIpCH/e/fF49rKnhaoCo7Oeu6FujBHf+hbAoRrDhbB80HNScIrD2TzUA/bK44vcqNBjilTUgAULA3xp0SWf1FZxzq1N3Q/37yPnZ4oO3wL5IAk5Nj3cYzWgRMdj4GixaQQ1j30c0OTwRbcCXh4KrlCcmI+5nb7fHTfrg6SwOjhhOuR7v3/OcSDE99XaZvhIrbR97L7WB/uaIwQcbTKrJKTzh6Z16HBydu8IGt10v6CBP2ncK3BlVRn2O6PvIXKdJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MMIe6IBuwQ+qrYVfY9/Pg44/UJCYLopG7LrTL3yHAAg=; b=l3ulM+oZwK1nd/YdcoyRiGF08Drg06PBgfZywvDtMLxdF50fX6HbirjFjx8ps79/L7YLp5uCvFcskocaqohqFiGwZbuNyREmoeV20euHPcNLuHC4lYm+I4x7Q7yOn67KL2KojJPDW7M4GOOvmP+5NgD5AA2/bSJFC8FmjesC94k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8147.eurprd04.prod.outlook.com (2603:10a6:20b:3e0::22) by AM9PR04MB8683.eurprd04.prod.outlook.com (2603:10a6:20b:43e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Fri, 8 Mar 2024 11:01:25 +0000 Received: from AM9PR04MB8147.eurprd04.prod.outlook.com ([fe80::3fdf:4cf8:d542:1b49]) by AM9PR04MB8147.eurprd04.prod.outlook.com ([fe80::3fdf:4cf8:d542:1b49%4]) with mapi id 15.20.7362.028; Fri, 8 Mar 2024 11:01:25 +0000 From: Julien Vuillaumier To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 0/2] Add environment variable to order pipelines match Date: Fri, 8 Mar 2024 12:00:54 +0100 Message-Id: <20240308110056.453320-1-julien.vuillaumier@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR04CA0052.eurprd04.prod.outlook.com (2603:10a6:208:1::29) To AM9PR04MB8147.eurprd04.prod.outlook.com (2603:10a6:20b:3e0::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8147:EE_|AM9PR04MB8683:EE_ X-MS-Office365-Filtering-Correlation-Id: 1deddc74-2868-4477-4edd-08dc3f5f1909 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iIqOshaEtxd/f8osMR8VMgcfDTmGRAMkZChQNhc+xOLaTxy4kKhCQhjlM99UjKfweuQLGUjTBV4fejGjoT9H8BJKsjbNyBlEWt9IKIA6ezCmXbLm5wWN5/xlq/QgSj6+wQSVMaVQtsdy7f91wambc1CbsY5E4uYunF6+AebmGUkSmYVZqrSkRGUSzqXZMRABOE26O3XlQSvvL5/ylrWnIJi/nEqyntWjifYRHcApfSEasHJcadaqHoSggzeZ1KhROupnCw0KxteveiIUkZuUjFJuQxp51zpWS6O1ktH7c97gCyhmjUzxWxnwKFBeAKCkDbSVDs3ursQak9b42juUwTkjBF5jgZSl+GaWOwNvtY0b/JpO25vwa626HCgRrDXoxj1JbkRvHts/4xne5hw8x4LvNunx82bLian6ZSE4jiWUXHYjwiJTFefnnPIkyK+xmEZRoJerGrytQO0grz1nwbxT0slz8MBpVODZoHYBeCbnyViUMqkTHeF1jqEQTG9VDAodOgCvMUoVMx8x2y+SoN7LTslpFNY1YDhtyuP/ghIbiDN+SajjbulEmDenLPj0qGH4fXoYKImRmj8sL5V56vWZrGna91+ygr8RagVcpcEInu0ZzuLIdTB4wcjiCeusrCXEUsIJI6igksbA/UeDKDtfgT65MqNIUs06oSD2Lw8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8147.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zlUZFiY4E+oP3Dg8Xo4PrNAQo9tlPAU4vjd5gmgRFk49gc235J0BcuieSHibqxVoiL7AJemt6CXl7dmyzdOY1io+dy1xIJFtQMmSoB8Cxu+3PucW+GoxlIJnMg0C3yIiqRoBQISLQhRjjQC9hEfH4QOFB22PpbdEfM1BMZ1Ta6I00SVnxofs2zDogihvViAmWMbl1aX6To2nShmrC0Iy2Z+bqHRi2sten3pU++UsbTMgtl9bacl+ipKw0jnU9o/mUKZIakFyeNNg2PJ5qtPSGGnFrs+DoK9PGO1DzvVucoH3KfxQO1CeltEg0/d8HzZLZ51Uuug8GvhNU2grj8FYW0l1MgeYlqz7Ztw5vmXWuj+L3tw+pyFlDgtpxbalDrpz2dk6sgdrMFtxcTOb8vVJLHviX5wybTwtwb8Z6DE2mA9L9bcmEUrVCFp127C5No45Eiz8Vft4Z4k/FpUoCSk9ab8WRlWvD4Y1lWfKSEivMLBNupqofyQkrSHzu3HfECHV7lZszqVxMU7opYAWTj4L23sC7ocf9XRxujLriaI63G3U8OnXDo0noc02CZwUG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CrossTenant-Network-Message-Id: 1deddc74-2868-4477-4edd-08dc3f5f1909 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8147.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 11:01:25.5796 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: msLRaT6yfrBuYeo6m1DLhi0lxIHXmNakGIO5NsyJDaezMfr9qslrPhcakBaANUENjSNtXkzVvMI40FviQxJ8DucN+e7hKv84H9TuR7AnyFQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8683 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" Hi All, This is the v2 of the change to support the configuration of the order of pipelines match, by using an environment variable. Changes in v2 vs v1: - Add 'get factory by name' helper to PipelineHandlerFactoryBase as a preceding patch (Kieran) - Move lamba pipeMatch() to a private class function (Kieran) - Remove unnecessary string empty test (Jacopo) - Inline lamba nameMatch (Jacopo) - Update comments and variable names per v1 reviews (Kieran, Barnabas, Jacopo) Link to v1: https://lists.libcamera.org/pipermail/libcamera-devel/2024-March/040769.html Thanks There is currently no way to configure the order used by the CameraManager to select the pipeline handlers to match devices from the DeviceEnumerator. That is a limitation when multiple pipeline are compiled in, capable of handling the devices of the platform. In that case, user can not specify the pipeline that will bind to the devices and handle the cameras. This change adds an environment variable, optionnaly initialized with an ordered list of candidate pipelines that CameraManager shall use to match the devices. When the variable is not set, CameraManager behavior is unchanged: every registered pipeline is selected in turn to attempt device matching. Using that variable, user has the option to explicitly select the pipeline or the subset of available pipelines that CameraManager shall consider for matching. Julien Vuillaumier (2): libcamera: pipeline: Add a get factory by name helper libcamera: camera_manager: Add environment variable to order pipelines match Documentation/environment_variables.rst | 5 ++ include/libcamera/internal/camera_manager.h | 1 + include/libcamera/internal/pipeline_handler.h | 1 + src/libcamera/camera_manager.cpp | 57 +++++++++++++++---- src/libcamera/pipeline_handler.cpp | 22 +++++++ 5 files changed, 74 insertions(+), 12 deletions(-)