From patchwork Wed Dec 11 16:50:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Zapolskas X-Patchwork-Id: 13903939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F909E7717D for ; Wed, 11 Dec 2024 16:51:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CD5A10EBAF; Wed, 11 Dec 2024 16:51:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.b="RH2HkpD5"; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="RH2HkpD5"; dkim-atps=neutral Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2063.outbound.protection.outlook.com [40.107.22.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3AE3210EBAF for ; Wed, 11 Dec 2024 16:51:05 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=ZBpsBTulDmNrfwJbZHeXcq75jMj/boSmH09tWylX/NG2VNB4DC3pyRwvw8Ne+vxDJo4iPhPUzDwCJmeI2gJ24j6RJp0LfEQuTxBCXbJRiRMyG+XHe32vM2aWrlTc0TtG6J9Vu+2UZj4+QAy2ORr5BLRmpWc/SwYQGHXzqerD+utAky0c+aNAXMuqZHG6gmOEZmNaKHCOjnvQjGAH33qzwPrZYceliFKHAeE075EKsGYXCEG7nH+/hxnP305twlc9naBre7qS9n1VSLnbYb/8PS9McgufCQDk6NjCeLs3sUGy8FFovft8UhhWYyCvFA6eQZHdZNOvoRPR/Hukh3yfQw== ARC-Message-Signature: i=2; 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=6ayApdt7pFmAAU/+0KjMja4H3DAGhYFLXVanPs5Gsk8=; b=vonbfuz4GHdeCo2cLOk920lCBitBdqE8ntoTEAtl6GJV7C1jBWguMde0FfhEM3awCFiV3qLfkrBvu546Di0uyQjPos44zLbzmVlQ+EJBAq3IW6VocSwqiC4FyydMP+ZhOt9qM9XJCT/gPx2G29tOlWWQJrg6JlF4YpCBNoscvRCHt6fe9S6nVaJ+O+PY4VfMSUs+o3p2cnHJ0xJn/HxyUOZ9Hkf2LEVrB04tW+bsZCla+kLmnQXoCCLvlrhlaQ4O0vzpbC1d+HQbfZDwkkTzOQBfdcp8x5bhMgMejCSBaxEb+NiLVy6e3AVdFkri+vpjWYDK5Q2BkrUUqp/mehruOQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ayApdt7pFmAAU/+0KjMja4H3DAGhYFLXVanPs5Gsk8=; b=RH2HkpD5/lYZy097Neb+M5ZxK/nuOVWGp4ST/VMEPc1O3CcjLAbh2q3rnsrPLCNvIvNG10CtrlEqw//XkLKCezpGYXwKkrfAvAjawFDtweEgMNxlWXaw1rfUdAftkVkVCqw3SmZREe+UP075P1a3epx8/MiWeoO7wTbvc0haEbo= Received: from DU7P189CA0020.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:552::30) by AS8PR08MB6712.eurprd08.prod.outlook.com (2603:10a6:20b:393::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 16:50:58 +0000 Received: from DB5PEPF00014B9A.eurprd02.prod.outlook.com (2603:10a6:10:552:cafe::43) by DU7P189CA0020.outlook.office365.com (2603:10a6:10:552::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.20 via Frontend Transport; Wed, 11 Dec 2024 16:50:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5PEPF00014B9A.mail.protection.outlook.com (10.167.8.167) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 11 Dec 2024 16:50:58 +0000 Received: ("Tessian outbound 3df7a8fbf509:v524"); Wed, 11 Dec 2024 16:50:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 42a7f1a433c56572 X-TessianGatewayMetadata: r2NuGx4gX34veOs4T8DOdHNbgv+r1W8HjCKLciDUHmXtf5DstOCT1Qu3fGvHDfPLAtkJZnjEikQD+KM07i32tOP0Ki7yEbD/IV6d1LiccBvuxNYdHP+yU2w5HznLyh0FXHPhpAhQ04hxIQyCT17ejz8spC4dl3moQhQ4+hmEo+U= X-CR-MTA-TID: 64aa7808 Received: from Lf5fe2988448c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CD584AF0-00F3-43EB-BC7A-6B5260494457.1; Wed, 11 Dec 2024 16:50:51 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lf5fe2988448c.2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 11 Dec 2024 16:50:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IhHSuEyLgAWEyn8Rsd7Tx54KS2+NwwPou24juz3fi2HDhG2JTi3lzpO6pweyUvQ3kDu/bX9Zt45bbQyN3qDzjhiPpV1jt2jn2pnk0mtEG7EceszSnnLyzdktQ9n7hGDqJ01cIDyDdxnlh+MxtGSrH+hgYfUadSsSBZgesmmUBY3Gdl/meyyvrk6stll6L5d0lLOibDskIgOIYMp4iBFZjp6vxMc07r7mB3Xms9NdWsoGhjMWdVkjKAjgpf4F8oN29pOBvw+GWb9gwt/axepGuTe4hdhwTXfa+biG21i7aDFvVYTYOM0mSHHPGN+bxaR3LR19SNMqay/HsAbLFpfYOg== 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=6ayApdt7pFmAAU/+0KjMja4H3DAGhYFLXVanPs5Gsk8=; b=Qh9HStLCeze+0PqjnC/l2iYKLb6DeISaXbWlQ6gAt2yjBGmnx1KHKhyR5otDPRHrhJduv7TZhpsoBgtr7ZQWjkb9lRFcRBwF1atYGWfjfV1SV8hdTJhBodhmuelp2yoE3sIoJxhgAujRAlI9FIEkULimafkhSvepG4DD7Otn6vFz5CwQ2cXwtSfqGYZL4fhVI4hFqCy+0LoaEgHp4OseAo2KatwUFD9/lWlpfqEFfZLHTyCKLjgKJgkU1UlRvSMcmZpodhLuU9hZsXOXvyijmwgGpuzyiGM2u0FGpbSrBH3j+0ZJ347RO+SiR6li5YRmC4cBAwgf4znh/bDTqlYEeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ayApdt7pFmAAU/+0KjMja4H3DAGhYFLXVanPs5Gsk8=; b=RH2HkpD5/lYZy097Neb+M5ZxK/nuOVWGp4ST/VMEPc1O3CcjLAbh2q3rnsrPLCNvIvNG10CtrlEqw//XkLKCezpGYXwKkrfAvAjawFDtweEgMNxlWXaw1rfUdAftkVkVCqw3SmZREe+UP075P1a3epx8/MiWeoO7wTbvc0haEbo= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3317.eurprd08.prod.outlook.com (2603:10a6:209:42::28) by DU0PR08MB8422.eurprd08.prod.outlook.com (2603:10a6:10:406::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 16:50:48 +0000 Received: from AM6PR08MB3317.eurprd08.prod.outlook.com ([fe80::e42a:494c:6581:1897]) by AM6PR08MB3317.eurprd08.prod.outlook.com ([fe80::e42a:494c:6581:1897%7]) with mapi id 15.20.8230.016; Wed, 11 Dec 2024 16:50:48 +0000 From: Lukas Zapolskas To: Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , =?utf-8?q?Adri=C3=A1n_Larumbe?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mihail Atanassov , nd@arm.com, Lukas Zapolskas Subject: [RFC v2 0/8] drm/panthor: Add performance counters with manual sampling mode Date: Wed, 11 Dec 2024 16:50:16 +0000 Message-Id: <20241211165024.490748-1-lukas.zapolskas@arm.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: LO4P123CA0563.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:33b::11) To AM6PR08MB3317.eurprd08.prod.outlook.com (2603:10a6:209:42::28) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM6PR08MB3317:EE_|DU0PR08MB8422:EE_|DB5PEPF00014B9A:EE_|AS8PR08MB6712:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b4d6228-f4cc-47e2-4aa5-08dd1a03fc90 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?q?OK7b6lvVShee4PyABT7uHF?= =?utf-8?q?7r66L7ejqF4SXQ3ZwRiWBF8l82WT/M8rwQD+br5aTQlF59dvV7pcX3VxeeRjHsxry?= =?utf-8?q?ADsaeITKHt/bXNu7OBRL0YdXKNCcF4gvLd47o+0M2wF/c2CgaUPIbnPtT0e7pHPTx?= =?utf-8?q?d+MAooA5iBS00jxL/DWet5n/IJ3lQvcGyLMkeyLfoEW9A0BUOX45FO7QdIVAMYCq4?= =?utf-8?q?0Avzt6Xb+Xn957Of0TPDZzDCZn1kx6GuK8KMzp5UzO+EJ8lDnp2gdp4nIRZDAIApG?= =?utf-8?q?HIZP4fFnrJ7GwcOg9llk2NA2BumZc35FXqSPf6ZypTJVqK5OpnYL2QELQ0cqTnQiI?= =?utf-8?q?mKakM4z7PeERXLlkOY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hkq/Cguzj4VtDss/vHR5ZvUcGloTqrWxaoqWOlAbdhzN?= =?utf-8?q?Q=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3317.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8422 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:209:42::28]; domain=AM6PR08MB3317.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B9A.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0b089aa2-e535-4122-d3d3-08dd1a03f6f0 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|1800799024|36860700013|376014|35042699022|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?CtBY5M0+QcWmWhZsuodLsG93f6bxCKn?= =?utf-8?q?18JYPctZQNfk7ivfq/l2P0Vq+l5l/G3juN829Ff+Xlh3zpEANY8xv4eQdYpUFKTGR?= =?utf-8?q?oP7GYFVdY8q9hRho3cr8RR64qaS9B+pmSO0oNxN4LcRhlwvNNRS2Fm1pbthw53Q3T?= =?utf-8?q?VoM6+jm4M7Frf4CffO01sCWqIF8d4yDdRqjnBtAEKIVE+NxJTUiO2Cf+v+Zl73tmb?= =?utf-8?q?7QoSGh6Or/5ElYyMqSd+4OB99FzcxJfqzh4gbGlqfMSQSOB/hQDequ/AN/KvBNCC9?= =?utf-8?q?jxcHf7As5vlR0TcIN0JWMZH9iD9AS++nmFUZakvyb/IN6IflYuvj67B7NnIQY4k8J?= =?utf-8?q?BooCtyIulGM0nFuFvh45Bu+w27s30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eY85crPhExYBD5E?= =?utf-8?q?U4xTEdVM5H+xXIMwhEcve3irROLxmJB15U02PRk2lpAsq7hNvL2q/hWzegVpap0kd?= =?utf-8?q?C/3ozd1+XIWChF+HGUkFXa/sd7woz9i2nA=3D=3D?= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:64aa7808-outbound-1.mta.getcheckrecipient.com; CAT:NONE; SFS:(13230040)(14060799003)(1800799024)(36860700013)(376014)(35042699022)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2024 16:50:58.0548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b4d6228-f4cc-47e2-4aa5-08dd1a03fc90 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B9A.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6712 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello, This patch set implements initial support for performance counter sampling in Panthor, as a follow-up for Adrián Larumbe's patch set [1]. Existing performance counter workflows, such as those in game engines, and user-space power models/governor implementations require the ability to simultaneously obtain counter data. The hardware and firmware interfaces support a single global configuration, meaning the kernel must allow for the multiplexing. It is also in the best position to supplement the counter data with contextual information about elapsed sampling periods, information on the power state transitions undergone during the sampling period, and cycles elapsed on specific clocks chosen by the integrator. Each userspace client creates a session, providing an enable mask of counter values it requires, a BO for a ring buffer, and a separate BO for the insert and extract indices, along with an eventfd to signal counter capture, all of which are kept fixed for the lifetime of the session. When emitting a sample for a session, counters that were not requested are stripped out, and non-counter information needed to interpret counter values is added to either the sample header, or the block header, which are stored in-line with the counter values in the sample. The proposed uAPI specifies two major sources of supplemental information: - coarse-grained block state transitions are provided on newer FW versions which support the metadata block, a FW-provided counter block which indicates the reason a sample was taken when entering or existing a non-counting region, or when a shader core has powered down. - the clock assignments to individual blocks is done by integrators, and in order to normalize counter values which count cycles, userspace must know both the clock cycles elapsed over the sampling period, and which of the clocks that particular block is associated with. All of the sessions are then aggregated by the sampler, which handles the programming of the FW interface and subsequent handling of the samples coming from FW. [1]: https://lore.kernel.org/lkml/20240305165820.585245-1-adrian.larumbe@collabora.com/T/#m67d1f89614fe35dc0560e8304d6731eb1a6942b6 Signed-off-by: Adrián Larumbe Co-developed-by: Mihail Atanassov Signed-off-by: Mihail Atanassov Co-developed-by: Lukas Zapolskas Signed-off-by: Lukas Zapolskas Adrián Larumbe (1): drm/panthor: Implement the counter sampler and sample handling Lukas Zapolskas (7): drm/panthor: Add performance counter uAPI drm/panthor: Add DEV_QUERY.PERF_INFO handling for Gx10 drm/panthor: Add panthor_perf_init and panthor_perf_unplug drm/panthor: Add panthor perf ioctls drm/panthor: Introduce sampling sessions to handle userspace clients drm/panthor: Add suspend/resume handling for the performance counters drm/panthor: Expose the panthor perf ioctls drivers/gpu/drm/panthor/Makefile | 1 + drivers/gpu/drm/panthor/panthor_device.c | 10 + drivers/gpu/drm/panthor/panthor_device.h | 11 +- drivers/gpu/drm/panthor/panthor_drv.c | 167 +- drivers/gpu/drm/panthor/panthor_fw.c | 9 + drivers/gpu/drm/panthor/panthor_fw.h | 11 +- drivers/gpu/drm/panthor/panthor_perf.c | 1773 ++++++++++++++++++++++ drivers/gpu/drm/panthor/panthor_perf.h | 38 + include/uapi/drm/panthor_drm.h | 538 +++++++ 9 files changed, 2553 insertions(+), 5 deletions(-) create mode 100644 drivers/gpu/drm/panthor/panthor_perf.c create mode 100644 drivers/gpu/drm/panthor/panthor_perf.h --- 2.25.1