From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78DB4606A322 for ; Thu, 3 Dec 2026 05:05:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kjDyhMMG; dkim=pass (2048-bit key) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=hzfTsW38; dkim=pass (1024-bit key) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=cv+u6Ugo DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:CC:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=/KQ6lVFmp33+PPQagUEZDFzJUhodTPxPfvs/lrE8Jlg=; b=kjDyhMMGvStgxj GYtT/fkKtubfBKAWm+CXZGYUvYEKi8FHVG6j1/K8dFaOMXHezNpItR8bWY5ERC3Y8KP3rVs2nPyKE yn4MzqxdvNdnU9mLJ595lKwSJ7fEjzkm59JPYN2Eju7LSgt1/m+XIg650xq7kIo/YNpQtqNSRyfWu 2NpE/P6qVnJqSuSiluiCab5rx4PUCMsX73C/bf37i3jUMZ2FvikN3hG9ZGg3Jd1TQBiVItquZPwBW MFkUueK8IZUGupCz0DGt+YVsmhGjsf6Dj79/2A66cTTj6kUHVWVMKs5cxSKhqqIUhyilJ9RWFZYhL ZkZbHD6GD011PbWAAiGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYz0C-0000000DYhg-0Xcm; Thu, 03 Dec 2026 05:05:04 +0000 Received: from mx0b-0002e601.pphosted.com ([148.163.154.28]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYz07-0000000DYh0-2K1p for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 05:05:02 +0000 Received: from pps.filterd (m0374955.ppops.net [127.0.0.1]) by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B336YVp976350; Wed, 2 Dec 2026 23:04:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= proofpoint-05-2026; bh=/KQ6lVFmp33+PPQagUEZDFzJUhodTPxPfvs/lrE8J lg=; b=hzfTsW38xkpwQNPblSIKhye7BHuFfDHJkZXfK4lLNST+ZtC3ZtLugJjCF 4vLE7+mGEysrYiNj3xDXErmI35u+yo2Q/gmAf+af5Cink+ANqa8GrOnnMWxMzsBe j2Ho9St13p/ONLxGMCUfEOHgKd8wyxXJH/58ZM+k+51I8vU8ICfGU5sRHqXucRXl /CTIg1ugdJUZYUnkT1ni96q1NqxODojhlGsUutiy48QiERfhijx20Z977zWh7ofE 8pQhsVypPsVedy/bdroQF5yCrH66usrwfv5FCqT6VdA1uzEwCQeXDmUNcdLDN5y0 TvuxzI3JD/Ag66n4bYdgypqnqsIuQ== Received: from cy3pr05cu001.outbound.protection.outlook.com (mail-westcentralusazon11013006.outbound.protection.outlook.com [40.93.201.6]) by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4jansy3xkq-2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 23:04:46 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wpx1CSxFTWZepYND6d0av/kOyWRBYyOWpbxixYKX1eJMMZhNJ7i+0zlnYHX7ei3W6ASd6+N+wmXTAK+8toAABdI9soIVquTd6xXu0ec6ZOyR/p/UW5SYLxIqM+F2U7t3oMxdF7jiEKY7tbbsumTlnKt+I3y3PpcBh5JvQ/BWxAGqF6KQsHhOkW5ky+9DAHWxbEb80ilsu7cGLAmax27kfXpqI5Gk2RhgygS8HZtiN8Py2VP7mtzRcDlfBUVa4G87EOPXppHdfSd6QbSHnfMNopPYJKQO3m5JPjP9U5u77x2nizQJPJb8VLWfs0gKOifLzmgvOqHQnveMirLSeEgYYg== 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=/KQ6lVFmp33+PPQagUEZDFzJUhodTPxPfvs/lrE8Jlg=; b=THx52M17fnX6akJs0/euhG0YinJV4w8kggCVdA7N+GlRMwIJPCbyX0hTTHngS83sbkyZYmx8dbs2T0/6Wv6VOLheoRAG/Ir9bChImBRe7OC4gtPO1cku1Bzg7H60GsOP3lp1LVxAZ8dlW3JOJ8wH63zsWltqTnCClyf9ec+y0ZE2oZTFnJIe5tHLTPnRPLcZvcaHkC9/446sZK7GP4Wne5+SXBAWNY6Y7tXK9wohzADbiW24iC2LItFW3nmwux9wz5Vv3vT/0QiC416L3Z7zzFe+qTyQ4/kWYA3aRNIrHDOFjefr7PAMDFgB6dsS94cBLrW1XbLS/t+XnY8lD/9Dkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ticloud.onmicrosoft.com; s=selector1-ticloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/KQ6lVFmp33+PPQagUEZDFzJUhodTPxPfvs/lrE8Jlg=; b=cv+u6Ugo3yMeB0PhbGXaI7T0CD4SYTA8EG1V8fNFDQxu3qqF+Y09sr9uIyVVGkcLpyvsGGqxLStY/elArdyk0G4+UGTXG6/NjfXof/ZvLROKBWLf28+psWOzi2CTHSg0IkEUPPwr/9a7qhVuQB0vrWoTEas6H86pLJuObEv5t80= Received: from CH0PR03CA0341.namprd03.prod.outlook.com (2603:10b6:610:11a::18) by SA2PR10MB4411.namprd10.prod.outlook.com (2603:10b6:806:116::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Thu, 3 Dec 2026 05:04:42 +0000 Received: from CH7PEPF00000017.namprd21.prod.outlook.com (2603:10b6:610:11a:cafe::7b) by CH0PR03CA0341.outlook.office365.com (2603:10b6:610:11a::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.9 via Frontend Transport; Thu, 3 Dec 2026 05:04:42 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by CH7PEPF00000017.mail.protection.outlook.com (10.167.244.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.709.2 via Frontend Transport; Thu, 3 Dec 2026 05:04:41 +0000 Received: from DFLE206.ent.ti.com (10.64.6.64) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 23:04:07 -0600 Received: from DFLE210.ent.ti.com (10.64.6.68) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 23:04:07 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE210.ent.ti.com (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Wed, 2 Dec 2026 23:04:07 -0600 Received: from [10.24.68.238] (uhda0492258.dhcp.ti.com [10.24.68.238]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6B3543MN2856357; Wed, 2 Dec 2026 23:04:03 -0600 Message-ID: Date: Thu, 3 Dec 2026 10:34:02 +0530 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , , , , , Subject: Re: [PATCH 1/3] media: v4l2: Add V4L2_EVENT_BUF_PROGRESS to report progress of capture To: Nicolas Dufresne References: <20261129132825.4031308-1-s-vadapalli@ti.com> <20261129132825.4031308-2-s-vadapalli@ti.com> <265be1d1-317c-4831-b5c5-d59ffdd5630f@ti.com> Content-Language: en-US From: Siddharth Vadapalli In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH7PEPF00000017:EE_|SA2PR10MB4411:EE_ X-MS-Office365-Filtering-Correlation-Id: 495feb27-f7ab-4eec-c218-08df50faf06f X-LD-Processed: e5b49634-450b-4709-8abb-1e2b19b982b7,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|1800799024|82310400026|7416014|376014|18002099003|22082099003|56012099006|10067099003|261026121527099003|261026140227099003|261021123027099003|261021121427099003|261028144727099003|261102123227099003|261022075727099003|261022113327099003|261022105027099003|261021135927099003|4143699003|5023799004|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: OYQWbyYK/byLJ1xAoPSF43/RMFv4yFOoGM9AWW2sj1XGYjIEqbDuFqgveSfO/81AE1Vv/YNVvgAmVTyLrTGP0maw9TJRKONShPmpLetpqu3bSOsFWOlb7/gOiU3wfu4YZ5zLxXkIV2U65VCpX5UZdGtDDkcPfzxxVXV7h9Q7iVTrpXTYpCdHGFXwejzmJJr7ZcThsKuAyZ0oFde1k7WoNlLXYyfE6gh8t8esCEYRuAAcBZoWr9Api1mVdMsytZKLQU/43mnNHPRE6PfhlQ20cfwn1cGo/oTYpyA25KYUm1Dl5LaZSSAY2sxk3gOXWSpVfVsLSjapS0RasTo4MzxpgVqdKYQZVpm3ip+hVQbxo0k3+3I61hkuZEDfzJwfnKCpWFfh5H7gFy5WOa7F69C7nbYb3lIiqJ+6c8KAkhgj7Eme1UN1MBPWBEN+N4Wy7sigIzv3PlVzXmn12qW89NLIjlH6QzTrTC4wmrUmPs7TH4fivrunWXerZ8gfYvVJH9WmMBDSr8HmrssdO/VvmaG2x55bGx8brfa/bYZEcbZGUrC11u5TqRs2vTbuFi0D2SFKinlKVhLocVANaF3OUc0vZBAO/RdUoEL0FLQi8vkEX8CWWvgT6YMtTF8O1YyzU3uUH6P5GS1xSAx6zeUdocB7BDVClbwuHn26fYOT/0VHPI6xKbDIoAwO0HyFS0QaxDbE6z0lxEouWEbIYgkU9X3K6w== X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(82310400026)(7416014)(376014)(18002099003)(22082099003)(56012099006)(10067099003)(261026121527099003)(261026140227099003)(261021123027099003)(261021121427099003)(261028144727099003)(261102123227099003)(261022075727099003)(261022113327099003)(261022105027099003)(261021135927099003)(4143699003)(5023799004)(6133799003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gP+jKHHC4jh7INoUbcdJe11eq/mtubYUVwZKuRjnpZw+coJr82VpaE79erM0ULX8LnNdO8IUxr0+aTPTSvllQfcTxuSvqAugE9RnK65M1mOeROA7NbcNTvSppKGhabQ6IRsBC4byorYUFjdVQgT5rVhtAhylocVoY7Cq9S38jXs/4SSn9x3n5BPm4XTrYZ+AgyOm9Ic5Kst5/o0+hzEtus06OJar0Wo83DtZ6UGiIClaU0wV7CCNHxCnt6jPup7gKMbEelea/NjFDsAeI9yewGsJZ0dkrxAS3KC0h69SCuu3ivvamy6AGu1ywQxXPYN32bw1qwEmDpSoGPu9cZ7oMwHTRJVlc7qmLHN86/graxX+TRoLjX+87mlnoxQGZyrnkWjGYSusBr/Bbf4NBcJ9PUMcJstwn8oAcCvWFJ3R8D2HQhViRQptzTtqcuMkCD1L X-Exchange-RoutingPolicyChecked: KAzW24ytpN5LKD6NTqkVBhei+HoCT13RJ9SdSMZANm9fN5dfTspUR0O3oe/ZWG6lTyHx+NV92eyH3geTAGSat9nKuvJm0TiQutsWdsBssO97KQbe8mOm96qOkxAsqrf3c+rhw9njzazm32iDDMeyTU51SOQN7mEGkuyLYeFlbiii9rKqQ5JQamzwcYGjOJsgdWv9WLT9hQY+ulw3aYXUmISmV+eo0pbT+vayky5eOOdrQJsUZd3+UEsE49r3N53kXFTz4FQVzcYSAs0NCqDX12o/Av4fgxDvwc+hbJGqLyQFos35Ba2DDT3YLeReP9YsVMFAwjZvhomDv0hcSaDm5w== X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 05:04:41.4780 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 495feb27-f7ab-4eec-c218-08df50faf06f X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: CH7PEPF00000017.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4411 X-Proofpoint-GUID: jtermO7FkKgqYSrrOyLcdzN0yOIBuD2d X-Proofpoint-ORIG-GUID: jtermO7FkKgqYSrrOyLcdzN0yOIBuD2d X-Authority-Analysis: v=2.4 cv=FaqiV5+6 c=1 sm=1 tr=0 ts=6b10f86e cx=c_pps a=/+xYJgQt7uUW31a/4HdwMg==:117 a=iwqwCZQqcuTv3JOpYdM7/Q==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=AlMIdn_sM9wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22 a=m9av_yUvlsBc_kLsbEEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDAxOSBTYWx0ZWRfX+k93K6Xjl1mf /O47fpAl8D+OtNhGFzxNajc7aP6GzQHd5roUIjcJgupbBFVHgwrupMrkFUOyefNGcRPwkb5+wC8 Ad+1sN+xeZEodxpwky5fkgfhp5Aeg64= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDAxOSBTYWx0ZWRfX8mTz6uhCBWwh nZiC5c+k+wekQw3r1zrBqJUwHt0iTx1GcjnugWtDwwDO2Mkon3a/Z7QkH1JH2prJl7zOLQOmwGr y9N4FkmsKoylqN6Reh8/X2F5lPKxKCjS5gViu+KgvSoN9KnfORG66MTeX6YAowycmvBkDVoqOq2 Wb0DClSTsIbQzN6+4jjSWOlWkPS7nIBpUcH/lkaAXN1wxxEPVsV7m7fDw04SYNPvf2ZsvEIdqBp HzDEGek4FEAAFt/7kyZdpr5N704nfVVthBuYQ2bIiKG6umChRXoQHPnPNV5b9KY6yTCTM7Pm18B ct02n5xSv3p7fhAAJEbTqs2L1dcy8GWJoKB0mq1vHsik/bC5ReJXpYhIgRveDssXWFbHkAc0jDL 1KC+F846dplYRjl5vwBrU0t0p0hjEGSsXnUMVTam7fMpuRa4F+HpoY0aRBmawVRzIxHHxK1chj0 GOHeDra6brZ2Gtt/l6w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_01,2026-12-02_07,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 bulkscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030019 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261202_210500_009119_ED6B09CE X-CRM114-Status: GOOD ( 19.44 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/2/26 7:39 PM, Nicolas Dufresne wrote: > Hi, > > Le mercredi 02 décembre 2026 à 11:26 +0530, Siddharth Vadapalli a écrit : >> Hello Nicolas, >> >> On 12/2/26 12:59 AM, Nicolas Dufresne wrote: >>> Hi Siddharth, >>> >>> Le mardi 01 décembre 2026 à 10:56 +0530, Siddharth Vadapalli a écrit : >>>>> device caches can spawn a worker that will signal the fence when the memory is >>>>> actually ready. On top of which, you can deliver the fence once the transfer is >>>>> proven to have started, rather then when its complet. Sub-frame, unless you only >>>>> care about really slow devices, introduce very tight timing which only dma >>>>> fences will really cover. >>>> On platforms where sub-frames work without DMA Fences (Hardware-Managed >>>> Coherence or ARM64 pgprot_dmacoherent mapping), I assume that the latency >>>> advantage is noticeable (as documented in the cover-letter). The usage of >>>> DMA Fences will cover other platforms as well, but that would defeat the >>>> purpose of sub-frames due to higher latency. Hence, a limited support for >>>> sub-frames looks better despite not being supported on all platforms. >>>> >>>> Kindly let me know what you think regarding this and please correct me in >>>> case I have misunderstood your proposition for the usage of DMA Fences. I >>>> look forward to your feedback. >>> >>> I really don't see your logic how DMA fence has **much higher latency** >>> then polling for a V4L2 event. But let's me describe from a video receiver >>> point of view what I had in mind: >>> >>> - HW signals the start frame >>> - As needed, update the sub-frame signalling (e.g. if it changed) >>> - Emit one V4L2 event with an array of fences for each sync point >>> >>> At this point, the buffer is empty, but userspace software can already >>> start programming the lower half of the ultra-low latency pipeline. >>> >>> Software component would simply poll on the fence, like they would do for >>> the V4L2 event. With the benefit that each thread can have its own poll, so >>> you can wake directly in the thread doing the processing. >>> >>> For hardware component, ideally they handle fences in the kernel. This is >>> true for all the GPU and NPU driver today, V4L2 is lagging behind. This >>> way, driver can go as far as using dma_fence_add_callback(), and trigger >>> the next block with the smallest possible latency really. >>> >>> To continue the video reveiver: >>> >>> - HW signal sync point 0 (irq), fence 0 is signalled >>> - ... >>> - HW signal sync point N, fence N is signalled >>> >>> You cannot really achieve all this with just the V4L2 event alone. Remember >>> that this is how video games maximize their use of GPU hardware, its really >>> mean to achieve the best. Another aspect is that fences can be safely >>> shared accross process, where if you share you v4l2 device, you also give >>> control over it, its unsafe. >> Thank you for explaining your proposition in detail. I agree that my >> earlier point about the DMA fence signaling latency was incorrect because >> the driver on the SoC (j721e-csi2rx.c) polls for DMA progress using >> HRTIMERs as a trigger to measure progress and it does _not_ get interrupts >> for sub-frame completion. >> >> Just to be sure that I have understood it correctly, I am attempting to >> describe it below: >> >> 1. Instead of a V4L2 event every sub-frame, there should be just one event >> at the start of a new frame. >> 2. The event at the start of a new frame should contain an array of DMA >> Fences passed via a sync_file file-descriptor containing Fence0, Fence1, >> ....until the last sub-frame is covered >> 3. Userspace applications can submit the DMA Fence file-descriptors to a >> Video-Processing Pipeline >> 4. When sub-frame X completes, the Capture Driver (CSI2RX in the case of >> this patch series) in its IRQ handler will invoke dma_fence_signal(fence_X) >> to notify completion of sub-frame X and the Video-Processing Pipeline that >> was polling on the DMA Fence for sub-frame X can start processing that >> sub-frame > > That is correct, though you can signal fences from other context too, IRQ > was an example. I had in mind as reference some display controller, that > had N configurable line IRQ. Typically, polling + sub-frame make sense for > slicing such as slice encoding, where you will have at most 16 slices per > frame, with frames being 4K or more worth of raw data. > >> >> If my description above is accurate, then, I would like to list a few >> reasons why the above will not work for the SoC/Hardware that I am using: >> 1. The Hardware doesn't support interrupts for Start-of-Frame and I have to >> rely on a HRTIMER-based approach where DMA-progress is tracked via the DMA >> Engine API (get residue from DMA State using dmaengine_tx_status() API). >> 2. With the number of lines in a sub-frame being small (10 lines for >> example), the number of sync-points and therefore their corresponding >> File-Descriptors for a given Frame will be large. For 1280x720 resolution >> at 30 FPS and the sub-frame size being 10 lines, it will mean 72 >> sync-points per frame (i.e. sub-frames) at 30 FPS which is about 2,160 >> File-Descriptors being created and destroyed every second. At 60 FPS, it >> will be even higher with a value of 4,320. Overhead here is that of >> sync_file allocation and installation involving locking. Additionally, if a >> userspace application that consumes the sync_file slows down momentarily or >> isn't scheduled for a short period, the number of FDs that are open will >> increase and lead to a ulimit exhaustion for that application/process. >> Moreover, each FD has an associated 'open' and 'close' syscall overhead as >> well so it translates to about 4,320 x 2 syscalls per second. >> 3. Currently, "struct v4l2_event" has a payload limit of 64 Bytes (__u8 >> data[64]) which can only accommodate up to 14 Fence FDs (4 Bytes for >> Sequence + 4 Bytes for Index + 14 FDs each being 4 Bytes in size) > > Can you explain the real use case where the CPU will actually keep up with > polling and waking up every 10 lines? This is ~0.5ms, or over 2000 wake per > second. The CPU scheduling latency will reach the roof. I don't think > either your design or fences is applicable here. The use-case is that of streaming video frames over Ethernet by packetizing them (encapsulating them in Ethernet Headers with RTP as a protocol for example). Without sub-frame support, there is always one-frame delay plus an additional Ethernet-Side transport delay. On 1 Gbps Ethernet links, the Ethernet-Side transport delay is minimal compared to the 'one-frame' delay. Therefore, the objective is to consume sub-frames in Software and begin packetizing them and sending them over Ethernet as and when they are ready. The lesser the number of lines in a sub-frame, the lower is the latency (since it is only the last sub-frame's packetization that adds to the latency alongside the Ethernet-Side transport delay). I do agree that 10 lines per sub-frame may be an aggressive value, although I have indeed used this exact configuration when testing this series and measuring the packetized sub-frames on the Ethernet Wire. I am quoting myself from the cover-letter below: "Enabling sub-frames with each sub-frame being 10 lines and the polling interval for HRTIMERS being 100 microseconds using the following commands: v4l2-ctl -d /dev/video3 --set-ctrl=buffer_progress_size=10 v4l2-ctl -d /dev/video3 --set-ctrl=buffer_progress_interval=100 shows each sub-frame being queued to the v4l2 event queue every 258 microseconds on average (with a total of 72 such sub-frames i.e. 720 / 10) resulting in the entire frame now being queued by 18.5 milliseconds and a blanking period of 14.8 milliseconds. This not only proves sub-frame queueing to v4l2 event queue but also shows that the OV5640 sensor which also supports 60 FPS seems to have the frame ready by about 18.5 milliseconds even when operating at 30 FPS." This was validated on a Texas Instruments AM62A SoC with Linux running on ARM Cortex A53 CPUs clocked at 1.4 GHz. > >> >> It appears to me that the current patch series and your proposition are >> addressing different problems: >> For Coherent platforms, the current patch series is a lightweight and >> simple approach to enable sub-frames at a fine granularity to lower the >> processing latency as much as possible. > > Its only a tiny lighter then fences, with the difference that with the V4L2 > events nothing happens ahead of the critical point. The overhead is inside > your realtime slices. I think you want a different mechanism then V4L2 > event here. One where you don't hammer the kernel CPU scheduler so much. Thinking about it again, I agree with you that the current approach may not be the best due to frequent HRTIMER based CPU interruption and rescheduling. > >> For non-Coherent platforms (not in the scope of the current patch series), >> your proposition of a DMA Fence based approach with the aforementioned >> overhead and a limited sub-frame granularity at the cost of a relatively >> higher latency is suited. >> >> Therefore, I would like to know if the current series is acceptable with >> the predefined scope of Coherent platforms with the aim of being a >> lightweight implementation that provides high sub-frame granularity and low >> latency. Kindly let me know if you have any suggestion regarding other ways >> of implementing this while still taking advantage of Coherence and keeping >> the overhead to a minimum on such platforms. > > Unfortunately, with the information you provided, I'm not entirely > convinced its a proper API for the task. Of course, I'm just one co- > maintainer, and not entirely focus on acquisition, so Sakari, Laurent, feel > free to overrule me here. I'm obviously playing the devil advocate, with > the concern that if we commit to yet another API in V4L2, we should make > sure we don't do trade-of where a better solution may exist. I appreciate that you are reviewing it with the intent of finding the best approach to address the problem and am thankful for that. Feedback from others based on their experience and a fresh perspective will certainly help. > > So base this additional data, I think we should seek inspiration in the > real-time audio pipelines, but with frame signalling in mind. Your use case > is based on predictable timing, which is how your kernel work. That your HW > does not do SOF directly is unfortunate, but you already said you can > figure it out with hrtimer. It basically mean you can already generate an While the DMA will mostly operate in a predictable manner (and write the video frame to the buffer at a constant rate), a DMA residue check is still required to catch those scenarios where DMA may be temporarily delayed. The HRTIMER frequency can be programmed such that we are interrupted at an interval where the expected number of lines for the sub-frame _should_ theoretically be written to the buffer by DMA. We verify this using the DMA Status and once it is confirmed we queue the event. At least this is the current implementation and may not be the optimal approach. > accurate timesamp of this and you know the acquisition rate (just like > audio). The SOF is earlier then when you can start processing, so it would > be the perfect time to calculate the deadlines for your frame. These > deadlines can be passed to an RT thread (or non-RT if you don't have a use > case for not being late or very fixed latency), and your process will > simply use the deadlines to decide when to batch the work while maintaining > desired latency. You endup removing VIDIOC calls from your processing loop, > which removes context switches. I will spend time thinking about this approach and its suitability to the use-case being targeted. I shall get back once I have an implementation in mind. Thank you once again for your feedback. Regards, Siddharth.