Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp141087pxf; Wed, 17 Mar 2021 01:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY+R33pAZKBSf/S84z13k/jOXE7UmIojnsmYFvqRTZKNc2g45TT1AIchuWVanebqTt21Gf X-Received: by 2002:a50:ed83:: with SMTP id h3mr41804447edr.140.1615968726018; Wed, 17 Mar 2021 01:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615968726; cv=none; d=google.com; s=arc-20160816; b=jZfnawlWQi0WDZJI+wpE1Mbw71ReCl13T+qLU+y1IIDuQkc0HDz7C3tfQzsbnXJxRS KQq6lMAOsc0L8ArgdCeSDidxzyVoHlFmVkhFxHq+r4fPbcpxzdg6m+ctPPk4kHFH/owI khfRvHGBi0ND1w/6BdVly5ylTzialhNlt0Rf0du649kuMAyajpwH6mQEijMbxBXeN4h8 TgptxQJhRgwXPq8Bzo9usw7jl6GVfPBbAdWaQXZBixQYzvb0VxBph4xE4CBUBigFUn2I s1YdOwyr/t8uI2srmc1n1l3gt/3q0DxEO+Zm5pvc1dI6KiBVrZRG68caoSWFNFNWoICD SDyw== 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=aCfSB5C9ykLdXLAp7ZVnblWxeq2vcWW6t+WdAO0dmzU=; b=TGOU3dKh7GIyIkbNbGbs0HSKXVlEKs84kES+X6WVAApZWeIjbG2atWcGWchhkbcIHP q4U/kh/HBTpv5pcQOPn2RLVg0A07YkDzUrFv6wfmhGeAQD3Wuj0Agb5qb69HICrVaCx/ SsmVB3s6XE9h93IHNlltAsO3rZ+SsCMBaee9XLvsFaKHdLGG19Sno1by5N6auQcrHzjT rPs5rRzw3mZyiIabMkXFRA9DgHsY7isPAOBea1OkDbnRbu58YjKxwwUJ0ix0P3u+sTZA zsUwQv6C9ObAn1wb+PE4wQyxjVAf1tulpi9Ai4OqCGiDd2YD+QhPTTA/GeiTNW2Bn1+d +TwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FNiJ1e89; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si15716185ejj.303.2021.03.17.01.11.42; Wed, 17 Mar 2021 01:12:06 -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; dkim=pass header.i=@chromium.org header.s=google header.b=FNiJ1e89; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbhCQIJE (ORCPT + 99 others); Wed, 17 Mar 2021 04:09:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhCQII5 (ORCPT ); Wed, 17 Mar 2021 04:08:57 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8035C06175F for ; Wed, 17 Mar 2021 01:08:57 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id x26so568307pfn.0 for ; Wed, 17 Mar 2021 01:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=aCfSB5C9ykLdXLAp7ZVnblWxeq2vcWW6t+WdAO0dmzU=; b=FNiJ1e89JqQ5a4mLi2mnsooQBUWrvZr/BYgfZQ59qpA+tLIAGK22H69NLhGv9Y31ix KydT1oM6mZjUr7IRn32FnrufWu0pn52WwXCSdFRUEj+pLuAn2Xa9a0vohTaL9VrUyT/I +FTJceCml/q0dUZIUmN+LYuWrhCG52BECYX+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aCfSB5C9ykLdXLAp7ZVnblWxeq2vcWW6t+WdAO0dmzU=; b=Jrj5RViZ5xIJ6jiPfP993YC6X5tKoRiTwJJQyvJAqsCiF4CsCbkDNjJori/7zpGifZ NZ4jjhJ3vAyGeUBIpzJ05/LIQkmOut0Rifo6jIRuuWaBp0epIYNcefpf9jKjItPjN959 m+n21Q8V6m60V9FWAoukQR3rX+hEOl7g39viOiDqJZydrWyzRHIvMm6X3x5u+SxQ+w+e by6D15UsDcBfd6FLjlSTr7rC6QJ8rGj4cLZ6hqfnZFHHiaGureEP0HoPibkkiGwq89Xo 0EfO0BABO9ZbowqdhKZ/DFycf0kc2r4kVjnRYLyfBOzzEOeESSJV3wBDiWw9E3NttmZ2 fk8g== X-Gm-Message-State: AOAM532tHQPzstppDeqeRJjwf40O4V5wkK+VvRIKrWsBuvMRQd3M2aC1 pN1e0KqtKjsu9TspgSlKO0+3LA== X-Received: by 2002:a63:cd08:: with SMTP id i8mr1637851pgg.49.1615968537259; Wed, 17 Mar 2021 01:08:57 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:b48f:f050:bdc5:eb89]) by smtp.gmail.com with ESMTPSA id p7sm7591308pgj.2.2021.03.17.01.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 01:08:56 -0700 (PDT) Date: Wed, 17 Mar 2021 17:08:52 +0900 From: Sergey Senozhatsky To: Ricardo Ribalda Delgado Cc: Sergey Senozhatsky , Sergey Senozhatsky , Laurent Pinchart , Tomasz Figa , Mauro Carvalho Chehab , linux-media , LKML , Sergey Senozhatsky , Ricardo Ribalda Subject: Re: [PATCHv2 1/3] media: v4l UAPI docs: document ROI selection targets Message-ID: References: <20210208051749.1785246-1-sergey.senozhatsky@gmail.com> <20210208051749.1785246-2-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (21/03/17 09:04), Ricardo Ribalda Delgado wrote: > On Wed, Mar 17, 2021 at 2:31 AM Sergey Senozhatsky > wrote: > > > > On (21/03/16 19:19), Ricardo Ribalda Delgado wrote: > > > > +Configuration of Region of Interest (ROI) > > > > +========================================= > > > > + > > > > +The range of coordinates of the top left corner, width and height of > > > > +areas that can be ROI is given by the ``V4L2_SEL_TGT_ROI_BOUNDS`` target. > > > > +It is recommended for the driver developers to put the top/left corner > > > > +at position ``(0,0)``. The rectangle's coordinates are in global sensor > > > > +coordinates. The units are in pixels and independent of the field of view. > > > > +They are not impacted by any cropping or scaling that is currently being > > > > +used. > > > > > > Can we also mention binning here? > > > > What's binning? Is it in the UVC spec? > > Binning is when you reduce an image by adding up surrounding pixels. > > So you have a 100x100 image that you convert to a 50x50 but showing > the same area of interest. I see. Hmm, not sure if I can comment on this. It's not in the spec, so it might be up to the firmware, maybe. What do you think? > > > > diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h > > > > index 7d21c1634b4d..d0c108fba638 100644 > > > > --- a/include/uapi/linux/v4l2-common.h > > > > +++ b/include/uapi/linux/v4l2-common.h > > > > @@ -78,6 +78,14 @@ > > > > #define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102 > > > > /* Current composing area plus all padding pixels */ > > > > #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 > > > > +/* Current Region of Interest area */ > > > > +#define V4L2_SEL_TGT_ROI_CURRENT 0x0200 > > > > +/* Default Region of Interest area */ > > > > +#define V4L2_SEL_TGT_ROI_DEFAULT 0x0201 > > > > +/* Region of Interest bounds */ > > > > +#define V4L2_SEL_TGT_ROI_BOUNDS 0x0202 > > > > +/* Set Region of Interest area */ > > > > +#define V4L2_SEL_TGT_ROI 0x0203 > > > > > > Nit: Maybe it could be a good idea to split doc and code. This way the > > > backports/fixes are easier. > > > > I'm quite sure this is the first time I'm being asked to split code > > and documentation :) I'm usually asked to do the opposite - merge code > > and documentation. > > I got answered in both directions. I prefer to split it because the > doc can go to different audience than the code, and then it makes my > life easier when backporting. > > But if you or Laurent prefer otherwise I am of course happy with any option ;) Either way works for me. Laurent, any preferences? -ss