From patchwork Tue Oct 10 02:21:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunke Cao X-Patchwork-Id: 95692 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1qq2OQ-00BAr8-Rk; Tue, 10 Oct 2023 02:22:43 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441876AbjJJCWl (ORCPT + 1 other); Mon, 9 Oct 2023 22:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441843AbjJJCWk (ORCPT ); Mon, 9 Oct 2023 22:22:40 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B8F39C for ; Mon, 9 Oct 2023 19:22:39 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-59b5a586da6so42034857b3.1 for ; Mon, 09 Oct 2023 19:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696904558; x=1697509358; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=U8Kme82A4K2KxhYlD870r5GvvSSeq1S7+B98al6SOxk=; b=Jk6txltOSMO/1PphRIu4IxNWkcuexakuhKYlQ5Owy5I06/93KQPzEjWuX6VkQnAtqy sch5PqUJCG3ItLE2XKYeGgFdLKP4o4iTGLNbX4MJ5IOyOAEC9qf+W4DiB0dE3lBNs6pC fZ0AQm72uZej1l8UMB8OeUC7Mt5XMdixiPjcwdjSsXDUe1oG74hElyJkJ2ySTNSvR6DM jU2qXBNCQMmmEQG5M0Kc23f9WS/GYVwPIyOUSAh+gnjl5RqPTqEaepDrCfXywH9JqIrd qF0P5mLBLSpCJQvjm0X1JNC9MRood618WhjyjMvF4xW1LChr3hslGk7GKN3aoboR5P3l ZErQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696904558; x=1697509358; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U8Kme82A4K2KxhYlD870r5GvvSSeq1S7+B98al6SOxk=; b=gkFzcshvz14PaiHTFWdvwA5PnY1Iqxt+Bw59wahbVW+KrqkLCnPrzpdmqAmK9EFKqI BcOIM1w9YnilYy9/CPtaFV7K9bepJNLnh3JmMuZXMkthNVdbQseP9ojIHq67FA7AYxtZ Mbqxpmvn4iThwctt5WoZiScVr8Ii7u+agsIFU7rRcmxMLs//2DvQJZiJqL6MQh0nSZ7v zV9qCtk9bMqvLl+G3GGkJkySp06fTrRbJy7PDbvZGQBT78B3fJSO8LQ80LtHFdQQDuYp BB/3525OHq3pHhjwe09Kvjvbjui8TqADWtZXvbJ4Ivc1bHyF+73GoZW+Tebjakxi2Hd+ IPnQ== X-Gm-Message-State: AOJu0YwpPnwtYaa8L46G1akAvOvLtQ3J5lvNAkCEzZ2FECgrVBYwuWgX cTS/RoBBPiq3AoDmDjL9jAWiQ1Drn0Q= X-Google-Smtp-Source: AGHT+IHiX+UQGGXlYWcYsWYFMBDC2WCDLG13plA6Vsqo4449JegYNsFTO99g3Bjl2ppBKsXxfQ6DxkGAcwU= X-Received: from yunkec1.tok.corp.google.com ([2401:fa00:8f:203:7303:2d54:5b83:e60b]) (user=yunkec job=sendgmr) by 2002:a05:690c:d95:b0:589:a533:405b with SMTP id da21-20020a05690c0d9500b00589a533405bmr394042ywb.3.1696904558717; Mon, 09 Oct 2023 19:22:38 -0700 (PDT) Date: Tue, 10 Oct 2023 11:21:34 +0900 In-Reply-To: <20231010022136.1504015-1-yunkec@google.com> Mime-Version: 1.0 References: <20231010022136.1504015-1-yunkec@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Message-ID: <20231010022136.1504015-12-yunkec@google.com> Subject: [PATCH v13 11/11] media: uvcvideo: document UVC v1.5 ROI From: Yunke Cao To: Hans Verkuil , Laurent Pinchart , Daniel Scally Cc: Tomasz Figa , Sergey Senozhatsky , Ricardo Ribalda , linux-media@vger.kernel.org, Yunke Cao X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -12.3 (------------) X-LSpam-Report: No, score=-12.3 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_MED=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no Added documentation of V4L2_CID_UVC_REGION_OF_INTEREST_RECT and V4L2_CID_UVC_REGION_OF_INTEREST_AUTO. Reviewed-by: Ricardo Ribalda Reviewed-by: Sergey Senozhatsky Signed-off-by: Yunke Cao --- Changelog since v11: - No change. Changelog since v10: - Added Reviewed-by from Sergey. Changelog since v9: - No change. Changelog since v8: - No change. Changelog since v7: - Fix documentation for automatic exposure based on comment in v7. .../userspace-api/media/drivers/uvcvideo.rst | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/Documentation/userspace-api/media/drivers/uvcvideo.rst b/Documentation/userspace-api/media/drivers/uvcvideo.rst index aab4304e6bb5..3dc062221f8b 100644 --- a/Documentation/userspace-api/media/drivers/uvcvideo.rst +++ b/Documentation/userspace-api/media/drivers/uvcvideo.rst @@ -181,6 +181,7 @@ Argument: struct uvc_xu_control_mapping UVC_CTRL_DATA_TYPE_BOOLEAN Boolean UVC_CTRL_DATA_TYPE_ENUM Enumeration UVC_CTRL_DATA_TYPE_BITMASK Bitmask + UVC_CTRL_DATA_TYPE_RECT Rectangular area UVCIOC_CTRL_QUERY - Query a UVC XU control @@ -255,3 +256,64 @@ Argument: struct uvc_xu_control_query __u8 query Request code to send to the device __u16 size Control data size (in bytes) __u8 *data Control value + + +Driver-specific V4L2 controls +----------------------------- + +The uvcvideo driver implements the following UVC-specific controls: + +``V4L2_CID_UVC_REGION_OF_INTEREST_RECT (struct)`` + This control determines the region of interest (ROI). ROI is a + rectangular area represented by a struct :c:type:`v4l2_rect`. The + rectangle is in global sensor coordinates and pixel units. It is + independent of the field of view, not impacted by any cropping or + scaling. + + Use ``V4L2_CTRL_WHICH_MIN_VAL`` and ``V4L2_CTRL_WHICH_MAX_VAL`` to query + the range of rectangle sizes. The left/top coordinates of a minimum or + maximum rectangle are always 0. For example, a device can have a minimum + ROI rectangle of 1x1@0x0 and a maximum of 640x480@0x0. + + Setting a ROI allows the camera to optimize the capture for the region. + The value of ``V4L2_CID_REGION_OF_INTEREST_AUTO`` control determines + the detailed behavior. + + +``V4L2_CID_UVC_REGION_OF_INTEREST_AUTO (bitmask)`` + This determines which, if any, on board features should track to the + Region of Interest specified by the current value of + ``V4L2_CID_UVD__REGION_OF_INTEREST_RECT``. + + Max value is a mask indicating all supported Auto Controls. + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_EXPOSURE`` + - Setting this to true causes automatic exposure to track the region of + interest instead of the whole image. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_IRIS`` + - Setting this to true causes automatic iris to track the region of + interest instead of the whole image. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_WHITE_BALANCE`` + - Setting this to true causes automatic white balance to track the region + of interest instead of the whole image. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_FOCUS`` + - Setting this to true causes automatic focus adjustment to track the + region of interest instead of the whole image. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_FACE_DETECT`` + - Setting this to true causes automatic face detection to track the + region of interest instead of the whole image. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_DETECT_AND_TRACK`` + - Setting this to true enables automatic face detection and tracking. The + current value of ``V4L2_CID_REGION_OF_INTEREST_RECT`` may be updated by + the driver. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_IMAGE_STABILIZATION`` + - Setting this to true enables automatic image stabilization. The + current value of ``V4L2_CID_REGION_OF_INTEREST_RECT`` may be updated by + the driver. + * - ``V4L2_UVC_REGION_OF_INTEREST_AUTO_HIGHER_QUALITY`` + - Setting this to true enables automatically capture the specified region + with higher quality if possible.