Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1057222rwl; Wed, 12 Apr 2023 07:45:38 -0700 (PDT) X-Google-Smtp-Source: AKy350abLqnC5JplQ8V8a9vJ1IEvHH4sOoiOxvY8zh1S3iT30iuUawSNnD6juy4st96Ew5gF7uDr X-Received: by 2002:a17:902:f68d:b0:1a6:413c:4a54 with SMTP id l13-20020a170902f68d00b001a6413c4a54mr3747415plg.1.1681310738543; Wed, 12 Apr 2023 07:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681310738; cv=none; d=google.com; s=arc-20160816; b=CIeXtja2ZBYQrCCHDEKRLpa3u6XWJ23IYfYtoHcb7AM4otCkoUycspigLhRG4EaCKf c6ic/rfHSqaStD3iXxAUyJhwb4lRclma1D6mzfXCuAYh8ioGt1LPZxIXktUUHkV6QYD5 bTptCefyWdg2Ett4ezPB9DPpd/4c/cmPqw6hwdKqTJm8eIRZciAQo5a6NoPlwi1fqG4W aEpoQgPJ5jn5sWpLIpWwXnOsggkLG1l41kE1rXyNRwgOWReeX2S8z8zwd10oMkp/iOkh t4K8oE5veeOqZH1A7Qt84VEhEcy7LD5rMb3+Mu/bnc+WZNgnbJshm/gkaylcyFRiq7xx LJsA== 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=OlFLA05bDrG5KC1T3C0qlUgyAzHXgDyjgQKaIf0SE6k=; b=xfhu0KRGW5AbhCYB1AVGQ0yuERYISJclDnSWLMTohkJuHPkZ0IUuli1tIVXkGH6Q1p 1XkZno4E1LT0AzB19U/CASA4N3eE2rC9P560oarycYv59tD/vk1rUzOS6BJfNfYvtf+x 45j39GDiHYr5YwK3rBFvwYn/9XV25YWYk2NInIug+QIC3asD0g0MZXb0XqqYRDEG1/fU 7yuJ7DJTD9g7xQKhniW7PD+iKM2CHDAfJPblm6wtekdngKBpObDCeTk7r7/D6gLJ5q7f MyWbfI9Dlq4n7kKe9zZ8PIHlMIa4FV6C6mfj6n3LYEHhcwY/0Ip4Z6rTJGfeyH0gR/jL iwGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NFbU0lN+; 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 j8-20020a170902690800b001a1f2843b88si15181273plk.371.2023.04.12.07.45.24; Wed, 12 Apr 2023 07:45:38 -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=NFbU0lN+; 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 S231717AbjDLOjp (ORCPT + 99 others); Wed, 12 Apr 2023 10:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbjDLOjh (ORCPT ); Wed, 12 Apr 2023 10:39:37 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8C59775; Wed, 12 Apr 2023 07:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681310349; x=1712846349; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DZ+4bqcOwGArNUff5c6q4WqLlSztJS1TSKOKE8pP2P4=; b=NFbU0lN+kFFYJzZWK1MCEbKb2no7YqwKEIWRwS7KDi53b2LPGdu8FctW l2xKHCT5iidqRjo9WKgGC1iRerBI2hx50nUVC/HTDH1Rg+/IziP8dfnBN A+ZqsSWKbmlZuWkup7Tm677S8V0+fL1dH3tt6fZdSRKLpAkgyAM8An4CI fBfLoZbm0VaGoqfhMvKz445dxpuxiJuhV5Hmh7TYCcX6bHh8uL23sXDQd DM7VuRZOl7XH+AYTb2MEBe+YEVtwDYcbTNLGKJOvaOmiMqQ5ukl5n2V// TAwm50863EWsDVxRa6ikkYhTdiLpKc+QjWcvTq3Bymj+Y+2snqeitP0L8 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="324277258" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="324277258" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 07:39:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="639258064" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="639258064" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 07:39:05 -0700 Received: from kekkonen.localdomain (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 7EF49120D2E; Wed, 12 Apr 2023 17:39:02 +0300 (EEST) Date: Wed, 12 Apr 2023 17:39:02 +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 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> <8fe5c9c5-6eb0-86ae-9e5d-fbaa72be25fe@wolfvision.net> <77d91964-de0a-8bd4-12d9-bc16110cfa7c@wolfvision.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <77d91964-de0a-8bd4-12d9-bc16110cfa7c@wolfvision.net> 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,SPF_HELO_NONE, SPF_NONE,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 Wed, Apr 12, 2023 at 03:43:26PM +0200, Michael Riesch wrote: > Hi Sakari, > > On 4/12/23 14:05, Sakari Ailus wrote: > > Hi Michael, > > > > On Wed, Apr 12, 2023 at 01:57:36PM +0200, Michael Riesch wrote: > >> Hi Sakari, > >> > >> On 4/12/23 13:50, Sakari Ailus wrote: > >>> Hi Michael, > >>> > >>> On Wed, Apr 12, 2023 at 10:00:26AM +0200, Michael Riesch wrote: > >>>> - Different controls: If moving = (V4L2_CID_FOCUS_ABSOLUTE == current), > >>>> then what happens if the application performs a > >>>> V4L2_CID_FOCUS_RELATIVE with -3? current should reach 39, > >>>> V4L2_CID_FOCUS_ABSOLUTE is still at 42, the lens is still moving from > >>>> the application's point of view. > >>> > >>> Would there be a reason to implement both of these controls in a single > >>> driver? AFAIU, the relative one should be used if there absolute value > >>> isn't known to the driver. > >> > >> Probably not, but on the other hand there is nothing the prevents a > >> driver developer from doing so, right? Point is that should there be a > >> driver which does implement both controls, we are in trouble AFAIU. > > > > I think the documentation should be improved in this regard. > > The documentation of which control exactly? And what items should be added? Both V4L2_CID_FOCUS_ABSOLUTE and V4L2_CID_FOCUS_RELATIVE. For the former, the sentence "Positive values set the focus closer to the camera, negative values towards infinity." doesn't make much sense in the context. For the latter, what I mentioned earlier, i.e. this should be only implemented if the absolute value isn't known. It's not a driver's job to do simple arithmetics for the user space. In fact, it appears that no driver is using V4L2_CID_FOCUS_RELATIVE at the moment. So we could as well deprecate it (or remove from documentation altogether). -- Kind regards, Sakari Ailus