From nobody Sun Nov 24 12:11:52 2024 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2044.outbound.protection.outlook.com [40.107.105.44]) (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 546081922D0; Wed, 6 Nov 2024 06:08:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873322; cv=fail; b=Z2JD6BNBRdSbWi94EvyZzbAeXflje2cSqJxi32ps9IVgiakWFdJP9oekCNLdSZjI2nzG4eRSKMV/tlAmgiNdrUNtztd4L9BL/LHqgOe9ozpo0IeQeivfN9vqNdqtBw7Rl+hP9iHEZR7eVlYCdKqb56+eOJe65DZZHaz5Qg2Ets4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873322; 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=f1kZuc73GcbzL0rsNrCk4bB3LF/QZR6b/kdgnucxijibpKP5zakn2FqKiu2UHRK4g1uFkAUkfxtLOddlVW1QPNPnbgNgESeelwwKl91q6/EDu4h6sfPibPsmGpxoWP9eGBHWQd7btFVe8urh7Lw3Hn1ZE0De+bBIlt4JQmgYG08= 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=aZe6zRz2; arc=fail smtp.client-ip=40.107.105.44 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="aZe6zRz2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gdjw9ly8B8kPyf5KH75DC9CqJU3feyB9uR+65iK9X6is44tfPsccYZvRIZjsOJ3inG8J61scZwgKRoHeYvluMJ/Q4tKU5B61vVHeMKSugLX//cIdJW+8ZAvyIElA+5nq/SOIlJIP27mZqyJmnFPCLcNHyrrymSGAJKAvnx4gvYSu3iurb0mO2q2qmcEzkALphgTWNdTAazckVww7pk6d4UKM3wyzgg3MEXDAh1QiS9J4cajglaYBgY517LHZlnOs3M7OGzqVDEKtcBEhYq7nk9bkAZVpgcrevLllvLx77Ih+1Zcyn08jzOatwdHroyJgC+Nljexrs6sJBHwc36j8/w== 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=nPdiPrnb8fon063dJIfc1eAOfer9ip/d5yi5D2vhUlFODQKuEmje1BYyUxMp2EkITK2RoVxDNeFNMY95uMkmGx79duzn8JlUHdoJJdfuZuJ6q4VmCsXX5hvV4p1myGErduBrrlTDYianDap1agRqGgZlsMdvPMfPHyNl1GKxghrzJeiXJMWl3qaEq0VBePVTPQmtA5hkFS6vO2JeLM3ACLAeqs1/jEHOQPeqEBkx0iB7OHHeD4mar8mL4PcnzUaiZBxUKd0jT88cnza2y2Fsm3E2EJB5cmWyJHnaw0AcsNUrztNyH7FhX1t22vXY4TfNc2R64xv7TFtyi4xUy+4RTw== 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=z3oKuxRFkA9yHb1hrfi99zYa7fO58IZs40h8sxAWj0U=; b=aZe6zRz25BnyL99xSzmk4gbC3Zhw+b786qY4Z+bwaRQXkl/gbN1xWDwNjjQc4WWcLbE3bGnaSTEApS6r+04PtFCA2epHpDP3goymvtuj3mqapmhSomU3K7uX/tafK57elDpXZIe3rHPsG95/LpANT3IVPf6XdWSo8mMJ1ms8iy1b7/EBZbNSXTwb7NSRaUFtd6N9A9n+5hd1XYPKVUFx9vLXcx1ph3nm04oZC3/COn1Crbc3aezgTkD5QrVmK1G1DMxskJiLADlhaKgxn9YUGWcw/S7UGOXlecLr20exTY/aiQNGokQlhp2WnUKr51GLnLF7GdLR04PZfgdUQ2rX5Q== 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 PA2PR04MB10506.eurprd04.prod.outlook.com (2603:10a6:102:41e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Wed, 6 Nov 2024 06:08:37 +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:08:37 +0000 From: ming.qian@oss.nxp.com 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@nxp.com, imx@lists.linux.dev, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 3/4] media: vivid: Add an rectangle control Date: Wed, 6 Nov 2024 15:07:51 +0900 Message-ID: <20241106060752.205074-4-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241106060752.205074-1-ming.qian@oss.nxp.com> References: <20241106060752.205074-1-ming.qian@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI2PR01CA0013.apcprd01.prod.exchangelabs.com (2603:1096:4:191::9) 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-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|PA2PR04MB10506:EE_ X-MS-Office365-Filtering-Correlation-Id: ec54c818-56e6-49d7-7dd6-08dcfe297411 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|7416014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?TR6XBap2c8sgr9e8Tlfiopmx7iADuAnYFs8bOlu8sgbFZLzLSWJkKTKqMt+l?= =?us-ascii?Q?nfnXByzW93bKazwnguL0OzyKHyeT98nb0r/VPGS4KHl/gLid0rNM/JOmkNHT?= =?us-ascii?Q?0sYX8v5DdBSbj4cLmUQmepgUagIAFZyLnXcwUikoyD1ijaeDnu9PgmRPpBPD?= =?us-ascii?Q?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mW2gmhb2?= =?us-ascii?Q?JGZfrFQEypYVmENJ+ZP2HTMAyu4E7SMTIafxtVtUBLAP7suGD+4JFGicQzGN?= =?us-ascii?Q?asoORwyijB0m7qpxjfwVa7PDF1qaYeOrvRr5a2Ixt6E8D3jIamtMaE5nLAJo?= =?us-ascii?Q?WKYCcVvMdV6RbrBuWPD3P9fa9MQLGSfo/JpdD0bIO42uwn+lBdDSqprNv7jA?= =?us-ascii?Q?NUVxhC+OFot2Be7lyAfxWeTuRvE/IJzC16dEhfOI/oLQd1BKSTTWQRyP2axY?= =?us-ascii?Q?1Lg6xgyEWcZBW7T6nIJykA4+eQsyLxGTH61ybNm+xPHnPRDtrkXVHLEnKCAk?= =?us-ascii?Q?wymyVXs=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)(366016)(52116014)(7416014)(376014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+H+MkrcnwkQdXqsGYqHwSnjGVVKa428gP6WIsLnddeRg3o/HJx2CcmFDVfxz?= =?us-ascii?Q?jvFPjerJAqj1cmoWlufxV5Amz5GM/xGZiUCiiAknW8AtCf1l5mkEneoJpyNA?= =?us-ascii?Q?wbuzYkLRT4m0kikcXqHBAH28b104mwtg2HE9gC/tKqH7WpGUAAzFMFMxdW6w?= =?us-ascii?Q?Hi6TDEdIabC/pLQOo88SazCdYINASMnBNUJLmQ5S2CuruPD/9htMyCZsQNXh?= =?us-ascii?Q?2MLzhlUYugp+CFee0XbqlCHwkZMY4e1h55rzhwpb7qcOpU6Ylv60RvYh9iDl?= =?us-ascii?Q?auCXbVMMye9I87FqicsSpQC07VG7PmDJEqBoklm+ns8TZzSycb+DwVIDDnvR?= =?us-ascii?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HZDW?= =?us-ascii?Q?KVYeuvEDroA7Kv5k4N0tkvaOz7GzCAfrJy02/kcvxdpuqqKaH9vXzA7GLXDq?= =?us-ascii?Q?RjkwcktYvgt3VNbNt7qxCLgacQi7atdHYAkJaMoHhkmrEV4/8V6x/p1+vLSr?= =?us-ascii?Q?+lkXycXlvrYfhtGtlU8jzmFjcREh/FCmh4Det5FA0vwhLH5E0DlBXHjiqA33?= =?us-ascii?Q?sVwe5kyClniHKcot0rWLtm43SosOPZZZo0qV0YHPdz5W9adnWLeREELvJMsY?= =?us-ascii?Q?m7tUnwAjiHYgInlyxGvOVCHSYIEN8n6wWfZ8C5/kC5HhCE+NTMhK8qwDjTk0?= =?us-ascii?Q?CreY/4oW5GoT8a17E0HCxNjqn1I+trWWsD6FiQfg?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec54c818-56e6-49d7-7dd6-08dcfe297411 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:08:37.6056 (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: FLLElCa8QRSa5oyt5D92HInnt/mjGbScv8kBIRY63b7DTAUnqJ9aKVu6O3eMagfmh8vvum4POpP1EFAfqoVoCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10506 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