From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB15DC433E9 for ; Wed, 17 Mar 2021 08:09:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AECCD64F7F for ; Wed, 17 Mar 2021 08:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbhCQIJG (ORCPT ); Wed, 17 Mar 2021 04:09:06 -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-Google-Smtp-Source: ABdhPJwrvdFOCq7VKRASJ+InsNz6citM6tF95Wjs7Ed8zR2seTeb2ooJ2Zx7SJY3iHRhtEh6nlRyqg== 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