Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1629226ybz; Thu, 30 Apr 2020 02:44:36 -0700 (PDT) X-Google-Smtp-Source: APiQypL3spW60DMAYSYbpEo5JpkWW6pgHxKMM2fwJAeDWmaWCYqGC0OjfaT7VTNVp2cAq9LcAlU3 X-Received: by 2002:a17:906:f90d:: with SMTP id lc13mr1758363ejb.367.1588239876585; Thu, 30 Apr 2020 02:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588239876; cv=none; d=google.com; s=arc-20160816; b=piPVM0xb0gQPm8FuVGWdsqU/QkYjpljew2ZjSICAkjlO/n/2gU0RvvdtrW6wpoaY2S qYjonbLLnwV9iYx/jJSS8ohz6QAwAvrzBmrgphrVSKcUTerhWGXujFzekwCn7CcWEVln AYoQERHerbv33dL3XuJm4w1/3XojOwKZCnkz9fzZhixtbSWHOH3sK783dDl/DNvI1/k7 PkxzIrGYz4P6KLtXRA58ky+MF/RgHpr0Y6+e/uiHXzW9K2eFr857DuGA4/q8W2dPU1c+ uWBbvlNmzuH3wan8NfDNMESdNQVeNzgVtTAR4IVzZcgHu7ATNng41ztwLDs2WWevlgeN Q/CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bnxbUrQASdxzVPmWqd+AsQvDTiR7ox8c+N4gZD+b5XY=; b=MMu4yFhSvFuZLaXBdzbjHRj0GPHwfXZ+fYUunpCJBCgnP0DbT8rLxo3/D6mKJ5CIQD /eO5wtgQEglcTgVVUU2Aup6S18L5nX7cT+OAcMRYMkBm3FlcdCPDhZOYpcmTQqoJsyhZ 42FV0k62eTki5ELeEFOj2LDnii/r+uINu+DOjQARxQRZUCMqNmgC7Xquy7sYwQEeFaMX +mg0xMzFZLMfjzDsiLubIk7PK3dTooAK0RlqM3LmcsLPmy5fTNEN105OOBNPNw7ysPC9 0YPRpe8UzQ/0CLV8hfixrLzOhCTRtwKYdJdopHFAufN9g2ZaSP4f32wVs8zkioFoeXMp 40AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k15si5842124edk.194.2020.04.30.02.44.12; Thu, 30 Apr 2020 02:44:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgD3Jmm (ORCPT + 99 others); Thu, 30 Apr 2020 05:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726404AbgD3Jmm (ORCPT ); Thu, 30 Apr 2020 05:42:42 -0400 X-Greylist: delayed 131958 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 30 Apr 2020 02:42:42 PDT Received: from hillosipuli.retiisi.org.uk (hillosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::81:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0627DC035494; Thu, 30 Apr 2020 02:42:42 -0700 (PDT) Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 7CE2E634C8F; Thu, 30 Apr 2020 12:42:33 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1jU5iD-0000Q1-AI; Thu, 30 Apr 2020 12:42:33 +0300 Date: Thu, 30 Apr 2020 12:42:33 +0300 From: Sakari Ailus To: Daniel Gomez Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Laurent Pinchart Subject: Re: [RFC PATCH 1/3] media: v4l2-subdev.h: Add min and max enum Message-ID: <20200430094233.GE867@valkosipuli.retiisi.org.uk> References: <20200414200151.80089-1-daniel@qtec.com> <20200414200151.80089-2-daniel@qtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200414200151.80089-2-daniel@qtec.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, Thanks for the patchset. I'm also cc'ing Laurent who I think could be interested in this one. On Tue, Apr 14, 2020 at 10:01:49PM +0200, Daniel Gomez wrote: > Add min and max structures to the v4l2-subdev callback in order to allow > the subdev to return a range of valid frame intervals. > > This would operate similar to the struct v4l2_subdev_frame_size_enum and > its max and min values for the width and the height. In this case, the > possibility to return a frame interval range is added to the v4l2-subdev level > whenever the v4l2 device operates in step-wise or continuous mode. The current API only allows providing a list of enumerated values. That is limiting indeed, especially on register list based sensor drivers where vertical blanking is configurable. I guess this could be extended to cover what V4L2, more or less. If we tell it's a range, is it assumed to be contiguous? We don't have try operation for the frame interval, but I guess set is good enough. The fraction is probably best for TV standards but it's not what camera sensors natively use. (But for a register list based driver, the established practice remains to use frame interval.) I'm also wondering the effect on existing user space; if a driver gives a range, how will the existing programs work with such a driver? I'd add an anonymous union with the interval field, the other field being min_interval. Then the current applications would get the minimum interval and still continue to function. I guess compilers are modern enough these days we can have an anonymous union in the uAPI? > > Signed-off-by: Daniel Gomez > --- > include/uapi/linux/v4l2-subdev.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h > index 03970ce30741..ee15393c58cd 100644 > --- a/include/uapi/linux/v4l2-subdev.h > +++ b/include/uapi/linux/v4l2-subdev.h > @@ -117,6 +117,8 @@ struct v4l2_subdev_frame_interval { > * @code: format code (MEDIA_BUS_FMT_ definitions) > * @width: frame width in pixels > * @height: frame height in pixels > + * @min_interval: min frame interval in seconds > + * @max_interval: max frame interval in seconds > * @interval: frame interval in seconds > * @which: format type (from enum v4l2_subdev_format_whence) > */ > @@ -126,9 +128,11 @@ struct v4l2_subdev_frame_interval_enum { > __u32 code; > __u32 width; > __u32 height; > + struct v4l2_fract min_interval; > + struct v4l2_fract max_interval; This changes the memory layout of the struct and breaks the ABI. Any new fields in the struct may only replace reserved fields while the rest must stay unchanged. > struct v4l2_fract interval; > __u32 which; > - __u32 reserved[8]; > + __u32 reserved[4]; > }; > > /** -- Regards, Sakari Ailus