Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp748387pxf; Wed, 24 Mar 2021 15:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjsvEhf0kQll6rLe41ZzCORsLWnvtWYCixyn06huJKl3gilOsTzf89oA9WWStEyCKYCu6j X-Received: by 2002:a17:906:1985:: with SMTP id g5mr5936923ejd.285.1616623946296; Wed, 24 Mar 2021 15:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616623946; cv=none; d=google.com; s=arc-20160816; b=DbritbKpjoZFR07QVocNb5B5Ab7x9monDbPNuZub5zJVkkWFxpvazT9pp0tiIXkh5R k/Bv0n+ee60IC44KkrP4F+G+lkEAWsM4cEgFiidx3qFzpe6CEe/fPRt9HR3UYp1IsdAz dqUXjDCvXhmGDX7dIc2wkd08H0YJ33cxjf+dGzLcTy1ked4crw4F4+oLcI3gK0PHMp34 ottH75zAqS/UyHEdLUcbvW/KB+TjpKtN073jv/tvhQNJa13Y6O7NHZAcPTHUf35iVeHq XMRMlpKJ3fkFt+OVlcVl7fLKHZUYAJiySpsSXd+4Y5pqovjCWNLHcV7cqWpCchRQbGqS ZBoQ== 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=XjFHAUzPomVRVT0dS7pmZgIlLkEy7sjyft1TIrApGAY=; b=v6GU1erBG9XK7pbeEyF53pk2IA5R/r9eCF6JncIX80DzFpn0SmTlgba0YIzwb1ckbz IxByz1cxBqwkRAIFEEXkgHB5pqg0dwCCEV5BAwgr/NgsEzvFe5umYwq3Nm7pAzKhnGaz 4WpQISaRTkOlKD/whUs0ssyAICCGySXsd7RnrXqG3f/QAwK/XYDqizR7gUoqXayfwqF0 r1O8V3IIenEQDm45kZdMu65dRa0XoN6fLQ1zHwYBxb6JxJHo+RyuROByOjQyY194n0Ug 22Md4SQqcxDW+gVhGb7RuJbLqNh5iZO1BB+PJMOgfSWVd+WqTzTtqqts+aJj9EfO8Cge au6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GFIP4zRJ; 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 m24si2914672eda.304.2021.03.24.15.11.52; Wed, 24 Mar 2021 15:12:26 -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=GFIP4zRJ; 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 S232358AbhCXDIp (ORCPT + 99 others); Tue, 23 Mar 2021 23:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232136AbhCXDIe (ORCPT ); Tue, 23 Mar 2021 23:08:34 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DD8EC061763 for ; Tue, 23 Mar 2021 20:08:34 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id n11so13683436pgm.12 for ; Tue, 23 Mar 2021 20:08:34 -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=XjFHAUzPomVRVT0dS7pmZgIlLkEy7sjyft1TIrApGAY=; b=GFIP4zRJL3jF5iJqQHC9YibDfZVI+vmMTU3Diyk2jrUzrvXHMg8UPs7vmxtMdInl2T ZLsauiSNhOBncbdAarCM3AtivkonMEc8hDpu7JyqGA3SoWRcRUSvjrVDSebzLbkupkOW /+sV7EmknP58RCpOexLYcOXMwqdfHTZfFfXHY= 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=XjFHAUzPomVRVT0dS7pmZgIlLkEy7sjyft1TIrApGAY=; b=R0lmwkQPdVO2P8mYOvhVkQyB4DzRNthrigOP2MoaamRaCAKhhwZ6vZKebOeYnyTcff OccgJkV5ZlQggCTjaBTEHd7l7ZV1XOnatCYrBm/u2sndZLFNMABIJp4dNBGyYIpcMW1D X5OQjJ1lp4thZD1laRupM5Oi9JQQH/vT1Jt0dXIrWrhtx9yhzNuLN0ZJ7hc1NdTuXyXX SzioYxFh114SXbhmeveL1piHVQ271hYiOMAy7TKTwZ15zs8jOmDXiHVPY4j/z4z5xW6H I6wFyYrk2QN0G7A/pU+i9GlBkJGs8hOM+pR29RTLtVwyWzW8KnqMKucDYIS1yBrniEAz tgBQ== X-Gm-Message-State: AOAM532qRxcanhnqX8ZSkDLWcVaIm6heGlAVO6sUx3Hi1ENH25L6XmCi gIVEgS9f67w1GJCouGHPbll7Xw== X-Received: by 2002:aa7:9984:0:b029:1f8:b0ed:e423 with SMTP id k4-20020aa799840000b02901f8b0ede423mr1098358pfh.81.1616555313655; Tue, 23 Mar 2021 20:08:33 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:bcf2:e05a:a993:9494]) by smtp.gmail.com with ESMTPSA id g12sm520787pfh.153.2021.03.23.20.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 20:08:33 -0700 (PDT) Date: Wed, 24 Mar 2021 12:08:28 +0900 From: Sergey Senozhatsky To: Tomasz Figa Cc: Ricardo Ribalda , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , Sergey Senozhatsky Subject: Re: [PATCHv3 5/6] media: uvcvideo: add UVC 1.5 ROI control Message-ID: References: <20210319055342.127308-1-senozhatsky@chromium.org> <20210319055342.127308-6-senozhatsky@chromium.org> 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/24 12:05), Sergey Senozhatsky wrote: > > > For ROI user-space also must provide valid auto-controls value, which > > > normally requires GET_MIN/GET_MAX discovery. > > > > > > v4l2 selection API mentions only rectangle adjustments and errnos like > > > -ERANGE also mention "It is not possible to adjust struct v4l2_rect r > > > rectangle to satisfy all constraints given in the flags argument". > > > > > > So in case when auto-controls is out of supported range (out of > > > GET_MIN, GET_MAX range) there is no way for us to tell user-space that > > > auto-controls is wrong. We probably need silently pick up the first > > > supported value, but not sure how well this will work out in the end. > > > > Shouldn't the autocontrol selection be done via a separate bitmask > > control rather than some custom flags in the selection API? > > That selection must be done before we send ROI to the firmware. > Firmware H that I have supports split controls - we can send > ROI::rectangle and ROI::autocontrols separately. But other > firmwares don't tolerate such a thing and by the time we issue > > uvc_query_ctrl(stream->dev, > UVC_SET_CUR > UVC_CT_REGION_OF_INTEREST_CONTROL > roi, > + sizeof(struct uvc_roi_rect)) > > roi rectangle should be of size 5 * u16 and contain values that firmware ^^^ roi structure > will accept, including autocontrols.