From patchwork Wed Oct 30 02:43:05 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: 13855873 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2084.outbound.protection.outlook.com [40.107.21.84]) (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 0A96F1946D0 for ; Wed, 30 Oct 2024 02:44:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730256265; cv=fail; b=eOwwR+pHN7+2I2x0Uexsjjj9slNdduG1BwSyMuPTohW6bOXGmF7nSffVs89M6yLvU01Q1AeVoOUIV3aGxVhrHU+dOVxmgY26K0pOVHJnwPv0jaUBLFnciVLA2Fd6L/5jRIQfjHtWCzy3XCBavB3RkUV0sUv86BHVZlVl9hPprCc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730256265; c=relaxed/simple; bh=ivRJYMbM84wlwp6uoS2CN9T6O0uhk/AnaPNw28E4t3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=AP2E0TeRtyVkx3HTz8KFhgXkbUpleScpM5jHqEYG+vErl+kVzNkfXdsz9cYsHK9eI0gWLAhafjV6vGp7VTyd1sWaMzHZXWD8V0DlbZP4jFmmNFiQLtURaBciPdhD8RTztyRCX4Hmv0729gkceMHvRI3/CKCPSThtl4gOllFThM4= 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=WtwnaD1B; arc=fail smtp.client-ip=40.107.21.84 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="WtwnaD1B" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iHXatLrYWcjztKjZsf0ug5B17T3y3kKxQExX4JOayUMRgR2a64enaeYAp3dv0y007w3UpP2as7nRKx49FiS3t+EEQpIzUCJl4HiQhBxOtOfiAedms67chlLt2sGgB/22O22BaO0+suzUjJy2Fcka9z/4wbcrA0TG8f9hy5AQkzGCQXJnoD+PFiTmv1BeOZsGirKQ8wZAqvsNUzqvCWSM2qOJcAIOPlStVI+SJ3ns8ToFamWgNaFZEhQ/dkLl8EqKw7s5H6W7WGRh1gMPSmonaS90USbMdaVn+2tzX1BsUhDpNwaiObxEhEIXpsJhqFnaZK57Gd/6PMi07lGHc6FRHg== 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=yPJU0d+tAVUjMYqr3ORkFBev4nEODYnI8YGX23/xTrAlmQOBwiu5EMbXkNlaOT217NzbThTunORO5gnHSCVvpNZ2354qcXw6tFI70nNdbnS4LOYYFzrhWGHZAlOcuwi7xwlJ64USPVb8DnBD38//XUwITmCcboWCxRoFz6c5TKQ8d22FanJvtI0sVnVRg8S5M1iurioObgejYSAnOhHz4HWnT4XRtiV9+Drg5OwkqHhQdS2lfMOjN9ot9bdI2zAFzv4D1kJNkYmGCEE7pRYdS2fw2a90Ea8Kb5Q8aBAKj06DK+xwDrn9Y1EWEkfM5QWdHMVOQ04vxjCHkBM+xmPyhg== 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=WtwnaD1B686a/9+cRz0t6t0HBjWRq1RgW7QtAW6cO0kepZsKq6eONvXZDN09q/lE6mWl6nbzDLgi2C/pFvetVElh1s7TG69ovWNwDtOz0rLlBu7WKBLN/Y5ye9zgUdVaSwww1gab1yB0rshc+i6JIMJ+Sck44hsplL+K3eSyTYJQlQa/mXjloWkz32ac488VuwO9AeadWOc7Cx4RHk7puawnV1lA6urN80ch/3X94yRQ5+czwl7dfJO6Qt0KGm2XTeRNDlpSvTrZ9O0/ofIYccu0WBpG+G9hZd6GiyJJXNHHsuYX5pGjgLtxLInn2MbA1HRMXenLqEmRez1LRUTPHA== 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 GVXPR04MB10729.eurprd04.prod.outlook.com (2603:10a6:150:226::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Wed, 30 Oct 2024 02:44:18 +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.8093.027; Wed, 30 Oct 2024 02:44:18 +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 v2 1/3] v4l-utils: Define V4L2_CTRL_TYPE_RECT Date: Wed, 30 Oct 2024 11:43:05 +0900 Message-ID: <20241030024307.1114787-2-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241030024307.1114787-1-ming.qian@oss.nxp.com> References: <20241030024307.1114787-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0172.apcprd04.prod.outlook.com (2603:1096:4::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_|GVXPR04MB10729:EE_ X-MS-Office365-Filtering-Correlation-Id: 514b9e16-0512-4e6f-126b-08dcf88cc052 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|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: HJ/Nigi8uvlpKdhU/TQwvvXi7eGXy3oecW7133NriVjk5KoNp5QBmuuanG2OrDArGXD7mmfx84jYTlZVa1kPpsVV2N+SLRGmPBDm+5mASqJjzK1TjKV7mkY6DuTH2gIutbITTTtRnYPD+L2g9cIUdC4E4sTpu8H6Mw4HfdcdzG58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OKjvE6OJHRZT+Eg37OcJbx69FZK7MqsIyprS/sPL6qILRPgIZi7ffTktaHnwhOqEHITLrwj+I46ign8Z1uREVl9Y4mSWp7sEyekrSllLatV8W1TW7tOsScUX7jmup/t4aU= 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)(52116014)(376014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zZm8YRqEtC0u/qHde4PpGv62wy0UA0uWAm8zkgbfu/BCPOXDuPR/Vhnm0TESKqFZtzoRouMURLepQvVoNUZTIVE0mubs7TiotY8iWuuMsg2BNB/tSzGpXji9ABAS4IDaKUD/vlYTXbnr+Smgf5s0+VAE4mXXGEg4ylcxoMHfbSZMTyRZh5C5mokSBUNjFUUQMkIp45iaGBG+iTEBT81/nGreK8CKywuCaLHZ6BrP4YoNO89dd0ind+Ev7aPeT8ion81ibSZr/S5qBiElTtij/s2CMLBb/FTurREYCmnkXYWptqVtUz/AlNE/BLPmZH2yxqvyaNaKZ6JzfZZyGN/TX0qJJe4b9AzrDMYYKi0+JnG0YLhK7gxkbCN8rajef5iyaCrfpl64lQDR/r3Mn7XyloK/bL19Vz08/MzHmj5Qs+Ugucz+xSrsoosejM6wR4Rt3cGf6SemeZCzwBKcJc9YZMlgxBOL73pgvTwhmM5+Enj3FL+oXnJmTnHVd391pc9M9/aZr3Bh02sDDNP/I9ZslFlwl+NbBP+eoMtXVsDuMOuMnikAzd7C3425jnEMNcR4FiT+Xc+YmerWvo4YnUTBpeb9G43uq57hO2nXEprvK4JKd+TwxVo7VUdTkpVskUQsbPLytTrj7DEvXS7eCBVcta4FxxOnK0/Pb2LJT81XdjwRhlBC0HITbbdERklFkSfqZqtl9vTap/8wBC4lCWuOtsBF6WqEQUPP9lR0nutgmkKYkfDgUJGDIgQFGOjSD09IvAsJ6zu7nJTd1OyIcejnGabt/UTUSuOhamjb2zQH8dD1fD9ipG6CO0dpsZr98Y6kW4eY7F7C/WoqPpl4gjwB44i6oWLufKR7I1sLnckNVFVVUngN0UyNiovYb/5aW+0hTfLTJiBeS8/tCWHXLolJJBPw3yKrtIABG12Y1STZEbeYXhqZaba7UwRLej3VYq9lTXYV34wGb5UHLcsb7PDBwWNmNqdfqmcZUGOJ4xR9f8W3sqwbaqbfxH3LH7Ym9+i+PKFdnm9ENOcNl/fyNWV7i9ZZbLB/9rGbo4SXdmOb7Fqb7Wlg4J9ZxU7WE21OHYRexR4sU9uwrgxwZjP/jdGXBReequ6Fe+bFiTXG5qpja4ig+lsFqE8yyPuoeo1DEhYm7ljV5sdkh9AetgQhtVY5r5gBLzZRovHvAwQFOTjurWTDnqGIdNylt9SUU2VMyK58YwFNq4WYdJUudAYmWNyZP0Gn6SxPsLVdkRtWZ8vnpPjqqzLmm2q2K/JU+H+PqaxLCreBtzei2ocYfMQwe+WwZ80BcR7aFMO2a8HuXwm1mdOjvEOzxnnpZRHpGgsP2oFctAaNYlFEwGeFBpSmy6rgsSRtJMOnWVB5hOMC3LXKwjLSqecnR28e6rIfXocoYKUeUsimMcaGJwkWiNsYp5zhkdUt3/V6JWmRn2mYD7SpOCc8AKbhwiSUfqTwsfwf5qL1np6lD1qdWn/jSwWJzjd8U5c3+kXLbNiAWwBU+sKeJDxg4jz1R5TXFo1jSityHR30I0znxhOzs3sESl52blcjVA9y25yJMScb8c/mXs7eiABqn+z7w6YpEBCqeoy25aCN X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 514b9e16-0512-4e6f-126b-08dcf88cc052 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 02:44:18.8228 (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: 35d88eAwjuK3byGCAjAi7WpIR4f17EAvG8UPJHuBcQScOYuCh4MczkFOQ/SWPqL/hFLmQVnMvmGuWl+G+tYuxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10729 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 Oct 30 02:43:06 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: 13855874 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2084.outbound.protection.outlook.com [40.107.21.84]) (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 A39781991AE for ; Wed, 30 Oct 2024 02:44:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730256267; cv=fail; b=BOM+Acpc76rotqk7mqioARZ7HravYCxIgXdJIpThRHRsgnlwQ+uso4DJOIIIJaTEgV/y2xcA2cufaRZcCXIWBVpq6sXXK+M2fXRD53yBtbwhtonp0mfFGeS7zlds0uO04Y/7Fr02AkpWTRWKoCvd8ms+8hsmXtReN2BwOQ/Ry+I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730256267; c=relaxed/simple; bh=Rwln1HEyBNWvq1CS0srpuVZ/7dvqmRRGR41ArEIL9ZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tvjeB+OzGnfAGSUS9ShHI1tAaUw+mB3foH9fts52lZ2xQrYEOc5H5v2MqXh3aWD7tR3gh31OnGoBrtDIwn+MVPtYpHbOyywg+jnvyoCUyI8YyogOmMyTXzjWoALLzLFW2G5NlLUhn42gkLT/GC7s/xkiaL7w4/f7lgHL/Vri63k= 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=c74/vL2T; arc=fail smtp.client-ip=40.107.21.84 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="c74/vL2T" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l6rPQlV4YncgMdTAJV8zuf9hxE7x32ABo+iopXVgRdrjL9NoYR9fOAP4tjDxS5GgKitVir7gPgNzJRzebPTbEJz+UENfWCGQgdzb2xOsKR4RD2vRlhl9D0b26pKlr1SzMdNKxTYOpFk7OU8hGtfhInNoqa6bM2l28CNVOnrC708uJ4qbl27WcSmy+fG7aQqJm+LcKfi9e4k6q0zc78mCRJhHD+v0o+s6cSJNK4Z4N/tBAKSNOPitflRo7ibDCS2aCLozYTwZDrODzfkdkcUY2QIAgCDFZAYd/7rxzEI9JPXkowDEQac/OX5BHcEB2FsL17ewsuZYLj3GjdZuMou6tA== 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=jv6y5GQDvDTJGcfnEvAvkb8bjRoxPGRDy+KtEsu9/n4=; b=Q23dXa3/1BDcvOJCaPn1BiMhd/xeUSzvhQF1cmRdR50vXDjkYkI0g4Tt6P+nGWJ6jxvgEFjWokSKi7wyYGh8aNmuIRO+BfH4uHBPDwQDgDXj35hjjnWFPbT1v11UNJETdfj9Td3bUPz256sD4YbAIunag67l8BHJOf+QkYQ4dn4x0xGXk1AFGEhNCDqbFLOSOZN7SjqhO/M7dcQw0F6HQUyHh8jPmwfdqDGEM/CJLJ7UISeuREhwhxFXWK/molVMYB5ZVPYrRAhJAcw/OxDorXOsu07SAHesvi3YoGGq4ZhvdaV0uDco9+vPd1/atDqAzU+JZtDXaL0EPZ2RlYdGdw== 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=jv6y5GQDvDTJGcfnEvAvkb8bjRoxPGRDy+KtEsu9/n4=; b=c74/vL2TijjfON+IdDofeU9EK1Js8uxWpjC121trQWoHFtSXgLz0i0i/BSXRyYSAyOmeiDIPBePTpQuU6qwOJC9UvN2mWDfmlXOp0AkiTYGesE/sEzQLuPkPfdBli7GCcgZiU+CYivbmej1Ts1iI3IfXTuvPZIUfg231FALhWk6Zv3AgaXxzngpu6VsXcFh8WugJD8Er5ORZ8nGLwuHBBwTlBrpPdSQXSqw8y49sgax5M7CppSQ/FhkoM49bvjmKE0OGt7PSGSZzQ6KRP+X6Lfp3B/1veVTIHgXE20xNcby/WYKy5a/3EWeARHPRhrWsopAQlWDuvuNsSkSH/G5DUQ== 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 GVXPR04MB10729.eurprd04.prod.outlook.com (2603:10a6:150:226::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Wed, 30 Oct 2024 02:44:22 +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.8093.027; Wed, 30 Oct 2024 02:44:22 +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 v2 2/3] v4l2-ctl: Support V4L2_CTRL_TYPE_RECT Date: Wed, 30 Oct 2024 11:43:06 +0900 Message-ID: <20241030024307.1114787-3-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241030024307.1114787-1-ming.qian@oss.nxp.com> References: <20241030024307.1114787-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0172.apcprd04.prod.outlook.com (2603:1096:4::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_|GVXPR04MB10729:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f3116fe-e9c0-47fb-a36b-08dcf88cc25f 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|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: x9uMiTWnUPnL/Vln+R1HfTINbTsh6EBi0MJ7QLDiabwejPyYYwokvx8QTSa++uREhr6bkwd8M9/lkLHQ9DcO4ctjV8AM90g9LyvoLzPv7L690Opgp/2sVp7zShW92B2RJUiM8soj/pVvN8JnTNZKPsp7uvk2iPdqhrMgsvhKYtnAUYJO3JvMJZ7y0xWVfHQxTohFgZYqRtJQBEZD+fE+vlUfDnC2nbqfMkYfN16GcZRAC81hY8a+Bt86mV+fvXwiHl4Lz+RzSDoMBcysrRTVDuZKVhYu1JvWUZWBj9M0/pWvF7ztt5s5195ez6E1dhRSyMXk427hGkGRtT+LSnkAdY3/C2zdObSANt9zctzF7OYjUVitGdQoXDXP7S3B+2CSBFt5CnH/CdQ2ZNAgNRjPWacNJjTE3aCjcoiMuhbB6pXSWLZAPeTOgx2RFJCkbwECL5ZDgl0o7RttOZLQGHM5hEDr3tpUuzGPQfjEUGJUprZeALZ3db1TxNg/WceDmLjjwN4+8BpDQPZQCaNkjhAZbTKeJ2bXQ3bgFqdIRElMdNmCkcBEo0iUrLBW83IDKXzTk4E7uxl8bSKC19ITbdCAW/v4LjvGSMynLO1DRwFY7LwssbRIL9RuZofTX3RETC9vo8K7NwhVPc0WBzmQeaI9h6cnl2yY8NFLBTpD5qfiEkyODS4of0i3WxSUUbrM+PuNDhBta+8Aeauy66BhxYVY5wPYPiMuFbunthDq1zMP13SIS1m0kczf6wV2n+HffzTp5qHFFU5Fiwu276aUZj3LHnK2QSNZ3OY4O/DPDrbCkb8AvnpTKWV9008jJcP/7yFHhCRgHNzC9Qcn4k7oslJ6Rw1KHfCeA/JRAUNTgvZIvQ/4XlxaRZJrDz/N9uxUGP/4o8h9rrHt4ovgNrXkrGg6Wy/NJbRnQ1z5HOBCPcc6DlMJnubPk2BS9jlPQqNYxir7nHKpq1U4XIuCH761TAXS+gS3m2PZdnm8EK74M0z0onhDyCLcESbCySkzVnwauOaVMcsg07sgip/fwy61LUDLfn1VRK8SANbC5Lp/yxAP28/mIMx6GAa3W8kC+/9lv/nWk+NwOlPDFOgdGcZzavW8/70V9gxuaFQHKmq2NgkJqRLlTY3jvyHhInyQEkh7ofetxNpJ7UOW2rYCxcSMLQDu8K2dtXySX7L05q/AmvmHxgLTHe5aTatvbb7CZukvk1njRiO/ssIOfNORyewA1fQNQybOB7lHoJrKa7lYNU196etxL3Cs0IOI5kG2THIyYDp5p80xnqGLtSRa5Nn+3IUkaj//AOHRvsp+IjfVXLwqyUOgIHIJX7vyj4o+u18m8TfVBzuZmUCXjh/H5a+cLRPsD8/Vw9bgTSvj1M8oUynFbqA= 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)(52116014)(376014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ffwY+pXaClL6J3nDKb5bDY+SpVyBb4loDDSHg/l1PjmzrPLRIh6+shxRx1ULTDTyM/SSMYzo8YioNjDpNN6sb+kx0vRGgBOETokqS6qJQw2qKAU+mMHk+Ov8K7HpzrUU9KbIt+iDca7gWcp9ajwMJY1t338Mhyw5GTDlzuy63r9L1XR2HLXjbh99n82N3YMR+Yyx2LWYNyi9f2WoPCj6tgk6p1Kyx+GDwC0m/B9T5axH1LBu0yESRxVjhLSoNKhLQfYzv9anAd9c6GqUSAIgVNhoYNqUVicyDk8mksuN8RQO1T3O6TOCceJdHaExI3CzkwWncX4a7mxdVOEboJ2ANk/qOFS8FB6JzS0zB1+L/nmNfyUVC/bULqTyP57ROW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ZlyVa54O8mIXPjRQ2cXjYOuYSkfNVk2qlt08JSpUtiAKlUEPtQMF314EFgv1EkVjEHaRFLgJq7+TwXSyppYv+7v8B5wuyniEB5c1uLFZcc0GXNPIlmRvKC+Mqw/7TPVdqU X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f3116fe-e9c0-47fb-a36b-08dcf88cc25f X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 02:44:22.1695 (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: loUpigqeekJnqqo7a/Uf3exZyofyoYXVIcNJHW30AE6qVuVaXS0fdmJsI0KvPanS6aSeUnAtB4A89z+F6ffOKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10729 From: Yunke Cao Tested with VIVID ./v4l2-ctl -C rect -d 0 rect: 300x400@200x100 ./v4l2-ctl -c rect=1000x2000@0x0 ./v4l2-ctl -C rect -d 0 rect: 1000x2000@0x0 Signed-off-by: Yunke Cao Signed-off-by: Ming Qian --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 40667575fcc7..538e1951cf81 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -614,6 +614,10 @@ 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("%ux%u@%dx%d", ctrl.p_rect->width, ctrl.p_rect->height, + ctrl.p_rect->left, ctrl.p_rect->top); + break; default: printf("unsupported payload type"); break; @@ -702,6 +706,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 +1286,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(), "%ux%u@%dx%d", + &ctrl.p_rect->width, &ctrl.p_rect->height, + &ctrl.p_rect->left, &ctrl.p_rect->top); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name); From patchwork Wed Oct 30 02:43:07 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: 13855875 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2084.outbound.protection.outlook.com [40.107.21.84]) (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 44BC4194141 for ; Wed, 30 Oct 2024 02:44:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730256270; cv=fail; b=jdt7u3D4zOGsZQ42fOWDV19vflASq63kMQhyq9GhOTDqfJTJluNTqyWikQ4ULeauSGAa4pQZY9TsVwn+Z0kr6N0uWb9jwgy1FzsnLfbbO7fI2NJqXJZ/YSsmsl+xhhxo6DrZj+/MYBKXv49SirNiK7befxEOnzRGQF8whtz21P8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730256270; c=relaxed/simple; bh=jYBR6IaAOzHthSKsJcNUfjwN48HyC6xx7AHbrV37V0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=HbjJY0ypdtCh+V1SEziYtfCwksMfu8OAxobPQw06dF3cl3bwaYLSmkPPjlwy1EHT6KyO0h+F+dYjI957m7IxMGIT8bVmyndoBoAX2fMA2EfUrQkYidQA0aRoHCkK1ypOAkB/51eIeXijsXUnV7E2TxDE6lHTco/09orblW6tD1Q= 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=CAfrZPjh; arc=fail smtp.client-ip=40.107.21.84 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="CAfrZPjh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lPqYizZDa+lIQZXYaqxTNtQ0MrV+5BzlmI1Mg/ushhLc0931ipGHd6iRmWHvvsmwqoR1oCxKwfvro9qlgW4PPKAmbWha5bsN+g3M55FCSnU5VnU6N4gusWKOAf6jXHp7LkT2eEvY2cfXnF44F0BWEA9iNlC4rOuZuyQWmdlzKbmaAfofKhYB5RzRC4ivEkChJ6OhWu+Z7pqpfOL53U4mQHSP+fgApJlfkGrehYegF9B6jyNPpldnkGW70zd6po4hBKwBgUTEeFQnKu8MRE2eQEZoUSUsIUSLqT9Rp4/i8EXXCEyFhSCEEJWwJ9ybIt8IDNwx89vG11H27ER3ajeypQ== 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=/79BIbJRU2NDpCO1VkTQ7IokCz3eFLotW0JxGCDsU5U=; b=XEsjjLiji64KS+Yl3Udypff+7hVAgfUQ1o4vwrj1SYB0QFV0wivKKfhP2RHyQ9UlwCqZOpiA/ZCxbEJ4oNwp13SaAPNB/NNAmyzvr+wPK5oSBlsREWtogQmDHA5/96HXNawdU3eJ+3lYGknJ6+3gV4jxdGMar8NX5A4lt2VqEwq10qSYApKH935sxiVvQ45FBEtySwdqb3a5jmmaGgUW04C1TdmiHPhvrIdXlcQdtZvCp3V3YJ54FK9IkGRIX+Zz5PRsykrld30psMVqSYZPfD4pLVQVVQDkKauVK+4VU0sfFQ9N02tJtQpWUQoPLvcL+exSobMXrNcLofbgT8Ht+Q== 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=/79BIbJRU2NDpCO1VkTQ7IokCz3eFLotW0JxGCDsU5U=; b=CAfrZPjhMNsus9PeHn0QgE2Ndh6iCdDSq4Cu2NdhDQEtPDQBjT0sSRqA3LR43sDRHxqxTsZ0p/2sDzGUDeWYpXlorKhp7z98qimuGbDxbsuhYq+d32cOPLZSOU4/w4YElSjavDfEQGGuZBxjKFswrtLYtmbVe+qsNiQL5aWQl/qz2hml1zliNrTN/wyOLQeebYSHbYh1Ryj/cjIVItylb/0oHmwbdv5cFl+/Z+BFdcn67leF+e1CKBuk3hkgt59JCPI+xJ25HsH9IBTvF5MvmWCMdTCgF2sAzVbne0/lpMXxP1k5qpi39uqzZlcSznXtj/xYzJuwlRStED4d7AJtlg== 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 GVXPR04MB10729.eurprd04.prod.outlook.com (2603:10a6:150:226::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Wed, 30 Oct 2024 02:44:25 +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.8093.027; Wed, 30 Oct 2024 02:44:25 +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 v2 3/3] v4l2-utils: Support V4L2_CTRL_WHICH_MIN/MAX_VAL Date: Wed, 30 Oct 2024 11:43:07 +0900 Message-ID: <20241030024307.1114787-4-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241030024307.1114787-1-ming.qian@oss.nxp.com> References: <20241030024307.1114787-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR04CA0172.apcprd04.prod.outlook.com (2603:1096:4::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_|GVXPR04MB10729:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c88eb6f-caa7-47db-287c-08dcf88cc45a 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|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 38jDDb5TyMB2RCGTzMlScfZcwA+z2Zpnc/ien8rMMo2jA4daBI7/fgoHnpPNoNEYeNajtcrQJwtfXdy3d7KGtG2kBogKdfCgjrELJojbKKprM37eYiBREcl+7mAnf3NYIhlopmpdXKZyO5QAVh7SrGIjYZuCW5ytaqVIcOaisSgypfhdXqzKNxOB1OzbwEwofzY0NCyUXs34Gl5LEgPBwLan4tTaXIk7uP7RcLtjTQezQhhOfsgXsKHPJ00Czpd5F6ICE+bMouloGVZ9V9f8GxJUpBVpYviB7/NBZkPRYuzoakx8Do88ma7ru4m4UxcOwLwlNkmAHP2Lgeg07ub4LesvKrgkuDMQuGqBZAkdBVp4q4IOdJhvQh/3SRRi6PKcVQLJ6+T+dVmjkJv9TD7FiGexJeknZpDrxI/81dsDXi0FgGCYhZROEdSkLKOFIlmc9EL9Co5iGZ++v1MRemmuXOLV5eqCDtTlBfInwc5X9ZQMxXoLtRBEq9KLGGwXxUZ3En40huJSoHWCe+9Vjee+TKv5YhbAZ0No+G1J4kb++0IxeXgOt2iwF8dkY3obeTttwSzrpAoS07rnISSxJUDZTssczjzjEt7vdVlWIPIemN1fb/YDzRGFDvyMdKAXDA82Nd56YPSbIXvENjaSZW1M5lOKxa/JHoYtvkF3eNomdgtV21/5Zu/MMY1VYWRIVB9uIzprO8YoS5DFjz1pjQBhiq2YnH7foBb4qehSILgWkp6oLr4PuozyL5hqkm73adVdodo2G9wXjSKuyFH6Essmv3hX/v6MDgQ/x00VMUBpy8cLh1vVHto9VCGAjOn+VHQ3bn/rYkp3Esse7DbZ3iqfT0AbeL53ePUEqzRDWV2ugVjyQWjUl+4kKQprLWVmL4ntmhu+34ftrhmmht4gW/m2ttwl7uIJ7X8gRKn6AjY6HoJfaXPj+9ZDMeA2PATsuyRWLkec55qr3gCnCFbxzMIekfVybccg9wxyx20R/KyAk1c1tvF9+A9HWubnyDof3RWHXs93mtcThXDNiouTP6M5WwCbGjhPW5fhbb4+KJ0zxB1sJZy2GGsErTzE6keDWC4dWbEYgTCY1svlwnjbimlZ77GpTR0NwoyZUW7phai/ESapI1OZszGFcbt78IFz4fCBIVZpf1Wh+iKC88kaFjuMguBaWCmpoB2J9cKDFVia/3Vlg5azj1/hTzI4sHWLh/7M4/Z64NqD7O4Wp95XLL072AclW14pfHAmsHobe1fgGMmgGhx9tJ9vPwcmgun63w6LpIkf1Y/FK+jf01f8xYloFxGk/eVW+yxRmiBKu4geXOn9PNwfMlh+33TmpepSsMy4nb0oc0xwD09mJDBW1BRDjxM41uNRTrEKFZX9QZwPS0I= 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)(52116014)(376014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i0EfqvKtLozdW26zdPo5dNv+perVapXbUeGFMdDXqZLVY4A/aMiw9qVYfV8OazWD5zLkFfMy4JLjBaWSp0gQsmO/WPXmtZvspOWECo8/YE29YAmY7RaTLRUysGJGEhSTn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gquDkyw1zb/rze3GGjIDE1RWI+vT8vLDRay9f/ZfJ6So/Gn6joTxNgJ66byJpFk0R7rhfZXy+kNxt9WpdxpFp5izJGYxYD3IYqee2e2SnkH2db8n6FhK1Q3rY0Hu55g8gUrNjQu/u5yv4T+Arlk0r94R0ts7RAmoaW1ho+3ILEPlzz1XKU4HSvaNC1uuKRMgX+fTxiUFM2gJ9aYWgbCqe5tf10RuPbMgL4vBaz7zcRopQr8CGpd4ROE9e2x7gWfl0rLrGO9H6kKospUo8vOlZqyBXKCBbj4zy42MBzOR6nxpUbt/N8eC9qVeZ/7KJyC4cLT7X/GmDJJp/mJT9Oge0n50dmsP+0HhveDnCl0ANWn7126oGDrKT1WkhwShT7XlJMQrTvz X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c88eb6f-caa7-47db-287c-08dcf88cc45a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 02:44:25.4883 (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: pffIdlyypaUai8KEu2mP2nOga31p7LFGEJWsDvQuV1yWYgR+7VKkVtS3OdJ956cJ3Aarw6+bOuW+yXPT9Mz5SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10729 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=300x400@200x100 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; }