Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp183992pxf; Wed, 24 Mar 2021 02:30:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlI0oAjWfkZOP2nP1raaHPlXW+J2GFHMERvPVW0LFBwtcgInLiINCCXPCltPpYno54ppGF X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr2474234edd.212.1616578244471; Wed, 24 Mar 2021 02:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616578244; cv=none; d=google.com; s=arc-20160816; b=me8aVkPKCLuaYNj7lRN5rmH9deSyordiB+o8prY/5Hf3hyp0LfjatxIA1L0aD3WjMA wnyt6BGx662O0m1TczkEERHHQTqKN9u+aZfakXRs7Z2+e8Y16U0bdB2gTDYJLC/1JSxP oRfrN7X+Zz6utoWIZ8Di0xDjS2M5AyKb4xWlQ0NQPW2qNw+/dAQsp3bs3BdooQpzoo8l CxZFMRIaI47Jop+9NlbBgmWMl7eSdiEoPmyi7crbbaEKpJiBO8/FFOsVNkp+K6hlsbDf ufJhY8NvHf7leKuhq+QzRmDVPZpbkjQ1c5yvAu91w1WulfgCdlxiKd2epDx+IuG8T+At 7oHw== 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=EhPV3KVrzkPHXSPWlu07vX6xVGTVkVHyIa1YY2b8Otw=; b=NLtcZN6XfvEGbqeSNCLassr6KUIO+o7K4ERXX/1I7UVnWOqLOePdGh5L9y3NqUco0B /QCEuyEM4PZ1vqC0fb0GUGqLDW+5D1bWxU+OGyzzeYEsvaxwjAGFSh8SLmcSNDGw1BEQ LaG2xs9zR3EHGYyfmEZwuBVf2TUVx4IyVbow+GtB+7An5KA0387RDHgbWU/1PKCgdDAN GFtzj0Do/+AtjpafhS9xRmhNLeqK/+0BNBIIBIT4vhHMBAcMsoqxNorw1q34xJeEk/nc ALAbJr43JhZ/OU7yQv74t4gViTtkJxxjWb1DRS4RK7klSpfm2eHX06Gx1UtHD8EjFgkX hlaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JFUuXK6T; 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 dt8si1324953ejc.111.2021.03.24.02.30.21; Wed, 24 Mar 2021 02:30:44 -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=JFUuXK6T; 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 S235003AbhCXDFb (ORCPT + 99 others); Tue, 23 Mar 2021 23:05:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232312AbhCXDFO (ORCPT ); Tue, 23 Mar 2021 23:05:14 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F099C061765 for ; Tue, 23 Mar 2021 20:05:14 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id h20so7172697plr.4 for ; Tue, 23 Mar 2021 20:05:14 -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=EhPV3KVrzkPHXSPWlu07vX6xVGTVkVHyIa1YY2b8Otw=; b=JFUuXK6Tas6z7Evj0JZdtYJjiCfg7dti/qpuhyE8T3457+msCSfMN5TkdBHWI9gLX7 HwqE4GDarrYFO/9ra0rAqSZKBEktQ9rpXHatOpXW9o6UbPJyH3VhM7WftzhHBtTdmAv0 r5DWRZS3XsgV7ejdsg8ftEetrX2Szi8NAFowk= 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=EhPV3KVrzkPHXSPWlu07vX6xVGTVkVHyIa1YY2b8Otw=; b=ZqNqCAcbzmHD9JitobWOzq1O2MjiUf3UQtr11FuwriXlML0/w7dLVmJj1ugfoaMe1c BWAOOojywZDVPzMkT0oJC6iNMdDPfKS30nEt4E4L1VwRiZ2oM+qlMwBnpSDj3jO5eDI4 EPYJYR+RqHbHaDrONc636cbWiKp7CVM8xVqz6eugvW4K9KSL3U+ijc5hu7lhFTyvQVZx l3LkMZXH2vZXrvz70M2S7jSOF5zArEheLHk6BhsPLlyNKiq87q/FISMzh88pCVzunyAh v3FIxq6xb08iobH4PD5JuDSRvoGka0VzoTUjH+MZPAYpFnkd9xFWOIB1CGvCum+PNV/e eVgg== X-Gm-Message-State: AOAM533edIOD7DnRwK3XMnTDtufdOkZWg9NbVWN323cIeeSS5mi+fzzw oKmh3SAG4fk1aLRmSb3SXcasRQ== X-Received: by 2002:a17:902:b7c5:b029:e6:1a9f:5f55 with SMTP id v5-20020a170902b7c5b02900e61a9f5f55mr1479501plz.57.1616555113706; Tue, 23 Mar 2021 20:05:13 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:bcf2:e05a:a993:9494]) by smtp.gmail.com with ESMTPSA id j20sm470526pjn.27.2021.03.23.20.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 20:05:13 -0700 (PDT) Date: Wed, 24 Mar 2021 12:05:09 +0900 From: Sergey Senozhatsky To: Tomasz Figa Cc: Sergey Senozhatsky , Ricardo Ribalda , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List 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:00), Tomasz Figa wrote: [..] > > I guess in our case we need to talk about rectangle,auto-controls tuple > > that we send to firmware > > > > rect { > > (0, 0), (INT_MAX, INT_MAX) > > } > > auto-controls { > > INT_MAX > > } > > > > 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 will accept, including autocontrols.