From patchwork Fri Dec 3 22:42:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15030 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 9ADB4BF415 for ; Fri, 3 Dec 2021 22:42:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D48CA60836; Fri, 3 Dec 2021 23:42:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kULV7Zxa"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DA09860725 for ; Fri, 3 Dec 2021 23:42:36 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 133so3529766wme.0 for ; Fri, 03 Dec 2021 14:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PHfQHZqADHWlnoF41MQoqRfmxnVxtOO8DgSt7FhDw5Y=; b=kULV7ZxaztdphA1/pYoj8fV/H8jIj3q6KQB3Aedtr0akZMOde2jvuFWCjaSh1pj/41 DjX7cYmT0f8Dp5FJJ9M6A/PryYPtjqkLlhg6HscvSAYlYfRR2ySa/B5w4FQdp1uHagZG kviLF/6+Al4qR2orXiO2URMxlwZfxEg1k5NtCGd0lJDHRAPt5ksRvUQSjvS7NbN6FUPh tS3Zw8dXWZ6LwDpvIRRF/9ZT2DGE5Q7PH/R77R1bH1TSLcV/cHignbMybfTU23WohJec 64GI3UpU92jm3iq4saDs3DFgeTn0Ud1KyhXEanrbiG40F2KXItDaeJyrMiuS1nB0TS4o HuUw== 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:mime-version :content-transfer-encoding; bh=PHfQHZqADHWlnoF41MQoqRfmxnVxtOO8DgSt7FhDw5Y=; b=vn8mReNN/8cVb97Bgu22o8oxMMRWG22qYcQfcQDZrBaEJo5O2aMC8qZwt/sD6VC3Kw U7L8VLrf2xJRNm4D+vxfQC3jn6qeqNWkM/MQOsoLRumSAu89P9+NV/nRFN2IhMiGT9WV TpWPfgc2+uAGbGOgyK7pkuH3DOFfPBiX/8VAaLEq5Sw7OvNRFFUqerdP9oKDN8rEJ13Q VYNCT5daepfZ+AElPmayL0Z/tRksGCjc1MPiTk/cW7QHW8jg34nJTCjLpbCUu6ORBZm7 +gLc4AtbvppHFSNjphgtFC1CczsAnpaEVCWNqyagdLAuT8txtGKP030VT4tlFIo/Xpwv mVxg== X-Gm-Message-State: AOAM531kdQH4cisbnrWkhYTvkZjwvdQwZup5TJQj7vhZmHy12l6Im2TA SQSQFAP3mgZ+nFzyJCpk92IyGOszILY= X-Google-Smtp-Source: ABdhPJycpYVZSijYFLrtdGUPTRIuSpXmJDfu0qNuO2e+tG6Kkux6ui8PNp/m3WLN2sBaYC6NGK9+Sw== X-Received: by 2002:a05:600c:4f48:: with SMTP id m8mr18854784wmq.50.1638571356478; Fri, 03 Dec 2021 14:42:36 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id o25sm3939919wms.17.2021.12.03.14.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 14:42:35 -0800 (PST) From: Daniel Scally To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Dec 2021 22:42:23 +0000 Message-Id: <20211203224230.38700-1-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/7] Enumerate CameraLens by following sensor's ancillary links 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 All This series is an attempt at making the incoming VCM support a little more agnostic, by following the new style of media links described in my series to linux-media [0] to find VCMs connected to Sensors in libcamera. Now that Han-Lin's series is merged this is based on top of master, plus Kate's v3 [1] The general principle of the new links is an entity to entity link which will be connected by the kernel between a sensor's entity and an entity for a VCM device, where those entities have a fwnode match based on the "lens-focus" property against the sensor. These links are then discovered by libcamera and followed to create an instance of the CameraLens class, replacing the matching on driver/device names in Han-Lin's original series. With the CameraLens available to carry out the controlling of the VCM, I have pushed the controls to the pipeline handler. Series changes in v2: - New patches #4, #5 and #6 adding some extra framework to the IPAIPU3 and pipeline so that I can pass the lensControls as a ControlList in #7 (which was previously #5). - Dropped the patch amending Kate's work, as Kate squashed it (thanks!) Thanks Dan [1] https://patchwork.libcamera.org/patch/15011/ Daniel Scally (7): libcamera: Add members to MediaEntity to support ancillary entities libcamera: media_device: Handle ancillary links in populateLinks() libcamera: camera_sensor: Discover VCMs through ancillary links libcamera: camera_lens: Add function to fetch subdev controls libcamera: ipa: Add lens control member to ipu3 ipa interface libcamera: ipu3: Pass lens controls to config info ipa: ipu3: Send lens controls to pipeline handler include/libcamera/internal/camera_lens.h | 4 ++ include/libcamera/internal/camera_sensor.h | 1 + include/libcamera/internal/media_object.h | 4 ++ include/libcamera/ipa/ipu3.mojom | 1 + include/linux/media.h | 1 + src/ipa/ipu3/ipu3.cpp | 10 +++++ src/libcamera/camera_lens.cpp | 11 ++++++ src/libcamera/camera_sensor.cpp | 42 ++++++++++++++++++++ src/libcamera/media_device.cpp | 46 +++++++++++++++------- src/libcamera/media_object.cpp | 16 ++++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +++ 11 files changed, 126 insertions(+), 15 deletions(-)