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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 D5C25C433DB for ; Wed, 24 Mar 2021 03:06:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6C41619E3 for ; Wed, 24 Mar 2021 03:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235005AbhCXDFh (ORCPT ); Tue, 23 Mar 2021 23:05:37 -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-Google-Smtp-Source: ABdhPJzFBNWkmTNIKtNNzlwKE5UR9znR+x2311GojQrFD6USVTuPrRTYw1IFXCjRT6OK8T0qr3wNSQ== 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.