From nobody Tue Nov 26 04:40:32 2024 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011016.outbound.protection.outlook.com [52.101.70.16]) (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 7F7D218BBA9; Tue, 22 Oct 2024 08:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.16 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729586479; cv=fail; b=BwWk+wKPlA91m5q0yKo1xQtVoJ2jQZd4ndTkU0Sf+GU4A7UR67h1L8zp24ihpdKCRijHvPRNOIKj6PEM+rOxAcHBv9mW2IY8LParCW9nz172GU02uMTGDnnvNCgYWTjIaWDLckn06dq9zy6w00+8EwlKGfoaytP5nXW4WRCq960= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729586479; c=relaxed/simple; bh=V9uQS5qYmiXssOXx3/jo+h9bUk3tmEJA4+u5KYczP+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=E/H46Ul1UrYYtO/ioJg2Ml0s3K6dE/G8ykBY7XDCRREq6pwxX7urp2EecHqhIUAfUevE9Q9kCfDYoa/oyZ+7GKfceCpYxTuk9DhAmgZxy5S1n9j8lXlJZXE7hpouKJlR6UdlpgjNEx9Oy4QUC03qJ56xm7YnyGmymzRCpwlQ1EE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=myPcoAjq; arc=fail smtp.client-ip=52.101.70.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="myPcoAjq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rFm08aoultYe5Me/7HOCB67lvPUZOnhu6DZCpwL8rwchZ40Lp/fIClHiV7HxmawoazqX/P9BxhotA7IgyjBqa9wRS7WJnh/cZgbuUu+PThciE5J4O8BBP7L4qO1AEB5K0Nnms1+TPM8w121u+fTECO2/mTNaATZFNV8hg0R8t59/S8Sqbd2zDj/Tn0oIy1LM02vyXCbC1vGB+UgiQbXLuQDRjgce410Jca4JkbJJGSqMmzAYGHeOUWUsnVKGrZJxRMTg0PPBTcGCNz9Frn+B9VJslsierbOLCUGDvi8pgUt2GVrn2rntUHEdq+0Ahn7zk4iGu9WZ2hau8lNoWkNm8Q== 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=z3oKuxRFkA9yHb1hrfi99zYa7fO58IZs40h8sxAWj0U=; b=gwoS65LnGeCLSl4Ieeb30vsmaieLeNN8NnWsUzYAC3yJX9jz9g8n/nCnPZMafSQg0FIpSN0QLaFrneqO4wZW2uj33YdlrVzmutAFGAqhY3L0oJtr0HDPEXF9E69VS2I3W8CY6Z31cvA/cs0kcv0rSJvLCJy27HoLkg495f0jvK29/WQ1VJTqeROEBUzwqcGD6sJmTLMpS4nPcmJcjjjsXvkMWY6oTBIz4prVgbRY4A5Xiz2bZ4yRnBnlzNpzDlSMT0ULXMWXpbrvskXmYqxJzCjyIli1+4APMeDbsWKqPdyzo3pv7R49RCd62FKgug/0VZsh5YyYNHZeyoE3UWmIPQ== 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=z3oKuxRFkA9yHb1hrfi99zYa7fO58IZs40h8sxAWj0U=; b=myPcoAjql+9blBeXgyxhqoWnZR9LFek9o/P1LgUqk1bbG5XJ2fbIB+lR+CNCnnqSZRuk+nfdKRwAM5Qm2/SiZD5IqpEfwfun0KDoTGBm77RC4zhULHlQLdAR0+CHbkRWg+EQsF6mp56IgtFr7bS+BJsVz7pGrGnlKMy+aaOn4dXWM7l9SU8eiCaTd2R3JSk3XfVFApBnPVHlvwb5ADObgjIG13pLi6MrPH/tYGGOcUdjlpkQszNEw90tU52ZKu7+jsUiianjLPiyQJ8YbXBnL9gODUqfwXCKCyQEqHNiNick7ZGf2s4u6XY0p4l6yPUh9HoeFdI6B58sNAJW9UOZGw== 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 AS8PR04MB7831.eurprd04.prod.outlook.com (2603:10a6:20b:2a8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Tue, 22 Oct 2024 08:41:15 +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.8069.027; Tue, 22 Oct 2024 08:41:15 +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, ming.zhou@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 v3 2/4] media: vivid: Add an rectangle control Date: Tue, 22 Oct 2024 17:40:38 +0900 Message-ID: <20241022084040.3390878-3-ming.qian@nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241022084040.3390878-1-ming.qian@nxp.com> References: <20241022084040.3390878-1-ming.qian@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SG2P153CA0007.APCP153.PROD.OUTLOOK.COM (2603:1096::17) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|AS8PR04MB7831:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cefc7c7-1705-45e4-cfc3-08dcf2754a39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?f57aSO1p4s8b+UvotILpSqMwQfAkr04tJhbGPEgWt+tw20SO5o8Rw2HPUffC?= =?us-ascii?Q?f8IkC9HjswTkbgjLSs55xxvBAByhXZj43Erqzo92ZmNcYyW6kVQJGiIZuwZv?= =?us-ascii?Q?Ixh0qFaIWgNJzCYndVxtIvE5MyP9TI2uLGVqT6bYFzSmIGtw2GluQJl2vVvE?= =?us-ascii?Q?S0huqbv46zFJ273MsolfT/d0L4WhVtqfS9rIejVNvzihlHzF1i0iCdc788J3?= =?us-ascii?Q?DAmzeu0ooAt5xThkc97ntd87ko01W8oXxBM+wswLg+PzlalmZYWDZVENy5/z?= =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Zm9BPW7fn7oC7z/X1gssP?= =?us-ascii?Q?BOANvOuFjCEB0I3PK35KIJzTS+mISiNn41HP2Dv6xxW232bjE0qCdo7y2YIc?= =?us-ascii?Q?H40tx7hXLPFeuXa8GxQMd106/tbWN+YCWuy4k89FYbUvaY0T4jZnFw3CaMoS?= =?us-ascii?Q?k1cb/X0uuSIp38RzP2KzCWJDBWW0MY/fGPWKwQCTqxtBRcQvAFfhBmaVbdQt?= =?us-ascii?Q?HVYEnDA=3D?= 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)(1800799024)(366016)(7416014)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sHOAKYuL3ed3Sg8Q/NMPGCmqo1UuoBqOUWe+uHFXmHI6GsBSWSljjOrRX3Tf?= =?us-ascii?Q?LZCTXilFoQx/W/6PnInWeN3F5ycgrxIV+O+8fAdo8tsKWZCq8HDVX4xwfCY5?= =?us-ascii?Q?vr3FcT6uOWNUfMJuVFN+XBccoHccfgyuSg8L8/Rp6bj8/6QKDE426D5LzSGv?= =?us-ascii?Q?taXiNAYg8VEXGzP14cDsXeDyuuJ7OMFd8YKndejh+y4rCJcQMKeLfe3lIkPT?= =?us-ascii?Q?mQ5OndP9w9ZFxo6iD/ElOwnviHgMlVXucjlWFkUYT19Q1rz9BZd+ZzFjlm4Q?= =?us-ascii?Q?U2GmYm9BirUlMczpYj/cLJjXCouBxepPGdjjaGwBwLZKYv6NSITEWSJIgsqE?= =?us-ascii?Q?42qrN1MJdl9NHpNKB5CORgCOphDIb5iLM4flQj5Pwi3IsGLFtmSv+cyPpBU+?= =?us-ascii?Q?NrZCJMTNUVaEITV3v16NtZ4zDRFPrjFsiHsR/Bs8xQN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11iHz/fJuD6sBGpOepfunNeZUPSF9EjCZnONSq9sRCj+?= =?us-ascii?Q?BF7HRpR4HFBUH+0OhF1nTp8Bqz4+dJjfLGeZo6FcwBDwpyaz+uxobn69XJmf?= =?us-ascii?Q?UfCqoMker6426A8F99XMSu1bM3kqRsLD+xX8AHVa1UdhZvqZ+h0Stx0hN0TR?= =?us-ascii?Q?7v8U7NiAUc2NCD8V/gT7s5Urc/CJklOd03plRTDkOZSJtfiFj7jCjXbg26vo?= =?us-ascii?Q?oqgO5fsWfWJ0Pb4Ss2ReseJpu+0jyvFVKfYg2OMs?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cefc7c7-1705-45e4-cfc3-08dcf2754a39 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 08:41:15.2540 (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: lMBk2wwTiOqlAA3HZHUSjicFPVbAjsTke/qUVBUYtPQkzj1IMNkm8t4ckh3/wkRgAd0fg83oUIilhilUXjWJdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7831 Content-Type: text/plain; charset="utf-8" From: Yunke Cao This control represents a generic read/write rectangle. It supports V4L2_CTRL_WHICH_MIN/MAX_VAL. Signed-off-by: Yunke Cao Reviewed-by: Hans Verkuil --- .../media/test-drivers/vivid/vivid-ctrls.c | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/media/test-drivers/vivid/vivid-ctrls.c b/drivers/media= /test-drivers/vivid/vivid-ctrls.c index 8bb38bc7b8cc..bed5f4fb0c69 100644 --- a/drivers/media/test-drivers/vivid/vivid-ctrls.c +++ b/drivers/media/test-drivers/vivid/vivid-ctrls.c @@ -37,6 +37,7 @@ #define VIVID_CID_U8_PIXEL_ARRAY (VIVID_CID_CUSTOM_BASE + 14) #define VIVID_CID_S32_ARRAY (VIVID_CID_CUSTOM_BASE + 15) #define VIVID_CID_S64_ARRAY (VIVID_CID_CUSTOM_BASE + 16) +#define VIVID_CID_RECT (VIVID_CID_CUSTOM_BASE + 17) =20 #define VIVID_CID_VIVID_BASE (0x00f00000 | 0xf000) #define VIVID_CID_VIVID_CLASS (0x00f00000 | 1) @@ -360,6 +361,38 @@ static const struct v4l2_ctrl_config vivid_ctrl_ro_int= 32 =3D { .step =3D 1, }; =20 +static const struct v4l2_rect rect_def =3D { + .top =3D 100, + .left =3D 200, + .width =3D 300, + .height =3D 400, +}; + +static const struct v4l2_rect rect_min =3D { + .top =3D 0, + .left =3D 0, + .width =3D 1, + .height =3D 1, +}; + +static const struct v4l2_rect rect_max =3D { + .top =3D 0, + .left =3D 0, + .width =3D 1000, + .height =3D 2000, +}; + +static const struct v4l2_ctrl_config vivid_ctrl_rect =3D { + .ops =3D &vivid_user_gen_ctrl_ops, + .id =3D VIVID_CID_RECT, + .name =3D "Rect", + .type =3D V4L2_CTRL_TYPE_RECT, + .flags =3D V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX, + .p_def.p_const =3D &rect_def, + .p_min.p_const =3D &rect_min, + .p_max.p_const =3D &rect_max, +}; + /* Framebuffer Controls */ =20 static int vivid_fb_s_ctrl(struct v4l2_ctrl *ctrl) @@ -1685,6 +1718,7 @@ int vivid_create_controls(struct vivid_dev *dev, bool= show_ccs_cap, dev->int_menu =3D v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_int_menu= , NULL); dev->ro_int32 =3D v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_ro_int32= , NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_area, NULL); + v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_rect, NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u32_array, NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u32_dyn_array, NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u16_matrix, NULL); --=20 2.43.0-rc1