From patchwork Thu Oct 17 09:19:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 13839685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38EDDD21269 for ; Thu, 17 Oct 2024 09:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3M9OnD4p2ZXsp5igVRuYNX2PmQ2vcvmplBNzS4uaMBw=; b=JWk2r1sMAEkM1IbFbNQrWcPH3B wfgAvZmf4Juz5nujnXrXlaloozd4vjSpR2qSo9NBrAmIqeuIDYdZJF/JOCB9HHnPi/FQITzE5YakU ItMYN+/+EZ1LzAeZ/YAMJmmZpKEUTzoWrKmYHgvouHwzbW2FWgKaM91MjDhm06jkn5cEWi4FDeml1 EvetkzBz2ovl12ZnkvbevHojRyyNmCUwX6rzDFoTY5Dox53qD+uk9x40Ne5YY+FNMI3HfiQnQSosG iZL7eoTdHZYk89fzu7hGskNsysN9SiBdBS9vM9znKt3xqWp/mnIi6NPhix2nWDxu9gseP9TtCKhjM 7eoA9/Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1Mno-0000000ELG3-0laj; Thu, 17 Oct 2024 09:28:16 +0000 Received: from mail-am6eur05on20618.outbound.protection.outlook.com ([2a01:111:f403:2612::618] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t1Mgg-0000000EJYk-1vKO for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 09:20:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J/5kNGgEBynLkVAlshHlrHUXaiDBRMX9XnhVfp4s6yw+uCQEJ1GmLLSO3t/kn0+VPAGHImURcLHxAgz5kuLmnknv1yUuxppagulM4fS3yK4YcUuznQMCHeiAZlZRR08GvT8N6beRn3mRCGcXbNAZ/o0zMvrKXKM0YtEy31ewqs3YBrB17SJ/yCHPWAqgW8rbSDdI9kfQzhOcX2aRIpOqXDaLvKCNjzV+ZWLfV7FV81ns+Oj8eV8MzglMuk+/Mc3af7zSpPvYV+hvRmG7GFBsBrO6X58fg/YiwrM59/dLTlpWtH1vr+4keOVhduhm0F0Ejve1ZLRoAkC+dkwHRBkIlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3M9OnD4p2ZXsp5igVRuYNX2PmQ2vcvmplBNzS4uaMBw=; b=nXvIhik7A+juNad7CodL9zpQuQ6UzHLBqQQcCrluIrTrbWNyMq8RJ6fYRl6MMForbftbGKFj/ItJBA0Y+isQ55zlPp85BiPgVCEl4l19kCPVtA8ERGmLIA1yYRFyQ3Nk8+zxVjeT2kEzYOEb+b3w87Ba8inPfUY68ptJzVIAf2x86faU4HcgLO5PYdzkyvDYUWHvMW0Tl7xMXSWsyB7r61dsYGBZ0C3NAGeieXxNhF1jUIGTEPQ8eYXycz4RS6OJhlnLh6A1ystg+lEitG1xJ3dJ0CFtpkA2Dh4gZtI53bycIVW5NaK5r/9IhLGe4R9ia22wkd8gBtYh/GtP8+VJ0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3M9OnD4p2ZXsp5igVRuYNX2PmQ2vcvmplBNzS4uaMBw=; b=JHRrSPobddqrTEUde2YoRG+CM8MOizvS23qGc05ju57HUjcF8J/PMp76cOax+n5rCHTCag7/CCOBPvlabpN4VsGWaOtKzcLp1fzdBiMGg/ulH2FzEVx4aWVv0rxxkrlCruH4Of50/dasl9emVxqWf5bZs0P3+Uiax2xytts6XEgyWdG8/3kvpq8Pu4nRC/hSvnZcC0br1DZl1W4hhBJ81MmDyi2HL07HFunbb/Zx+whKoArdZVsKyXDX2Ujys/oqYvpLbPaiw/m7BRxsyaj7/cya++NLCq1dxfIIc0YmfcIljSsWByYNLLbPcNAJVngrvKxBHxceaoMBJc1r0b2RDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by AS8PR04MB9061.eurprd04.prod.outlook.com (2603:10a6:20b:444::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Thu, 17 Oct 2024 09:20:44 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%6]) with mapi id 15.20.8069.016; Thu, 17 Oct 2024 09:20:44 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: yunkec@google.com, nicolas@ndufresne.ca, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@oss.nxp.com, imx@lists.linux.dev, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC 4/6] media: v4l2-ctrls: Add V4L2_CTRL_TYPE_REGION Date: Thu, 17 Oct 2024 18:19:49 +0900 Message-ID: <20241017091951.2160314-5-ming.qian@nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241017091951.2160314-1-ming.qian@nxp.com> References: <20241017091951.2160314-1-ming.qian@nxp.com> X-ClientProxiedBy: SG2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:4:188::19) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|AS8PR04MB9061:EE_ X-MS-Office365-Filtering-Correlation-Id: 4acd3eb8-8114-4458-e9eb-08dcee8cfa3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: /5SdIVau/c2W9oZ/uCjB7l5nMUa13mMF55usJPYPXysXa8OlT6uqKrES22QKxAPWZjj3fpSucfDMNOX/VJAuWG+qFZCx5m6y5f2XCm3r/Xh2X/L0ma7KlaWBfunF7HuMKRamsKOi4265ycRycvx7lSgNMsAi2GO+sm5gwQ8RqhEhoH4g58FyZ3kOmvsFVk4CF25cd5/2FaZSq6t9FuTso0WFt/1G3KFZYM1bORKpBw5CsnueX08AfvfzbtWQZq3cZm+Q4E4n1dz1BQ0SyIIiVuCeKJxawPQ8FleBF2YnXF3uni3jhH3BmBkvcv/OTTkwSYuiZxUcqVl8WZiMi6oHOXHiO9uLxrn0vt8edIo9gLZYQg96c0N5qlEO/ZEkzHm7Gp0gqdjSnhdTyh2r0Op1oifrwNfjXywxKFwl7zQhhpF1NwEw1ye81tC7GbmIHlgw5TrvhETVSGRNjG+xZM0pfnRP2lugoUaoVJ5llCt4N8jFyHiGlO1gq2cnC23/gadqRzJr2dDvKgc5BctlLIXjinunopsaCFuCxpHzIEJHSfplapkgsUVPBX1O/MsRFEu9InHDYQaaW05EcctLeZHIA0cQJfSFlFSPoXeNk4EA9FnfNmuBAoFkoL8oXIp6LiZHlSguCr8tnPsJGugjvdXJoP1sIAg0vK8xMMcJRTaW9zF4P/HViviq4Y7IYMbOg9lvgbeqZgTguiuTJ5f7q5+HNP9VNrsHI5eg0Q9oWeOlaLWqIRgmEGmDa5wxuhMAzCV8cxTEpS6YvU/z0V5+m/+N9xyOJYP9QosO3aXN5MRnH96R5iKjFKBIcNeL+lHtGF2skg4ZmDdalnuosnMRCAKsxCjG5/vlI8EwYX7FB6PuzxYI96m+2YAL3oc/3WoK1aaYxKHmEYflyLT+fCwOQ6LkxyGEG55mtTZl+DR4acobcvBTMXF+bogysl94uhKJRq7dI9I3EhdgOYKwVaFEannyJ/Y2Clhz811RIXGRKvy/8weDkTaDgta9Vrz2yRGZve5iE6KBAfjGXPQ/gBXw7t9W0aQu/p4NxPZgO2BTAZG0R+ccvlerYrcqWZItTYeC+h64I8SXLIpMuea7CiQnpx9AxD+sSBOY/8EzlcnxZZq70KUEmMghkvNxA4sWw4/T+qlSvFpfpSaVviCqmBAeaUt3UKjdLd668KdPWpdIGQH4lzAZNH+iUbOO/uJASADTeWoaHppZ5FNtaI3zVx0U1A5laC3sxsh1J+8jurQh0tczSSKA3EM+RFb19y7kfdP44O2zE7pTwMgso//FKAMmnSrswdB/Tfp+fJw4uqmAxNaalOGhkKD2Ap+9i28ERVYH7UGUlWcOxFhSwdCZZEAC14ss+hBM1SwyMb7YnTIfTVUFzBw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8254.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n4CJh+MGEvGa+Gvqtw/u21fJAUgknpEQ7dW8A4Lb9xHmUWZ51GSudzcC8o7JQsIeavrImC/BIpfTE7WT5TiOwh42X4lBpjTikmY6OEeRq2v1da1uQbyxuy5p8E1OaVfKslgVY4jcwWt4iQUs7gRgWEhjdb2rXUyDISDpI8WJUnVNY+icPlvkqJnfl5wNqPIbQz7Jye6xtu7NTJcixM0PmkGHUpyYb2H8ul6JOUtljbtMjj9cKRjJDkWqPHWgq1qv2pTEHXqrL7+ed7mc3A46K0v5Zi1r1/INvUrUaMycmoVMWzjiu8a7k8BY3xM5wq55EYt1AJA4WZK8INdwFTAb/FzodFgD9kzcsAuDEvdXLChZolB2DuILwuSq3Fb8/eddPft44Q3q6SXlqayNUrDu681Dc0yepd3EhkTXs9Xal7jLI1hQrOxTR1X42ljT71t8FGVOxzh9ZZ6Vywews0mJ1Ysj+QAH1akrt34YmS40bmESPfqbOOzcmdILBr/00GIrEtq6sjfiCfwPbdd9iJIdoVcHnQALL4PBqivMs+OADwucXaYIdWdicc0vK6FKL1Xmn2+MIUO/a6NY5veQLVV4IuqjKXcnkM9HK+26gxc9YPoNGKmS1BdUs+tBe5MGqBZMRLss1qZZU6QYbdnfUZrVJ9zJak16Ncr5hrbYPewljYwKD1C0OXGKJlKP01FKcGH2GZdYNmT8A+m2p3zOBBMD2wH95hlwZe8jswFz3qtE9hy3Na6A9tpeS+fXkmFeMsBHvHEuombV61fO8WgESiIDmNeoz/rWs0zNSgmOK2EKB7ByhTLq3rbzljV6ARH+k+SR3a/WJuDRig5rXfgaNlKHPC7q3ADfuR6owWXz05mCiWWZSmlpJsgeO2qOCsIlm/vaY/p9Pvu6KXp5PH0gH2r6NlaTYKSODg+GHGXEoEnSiyj+0Ecd7Rx4mNHJLTKmHezCa19if4HCOkGC5WOZVqRQRQyxVWjMIM9IDAzcU3d/SlMedGzr4j0qQs+pMQ30QpQIHmP4+tVFFEEU5H7a9csBn/Yd6AD8aBaNFvWGSOdrK6H3Ybk2lGJsFdzXg1STHuDJVPVGYTEquTLarZr9kRAkFFCAHR0pJDuMAUpPYC2DWxZlCorM+3S5N5p873VK0fnctnj9EOsi8bAfZO2/bjGG2dgG8jmSrvhLsfiW1vOOO/OsRzweHQ+E1j/xwROMt8XoB5hgtQ8TnV9TyyjofV4tSw4h11dZW5dRPYQyaqs0Vmq7LIDF6xF+JzF6TI+wfwQV4DRG3VWR99oCEehOwqMwMf+gw4oo9LsmnUoKTLO9ucebevmG8D80OFpjV0VkM+vMKOukdngaIod6k1T9sEHuexOfSSQHwn3b0YC2tLjOuMGYpL0jWZVQ/XMxDWnGv01OKrBoLSfQU8GcBit1mNLdj7UIHgAsMEoNijEZ/ySErcooJLrmvNULNyhghS86KXrG1XBVzsJKnuXgjgn9aFwB/G3ibYJ1hrgA3EgdLavibso4vz9fMTRQLdUApkJzmUn6IjkZiUH9+xSkjgMKktQ0hIS3rAQsymYqkU8CNZ59U6T6qwBqjrLkTfsa9y62zowH X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4acd3eb8-8114-4458-e9eb-08dcee8cfa3c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2024 09:20:44.2921 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o0n92O3FYS7HLp8EpNr8AuK+h+VQfDPVoVzic/UzyBQ+x73icM5LPl3pXUXNWu9j39xEoOtdEiUJ/a/vJcaPQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9061 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_022054_537824_AE98D994 X-CRM114-Status: GOOD ( 18.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add p_region to struct v4l2_ext_control with basic support in v4l2-ctrls. Signed-off-by: Ming Qian Signed-off-by: TaoJiang --- .../userspace-api/media/v4l/vidioc-g-ext-ctrls.rst | 4 ++++ .../userspace-api/media/v4l/vidioc-queryctrl.rst | 12 ++++++++++++ .../userspace-api/media/videodev2.h.rst.exceptions | 1 + drivers/media/v4l2-core/v4l2-ctrls-core.c | 14 +++++++++++++- include/media/v4l2-ctrls.h | 2 ++ include/uapi/linux/videodev2.h | 8 ++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst index b8698b85bd80..f00c6d1f7784 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst @@ -203,6 +203,10 @@ still cause this situation. - ``p_rect`` - A pointer to a struct :c:type:`v4l2_rect`. Valid if this control is of type ``V4L2_CTRL_TYPE_RECT``. + * - struct :c:type:`v4l2_ctrl_video_region_param` * + - ``p_region`` + - A pointer to a struct :c:type:`v4l2_ctrl_video_region_param`. Valid if + this control is of type ``V4L2_CTRL_TYPE_REGION``. * - struct :c:type:`v4l2_ctrl_h264_sps` * - ``p_h264_sps`` - A pointer to a struct :c:type:`v4l2_ctrl_h264_sps`. Valid if this control is diff --git a/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst b/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst index 3815732f6a9b..df3cd36b67ab 100644 --- a/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst +++ b/Documentation/userspace-api/media/v4l/vidioc-queryctrl.rst @@ -451,6 +451,18 @@ See also the examples in :ref:`control`. ``V4L2_CTRL_WHICH_MAX_VAL`` is optional and depends on the ``V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX`` flag. See the documentation of the specific control on how to interpret the minimum and maximum values. + * - ``V4L2_CTRL_TYPE_REGION`` + - n/a + - n/a + - n/a + - A struct :c:type:`v4l2_ctrl_video_region_param`, containing a rectangle + described by the position of its top-left corner, the width and the height. + And a parameter for detailed purpose, for example, it's QP offset for video + encoder ROI. Units depend on the use case. Support for + ``V4L2_CTRL_WHICH_MIN_VAL`` and ``V4L2_CTRL_WHICH_MAX_VAL`` is optional and + depends on the ``V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX`` flag. See the + documentation of the specific control on how to interpret the minimum and + maximum values. * - ``V4L2_CTRL_TYPE_H264_SPS`` - n/a - n/a diff --git a/Documentation/userspace-api/media/videodev2.h.rst.exceptions b/Documentation/userspace-api/media/videodev2.h.rst.exceptions index 35d3456cc812..22307e029883 100644 --- a/Documentation/userspace-api/media/videodev2.h.rst.exceptions +++ b/Documentation/userspace-api/media/videodev2.h.rst.exceptions @@ -151,6 +151,7 @@ replace symbol V4L2_CTRL_TYPE_HEVC_PPS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_AREA :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_RECT :c:type:`v4l2_ctrl_type` +replace symbol V4L2_CTRL_TYPE_REGION :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_FWHT_PARAMS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_VP8_FRAME :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR :c:type:`v4l2_ctrl_type` diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c index 9642a1f242e3..8235e681acb1 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-core.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c @@ -441,6 +441,11 @@ void v4l2_ctrl_type_op_log(const struct v4l2_ctrl *ctrl) ptr.p_rect->width, ptr.p_rect->height, ptr.p_rect->left, ptr.p_rect->top); break; + case V4L2_CTRL_TYPE_REGION: + pr_cont("%ux%u@%dx%d, %d", + ptr.p_rect->width, ptr.p_rect->height, + ptr.p_rect->left, ptr.p_rect->top, ptr.p_region->parameter); + break; default: pr_cont("unknown type %d", ctrl->type); break; @@ -886,6 +891,7 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx, struct v4l2_ctrl_hevc_decode_params *p_hevc_decode_params; struct v4l2_area *area; struct v4l2_rect *rect; + struct v4l2_ctrl_video_region_param *p_region; void *p = ptr.p + idx * ctrl->elem_size; unsigned int i; @@ -1248,7 +1254,10 @@ static int std_validate_compound(const struct v4l2_ctrl *ctrl, u32 idx, if (!rect->width || !rect->height) return -EINVAL; break; - + case V4L2_CTRL_TYPE_REGION: + p_region = p; + zero_reserved(*p_region); + break; default: return -EINVAL; } @@ -1957,6 +1966,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl, case V4L2_CTRL_TYPE_RECT: elem_size = sizeof(struct v4l2_rect); break; + case V4L2_CTRL_TYPE_REGION: + elem_size = sizeof(struct v4l2_ctrl_video_region_param); + break; default: if (type < V4L2_CTRL_COMPOUND_TYPES) elem_size = sizeof(s32); diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 9ed7be1e696f..299451b33e7f 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -57,6 +57,7 @@ struct video_device; * @p_av1_frame: Pointer to an AV1 frame structure. * @p_av1_film_grain: Pointer to an AV1 film grain structure. * @p_rect: Pointer to a rectangle. + * @p_region: Pointer to a video region * @p: Pointer to a compound value. * @p_const: Pointer to a constant compound value. */ @@ -91,6 +92,7 @@ union v4l2_ctrl_ptr { struct v4l2_ctrl_av1_frame *p_av1_frame; struct v4l2_ctrl_av1_film_grain *p_av1_film_grain; struct v4l2_rect *p_rect; + struct v4l2_ctrl_video_region_param *p_region; void *p; const void *p_const; }; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 4007041302d3..503cbb884734 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -448,6 +448,12 @@ struct v4l2_area { __u32 height; }; +struct v4l2_ctrl_video_region_param { + struct v4l2_rect rect; + __s32 parameter; + __u32 reserved[2]; +}; + /** * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP * @@ -1858,6 +1864,7 @@ struct v4l2_ext_control { __s64 __user *p_s64; struct v4l2_area __user *p_area; struct v4l2_rect __user *p_rect; + struct v4l2_ctrl_video_region_param __user *p_region; struct v4l2_ctrl_h264_sps __user *p_h264_sps; struct v4l2_ctrl_h264_pps __user *p_h264_pps; struct v4l2_ctrl_h264_scaling_matrix __user *p_h264_scaling_matrix; @@ -1931,6 +1938,7 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_U32 = 0x0102, V4L2_CTRL_TYPE_AREA = 0x0106, V4L2_CTRL_TYPE_RECT = 0x0107, + V4L2_CTRL_TYPE_REGION = 0x0108, V4L2_CTRL_TYPE_HDR10_CLL_INFO = 0x0110, V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY = 0x0111,