From nobody Tue Nov 26 17:15:29 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2085.outbound.protection.outlook.com [40.107.21.85]) (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 2B6C01D95B3; Thu, 17 Oct 2024 09:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729156842; cv=fail; b=n1s6kxZqJJIajlkwqqJBfYFGtmVOqcBe9mTYHgj3DM6CifB9mfLDkj5jp+7Jchkvz6Ltyoorgb+MHZwX0C5EGVI5MvO8y/PUreWi62gTZTroOhsRJEbprzbox/47mWXrJpJLGxMwAqb8ujgNZsWAxyScAHeBuop7UGWjO+RoH6k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729156842; 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=IALCzAqSRcrmElYBiWpBX4zP7hfRsRsSwlJ7PYY9y4zIKOJONSZ2Xlzkjb6KvhO6paeMGaRxFRtgRR2eoxEzH1MrMByVFaobhH+imNp1byTED7US9o+HhyYwIilRT9ISGxviA6t+yKiC3TVrY5cMZ04ohor+XTAGeZNuq/rNPjw= 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=M9SllDs4; arc=fail smtp.client-ip=40.107.21.85 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="M9SllDs4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e64ppHKrKlyOIV+iAZ7XfDq3DSdbWay27dD4DuhLSLbluGt3rElJ2c3sgX4dTqk12u9D6+g2sPhagD0Z4SJEvfn7n8Jl24y7Bvo++IArkWQmgwn+T5A1bPD3sz5oAuSjdUIgbqIoec8jszXIrl8cl5YdD62LWiGb/fVdeFqW2EI8KbO9wzWgZvRo/0M4KXPnCbFFsa0GQu4dT8X3kKoXAFPWiAhPUKVQ244O41v/AkjjqccU0YmYKomHljIBvFm4F1g/PMJCyl11jYx6kvzFvBRN7ub5+/Co355k8BFgzUAqRWqpkBxPtDavSmn1/NpAjqDEFBOCb6Wpd8CfR8cQ+A== 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=MWhytjmWIPHDXU5LysnP6O4H6p01ViKKFMnbeQXQKJflYgn+8ZgQCfPlF+3CTWBnSuiXM6habcZO0R52Yit9XusNhv7HtCl7IHQ/CDRVVQynTONW77dMWLS9dHBmvg3J3/pRST7f+E1otCaC9EO7UvRxeXE+UjSNwIrcZx53Uj7DnL3LN87VJVrU+Hmo/GfMhK4dqZtW6JXiRqLJzXcRYucX/jRYlKbbM7+5YEIJoQaTG5fH7Cjcn7sqeDjz7Cmi+yDD2EwfwohupkwBgtucCcJaRu1lw7/kgwXBabwetClTS41xHjYmLL2eS9k5+BUtdaCLke85O82Si3hgyvYoXg== 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=M9SllDs4VJY7zqyGbKI+sghP/RvIr2UksIwBHmLTdb+/2BnklPlNfoma4drPWYM4RrRgu7l5LVfobvJz/4iXZ8+Y8k5T4UzgrnUZY+AAAcRrqTm0QEMRLqIbkrBDcMBFBwzuKu47pf3P6PvmTHKBsI2I2nkqZtw+pkaIuzCyL9nyT0cTyLR0nDU/eXGLsbsmNj6Gj9EDkTrqSafl8EA3Zuew5CDUKLOhltk1ldD76sz40d5H3o/YWm+HQIl+vncdrYRkj3afmvnHj/Ib6flj1JhW4sM/D0lgpx24t8g7SEzu2mSo0Pb21iL8AZs22rr1+VxecMtJLd2nkVUt6g/umQ== 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:35 +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:35 +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 2/6] media: vivid: Add an rectangle control Date: Thu, 17 Oct 2024 18:19:47 +0900 Message-ID: <20241017091951.2160314-3-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> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SG2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:4:188::19) 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_|AS8PR04MB9061:EE_ X-MS-Office365-Filtering-Correlation-Id: d05e3b88-eb36-4c3a-c98f-08dcee8cf4cc 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: =?us-ascii?Q?ngBTSlgCZs+hrHL0CEfxET8XV5G9iggIlzaQwNOkz1NWkUcNArFP0kbxBlsa?= =?us-ascii?Q?RLvVb8GNrNRMkZSoEyjMe7Ez5109nqKPdgk2zDgueJEdguEx+iPMSmNQ6pdx?= =?us-ascii?Q?2lmqfde2ps0Dp3M9muX0CSXC9wR8L/1aZEsRfvtuAifyRvnx9HTdgQtAfQzy?= =?us-ascii?Q?Y9KIepGh9fYvxOl4dAWk1kZuyIzvIS6nw41Rf/eM8eEOO/TzD5MymSje3l/F?= =?us-ascii?Q?fjwxPgpQ4lPpf0DN77kNR6Dwfe7R0QG21RR0YW3xpKoJNWhuwPDyW4q4zIgE?= =?us-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oU3BYZ7GTAaJii8/?= =?us-ascii?Q?Xs3J4MYPiTF80Xx57SG7RfzZHDRYO6UAYlSEU4P9U74COM02A3Mf+QWjWE57?= =?us-ascii?Q?oN9N6tlRXvcXp+IZwgyH7Ze1Hi79EAr1D4JGfbwUr2NH6H9ZXMlrVZepr1Zk?= =?us-ascii?Q?GmAUQKC847Yx9nQAl40vtKg2+BKgQe8o/N6DAM/58fyAlH8G36C9YUzTWwok?= =?us-ascii?Q?MSfk6aQ=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)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SGLzGu4G/vb/aR0QSAOjHHcJ+MGQra6kmMAZw1xzV0LWp1laphoU4XKLvfWY?= =?us-ascii?Q?ufCNfrUd5goMaaB8H/7VErYB9QzMAN2x3BjfheHQ59wVxQtzVY9UZn2Br2R/?= =?us-ascii?Q?SSy/CD/XNggeX2LwEzSlhBzTMn4jb2V5r4/cLvrEbwjnJAPRVyYaXdAkcY8G?= =?us-ascii?Q?k+FrOYUb2B4+0RefXsjSQ2ZsySRNi2GKpBxXq6siuTKigdLsC8xsoVjJTFUI?= =?us-ascii?Q?swqtJjM1GagsfEU3wnvEpeJq113GeN0QpdYfgaEHREip1tMkrirYymCbgdji?= =?us-ascii?Q?8H2eJUCMR+UabvfVwoINPP+V2I3r1MIa/0Svhb39X2B4DOSLQ3pkVVQgmALP?= =?us-ascii?Q?XQ4BMX0zw4481AolGx/tooukH6O5dTj9CrPj5m9B9WCkrE+ZaGqI/BxQp9ZC?= =?us-ascii?Q?+RM1U92pKQG5949z6OFnhDwTeE912f46E1A+gb9TXW+Z+a0d9u2b/VsC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zKCKmM+paAr9j/zqnBSdevoimardSKVdR1CE+?= =?us-ascii?Q?Cj1S/Sf1J1etEmD6uemCblfKRV98sVRoAY7NI4r+Mp6VEZH6RHBN0rRqQuzp?= =?us-ascii?Q?oRqmCcsQTKRymlH3ww8CEZZc1hPQMXdMXbdcnufQ7qEomDWxLoOyNP7sSO5/?= =?us-ascii?Q?F+GRsnJOsQYPo7yVcJb37DhWZVK47BKs0u3yKfrbN+9o/osPGF17JZFM0oRC?= =?us-ascii?Q?EVtWrM84Kh7CqjCudxc/Y7by1JY7Odr0ep/+R/2B?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d05e3b88-eb36-4c3a-c98f-08dcee8cf4cc 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:35.1503 (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: SMzgxNs9oMpG831hNkXgqt3fT9uTViIcqwgEL5C26y1eU+yvQ9P1Fc1H/XAsCxvYns68Q12ocwlg9LnUb9MYnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9061 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