This patch set implements UVC v1.5 region of interest using V4L2 control API. ROI control is consisted two uvc specific controls. 1. A rectangle control with a newly added type V4L2_CTRL_TYPE_RECT. 2. An auto control with type bitmask. V4L2_CTRL_WHICH_MIN/MAX_VAL is added to support the rectangle control. Tested on two different usb cameras using v4l2-compliance, v4l2-ctl and calling ioctls. 1/10 adds V4L2_CTRL_TYPE_RECT. 2/10, 3/10, 4/10 refactors uvc_ctrl.c. 5/10 adds support for compound controls. 6/10 implements ROI in UVC. 7/10 initializes ROI control to default value. 8/10 is a cherry-pick for Hans' implementation of V4L2_CTRL_WHICH_MIN/MAX_VAL in v4l2-core. 9/10 supports MIN/MAX in UVC. 10/10 documents the changes. Changelog since v7: - Rebased onto media-stage master. - Move the factoring logic from 5/10 to 2/10 and 3/10 (new patch in v8). - In patch 4/10, split uvc_control_mapping.size to v4l2 and data size. - Move initializing ROI control from 5/10 into its own patch 7/10. - Address some comments. Changelogs are in patches. Hans Verkuil (1): v4l2-ctrls: add support for V4L2_CTRL_WHICH_MIN/MAX_VAL Yunke Cao (9): media: v4l2_ctrl: Add V4L2_CTRL_TYPE_RECT media: uvcvideo: add uvc_ctrl_get_boundary for getting default value media: uvcvideo: introduce __uvc_ctrl_get_std() media: uvcvideo: Split uvc_control_mapping.size to v4l2 and data size media: uvcvideo: Add support for compound controls media: uvcvideo: implement UVC v1.5 ROI media: uvcvideo: initilaize ROI control to default value media: uvcvideo: support V4L2_CTRL_WHICH_MIN/MAX_VAL media: uvcvideo: document UVC v1.5 ROI .../userspace-api/media/drivers/uvcvideo.rst | 64 +- .../media/v4l/vidioc-g-ext-ctrls.rst | 13 +- .../media/v4l/vidioc-queryctrl.rst | 7 + .../media/videodev2.h.rst.exceptions | 3 + drivers/media/i2c/imx214.c | 5 +- .../media/platform/qcom/venus/venc_ctrls.c | 9 +- drivers/media/usb/uvc/uvc_ctrl.c | 676 ++++++++++++++---- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/uvc/uvc_v4l2.c | 22 +- drivers/media/usb/uvc/uvcvideo.h | 23 +- drivers/media/v4l2-core/v4l2-ctrls-api.c | 57 +- drivers/media/v4l2-core/v4l2-ctrls-core.c | 166 ++++- drivers/media/v4l2-core/v4l2-ioctl.c | 4 +- include/media/v4l2-ctrls.h | 36 +- include/uapi/linux/usb/video.h | 1 + include/uapi/linux/uvcvideo.h | 13 + include/uapi/linux/v4l2-controls.h | 9 + include/uapi/linux/videodev2.h | 4 + 18 files changed, 926 insertions(+), 188 deletions(-) -- 2.38.0.rc1.362.ged0d419d3c-goog