Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp519991rwe; Wed, 19 Apr 2023 02:03:53 -0700 (PDT) X-Google-Smtp-Source: AKy350YwP5j0q1/EAW431Mg8j6OkCVts2gtQRFLzbgfwJ/vdGL6J4zAVKtPV7azYAQY+lRgDLt59 X-Received: by 2002:a17:902:bd83:b0:1a7:c058:a167 with SMTP id q3-20020a170902bd8300b001a7c058a167mr5257618pls.25.1681895033570; Wed, 19 Apr 2023 02:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681895033; cv=none; d=google.com; s=arc-20160816; b=nMmFBWCahc20KO2PqP9+So2aEhF60XRv66AKd7Cr4BTr37dYzcBxYXwF01zVI+7rUK TIK9xuXRHqIBMm150y0odjhSFJ+9kKyoWjqkESxyeC2InEpy/aFuumqltdbKDJS+cr40 fjY5gthMZGq7BBuqSgJ1bcVr72bczq9OajUT2N90GSWETDi53HKl6yD5Q6q5e6xii/iH k2fUEX0ypRFR5CN3G1OJyoWG07TCq0/fP9CspEV5GHu9fpSHHuusnjaCZYpVGIr+6/YJ bOXLuK+KEv58LiOJzQW93o5ua2kX5gISzm4B4rfg0VYdYZ5dQZAQpbhS/8F5nQi7VZc9 HANQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lkRWaX2tul3oZ2vJLT1C0r17LQdYb8FXjE4GNaILzaM=; b=AZW+iLQJGUokYcYwXjyXYH48g2A+jPGctTFnoiTlo24eF+c0pyoIE1Vd+nNfBXo1f0 kHPABXnzZ78SroLGjtJXDZQdQ07glHTIJ0ThJbD7dQg58p7Fx/EDvh74+IMJxIL+0mrc VOjzBA+8vez85CbnD1vg7ESoc5w/6cf+J14EvIctfTKO9a2KWBPpMdEGfryRXWi57RDU RujL6iHSJB5iEcv4Wz2C761GC4bPYl+X5WX5tWBEZY91a5mhXm/Cx4RwDGWhZ/aRwpmR pOnbLvsW1+jd+tkNx1g3nx6ki3xCe5pqODr4wXm/W4cPaexJz7M4XBBh3MXQZSlM6atZ yLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="OGO/tN7e"; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a17090ad30c00b002475bc0a189si1349351pju.113.2023.04.19.02.03.41; Wed, 19 Apr 2023 02:03:53 -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=@intel.com header.s=Intel header.b="OGO/tN7e"; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232265AbjDSJBr (ORCPT + 99 others); Wed, 19 Apr 2023 05:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232825AbjDSJBl (ORCPT ); Wed, 19 Apr 2023 05:01:41 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 988FE19AA; Wed, 19 Apr 2023 02:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681894891; x=1713430891; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=IiznyOV15KEk7yghNEwufQGnmpRCJqkzx0uQeGij21E=; b=OGO/tN7e3/6m/v3VEZ54eWFCHA0j2nlFHSTGXM8UX5EKQFe9Ekqnhgxc oqSI7DxtYu+CTs41t8Fz7alrlxqdSX+qYD1Lf4zKC9unZR08syecZ00Fi nNxIot9v4ljWlBxJePHp6Bwb3WbUyHKFEVnDl8cjnSRCS6FB4Nx2tAu5+ yfNJPsShzzyxCWMhSt5zI/wWssM1APST+DbRXsDTw5EC+FZsojiur2X27 3muuDr/8A1352tXSZOQNq38wBUZMBcFNbocZxVjXltJLkTRcMP8oWmToD R/qn6XCxGzSLw9yG9JY+gI3/m8Qh6M/XMVUmp56qIFghNz5/nMATqQLDn g==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="373276200" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="373276200" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 02:01:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="756028824" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="756028824" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 02:01:28 -0700 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with SMTP id D7E2311FAD0; Wed, 19 Apr 2023 12:01:25 +0300 (EEST) Date: Wed, 19 Apr 2023 12:01:25 +0300 From: Sakari Ailus To: Michael Riesch Cc: Dave Stevenson , Mauro Carvalho Chehab , Michael Riesch via B4 Relay , linux-kernel@vger.kernel.org, Matthias Fend , libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org, hverkuil@xs4all.nl, Laurent Pinchart Subject: Re: [libcamera-devel] [PATCH RFC 1/4] media: v4l2-ctrls: add lens group status controls for zoom and focus Message-ID: References: <20230406-feature-controls-lens-v1-0-543189a680de@wolfvision.net> <20230406-feature-controls-lens-v1-1-543189a680de@wolfvision.net> <0f1baf5e-2ff6-e10b-5c3e-0a82c71d0ce6@wolfvision.net> <3ab7bfc4-aaae-2e39-b420-40ad8d71dda4@wolfvision.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 Hi Michael, On Mon, Apr 17, 2023 at 02:38:20PM +0200, Michael Riesch wrote: > Hi Sakari, > > On 4/12/23 17:12, Sakari Ailus wrote: > > Hi Dave, Michael, > > > > On Wed, Apr 12, 2023 at 02:55:56PM +0100, Dave Stevenson wrote: > >>>> If the ranges aren't updated, where should that out-of-range lens > >>>> movement leave the lens? > >>> > >>> This is up to the hardware controller, but I would guess it typically > >>> stops one step before disaster. Wherever that may be, the error > >>> condition and the current position can be read out via this new STATUS > >>> control. > >>> > >>> Does this sound good so far? > >> > >> Sounds reasonable, but I'm not the gatekeeper (that would be Sakari or > >> Laurent), and I'm just expressing my views based on the lenses I've > >> encountered. > >> All of my lenses have a single drive for focus, a single drive for > >> zoom, and where there are multiple elements they are all connected > >> mechanically. Your setup sounds far more complex and is likely to need > >> a more extensive driver, but it'd be nice to not unnecessarily > >> overcomplicate the interface. > > > > Could we also have a driver that uses these new controls? > > If you are referring to the driver for our custom lens controller, then > I have to say that it is under development and simply not ready for > release yet. Also, the decision has not yet been made whether or not > this will be an open-source driver. > > A different approach could be the adaptation of the vimc-lens driver, > which currently only supports FOCUS_ABSOLUTE. But this would raise > several implementation questions and at least for me this would be a > nontrivial task. > > Is it required to have a driver for this interface (in the sense that > the patches cannot be accepted otherwise)? That has been traditionally required, and a virtual driver isn't usually considered enough. There are at least two reasons for this. The first one being that if the driver isn't reviewable and targetting upstream it may be difficult to figure out whether the interface changes are the right ones for that driver. This is perhaps a lesser concern here. Secondly, there is also unwillingness to add interface elements that might never be supported by the kernel itself --- this is effectively just dead code. Also cc Hans and Laurent. > > > The controls themselves appear reasonable to me as well. I guess there are > > changes to be made based on the discussion? > > I'd summarize that whether or not the status controls are compound > controls of the type V4L2_CTRL_TYPE_LENS_STATUS is the open question. > > As a potential follow-up question I recently asked myself if the struct > v4l2_ctrl_lens_status should contain trailing reserved bytes for future > extension (no idea, though, what this could be). > > Alternatively, we could come up with "V4L2_CID_FOCUS_CURRENT (integer)" > for the current position and "V4L2_CID_FOCUS_STATUS (bitmask)" (and add > further controls when they are needed. Here, we lose atomicity but maybe > this can be ignored. One could assume that all relevant controls are > read out with a single ioctl which provides at least some level of > atomicity. There might be something that could be done in the control framework to address this. But it's not something that can be expected to happen soon. I'd perhaps keep them separate, not to make it a compound control just for the access reason. But I certainly don't have a strong opinion about it. > > Any comments and/or recommendations to this open question would be much > appreciated. > > Other review comments will be incorporated in the next iteration of this > series as well, but they are quite straightforward. -- Kind regards, Sakari Ailus