From patchwork Wed Nov 6 06:15:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ming Qian(OSS)" X-Patchwork-Id: 13863925 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013041.outbound.protection.outlook.com [52.101.67.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB013191494 for ; Wed, 6 Nov 2024 06:16:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873815; cv=fail; b=U1Ggv+Q8pW6DYTC/G6XZSPf4tlndTDV/DMELnjXsAbETzbkGfVBFtbwttSssbrUFufryzZ1Z+ZrELe3BFfsmYJQUyQu+xX82oFLJiixsf7QLv7QSsMmOCMe/TWwUm05jwKPKriu4UrIAi/VWu3x6g8B+XVpohsxQGEL5HfzAjAU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873815; c=relaxed/simple; bh=ivRJYMbM84wlwp6uoS2CN9T6O0uhk/AnaPNw28E4t3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=jp+U592CuZcDWggm5w4ETjVVedSUOO/nz3anUHWMcipnN22Ferd31qvylZ0i2vaF39ay6wU3DUfkMAb/BETGO9FrAhgvzQNLiVmtzSaDX+pfBiVNOmE6eDWZpQ6XJEOzF4/xjIFop+LNcUsg0oF4fFGCRONQPo80mCaS81ec0WQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=FPYH1rW9; arc=fail smtp.client-ip=52.101.67.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="FPYH1rW9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UW3bmIrXGfdjmktQdBlbLgdH/dte5XnDf1pHBHg5F7XzYLiODFTDog4x7BkFpxVUJYJpz/1slUncMKYkacYinfBoD7+ymTAH+zDeJq0vzpXuJNJkoqC/3Yny2Af1MR1IhfRaJnLet31cSGmNOGejxD/OCgQQNR7sqp5WrQ93Lre399ABsIQcQjVviEP3H8D133K6rw8Ad//C1tayXaWNTXT8MNRfjnBpsUy2qIfgLT691rAgivk/3jnqKDEjrX/M+GIdUK0ycxG2oFYVc8QaAsd0+H7hFQEyl9DMVxQrRmnlsxlgp9ChthekQHKbqrHktGTqxOIMsOdvTS+Ez66tdA== 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=iffvyjG6tA622hD79Q1t/g9sqjsxD4ekfSLnY/n5LZs=; b=GEFDZEsKRW63ZOsOedHzy9xggHrE6nOmcji/DyCFxJdry7wYouTtg55u851ZEDpizxmx1E3LRy+y13+1XmtETse6UuV2ywRJlC+crask2Ic1B3nCKxoPqfw0JIYwfgtcgROYoaXR+tZa++GoClxgFyNGl31P0P7Vta8BGQ3AR7XIfRrd+wfJF18X21YGTo/IsFJd0OAA99lGklZZQH87xnlqIOoOqg+bYQtYkejKuLFYbOvRYkccToRePgK83RoaYevRFH9ySN4PIyvbuDGBg6mX6Jt2H8Ufj97BSFBlyulAqGbKp52CSLzrwwMFE/O2kHB6ac2oRs5PsERro2rQ9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iffvyjG6tA622hD79Q1t/g9sqjsxD4ekfSLnY/n5LZs=; b=FPYH1rW9uenyO2Jib5Vwk0arkLA/pSu/5KOil6U1CoR38YwDCTeUm6OE5gOy4aUp8T+q7miTCcaKTHYORngzZoFjhlRjYxTEgcXIdmFt8Q5+etcLBy50ADt1PHOQJwv3F74mqsQ/BcbPUvzbUDco2kcSB2IM+tV6rNAdrn713Pu5earA93g2j1FQKLS0Kz1vhzXEerp7cOLrRzMpuyeKsOGC3SdHIoI/EOcD05iC07LSe1tNRZprOt3m57ZP2TSFGmhZNnaArgFc/L/R9+R7D3+2C3dO93n9IZccW03Viegntdq013F05gZIyo1NMLEABu+dDOoK0CRZimXTAP1oJQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by DU4PR04MB10599.eurprd04.prod.outlook.com (2603:10a6:10:593::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Wed, 6 Nov 2024 06:16:52 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%3]) with mapi id 15.20.8114.031; Wed, 6 Nov 2024 06:16:52 +0000 From: ming.qian@oss.nxp.com To: linux-media@vger.Kernel.org, hverkuil-cisco@xs4all.nl Cc: laurent.pinchart@ideasonboard.com, tfiga@chromium.org, ribalda@chromium.org, yunkec@google.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@nxp.com Subject: [PATCH v3 1/4] v4l-utils: Define V4L2_CTRL_TYPE_RECT Date: Wed, 6 Nov 2024 15:15:34 +0900 Message-ID: <20241106061537.211002-2-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241106061537.211002-1-ming.qian@oss.nxp.com> References: <20241106061537.211002-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0250.apcprd06.prod.outlook.com (2603:1096:4:ac::34) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|DU4PR04MB10599:EE_ X-MS-Office365-Filtering-Correlation-Id: 5938c872-2f7c-4eb4-67cd-08dcfe2a9acf X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: saKfomrXTRbNmXzyHT+n+ljs3s4sNBZ9Im4CeMuV0AZnuuwGA4nU2zPv+aLiICsB0FMiG3DfpycCOkfMePyZSqmg4eK2JrIWl8kiS+SLBeLECmP5en0t3r0No9dw1oDfgrqzgzQwPJsS/BiqwDkelRFQnBqvVmUQRE8h4VNk0/gGXpaZv0/E4jtSX38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ea7qxuCqp8u7fLcOJh3ffnNBeHYvPazOa+anWGIXYRHgmRZTM/hP7W3eSC4wqChc97nz5eTXQGII2lxeKO3S7cTvVriZax9qpn2hCKQ6ylVA2GlfmQjA= 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r9Wp+4v885TFCj4iCupHpJLO076163K5M30X4Kt9cYbKGoASSLJRd3ar3I45WkqM/2ENKljUnG078bJgGC6avIpbswgAFrU2dVncYKTdDKZZMY2DkQvTz2bNtNe1ybqsPR5KzxLY6k36kil2os8jr4lC2DeJsN753UgR68lypGuMx0GR+jfFrJmMPyG4X2r7OqiWplZGXgfDfQlOyBUa9p54ql81DzD8btdtxdl8asZ5vhIt1ijL8AzkXC+KBQtW7S3fIhAPqow2wKE8QLVd6QeTfh+8SPcbHwUQX9+hkITU/RDezwsRYH2EP3ry6SJAjhGxOuVlrQuAHO53nqukM45+h/zINRsI8iuSKmqzPQ7NRf3Fhg9RsVXWxqG67TJf0CzVBLPLW9DTs2QmjxvyX75UIhg5BHmDmFl2LlG1WeR6njKnh0ZeU3s2XcVfvcEgimsgSh4rp4cogsadLkL+6KREMPhDGet/UPXJkKg6NpY9bUnN0Ko1K/B2yOcsHXJRB13qus9WmhgO+XvJPLgwbAWJ3rhm6CETZu5YUKO5XPTWehYxlZHwieJhwO6gczH7DCg7eaj0KPU/pcUj6U3swUreSyQzpOJAkZ/yUbO+tfXz9WRbHVzOAN3s7fmjpjNvBEIIa5Bihg+/vV9jlynoEollshl0wkWBt9cPunTZhZcGf1ZysoxTl3kWwOUYlgkMtYbjtErXw9CD0OTPqJG95GWlms0So46C7dUZarr70wMReHUKVjwxmojKeT4nh0pLfXKC6PNqk2X7msbOE+Nqtee4iB/UagF0+sk2YSlpRXSO1rArXUiip2i+4DM+vKs1VC2ozpymx1yqfva7tgPqJOspx1oLDkwUBltaYdZk/eODp9D9s2WbSfMpAmw/oUO3Uc8olc6jgyVOgP3CcKpq3GjdbgH+DISFFORlczv9A5j6rk07KD3wC8rskSctIYdKxCosq6VXumU46MyjpLzjjcKZ1i+3aXwnU8mjnWpC3PcyGflsa7KwzMvokJpl941ZvyQ4pplQCKsYn4jGyie5eHGc/vAf+BwwnA4NOw4GLqK+BziBG2eImsmSkDMu8nplYfLaOPBUIj2BKxGjCApdlcIVv38zndxqB2AfucZXqbsdQ8QIdctIsCkce5AG/vARY6aPtLX7D525b7mxNtGYit3tXbvXyujikrS93XQr9DMfMpSe7XMIoTA1wDt99AhJuSwz9o193sNuUu6zS/VXztwpowVPQfJUUB594bFrGrgDIBM27KdQcFkNHh7mSSd6LY2HP1nD2Lal+zB2ohkoOoEyhkCEb1NP7z066dN0h8+jBX5mWXk0w+OErLyZlspFmA5R7bI0xMgbeHtSTSGQW6l6pIN/nLMFGjf03Wg0mO4KhmjZMY/GpXaPH9Kd3IhWK7gCYFid72bMmq95Nhch/LKLs7Q8bsyOfnhfoWdhu7QO/mKxU+w2FnxOmCmhi2AuhMlVQxTlSmgcakQYmnEZl7N6E5fMb681phRpSpR4ZRUqnidjfpTBvR7kXBprGgaPZlQvsqVN5Ok1/vXdC6BhkKd9MapglURI9Oml8YMCa4Hi/0693eeqcfrQdSQ/ok7f X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5938c872-2f7c-4eb4-67cd-08dcfe2a9acf X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 06:16:52.1986 (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: CYZTPsSmOZ7wHWvyBMc9jX9FRuYiiNfNwP/VJhLfb0GkNjZjazbZ44gy6I9iSZf9WsQBTrd7ybwpWgvx/GypZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10599 From: Ming Qian Define V4L2_CTRL_TYPE_RECT and V4L2_CTRL_WHICH_MIN/MAX_VAL in videodev2.h This is a temporary patch Signed-off-by: Ming Qian --- include/linux/videodev2.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 23db72afdf60..6aae7e10e90c 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1816,6 +1816,7 @@ struct v4l2_ext_control { struct v4l2_ctrl_av1_film_grain *p_av1_film_grain; struct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info; struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display; + struct v4l2_rect *p_rect; void *ptr; } __attribute__ ((packed)); } __attribute__ ((packed)); @@ -1840,6 +1841,8 @@ struct v4l2_ext_controls { #define V4L2_CTRL_WHICH_CUR_VAL 0 #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 #define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000 +#define V4L2_CTRL_WHICH_MIN_VAL 0x0f020000 +#define V4L2_CTRL_WHICH_MAX_VAL 0x0f030000 enum v4l2_ctrl_type { V4L2_CTRL_TYPE_INTEGER = 1, @@ -1858,6 +1861,7 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_U16 = 0x0101, V4L2_CTRL_TYPE_U32 = 0x0102, V4L2_CTRL_TYPE_AREA = 0x0106, + V4L2_CTRL_TYPE_RECT = 0x0107, V4L2_CTRL_TYPE_HDR10_CLL_INFO = 0x0110, V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY = 0x0111, @@ -1946,6 +1950,7 @@ struct v4l2_querymenu { #define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200 #define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400 #define V4L2_CTRL_FLAG_DYNAMIC_ARRAY 0x0800 +#define V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX 0x1000 /* Query flags, to be ORed with the control ID */ #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 From patchwork Wed Nov 6 06:15:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ming Qian(OSS)" X-Patchwork-Id: 13863926 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011051.outbound.protection.outlook.com [52.101.70.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D59301917E4 for ; Wed, 6 Nov 2024 06:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873820; cv=fail; b=jGjCADmoVLLNGFgwvoBuOCmENqlHKAog5SStK1BS3hD5MjvxqcLwnyp9t6C53oY59PbryD/qL0ejClp365fPFe3cPWerZx4O8814LU3/WL66kBpWPtDtDjvU5Rxx5ZEZvPRuZuZSaKuk4Wey3uj1v2+0cHoOScRPr1AJU9QpIKU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873820; c=relaxed/simple; bh=zHT1KvSiEmLHYc/Wd33yX0TQmlGKLDhSU5F/fGC4A/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lsGgRAcasubQWTi0/FRnlk8z8t7VLVWfs8TLOsq+zHB05AFI9KZpm477ggVq7dD4jVoWER0UE+p2xssxtFzTEcq3VYRsKkslfmRo1hlkechLAUgqOUIx67kJqzG3SGawygPdCQUydOi8Q6StdTeb4B5LBaht3vXfMIYUirVq8kI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=AYOv3/Im; arc=fail smtp.client-ip=52.101.70.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="AYOv3/Im" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KEf4f5Q9W2Na8HF6O0RtdKHvCPtQ/BAPU9AHRlhsesm2UgF+EjpIDhUu6wOQxgd85gwaDSeZLcCdKI7A2ixCsenUn3eLWKmDL4+7CDW3LG1b2akg1x2A+2QvasGoIFE+Tr6YJv6ETLiIERnPlBAYyi+C7LcwIiPfH6z4hP5jiqM7pE4pSCYjpu2lsjLR2yNYCt/izgGu0JQbojS71a0FHPk9mplHcDiJpQyBZ7NESr1QN27YC+GCBpyFDf/lDDAngCMQH17JPSpsIkhda7KwCxDa2qRNObsLl2ZQ8w9rovWlEstI2R7sXfjm2z7PTdybCHnw5UMq56YRG4HYjo+0vg== 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=IO2tA97/KHJN4S3MFOlZ0I7sh5dZYw7DkTz5OCKsfw8=; b=CLWDhu/P3BilTddQ1jWmT5oEkJWQ39lnSwmfk60vP/NFiKRO1aoP84H+wtd5EAVB0e569Ykrax35xbtf066qxJmBAEVHMASMXeeGl5ssgLnQRORQgIGa43EvV6UIgycj7YsCDwwm/mtBFLbWRvpBJtGo9XCjOqf3S4mUuw42LIb2rSOLZMI7ZUFWM207jxEiC6ZVS1k/mKQC70OerYnzm70+NPX1oOaUkXxre6kSbKgHqohDpWJW06HIWwYTTc/xnHWZnb74NcQGBEoXs4SIHbGvRFEZBk+tLSgfJnU57/Hldrwthf0rx/xiuPmD9GyoBSa2de4wTrwJpt2m2JoO2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IO2tA97/KHJN4S3MFOlZ0I7sh5dZYw7DkTz5OCKsfw8=; b=AYOv3/ImYxLwB0wZaMJo4DCWk/ruB+TV5yyAv8EHlFFbmzgvgm3qbaPRjDcx6MvBd7gvFjoAkK9chLS+x6AESRiCLFM3zQyEon93XFlhchf39dZXl7RPZkjuL8E/GLkcce3LjkB2+2PRc4mdc/3UPfg5bIhmBL6T22tJ6ht3h1y6Mzsr2XQHZupx7wcUacQr7fmxxuOJrZKWEeuu/iFCDNHZ589EJRW4DCOesyYiI/dGWhHhzD/cI2Im+1S6wvvvn/fyk4/jLWLZNSxoGSeoGAGcVVcQSWvi4wq7vsCGOBNcei/uNEfir86t4tgNptCahTWGtspVJe8RbusWW6I3Lw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by DU4PR04MB10599.eurprd04.prod.outlook.com (2603:10a6:10:593::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Wed, 6 Nov 2024 06:16:55 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%3]) with mapi id 15.20.8114.031; Wed, 6 Nov 2024 06:16:55 +0000 From: ming.qian@oss.nxp.com To: linux-media@vger.Kernel.org, hverkuil-cisco@xs4all.nl Cc: laurent.pinchart@ideasonboard.com, tfiga@chromium.org, ribalda@chromium.org, yunkec@google.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@nxp.com Subject: [PATCH v3 2/4] v4l-utils: Ignore comma in bracket when getting subopt Date: Wed, 6 Nov 2024 15:15:35 +0900 Message-ID: <20241106061537.211002-3-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241106061537.211002-1-ming.qian@oss.nxp.com> References: <20241106061537.211002-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0250.apcprd06.prod.outlook.com (2603:1096:4:ac::34) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|DU4PR04MB10599:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bb5006c-df7e-4ffb-f9c0-08dcfe2a9cd9 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: a6Wk5Sn5KW3iD1TDG0PbhynTHFidsnqtSpBpp31eYMTRz9VpBACIweHbWwYQyEIPMFhg2AE1w4ej51OMivRl2wH3/d69FinbG3MFKB8vpLStHmOiJ2fag4WPthr+T7fNtSdTc+oGmYbAkXWFkVBzqBOPx/vArIA1qoLtDW+a7Ijv6anMGAmF/z5nqDYPLbf8o1cd1YafgmCtrf1w3ibA/s32BnjGg5Kn55psp0W1yIAykkiHwLDVO4tgcDD4YyJoO3Z8kMF8lcVcU2GBP8wzFPSc3MlNIS2WTCNPCJRaYK4DZBv+L81YO+c6k6sL78AZsY5Qwqwqn0xgzadxHetIC6zE91GHe5C4NjXkhNRN9+oVjJUv1ET46sII2jUyWtsvEiltjsT4VcSLfEx7vnuKiVMuiuIgGu/1ds1EO6lb7FEvve8e7TEVTKTOUzJl62apTPERiqhigRtqOjsE3r7XXytIGF4OzFoSY0MVIT7FEfHNniTG/GmkD7GlpUmQTAInAN4Q2+3a9C38Gxw4Aw9gmYIBjaa2ZfZ9dSot1lNsm3Vlv+2rNDtn3YxAWeXTcxUztIh5M/pM0xgthjNdMBNGm/bKX9fhJjVGlMkFnxhFR39I2MIPNfqbPEh1HdoB8Gbja0uQJIbSqJ8JccCWAKZb16ZdPdBE1qJhrJ7cpUhLCblQkMT9wMbElqLbFhd9Y+c/3kYxAnUTAyxeW6p47xkqAfK4eNPZBARPE0lfL/GyPDC1mkuoQsTHbs0H5DagxlSTp7jRX3M5IO7GxoB0xC5kAo4JouVPvoJ48HdpEfI3W8LADz0PPzdd/c/FqEtBokkXMHK+9mORWwgIYRJiLPcrufqupxPwMkztRitfcPfMjmaOnciJqe17DS44txMDlSYRcC1WgHj0GCinqMCMOqQGHcPjt+Eekkx/5JdFqaRCIaOKAc4B9y/Pb1I0K7c1x8GmkgCzt4ofWKKk7iIsVQSLZ79A9llka66yptN9l361Pg6n6oKOyDdj6tHCLTnG8q/7CKnjfO+ZMocFfdIUIh77BWPINkMx/00GUIXn6gPBEfW24v4JQA69s4Ft7lhs31AT0yOFA7kVcWFKvB8Zr2j5hGYjl3k+0wsHcQpBYZLrBYnO+RUakwRs2BMrFgg6hFmUpoAKWKYgGC9jsqnBXMgExyhhEmAENchGivKBfRC6HJpWZrmxFgQYdVTrebRun4kZwGJDsS/pMGNlwo3soc15mc12BGgeF2BuKo9W6ShqCIZeiq8Dctu56uJDZUy23pcZezDFvXG/Le81BdNYUpQ1o6XhnF49gIH8fL5sMHzB4WbztRkTp7IetWrOuj9UqTAlXUrQIjPyBfdK6YtC4ZK3ftVznPCQ2Qdhpub0/wmwlSw= 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 23szk9yywh55VSYvNYXuFYYgoZesZ3xXHu9tJebgkwVZhr9Zs1yxPm5IJT/dC+CdvOoSqbLMdPqlq1IlNoUagkc2j9yvzzddHrbjG7ZWV+t9IZsJb7hjUAuXDYX9oAekRrJfYuaMyfgzxh3d9r4RbsSl/ZH4YesElBZhgzk4Oau83k9dJGC0T3yfU3SLQYMUTA1XF0raeXhLkEtC9TS5r3o+cyZEWzCqstuMkVPd4L7EsXVAVDog+0LyrMxJhpAodRYXr2G+oLT/xqOE8g7Y3Lg8AkEj9lkyKxOjWehwqCf+z9X+NiXGvbYa/hWBsbRxogDbYo26nUroWBlpyaGaFfF9rkw5tpLwFOnS25nDh0pVlrVLykrMPfT+WQOLk8znLCUFMfz3/f/tpElbNc3gUtT9iOn5pp6zWAn5Sz3eeJSToqHp7LOuVU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rmfUW1ZV0M3AXBYvHvSYgGfjWGQ02G1E7URQ5w5TjZFLwbAp2emQ16G48nCNufDJPXRWztzbPVLfJKMy6YC96A8QcM X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bb5006c-df7e-4ffb-f9c0-08dcfe2a9cd9 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 06:16:55.6441 (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: GAYdglkqXgZt5wAtupipQSprplxLSZ25pWlnoz6yNJYE6EKQZQwzimZLMptPvzizSi5I+b0BzrlUqS1BAcS28Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10599 From: Ming Qian v4l_getsubopt() ignore comma in bracket, then we can set rect value in the format of (x,y)/WxH. Add macro GETSUBOPT_IGNORE_COMMA_IN_BRACKET to enable or disable this feature. Signed-off-by: Ming Qian --- include/v4l-getsubopt.h | 35 +++++++++++++++++++++++++++++++---- meson.build | 1 + 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/include/v4l-getsubopt.h b/include/v4l-getsubopt.h index 60e7b9767ab8..4c9cf509fc0f 100644 --- a/include/v4l-getsubopt.h +++ b/include/v4l-getsubopt.h @@ -7,12 +7,41 @@ * So add support for it here, if needed. */ -#if defined(__GLIBC__) +#if defined(__GLIBC__) && !defined(GETSUBOPT_IGNORE_COMMA_IN_BRACKET) #define v4l_getsubopt getsubopt #else +#include +#include + +#if defined (GETSUBOPT_IGNORE_COMMA_IN_BRACKET) +/* + * Find the first occurrence of C in S or the final NUL byte. + * But ignore the C in brackets + */ +static inline char *v4l_strchrnul (const char *s, int c_in) +{ + const unsigned char *char_ptr; + unsigned char c; + int in_brackets = 0; + + c = (unsigned char) c_in; + + char_ptr = (const unsigned char *) s; + while (*char_ptr) { + if (*char_ptr == '(') + in_brackets++; + else if (*char_ptr == ')') + in_brackets--; + else if (*char_ptr == c && in_brackets == 0) + break; + ++char_ptr; + } + return (char *) char_ptr; +} +#else /* * Import strchrnul(...) from uClibc version 0.9.33.2 since this feature is * missing in the Android C library. @@ -41,9 +70,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include -#include - /* Find the first occurrence of C in S or the final NUL byte. */ static inline char *v4l_strchrnul (const char *s, int c_in) { @@ -179,6 +205,7 @@ static inline char *v4l_strchrnul (const char *s, int c_in) /* This should never happen. */ return NULL; } +#endif /* * Import getsubopt(...) from uClibc version 0.9.33.2 since this feature is diff --git a/meson.build b/meson.build index ce6db73c7014..84a863f3ca65 100644 --- a/meson.build +++ b/meson.build @@ -46,6 +46,7 @@ common_arguments = [ '-D_GNU_SOURCE', '-DPROMOTED_MODE_T=int', '-DENABLE_NLS', + '-DGETSUBOPT_IGNORE_COMMA_IN_BRACKET', '-include', meson.current_build_dir() / 'config.h', ] From patchwork Wed Nov 6 06:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ming Qian(OSS)" X-Patchwork-Id: 13863927 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011051.outbound.protection.outlook.com [52.101.70.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 128321922FB for ; Wed, 6 Nov 2024 06:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873823; cv=fail; b=j3QKQcIgpAeL26gFxFOSDOcd5OuOYSH7Lu8yfIN0NNJWuR79d3uGOqCVZIqXmZm3127Okgp4hLorySZpJTMdySLhUYUoxTnOuyxp4MS1K1ivGsb5IbfNWfBWUE+20egAuVughqkFDPr+xdlFdFTKNWK9TLKH3fHgSAW0NEBTHcY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873823; c=relaxed/simple; bh=Jc6d7MjDrgy7PvyqchGCiZ+AqjoKDpV9uKQ4tvJnFxc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=gKHswamxlh40j71xkQg+9EHwB1Ks2kFmGmPyRtk9YSOo3ELD44Kjl7FIGM+++/+OS7kNX+2ApSfsLONzWj88KNpCzD/rO4R1pwsIQaX3HBKQuFZWdT2D2Uoayd2lCdVePiqWrs7mdtEg0Ja4kzC97qp5ZjLRvGpNzg11Owe+yS0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=AoM3fOHZ; arc=fail smtp.client-ip=52.101.70.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="AoM3fOHZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IaHkoU3Ty2A/yWSRBxJxxLsRVw55ozQtGXqNFxw7sHp9JOIeyEmpH4ck2v5x3j3xyFVaZrVDfqcNd5eNz3PzZT9nMPIbzPTqtHt9WixPlO56w+lOhdMPCW1even4TzrbjxESzAYmwZru4WPR6Js6hxTslZsRE8i7+B2URMuv8ZL9uokBFtbdptg0VeS5RrNvsFXn2RHEjUeQ2pfxnRz3Awq17FrdU/XdcANedcPMk2Fi8TMTrBBE/jG5K3NCV+bX2OUojbXRhygKfrcsVO9vQsEOLQg4AM7GqtoBn2YcurxDkxUdLPNXDKQc9+hTTn2mDvx6Vvjcdho6zROoZn3uZA== 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=FTRHhP7KH0T57Am0hgobO91+Ll7J2bwoMr724wGaPeo=; b=QiO7ecH1CJ41ezMBNqQkcnTa4hP1lpwezuS1p5HJLojPTAlRJeXOVP51/Ez7yVLkbCDmGkQy0EWYRtm9IOYPFQI2EtfAaRrtNlLhWXvL8KdRBOQuXg9GA+4UiF8kFHtxxK9RLyjL4577mb6YcuRmdyIm4uSw90p1m9nPgQahyEAXwmY4ci2NjckLESseDQIPT8P/alcFBulXzbL8a8KNA9qXxiZzvhHy1EVQnqKFUyqtgc1xGEYQbSI/aiN1q+vZD63iYGFkeqENeBks2dwQ8Rjbtj4oy7nVmcbI+ElNFyY3oGS6XdAL6JhmQTrOw1jYWXXGEkQpG7f69b1bABh+lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FTRHhP7KH0T57Am0hgobO91+Ll7J2bwoMr724wGaPeo=; b=AoM3fOHZr7az8DhvT876BlMmsz+ZMj7rovu0/a+OUrSZoLLb08ZSG9ZH1SBRr3OKRQ1LdTtRuV6cL8z14LG3sIC1XGNbSqDi9FCWWa9AG+DxZZGBE1urS3xDCr0zmxkuYE+UolW3a3pQMdhC/dNCBbsQ32l59rRkvfijTcpLcBpuZMMsOkbsIwu/d8WimC0MKoMeQn7QiRHuhaoXDL6ho907il/sa3Ehv99BOWc5/cblnqP7btSLfPzRXX2lnWWX0viF9q7xC3ocsqgpS4LrTZ6LpiQGSkm9MyUPAqZX/2G7Ve6KZAhbuMFz7731/EuGazpwu4Lib1hysyXjqbqsbQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by DU4PR04MB10599.eurprd04.prod.outlook.com (2603:10a6:10:593::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Wed, 6 Nov 2024 06:16:59 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%3]) with mapi id 15.20.8114.031; Wed, 6 Nov 2024 06:16:59 +0000 From: ming.qian@oss.nxp.com To: linux-media@vger.Kernel.org, hverkuil-cisco@xs4all.nl Cc: laurent.pinchart@ideasonboard.com, tfiga@chromium.org, ribalda@chromium.org, yunkec@google.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@nxp.com Subject: [PATCH v3 3/4] v4l2-ctl: Support V4L2_CTRL_TYPE_RECT Date: Wed, 6 Nov 2024 15:15:36 +0900 Message-ID: <20241106061537.211002-4-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241106061537.211002-1-ming.qian@oss.nxp.com> References: <20241106061537.211002-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0250.apcprd06.prod.outlook.com (2603:1096:4:ac::34) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|DU4PR04MB10599:EE_ X-MS-Office365-Filtering-Correlation-Id: f5170298-b7d0-4dd7-ab85-08dcfe2a9ef7 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: GFRqnVRpSTZRErcNhbdv5lmCOt2DkjcsAmtShd2Z0Zuf05Dt++WjycaDOi2EuQVc59TI1hKg2tQsb4Yy5v+UImyNpqi0SR8xnN5uNPJUDNw1hVU9JL/6JncRsolkPonbmOYYeyoUJL8/8F2XYJ4SX0p2GCCW3Do7ZHdz8rndDRmb2kMXoKWMpYhvtbvLoyb4nLm4XUB0hwyvMRSngU7il0KFP1g9Sp/B8O5hoDMwUwcln2N4U4SnTRei79cGFTVs6tf0/l3hOEqcOvocC1q+AT5+W8TzN5ata2ffHPOyEggzz9IqY532sqgV5YE4PXZGHlinJK/fOxkrpCVsHFy3J0nFplrkcjhMSEtZpUJzKlDx3ikcGfGGgsqQ2OsLzpSd/EQhYvNqDyPoe7IXJrxuV1EElmp5XGZSgYNSTVDh4fgoQIHm1bQ1CjjZReEiv2ZfcnEST2snZrdnSdRDOCn9LDfPM80vQyPNIm2a8BRa1fFy8dY9j71dKJMXBFhFEIygbaFvTVWVeYrFQZQPyafVILvksbxbl7HQSN6sMQmx1bpRojEVj5GYn2Zd8zf4VVvzY6dyH/vP8M44x+IWxmPGduF4jblIE5TK7r8nl2EYlsjFJ3QQeOIbtuOuQ2y0RiOCbu5w4biZGXJL8WVfK699aWaWs1ZzS7HQKhsud22nc8udp97oF99kZrZg5y/DYT2ucAC/sU8joo8QV9GxaL6kG0L13Gocj7bwGE0zi14FQE6JkYZhKGeZSxfiuoDjxFX4OdNjGugDdlM8v2jWhCkPF9UV0AzabsqmCNT8WwaygdKZ+jCxRD1IJ6MkQrfeHWfTjRyzJOljRhQ+t0Sp6IGg2BAAzXNxGKjSPRgf1lQETGGj0VLRMp//kJziGKIy7+p4mnnmJyF3gRJuQiJoNK5IXeTvNKbaVIa4ijS2Ea/2ettUjKFMgZpmhkLfW0UtGuTnPh9OENKJzITK6I01y5LX8WSPjvaXnLjv1iBgiPd5tZB6Wix/m8q3qX9/mYTQBHBTmL26hvjx6eyPrM6evG+npGD5hGNLJBXze74Z66lJV+OVkLnj/yI7XtNQhpYzIwWyLNOZe0gtSzXeCO++/7DkftJkBUZxNkY/Pg7/RiolcdAQ0TVWOh0C2QJN77MpPWqZqMWKiykdJkSW1W4kz1IweDS22fYn7VvIWWj61Zo5DU5VkIk8d+r73WoGGPQtGonyQv1Rwu84rKFv9oHldOZqSBLpLtjFxv5pdla97lnwu1FSjr46gRR/75DQ7nTywkCnJxwsAHKpK61iRs2H9tPuWtwPuKw5EghLfHbi8YoA35BvdxgG8Gc/PnwSyiUbDWwOi5rbd09t+oYuPa7ggwTk19H/DE0x+tuW3F8IA7YLnC0= 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8spMKTuSCImDCfMTb6B4GQ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USYZEQk4CGzrADk9Gwmrk9pa4WywUPeWnv5kk+wZCHtmrWNHtCv0RFOs2ba0lkunwaPZzgV2wQ9FJqJf/rrG6BNG7l0mVyvjh5Q9td+J+K856w9twTor2HEWpiZcKl/ThHtCizKElCjkM/Ammp4GeRjo+R0xfPPFqarBcpsIUT+ZLjg/k8JlEfKigoq7hklnHQohRxEFK/IqdQOHbpEzZ/oRt2EZ8aDD4LtuzSaalU9zE6S95wR9JxNyWjAb4QV4Q4e7gFRq7lyoFAH7is3NpvedWKtQBR6//3ofnNqjlrU7u5z/nli7SfOBS8iS1DOcZvLbhQj/hH/sd65arKj4uBwrF3AiyGXH9ONnTTIlNqRk5crmcTb4fAt2fKRKedwD0i7TUCOafL1SqY6ddFnpdpN7gVjNs3itayH7gsr3FMUOFxeOgSz+5+iQ6O39xfNrIixt0xPa/qS/DJlYeLuMNwcc6+Jb8XGEtV+P9mDF7BNi X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5170298-b7d0-4dd7-ab85-08dcfe2a9ef7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 06:16:59.1446 (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: GzX9qufVTT+sqXdnq9EPSN/m5TbnCzojARFGSdBNiqc4dANGiXH/5ikp/5a0dgOt2Gc1UhgSuy3ARDqCUqVBwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10599 From: Yunke Cao Tested with VIVID ./v4l2-ctl -C rect -d 0 rect: (200,100)/300x400 ./v4l2-ctl -c rect="(0,0)/1000x2000" ./v4l2-ctl -C rect -d 0 rect: (0,0)/1000x2000 Signed-off-by: Yunke Cao Signed-off-by: Ming Qian --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 40667575fcc7..1859292f6f77 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -614,6 +614,11 @@ static void print_value(int fd, const v4l2_query_ext_ctrl &qc, const v4l2_ext_co case V4L2_CTRL_TYPE_AREA: printf("%dx%d", ctrl.p_area->width, ctrl.p_area->height); break; + case V4L2_CTRL_TYPE_RECT: + printf("(%d,%d)/%ux%u", + ctrl.p_rect->left, ctrl.p_rect->top, + ctrl.p_rect->width, ctrl.p_rect->height); + break; default: printf("unsupported payload type"); break; @@ -702,6 +707,9 @@ static void print_qctrl(int fd, const v4l2_query_ext_ctrl &qc, case V4L2_CTRL_TYPE_AREA: printf("%31s %#8.8x (area) :", s.c_str(), qc.id); break; + case V4L2_CTRL_TYPE_RECT: + printf("%31s %#8.8x (rect) :", s.c_str(), qc.id); + break; case V4L2_CTRL_TYPE_HDR10_CLL_INFO: printf("%31s %#8.8x (hdr10-cll-info):", s.c_str(), qc.id); break; @@ -1279,6 +1287,11 @@ void common_set(cv4l_fd &_fd) sscanf(set_ctrl.second.c_str(), "%ux%u", &ctrl.p_area->width, &ctrl.p_area->height); break; + case V4L2_CTRL_TYPE_RECT: + sscanf(set_ctrl.second.c_str(), "(%d,%d)/%ux%u", + &ctrl.p_rect->left, &ctrl.p_rect->top, + &ctrl.p_rect->width, &ctrl.p_rect->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name); From patchwork Wed Nov 6 06:15:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ming Qian(OSS)" X-Patchwork-Id: 13863928 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011027.outbound.protection.outlook.com [52.101.65.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36191192B67 for ; Wed, 6 Nov 2024 06:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873828; cv=fail; b=nlrxb3DLQr99FOjllJEZmwGxooTvGS6I0Y/Azj4mIdjQYK+oC1BZ158KPPDrfRctlFCwIFWHvmd/5XzUDG9BNl/RIK1VKi9Qc9OmSbRpsTvVXyxP20hhYVMMR3/6c7R/54WoeFM49evSFKBN24+2BbYR0MdlExxsHZt1cV6WjnE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873828; c=relaxed/simple; bh=CxaQanWWHqPh+0YZKNWeOtN/lcgZ7RAeg/2MZuNpQfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=J4N1hbdm0paI0mM5BvfuQXQb1yOtCVcgT7OTMdMtJvhXosL51LX1oNHV+LRv9kvED3UvdiMQJ1lNTScebv9924G39qIIoTWP/A5k6xCDBzRAT5YyhRbVZHEluiaV5ji82aRPYXXQ3uswmzi8nmcWPmUPCGgqTIhF1/me/z7WBEY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=lxtTDeTr; arc=fail smtp.client-ip=52.101.65.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="lxtTDeTr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RE7tIwnRJtya+bBhJXxqmOKAJLR4Udg4/KkzzhZnRwmw5jxXjDHyR5wrzaVkp+UU0NmobTWJSNxNwMpApRzm0f+G9ptVRzKnXX7A0hZtzK3IxJMBjmiAd1qOo6kxxvm6YcIqYtJKOTBs2kFGHWuMFD6hEkxTqcqaLY/qj4sfDEQUYerWfsPG3w7NfFhj1ibTV0//BtOp0uRGa0d/+OBI1p18f0l+sgbdRqspWHH9bWIwykKJtIm+ZFmZE/uh/LhFu9+fiCAA7u/2z1HlAxWNA9xz6jFpUi9kx4HqQxM1MiaKezxRMZDnwYj6hVd/WuShYbiuAtJb69QtjM41GR0igg== 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=zMPuHhpVoXB+h/UkOMc6+e8Pzz1ob3RGYx4PvRYfeug=; b=gtKeSRNSmuc6qRh7fZyS3wb5pJW9ED23oa7506C0xxRH8nvWisp6byuuh+c+ryC72cEzNwTmEGR4Kv7DscpGD3oUfQPGUmhv2ULysZZmO1AnNQSWmvc8uP5xa3MqQ5R5u0IgIze9hpHn5URcF+dVHMUFuzNzySF/stlQwV5BMCkXSI7JtRJUU0b7iPUFsDdYAoXR9qhE0L3+kVnY/v07eLGg84x7OlgJOeKCNn1cVU3vERWrSdg/EbNqnvnRyUD4nVLxR4KoAN5J8GuJs+RDy3dHvUvU9m41IjOebo6QCnWyb3E115qYWS9kShhTCTVsMYXiPcREIO1MbNpf1OFViw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zMPuHhpVoXB+h/UkOMc6+e8Pzz1ob3RGYx4PvRYfeug=; b=lxtTDeTrr7zZnnV0Hwg0BerviWL1V5ELAtFEQ0CczRtJHG2bvBvVdKI9sL9Bj0dHc9xkyya8fDkrDo1YSqSY/dC2ux+QdAbeoIsmY5oN7naLJ01yYvwNxaFRoOo5yEN7dsTEj3N8c9z+w8C6och8PdtgE8tawchVwmOhfkvrp6VEyHBXZd+BK/fa+Yo5GjJYyr+tXx1E4ysflLYNIpWZI4nWlaOifDhoQ3u8kLNwz0DWjO+YdxfcZlkwppPlqXItg6Si6yp/SnOGKNLt9gdme7N6+ksyf6/xSw23N33tSc7h4ZWO3ESpleVQe0fdWsjYTjoIi0VgE+DiJ3w5iznRsw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by DU4PR04MB10599.eurprd04.prod.outlook.com (2603:10a6:10:593::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Wed, 6 Nov 2024 06:17:02 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%3]) with mapi id 15.20.8114.031; Wed, 6 Nov 2024 06:17:02 +0000 From: ming.qian@oss.nxp.com To: linux-media@vger.Kernel.org, hverkuil-cisco@xs4all.nl Cc: laurent.pinchart@ideasonboard.com, tfiga@chromium.org, ribalda@chromium.org, yunkec@google.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@nxp.com Subject: [PATCH v3 4/4] v4l2-utils: Support V4L2_CTRL_WHICH_MIN/MAX_VAL Date: Wed, 6 Nov 2024 15:15:37 +0900 Message-ID: <20241106061537.211002-5-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241106061537.211002-1-ming.qian@oss.nxp.com> References: <20241106061537.211002-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0250.apcprd06.prod.outlook.com (2603:1096:4:ac::34) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|DU4PR04MB10599:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b716557-9aeb-42aa-5283-08dcfe2aa0fb X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: wNSLozu3r8Ch5AFAMf7Z1vTbLMnpc07/wlnDSY5Br0M0nTRiHa/lTOLrMGti6xt2jkg6/dv2BG2Wg99qlCDSo+q80wYrllpBMgbF2oULJdqWRyC+on1CZnNANxPwpkntpo9Oipr64vrYVzxwbhbIhs86XRJ8YBVqnyK/zdbUAyRu/GCoZuF39oz63omYyJGhpU7nm+PCSn8rLV7RctF1bjbhovcMsEW+d8ONTm7ZN03AG8wpBHzFwijkVSHry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PkF0GLkVrye9s+w2/P7KxRICUjSdeD6TQNiOPLdZveI= 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)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ybePUDx8ZTSJlGe6JuURVOgrH6XZB/p6OJ9e59Terwer3jAgZiaDj6q0SnlAjG/RTaAM4L8570N31B+VElkGyhElza9C606BMgcCwoJceUv92p3z7vus/3fC1LkAkqAtjYkQenKMn0LqOvuNixPoQfZ2YHcYaRWNhdHLDAhlZoesPSqlcUNipmu10WCc9dwQdPeWunroxvFBKsHoV9QF4sI1SO/4TsBHqFuXWCl+mQHFdV+BneKTiBoEnSROeO+XpYzDOu2G+S+KOx1gW4G6AHpCwD83m0JX67Ws346VjELI1RtBpOEFsz7uUG7i6SPRORWjm8OEzDmlFfqIfj6p96DU6lIuzxmezyexIQWwvSgh4bGxgrlJjX1ioefmzFicBts4M4ZXqvIw2ErVAMXhJu5WtlFabe8F44DWaWlo2/9qqwA4mf4iviF0R3ZyZw5QwKxIBDUbty7jBANTKaixH/wmHjyS+lK8SIDLyxEXLNZgvCTlDKJ7+WoDhUoGRcKJEM9T6XYB4/Gvhye9whnmolTdawFtjP1aZiACo+EO43NsWGZxpUAha7x4CfJis4zn+E8CLinjTnKe7G/tlpRlM2WFqkUmSEyqbMlzj1jWDl0vcilqifqfmhAD+u6PRaAHwNZpXzse+dTZC38r4Iwxk/7YKUrrTM02KrbhUayvJZBRTeXS1wSDT8OSUihwD8UP45suIbvR9Kt7i7LvgAq2lRUjwYFnPbGxBJqDRoejOcQn3+5eXCHgl3IxO2ZZlhqryfA7cCmAjW+8Ni3e22zDp2xxjB+fnvz0ndCLEFL7xSRXgiDxfOj3m9EFOPpv0Hm4zykvSqKxm2uuBoRYFPphchopBg/nIqabJwNtGFfkuOChFyo1HUOSU8x7rg2npd4eZ3fk5+imEtPSdLSjW4VVwkwa4skuOXPVUKPIB5HuNl0nD7kraBDt6//LlRX9iULMdJQJBXXM858sTNlFWA70Nn4WHD8qiE0w9U0LM34H1oRSkonAXDmNCce4QukZbbHQJNj2+8w/LBdvmC3SbBJGN8ii1C1HxZk6hDy0HMH9N3Sdd21C9dKB1m0nKF7SOGQqTavm0bDRFv1Tc/GTopIJY7HYbjiaAwqzE+jEFu4vq4MFDM+4+d4lb4jBFV+JILDd8tzyAiPkYG4C+vlQTDTfCp5Ni8AcgysWUHIy6WeF1csnJ90RUOeAFgsH+Bi4WOiOLU/No8TrNINCnTgn1CR/eUTlzeOi94WusIOpoW8VJYH2gq41HBJbM95MU8MDXdOmTkcRHB5Sk/WUlP2il004/UVluD8ntbc8uYfV9+tzzEcm6+Z4BsEjCrUY+lOTzhmmSiYLEH76rcuuREQqIMhFeZdXCScraqbh3BbFiNkX6lMYaxoyTd+78cYaZJPfljgr8/dqh26WtXmt8tqU3WA2KfVvjsA35GFNNKNpAonMOgx5UTbSQcHrtn7TI4HqcbQqLBngah1YxGhDmSuQfYvVSNAL6cX5v/Eka1U6k/gTcG/a05d6/itximrVWGcswhw1kwdjoN16D4H3uRXn55zv3n2UzXRqRRMdBhyo4zNStoT6wmo/xpPyvdS3TTeOfN1P X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b716557-9aeb-42aa-5283-08dcfe2aa0fb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 06:17:02.4585 (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: d2JLQdt1C42AtF5M220WG5mB50Tuew1OLr87zfn+FywHST+IgPXcLoyd6zU+8iPth+PF7zYlmeZ5u6zzRRDPZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10599 From: Yunke Cao Add string name for V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX. Test that V4L2_CTRL_WHICH_MIN/MAX_VAL behaves as expected. 1. Calling G_EXT_CTRLS successes when V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX is set and returns -ENVALID if the flag is not set. 2. S_EXT_CTRLS and TRY_EXT_CTRLS always return fail. Tested with VIVID: ./v4l2-ctl -l -d 0 ... area 0x0098f90b (area) : value=1000x2000 flags=has-payload read_only_integer_32_bits 0x0098f90c (int) : min=0 max=255 step=1 default=0 value=0 flags=read-only, has-min-max u32_dynamic_array 0x0098f90d (u32) : min=10 max=90 step=1 default=50 elems=1 dims=[100] flags=has-payload, dynamic-array u8_pixel_array 0x0098f90e (u8) : min=0 max=255 step=1 default=128 dims=[640][368] flags=has-payload s32_2_element_array 0x0098f90f (int) : min=-10 max=10 step=1 default=2 dims=[2] flags=has-payload, has-min-max s64_5_element_array 0x0098f910 (int64) : min=-10 max=10 step=1 default=4 dims=[5] flags=has-payload, has-min-max rect 0x0098f911 (rect) : value=(200,100)/300x400 flags=has-payload, has-min-max ... ./v4l2-compliance -d 0 ... Total for vivid device /dev/video0: 125, Succeeded: 125, Failed: 0, Warnings: 0 Signed-off-by: Yunke Cao Signed-off-by: Ming Qian --- utils/common/v4l2-info.cpp | 1 + utils/v4l2-compliance/v4l2-test-controls.cpp | 24 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp index 7dd7e708eb5e..02dfd6da0248 100644 --- a/utils/common/v4l2-info.cpp +++ b/utils/common/v4l2-info.cpp @@ -538,6 +538,7 @@ std::string ctrlflags2s(__u32 flags) { V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, "execute-on-write" }, { V4L2_CTRL_FLAG_MODIFY_LAYOUT, "modify-layout" }, { V4L2_CTRL_FLAG_DYNAMIC_ARRAY, "dynamic-array" }, + { V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX, "has-min-max" }, { 0, nullptr } }; return flags2s(flags, def); diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp index e87a1af96406..a0e8bc19aafd 100644 --- a/utils/v4l2-compliance/v4l2-test-controls.cpp +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp @@ -971,6 +971,21 @@ int testExtendedControls(struct node *node) if (is_vivid && ctrl.id == VIVID_CID_U32_DYN_ARRAY && checkVividDynArray(node, ctrl, qctrl)) return fail("dynamic array tests failed\n"); + + ctrls.which = V4L2_CTRL_WHICH_MIN_VAL; + ret = doioctl(node, VIDIOC_G_EXT_CTRLS, &ctrls); + if (qctrl.flags & V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX) + fail_on_test_val(ret, ret); + else + fail_on_test_val(ret != EINVAL, ret); + + ctrls.which = V4L2_CTRL_WHICH_MAX_VAL; + ret = doioctl(node, VIDIOC_G_EXT_CTRLS, &ctrls); + if (qctrl.flags & V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX) + fail_on_test_val(ret, ret); + else + fail_on_test_val(ret != EINVAL, ret); + if (qctrl.flags & V4L2_CTRL_FLAG_HAS_PAYLOAD) delete [] ctrl.string; ctrl.string = nullptr; @@ -1082,6 +1097,15 @@ int testExtendedControls(struct node *node) fail_on_test(!doioctl(node, VIDIOC_S_EXT_CTRLS, &ctrls)); fail_on_test(!doioctl(node, VIDIOC_TRY_EXT_CTRLS, &ctrls)); fail_on_test(doioctl(node, VIDIOC_G_EXT_CTRLS, &ctrls)); + + ctrls.which = V4L2_CTRL_WHICH_MIN_VAL; + fail_on_test(!doioctl(node, VIDIOC_S_EXT_CTRLS, &ctrls)); + fail_on_test(!doioctl(node, VIDIOC_TRY_EXT_CTRLS, &ctrls)); + + ctrls.which = V4L2_CTRL_WHICH_MAX_VAL; + fail_on_test(!doioctl(node, VIDIOC_S_EXT_CTRLS, &ctrls)); + fail_on_test(!doioctl(node, VIDIOC_TRY_EXT_CTRLS, &ctrls)); + return 0; }