From patchwork Tue Jul 28 00:30:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9034 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 E5754BD86F for ; Tue, 28 Jul 2020 00:31:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 070BF616FF; Tue, 28 Jul 2020 02:31:18 +0200 (CEST) Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E78DE6053C for ; Tue, 28 Jul 2020 02:31:16 +0200 (CEST) X-Halon-ID: a0eef688-d069-11ea-933e-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id a0eef688-d069-11ea-933e-005056917a89; Tue, 28 Jul 2020 02:31:11 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 28 Jul 2020 02:30:52 +0200 Message-Id: <20200728003058.2871461-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/6] libcamera: Generate unique and stable camera names 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" Hello, This series aims to make and enforce unique camera names that are static between system resets while keeping them user-friendly and adding more information describing where the cameras are located in the system. This v2 is a complete rewrite of v1 (libcamera: camera: Add camera ID) of this series that centered around bus information instead of this v2 that focus more on user friendly names. The weakness in this series is that not a lot of platforms describe the rather new location and rotation properties in their devicetree/ACPI. This leads to issues that can be observed below where both cameras on the ipu3 and rkisp1 platforms are reported to be located on the front while in reality one is located on the front and the other on the back. This is not a shortcoming of this series however and will solve itself once the platforms gets update firmware or when CameraSensor learns to read this information from configuration files (or by some other means). Patch 3/6 also needs more work to query the device enumerator for the sysfs path instead of building a path that assumes the standard naming schema. This is a implementation detail and I think it's more important to get speedy feedback on the over all approach of the series. Before this series camera names on different systems looked like this (I do not have access to a simple pipeline device): - ipu3 ov13858 8-0010 ov5670 10-0036 - raspberrypi imx219 - rkisp1 ov5695 7-0036 ov2685 7-003c - uvcvideo Venus USB2.0 Camera: Venus USB2 Logitech Webcam C930e - vimc VIMC Sensor B With this series applied camera names on the same systems: - ipu3 ov13858 location front (PipelineHandlerIPU3) ov5670 location front (PipelineHandlerIPU3) - raspberrypi imx219 location front (PipelineHandlerRPi) - rkisp1 ov5695 location front (PipelineHandlerRkISP1) ov2685 location front (PipelineHandlerRkISP1) - uvcvideo Venus USB2.0 Camera: Venus USB2 on bus 3:9 (PipelineHandlerUVC) Logitech Webcam C930e on bus 3:4 serial 9F8F445E (PipelineHandlerUVC) - vimc Sensor B location front (PipelineHandlerVimc) Niklas Söderlund (6): libcamera: camera: Append pipeline name to camera name libcamera: camera: Generate camera name from a CameraSensor libcamera: v4l2_device: Add method to lookup device path libcamera: media_device: Expose media device serial number libcamera: pipeline: uvcvideo: Generate unique camera names libcamera: camera_manager: Enforce unique camera names include/libcamera/camera.h | 5 +++ include/libcamera/internal/media_device.h | 2 + include/libcamera/internal/v4l2_device.h | 1 + src/libcamera/camera.cpp | 42 ++++++++++++++++++- src/libcamera/camera_manager.cpp | 6 +-- src/libcamera/media_device.cpp | 7 ++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 12 +++--- .../pipeline/raspberrypi/raspberrypi.cpp | 3 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/simple/simple.cpp | 2 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 41 +++++++++++++++++- src/libcamera/pipeline/vimc/vimc.cpp | 4 +- src/libcamera/v4l2_device.cpp | 24 +++++++++++ test/camera/buffer_import.cpp | 2 +- test/camera/capture.cpp | 2 +- test/camera/configuration_default.cpp | 2 +- test/camera/configuration_set.cpp | 2 +- test/camera/statemachine.cpp | 2 +- test/controls/control_info_map.cpp | 2 +- test/controls/control_list.cpp | 2 +- test/serialization/serialization_test.h | 2 +- 21 files changed, 142 insertions(+), 25 deletions(-)