Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4591969pxf; Tue, 16 Mar 2021 18:35:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGVMfFEdtcJv4fIf7mXArzBuX3fRiKSAKGgt7b678n25ZwLJkbCWqfJCOT/1J8BETsOsdM X-Received: by 2002:a17:906:d114:: with SMTP id b20mr31641307ejz.449.1615944921432; Tue, 16 Mar 2021 18:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615944921; cv=none; d=google.com; s=arc-20160816; b=F0KtDS1TBSvfcSe1+jFLaK+ogQlnIq5J58s+jOt+QlbUaGk5UjcOojFSODXJgxcnJf TCOSVspGcWgl8gJWxKgfKC8L5IZvmRLMbFoVCIxec5tgl5ls9aACm6bEJF3SX/KJ3uvH hZoCtFdgUQCtnGbuuvtM2x/Nf4XZXyh+syPovRkXg3fz6K1WLQ8n2Qmgd5eXxyZ2OWgg lyr3LOi86q7uYsnyyrMGJSUECfe3p/xcffMeqMtUYx1QN3OqbkTf4hacGZBSgGOuJLVE pc8nXyfzKHwZ0/WUmqyk1Jza7vtYFkIZ8xBM1QwY02i4fatC/eX24WzueXKjQzjMV10/ stRw== 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=N/NUzf9NzqO7N5d6gDcc9DMo+DFjiot6YxLcXVdBLSI=; b=0/ZD7WmXiGdKQAKjGh2rEnZxA6CHMrfRaM+vKFdRrQWl+S+FSqLuFjmWpvL2oPpkpf 1AUv+6+xEK/ttq2qy/EeD4G+ZY4aHLS3XpmceHnSMtFApHaoSA1QXjo8ATU57n6OH1yX mF1LinUAt/4culfYLt9AVUWU/JVzpXkRxVnX7xhlUC2mVXbsDfjfbQkxcXGm7IBoONK7 kXDlP4pxgV9rezlaBhPOxEwmwN4i7AA5bZsPJLCVWzQ4GW+XFIzoZJTHGb1G6OtlUSiO b0DkpUYFZnoYcngxRMOqvl5aDbem6qk2LASdJ8QdLrfPuavq0CQ0NGuxzb76GxrT4c7x HJNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xx9uVEQE; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si15101765eje.555.2021.03.16.18.34.58; Tue, 16 Mar 2021 18:35:21 -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=@gmail.com header.s=20161025 header.b=Xx9uVEQE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231331AbhCQBbc (ORCPT + 99 others); Tue, 16 Mar 2021 21:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231441AbhCQBbW (ORCPT ); Tue, 16 Mar 2021 21:31:22 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2E4BC06174A; Tue, 16 Mar 2021 18:31:10 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id o16so6831508pgu.3; Tue, 16 Mar 2021 18:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=N/NUzf9NzqO7N5d6gDcc9DMo+DFjiot6YxLcXVdBLSI=; b=Xx9uVEQEYQWb34sLqV3KtpUs69UwnCPpsNkmr/NLxHly35YUf+A0mN6oeeS3TMhoH+ KH2XfvpBsjGbdBJFSm/Racmf1tsnz9c+aommsprJAEiWrNClVzZk71O4a1R2y06RF3tL jElLokCga0YFr1Q+7brLHX01lqupDOkQL0lq7nV9i1HMt9PhqJomtCha/2lGYMZo0eul WG4QstaqzwHVOHKOoamUnmpyrPvzT6mKAaUJY5FQk38NP6HBw117KMBJiaKscIa9Z4Qv H1pQqZb+h0iL1uumzDmD8MljDswSzYUMYGAnUH1O5OySTQUjrzVfH0RYLxtH+JeBOa/g dwmg== 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=N/NUzf9NzqO7N5d6gDcc9DMo+DFjiot6YxLcXVdBLSI=; b=QRyE0IRX3ltEbLUUF8NWzgBy8MvzyMZiaBZIG23dmbO8f45AAYjuJpqYyd+IdcPw8p U6rKlxqRhbXDXATB4sD2eC46ijsAr8MH3JZF1utf9F5NZyZoxWozRdGO+vnd9YsK2HgN BM/19URDduXGqhvvLTWF/qOzfwb0tM6kD+Y7XyMnRTt8Aa2oCDOBngQKdH3snb3VgHw5 Qd99glMEhzbeIQ+vw3pi0/3PxnN2o6FvZyFfsnPHXHzsM0JtFXDIXeRtcGYwuJ2ePH0Y H0NYs0w/GGguvQdlivYv74Pq9JWJE/rq9ZPhEAldEGh/9DA9OhSaq02AtnEpPDXudkhB pGVw== X-Gm-Message-State: AOAM533tAV8m+3TDMMzms4oU2UlEjVVlv7XhQnkX98sXs7rNJgHZ2nyT CPNaK4ms/XQORxbM0ZET/f7xhq4dRxi2rA== X-Received: by 2002:a63:f14b:: with SMTP id o11mr495234pgk.440.1615944670464; Tue, 16 Mar 2021 18:31:10 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:b48f:f050:bdc5:eb89]) by smtp.gmail.com with ESMTPSA id s76sm18092853pfc.110.2021.03.16.18.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 18:31:09 -0700 (PDT) Date: Wed, 17 Mar 2021 10:31:05 +0900 From: Sergey Senozhatsky To: Ricardo Ribalda Delgado Cc: Sergey Senozhatsky , Laurent Pinchart , Tomasz Figa , Mauro Carvalho Chehab , linux-media , LKML , Sergey Senozhatsky 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/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? > > +The top left corner, width and height of the Region of Interest area > > +currently being employed by the device is given by the > > +``V4L2_SEL_TGT_ROI_CURRENT`` target. It uses the same coordinate system > > +as ``V4L2_SEL_TGT_ROI_BOUNDS``. > > Why do we need current? Cant we just read back V4L2_SEL_TGT_ROI ? We don't. Will remove it. > > + * - ``V4L2_SEL_TGT_ROI_CURRENT`` > > + - 0x0200 > > + - Current Region of Interest rectangle. > > + - Yes > > + - No > > + * - ``V4L2_SEL_TGT_ROI_DEFAULT`` > > + - 0x0201 > > + - Suggested Region of Interest rectangle. > > + - Yes > > + - No > > + * - ``V4L2_SEL_TGT_ROI_BOUNDS`` > > + - 0x0202 > > + - Bounds of the Region of Interest rectangle. All valid ROI rectangles fit > > + inside the ROI bounds rectangle. > > + - Yes > > + - No > > + * - ``V4L2_SEL_TGT_ROI`` > > + - 0x0203 > > + - Sets the new Region of Interest rectangle. > > + - Yes > > + - No > As mentioned before I think we should not have TGT_ROI_CURRENT and TGT_ROI Agreed. > > 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.