From patchwork Tue Apr 25 09:45:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Riesch X-Patchwork-Id: 8629 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3284983vqo; Tue, 25 Apr 2023 02:47:43 -0700 (PDT) X-Google-Smtp-Source: AKy350Y/qKUDqARPKYUrNmiTo/xEwXMoE3a90NHULx3AIWxbMBpPzubYvmskTLZaxmZtMf33ybJh X-Received: by 2002:a05:6a21:9997:b0:f4:24e6:1065 with SMTP id ve23-20020a056a21999700b000f424e61065mr9297312pzb.39.1682416063225; Tue, 25 Apr 2023 02:47:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682416063; cv=pass; d=google.com; s=arc-20160816; b=MrE3y7VlH8KygLHz3nhUs37GznQy9kVrAi/U+LeoYQiDy4vQccfSiMqfrKKMV5RlLe 7abs9yih0Fcn6qWJxYConCjMjxnuhQ8jrtRoux04WgaR0wzofwwuKjxCNIPcnHBBol9P sSgoeHJvrrC4wgbD+WgCjp+QwJznIWbaNl6UIvaZ+aVds0hiZfdbI9V7YZun714FNnaT d0RLwwrMVjhs/aASIx3fJGX7hXsBJVptR7AMczPtSAsrPu78dBMV6KCUOYQpT5L1cXKP 1/Qy57A8eqrjlqA47Z6aIxCC9Lzj146y365FaGRQNRFOQRkbsxC+QxK5dx2x/2Jkp4ln dHAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:content-transfer-encoding :message-id:date:subject:from:dkim-signature; bh=tuCoKyWTDPx6eKC8CwMgM7bBA9pUsSLyk6V8IYhG+bE=; b=jbuNeYjELG5Zl67l//WNK/PtaatgNGCrkDcgMRWg5rZz7FrNCKqDwczQcKsezc9pRO 54fZ/NMh/VM78LpLIBedhrcES/yF7qnGBJXrV4H9gnSej19dDq0Qwjlb4zvntCCAHtjI cv4MAgKDcjmrMeD3Ly7/r3mOAUauFRkvqvWSjjDQHGKiYIIABdF8dFUuNElstNQup+A4 miOv/SL1Tk3OYS9SmkJfRW5vq95CXV2vYEbyZeLTGV58rxuWH0qvHhBEqmRDP28qc+at mooNGf4MeaXKvOC8YmqLmqr7Q7mAAEtYCywrqcJiObN4kIFof6utb4ztMhNXBLcRqwN/ Ssow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=WQ80ZUWF; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk12-20020a17090b4a0c00b00246ac322e18si14832847pjb.51.2023.04.25.02.47.28; Tue, 25 Apr 2023 02:47:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=WQ80ZUWF; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233664AbjDYJpa (ORCPT + 99 others); Tue, 25 Apr 2023 05:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233595AbjDYJp1 (ORCPT ); Tue, 25 Apr 2023 05:45:27 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D14D549E1; Tue, 25 Apr 2023 02:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lc9iNw0IVAqqywh3q4zwwvjtto6y5TFW9/591SPVyVLdZNukbJqz4Nq0S/VUSgGfX4Xe66hmuRPZ9SVUQnT2YWB4gV0VnX/tH/xp+GO1DbQIfXJhFlaMEvEdsoel9tM5Ipz6r88AbyEmoupDYcEJ/NH5Ygjc5yW7yB0EKXbG2tCLLIum+XmNfkSi4qv45KTBf3ZxzTCa+mxR0U7UOU0LF9pC6EZ0yLVlj581j/zwZDEPptfK13mbAbGzDORY7KxgDide6YqrlDGokcyFyIBsd9OJ2q1RvxKldOB3VDS/1CIrx9qtSq0zJP9JiEbPoV7DO75kfL0TuOT9C5rYTa43+A== 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=tuCoKyWTDPx6eKC8CwMgM7bBA9pUsSLyk6V8IYhG+bE=; b=R6eHrr8rd+efKVskRH7IZlxhnkSV0G/CV3SS59pfzcsg67QqK99vo4XKybzCSuaYUkvVGAvcRHriXO1nMNCXJ4xOCHdovQB9gPLxZOJbY/1kNPT96MbFGx8weFOV1vJx3cgzgkRLcPZ1RGsLPbfEabudOykx3xF0YT6FPGTncWH7WexknE5PWRLg7wzKQorgbBjjQNuRvrFZGy7/wfnTY9VwnauuYX/1B/iTLvqpmJUSL87r3BLCKQrII9sz+DVDneC+Cbdc81EmQPskQBmAO5FPQokmlOKJ8GfPqk9aoS3JhF1rPOtHVrV9iEm8UOBalEUe2oeyXf6hjYeQYIl9Lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tuCoKyWTDPx6eKC8CwMgM7bBA9pUsSLyk6V8IYhG+bE=; b=WQ80ZUWFkt3tv1SDjK/NsdOrIltVWyEde/vR3vhYWcnFoTuO+HJHNbeKiVOQpRAKz2YNnTi+/BJqzRK4J22DMFD1oo9oLrnrZOFmXTkK2w2IVIipEnnaHb38amcRWh2WcpuHR2NCrdlrg9behlvb2Zi7H/hs0iP9cuNmaDCP56I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from GV1SPRMB0046.eurprd08.prod.outlook.com (2603:10a6:150:84::17) by DU0PR08MB7995.eurprd08.prod.outlook.com (2603:10a6:10:3e2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 09:45:23 +0000 Received: from GV1SPRMB0046.eurprd08.prod.outlook.com ([fe80::3734:409a:8031:4f54]) by GV1SPRMB0046.eurprd08.prod.outlook.com ([fe80::3734:409a:8031:4f54%3]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 09:45:23 +0000 From: Michael Riesch Subject: [PATCH RFC v2 0/6] media: v4l2-ctrls: add controls for complex lens controller devices Date: Tue, 25 Apr 2023 11:45:10 +0200 Message-Id: <20230406-feature-controls-lens-v2-0-faa8ad2bc404@wolfvision.net> X-B4-Tracking: v=1; b=H4sIACehR2QC/4WPwQ6CMBBEf4Xs2dVCW0RPJiZ+gFfDocAiTUhr2 ooawr9b0Isnj7MzL7MzgienycM+GcHRoL22JopslUDdKXMl1E3UkLGMM8FybEmFuyOsrQnO9h5 7Mh6rQsqtbLgQXEFkK+UJK6dM3c30F9r8QHPu5qjVz6X/AufTEcp47LQP1r2Wn4Z0sf7UDykyl IKnxU7lBWvo8LB9+1mzNhSgnKbpDRoHdQbsAAAA To: Mauro Carvalho Chehab Cc: libcamera-devel@lists.libcamera.org, Laurent Pinchart , Sakari Ailus , Hans Verkuil , Matthias Fend , Dave Stevenson , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Riesch X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1682415922; l=3735; i=michael.riesch@wolfvision.net; s=20230425; h=from:subject:message-id; bh=FJLTmQCSIQ7EFhVAQ4CVmtl+q2IZONM4Z4PC+Z9A2oU=; b=xicDx+5R3ZxUiPjo/zPHbRk4RyCKOBV4HA3xieUZYvqGBrAOX8U4CsMgIaPs0D4/9iaoWtse+ LiwKV4ONlJcDYrv8JiQ0ZQWs/DMPVZfpdpO4Jr0M/SEYdt8IekNskoN X-Developer-Key: i=michael.riesch@wolfvision.net; a=ed25519; pk=1QQdXA2QbwdxaQn/VQK0hz04C8IBYhDowbK0hlNU4Ng= X-ClientProxiedBy: VI1PR0802CA0032.eurprd08.prod.outlook.com (2603:10a6:800:a9::18) To GV1SPRMB0046.eurprd08.prod.outlook.com (2603:10a6:150:84::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1SPRMB0046:EE_|DU0PR08MB7995:EE_ X-MS-Office365-Filtering-Correlation-Id: 97d63146-cdb0-4f21-859e-08db4571ca36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6jsHjUWl1LGPPqWK8sHMRB6z2OgK73/FIL1116cFP0LbnRFnO5ZZ25fTLLmVbwAVbj/AsLtjS+gPaoF6rhOEbmZlqDijzXN3MxQoeNk3Ntc8uCR3QaJD3A+536tbPSxHkkJ99iVcB0bwtidm9RHVX84afFP2cfBosku6nHRIKiSr3X3zge0NkmliExD+CRKtY4dKf8zK5wb1F4Dy7TMnbNK16rET2kSWJPq9QqrxFPQaXv6uWIkAwFfV4iN4x4vRDnDvakqaYXTSU2rMwbKEid2O17RRkTkI1NhpJ9uq7Z0ydJ4XR1NQM+ILPmMF2+Ch0jUfHSSiik9t4pU2e++9du/EoAGjkkndDo41vtQ3wrmCxdrfApc/6DgEA1p5HFMDByn9Q5qG04zxV9++xEcFstGj1TQUcqk7SawypsWck44NEW4zHzDDBebEsP+Y0dWF1P3Lo6TVmaGY4dT/n+CPynR+rKLy9DqF7I7zsYqv6HSXi0/z4PzHLEoDWc9hhuBNt7nrd2DXrxGhkbMnrsUBOlZ6PMb84w+o4cAOdnNTRzst9dJfNoXEv32z84wRHofM0ADtqAMm0z7PKTiJE8HEyh+LNf6Qp5GzHmVNcM5HTqc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV1SPRMB0046.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(366004)(39850400004)(346002)(451199021)(38350700002)(966005)(38100700002)(6506007)(6512007)(26005)(186003)(8936002)(2616005)(83380400001)(107886003)(44832011)(2906002)(8676002)(5660300002)(36756003)(478600001)(54906003)(6486002)(52116002)(316002)(6666004)(4326008)(6916009)(66556008)(41300700001)(66946007)(86362001)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?bIZ2MfJpabcNjPvLzwpf4V6lsHq+?= =?utf-8?q?9zw0dLRpecGsdlhTtX1gC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Z4+JAQPF0i3LTB23x/HwJ8OMJJGa69z810y7OroYub35olW?= =?utf-8?q?fIhj6jd3KC58p9mkxcKBm8cdAiEBIAtEQgatoXXwxzoA0ijLn47rNJKIvhPmr6iS1?= =?utf-8?q?RWU9tCIXM3IsQ5lWKDwBhEN6xq2nn4CuaLmNSo7EqwLDlScz6BCXpPmQsn5kUXtb0?= =?utf-8?q?DJlr22n/XmUTexlM4srDeFdvIOLSTtEl3xHXb8NqCvp5e1BAwarxZ59+CK1mqJRMH?= =?utf-8?q?/hA9ZwV7D+WmhaUuUiTzOCU60AsQVtE9RF4VKjmjhWln6NH2ZXb7hnbhrDK9vjrsF?= =?utf-8?q?D0Mq0FRWxoOJxb+ZCEw1UcgY8kcPOBEk1pLw5lBHoHZ4yiWxCtgDP7JuqHyygPeNh?= =?utf-8?q?Ym5Z3CefvPY+vQJaNHhhhm62uKzu4ozOBK09/H7iVzBffNFHznXJT2rNEM2WOomuR?= =?utf-8?q?RPS+pddj+scca1gF6p01x37awTBZoKb02aiR/5hTKK0QwfegbYF+/Vjg/8hPR0oLW?= =?utf-8?q?geul4VAmY3NuuXm6+spamx/hQv/sp+7SmTvXrHVN/kEnroWIZ/2aLv6lzkg0v7r1B?= =?utf-8?q?5gP0E8MMd9wyfiwZEn3a1dnK8wTt98Yl3Le+lwJaQQi+TffSZsYvw9YzHa27hItMD?= =?utf-8?q?ZlnGx5/kHkU50bTFV2xYinJOefA/0p02YQ=3D=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 97d63146-cdb0-4f21-859e-08db4571ca36 X-MS-Exchange-CrossTenant-AuthSource: GV1SPRMB0046.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 09:45:23.1080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: um/OsNF0dXFNxv6wirhWF0vV4d3ZgKRk6ZaVxcmVpXcsoRvwLVnoMN4z6Dw9cOtCzThBNEKUGUPDJQhS/+m3oPJhP37AFipVjs8MAIwSc4U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7995 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764141106073639498?= X-GMAIL-MSGID: =?utf-8?q?1764141106073639498?= Hi all, This patch series aims to add support for complex lens controllers in V4L2. Complex lens controllers usually feature one focus lens and one (or more) zoom lens(es), which are driven by motors (e.g., stepper motors). As a consequence, a few crucial differences to simple lens controllers (such as voice coil motor (VCM) drivers, which are already well supported in V4L2) arise: - Focus and zoom are slow. Compared to a simple VCM driver, which reacts almost instantaneously, the motors that control the lens groups may require some time to reach their target position. Therefore, the control process in user space needs to receive feedback on the current status of each lens group, such as the current position and whether or not the lens group is moving. Patch 3/6 adds volatile and read-only status controls for each lens group. - The velocity of focus and zoom can be selected. In contrast to a simple VCM driver, the motors can move at different velocities. Since the produced noise depends on the velocity, the control process may want to optimize the chosen velocity. Also, some auto focus algorithms use different velocities in different phases (e.g., a coarse and fast scan vs. a slow and precise scan). Patch 4/6 adds speed controls for the focus lens group and the zoom lens group. - Calibration may be required. Since moving mechanical parts are involved, calibration is most likely necessary. Patch 5/6 introduces controls to control calibration procedures. In the scope of calibration, the relation between the lens positions may be fine-tuned. This requires the ability to control the individual lenses and gather feedback on their current status. Patch 6/6 introduces a pair of controls for five zoom lenses. (Five is a placeholder here. The most complex objective we had at hand happened to feature five zoom lenses.) On the user space side, it is envisaged that libcamera operates the newly introduced controls. Please note that no tests with libcamera have been carried out yet, the integration will be discussed after the first round of feedback to this RFC. Version 2 of this series include two new patches that fix mistakes in the documentation of existing controls. These mistakes have been pointed out during the review phase of the first iteration of this series. Looking forward to your comments! --- Changes in v2: - add patch 1/6 that fixes unit description of V4L2_CID_FOCUS_ABSOLUTE - add patch 2/6 that clarifies when to implement V4L2_CID_FOCUS_RELATIVE - remove compound controls _STATUS (struct) and add controls _STATUS (bitmask) and _CURRENT (integer) instead - fix V4L2_CID_LENS_CALIB_STATUS documentation - Link to v1: https://lore.kernel.org/r/20230406-feature-controls-lens-v1-0-543189a680de@wolfvision.net --- Michael Riesch (6): media: v4l2-ctrls: fix documentation of V4L2_CID_FOCUS_ABSOLUTE unit media: v4l2-ctrls: clarify documentation of V4L2_CID_FOCUS_RELATIVE media: v4l2-ctrls: add lens group status controls for zoom and focus media: v4l2-ctrls: add lens group speed controls for zoom and focus media: v4l2-ctrls: add lens calibration controls media: v4l2-ctrls: add controls for individual zoom lenses .../userspace-api/media/v4l/ext-ctrls-camera.rst | 129 ++++++++++++++++++++- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 41 +++++++ include/uapi/linux/v4l2-controls.h | 41 +++++++ 3 files changed, 208 insertions(+), 3 deletions(-) --- base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6 change-id: 20230406-feature-controls-lens-b85575d3443a Best regards,