From patchwork Tue Apr 1 15:48:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Zapolskas X-Patchwork-Id: 14035063 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 A6335C36010 for ; Tue, 1 Apr 2025 15:49:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CC0A10E602; Tue, 1 Apr 2025 15:49:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.b="Brc2ZYea"; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="Brc2ZYea"; dkim-atps=neutral Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11011028.outbound.protection.outlook.com [40.107.130.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4118910E608 for ; Tue, 1 Apr 2025 15:49:11 +0000 (UTC) ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=QJt6iez8VxLCsoRMyTwrAqfT4ZggtBoMWCORHIODnAiQhSor93nlHr+i2B7rZT8tU+UQHK2NPp5lx09SWHXsg4qjppP0wu42Dvc+rX6i+FUuol8dLR8hpiqOl5hy1bHw5EEZXOVZEMWPi3kTNK9XXc2n013LaOTC52LrC3cnmDNq2hwEasbq7hn91uMU6rfyELRzj8zFim132yMdTvc97DvnZonkIK5v1nKrFMOMNyCa6dM22R+9zOp7+DtQpcz9ZGyW8Wxh53iUlw6Dh/Iz6eAFGqVEJYIVqNVy51qNR7UR0bEhektZPfurUhixd/E2Rp/HvIUevQTH9RWLt13y8A== 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=FZotHG/NiHZdV7jEQZVPj2JqaAhiLixdocbppNgllw8=; b=Wk8IUMfYXSF6xzlO4cqR//mbthzvuWmI/zifl9xddDg3D/mcBXPg77TVlVCNllTJaBIm3x+vFV71P7HA5AZ0q/etWvpqxiMMeD6r+WX+SFBOwRuOs2Mf9AEr+RrlcBiG1kPui/rOMzgd12g32o1/VtVlFPA63RJzlMVqwckJ3CtEAeQp7vPUz+18sohp03uw1rCioIoYDHj0oe5/cjf2biwUD0q8rwWINvCqrbm8PV/wO7XJF1gdmIj7OfWUvXU3iy9GxgtchBDKmDVZZJGYcMzTVoTkENmOXekkECqHzVj0i/96l7tBlnVI+enxgSpmqGNFKLknhAUtPHZLdLeqVA== 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=FZotHG/NiHZdV7jEQZVPj2JqaAhiLixdocbppNgllw8=; b=Brc2ZYeawqTOE4b0ZRYihd13CtrWN9bW953r+DXsJJ1nCFK/dcN/rAfPwV9/0dqcDqb4sB7XdhHXD9694xtsucPybid+YeQ2VaGDurMSw/yIoKocZzAjfOHZowKPULk2mFKs9UdpRLMNVCKnKzNGJQh/FnXc8ISFUWE9O3zI3gw= Received: from DB8PR06CA0061.eurprd06.prod.outlook.com (2603:10a6:10:120::35) by PAVPR08MB9063.eurprd08.prod.outlook.com (2603:10a6:102:32c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.44; Tue, 1 Apr 2025 15:49:03 +0000 Received: from DB5PEPF00014B95.eurprd02.prod.outlook.com (2603:10a6:10:120:cafe::39) by DB8PR06CA0061.outlook.office365.com (2603:10a6:10:120::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8534.54 via Frontend Transport; Tue, 1 Apr 2025 15:49:03 +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 DB5PEPF00014B95.mail.protection.outlook.com (10.167.8.233) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.22 via Frontend Transport; Tue, 1 Apr 2025 15:49:03 +0000 Received: ("Tessian outbound eb3c789b7dfa:v604"); Tue, 01 Apr 2025 15:49:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 054820aff8357f30 X-TessianGatewayMetadata: V9GQzal8YZ2Ke0O9w0rhnllqJQWy0U0aVPUNZ/GoNGOHAeXOg2xgPreGwImCkDXf2Bgx65yR9Tyo0bB2GoesCYCzE7bSgsRb/bynKuu+DdaO/TJnUFUv9avSuWu+76DvvbEjMY06N2qYsHMfJMxyIhf/qDJ73fGFwFaPZKvwsm+8UxEEsxMpQOHMutL+Iuz/sq/oDgZdHyt6Dol/n0GL5w== X-CR-MTA-TID: 64aa7808 Received: from L09bc3a1ed403.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FF6A9144-F857-42B2-841E-E4C600CA087C.1; Tue, 01 Apr 2025 15:48:52 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L09bc3a1ed403.2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 01 Apr 2025 15:48:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NyAB7QIyXG61lgi9Xaz0bX++huN4J08+PIyBPl3ZIm6WIjAxzz9j0xtnIhotRGaZoOtYRfBAqzng2o2PJueKD3fhid8AK6MK+wKrNBmLfoBEJulgJyLNqoC5tTtKLWiYUvp5VATUss0W7aKQgqikHdW0utogjqf4xoMIITbxnOtVK+KSbOvggVfyyo+VPkNRdlOMYzOHlEsBVem3sPmSVpqFNX18TYGnkh1aMV7ld6EW4ARSHReFGgkHxaDxGCdKHy5o8d2HApIuJt+rzR5v770mBaLg2oWf7+Nn1lgkULt2Cv+LbLCmM7nQ+tMw/y5u+3NyLnLRKphUg51g30IhWA== 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=FZotHG/NiHZdV7jEQZVPj2JqaAhiLixdocbppNgllw8=; b=ftUvpiqY9W5jR4nV5qVcwagxv0jCXX3EliNqmORytGAFfbNbDhgj5LhDEevkME7gERxc9S/mWHyVZFF9V0HA4BU1xBmpF6UEf1+3YjW+W/NFOirrpCeUgoJR+f2Krfd658HmXXNqg2P1K4+z0d3G3U2zBT5UT0gqK3ZaFtaDVQ8Pgw/7cmYRPXEGQ3nRAlR9/AhFQS2NNazfCk1eGw0IA8Kbco/gsbJ/MBYIxA2KypmChmD0bBi/3N6TMEqA3uVPsKcqs34obZelEvtluhiw4mEIfRWMpUpYi9pQRtwEwgV/ljUeNGd7RfJHlpktjYjFPUAVntjix24aHssOY0LPGg== 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=FZotHG/NiHZdV7jEQZVPj2JqaAhiLixdocbppNgllw8=; b=Brc2ZYeawqTOE4b0ZRYihd13CtrWN9bW953r+DXsJJ1nCFK/dcN/rAfPwV9/0dqcDqb4sB7XdhHXD9694xtsucPybid+YeQ2VaGDurMSw/yIoKocZzAjfOHZowKPULk2mFKs9UdpRLMNVCKnKzNGJQh/FnXc8ISFUWE9O3zI3gw= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM0PR08MB3315.eurprd08.prod.outlook.com (2603:10a6:208:5c::16) by DU0PR08MB8279.eurprd08.prod.outlook.com (2603:10a6:10:40d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.44; Tue, 1 Apr 2025 15:48:49 +0000 Received: from AM0PR08MB3315.eurprd08.prod.outlook.com ([fe80::42a0:1b6e:cf98:d8fc]) by AM0PR08MB3315.eurprd08.prod.outlook.com ([fe80::42a0:1b6e:cf98:d8fc%6]) with mapi id 15.20.8534.048; Tue, 1 Apr 2025 15:48:49 +0000 From: Lukas Zapolskas To: Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Adri=C3=A1n_Larumbe?= , Lukas Zapolskas Subject: [PATCH v3 7/7] drm/panthor: Expose the panthor perf ioctls Date: Tue, 1 Apr 2025 16:48:22 +0100 Message-Id: <1db5077232173ec63bb16e953422c55efcd41e69.1743517880.git.lukas.zapolskas@arm.com> X-Mailer: git-send-email 2.33.0.dirty In-Reply-To: References: X-ClientProxiedBy: LO4P123CA0584.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::15) To AM0PR08MB3315.eurprd08.prod.outlook.com (2603:10a6:208:5c::16) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM0PR08MB3315:EE_|DU0PR08MB8279:EE_|DB5PEPF00014B95:EE_|PAVPR08MB9063:EE_ X-MS-Office365-Filtering-Correlation-Id: ac2bcda7-6c45-404d-5b89-08dd7134ba7c 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|1800799024|366016|376014|921020; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?q?uVyVTVKavmT4EnO0Jk+1Nc?= =?utf-8?q?H4x+yxaPtCa1mLBP+rrFrR8kpj4ak5fix5juaaWigmIgnftrRNOBqThQwrfMdc1Jl?= =?utf-8?q?+XxiDjL6+d974ksZ+UVRWyMoOBYvwlejtKqxRsmzDwcBCsLXjLBGuQZh+VM8Pn2ol?= =?utf-8?q?NzztSGIGX/9DYNb6Ff+uTaTIjz8o7jwitqzrc7lTuZ5b/hXdZDhneaSbRbhkH+P/5?= =?utf-8?q?xkzvdFTlqDzzKBXyUN3Gaf0B9DHDYKkzmWqixxM/1ZQEbWBt+IhI2Q2GvjJBpv8QT?= =?utf-8?q?GGwnpANP4neZ5mmO0W0kU4HItV59ZavoqGssqkCxUeaLu7M33NDIIfQ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8?q?z8o+g7p2QWGI3HckqlEId8ASiW3TYdvxAz8+gG2mscNzGt+ZoHGUGpmN3ggRr9WM/?= =?utf-8?q?h5/eK+iM+3GmPsL9nbx3jBm0u/ss6UMWazOS+dpxpZpuGuEOOkkHhoMKM6/Ts2xy1?= =?utf-8?q?8685VVGBrMDvOirY5BGyujyjnV1fCOKMx0lA15TZ0ZMeezsQt8PTwUeHQ81MNJEg?= =?utf-8?q?=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB3315.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(921020); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8279 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:208:5c::16]; domain=AM0PR08MB3315.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B95.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 73bd0a7d-bf87-41c5-2a3e-08dd7134b21d X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|36860700013|1800799024|82310400026|14060799003|376014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xGXur36g+duVcW240Wrf8Re4GUm0ZEw?= =?utf-8?q?2eVI//WkO1B77LzupxifL2cRsr0IJ3Jvjt1l9bTYiDC03btw0jsHeXPq/4nqzoW98?= =?utf-8?q?Bfo9QzmjwdVw+pMYzB5B/VxKoY9xuToyIKHQ1cXzSXrS1Nj5RjaFoqb8GuASZR8oX?= =?utf-8?q?GBpmGvVuJNWgBZu66XHB0K7ueEFPBQZHtGyN89Wtl8hEDUze6jfDrXLzasPMcwXuC?= =?utf-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2pIydDYUWsR+8RL5+EtuPaNCRGHw/mTCu8jtt3686Kcrodb5jADkw?= =?utf-8?q?Gd4h2WEbYYs/tsAybghN7K++w6GzfeIAIelhLDGlb6mo2pOza/p8l/gmqjB73BNIw?= =?utf-8?q?A+5kNBk04PyrPWtw0KavtQKxj5IOQw55cWFzXG2MNknLHZMs+0m1buhTuJyg4e583?= =?utf-8?q?R7ojQj9fm1kXTKr2OP+wGAzcxtxt6MlJ1oHx7P92Q5cbdMwjDVwwA3pDDpRwuLRGX?= =?utf-8?q?S2AtJR8grfp3rNeWcifVyQGcxfdiU54IAeWBlyHcrY/jZlBmEdbxhHTS65dHUfMYM?= =?utf-8?q?zvodQbjfPmIwsR5sjC30FhgL9avCrTTe+ZjpNfmVMmcldHfRNWwSABt31mg/Slrvp?= =?utf-8?q?UsaYgJs7Le?= 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)(35042699022)(36860700013)(1800799024)(82310400026)(14060799003)(376014)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2025 15:49:03.7272 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac2bcda7-6c45-404d-5b89-08dd7134ba7c 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: DB5PEPF00014B95.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9063 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" This patch implements the PANTHOR_PERF_CONTROL ioctl series, and a PANTHOR_GET_UOBJ wrapper to deal with the backwards and forwards compatibility of the uAPI. The minor version is bumped to indicate that the feature is now supported. Signed-off-by: Lukas Zapolskas Reviewed-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_drv.c | 141 +++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c index 4c1381320859..850a894fe91b 100644 --- a/drivers/gpu/drm/panthor/panthor_drv.c +++ b/drivers/gpu/drm/panthor/panthor_drv.c @@ -31,6 +31,7 @@ #include "panthor_gpu.h" #include "panthor_heap.h" #include "panthor_mmu.h" +#include "panthor_perf.h" #include "panthor_regs.h" #include "panthor_sched.h" @@ -73,6 +74,39 @@ panthor_set_uobj(u64 usr_ptr, u32 usr_size, u32 min_size, u32 kern_size, const v return 0; } +/** + * panthor_get_uobj() - Copy kernel object to user object. + * @usr_ptr: Users pointer. + * @usr_size: Size of the user object. + * @min_size: Minimum size for this object. + * + * Helper automating kernel -> user object copies. + * + * Don't use this function directly, use PANTHOR_UOBJ_GET() instead. + * + * Return: valid pointer on success, an encoded error code otherwise. + */ +static void* +panthor_get_uobj(u64 usr_ptr, u32 usr_size, u32 min_size) +{ + int ret; + void *out_alloc __free(kvfree) = NULL; + + /* User size shouldn't be smaller than the minimal object size. */ + if (usr_size < min_size) + return ERR_PTR(-EINVAL); + + out_alloc = kvmalloc(min_size, GFP_KERNEL); + if (!out_alloc) + return ERR_PTR(-ENOMEM); + + ret = copy_struct_from_user(out_alloc, min_size, u64_to_user_ptr(usr_ptr), usr_size); + if (ret) + return ERR_PTR(ret); + + return_ptr(out_alloc); +} + /** * panthor_get_uobj_array() - Copy a user object array into a kernel accessible object array. * @in: The object array to copy. @@ -176,7 +210,12 @@ panthor_get_uobj_array(const struct drm_panthor_obj_array *in, u32 min_stride, PANTHOR_UOBJ_DECL(struct drm_panthor_queue_submit, syncs), \ PANTHOR_UOBJ_DECL(struct drm_panthor_queue_create, ringbuf_size), \ PANTHOR_UOBJ_DECL(struct drm_panthor_vm_bind_op, syncs), \ - PANTHOR_UOBJ_DECL(struct drm_panthor_perf_info, shader_blocks)) + PANTHOR_UOBJ_DECL(struct drm_panthor_perf_info, shader_blocks), \ + PANTHOR_UOBJ_DECL(struct drm_panthor_perf_cmd_setup, shader_enable_mask), \ + PANTHOR_UOBJ_DECL(struct drm_panthor_perf_cmd_start, user_data), \ + PANTHOR_UOBJ_DECL(struct drm_panthor_perf_cmd_stop, user_data), \ + PANTHOR_UOBJ_DECL(struct drm_panthor_perf_cmd_sample, user_data)) + /** * PANTHOR_UOBJ_SET() - Copy a kernel object to a user object. @@ -191,6 +230,24 @@ panthor_get_uobj_array(const struct drm_panthor_obj_array *in, u32 min_stride, PANTHOR_UOBJ_MIN_SIZE(_src_obj), \ sizeof(_src_obj), &(_src_obj)) +/** + * PANTHOR_UOBJ_GET() - Copies a user object from _usr_ptr to a kernel accessible _dest_ptr. + * @_dest_ptr: Local variable + * @_usr_size: Size of the user object. + * @_usr_ptr: The pointer of the object in userspace. + * + * Return: Error code. See panthor_get_uobj(). + */ +#define PANTHOR_UOBJ_GET(_dest_ptr, _usr_size, _usr_ptr) \ + ({ \ + typeof(_dest_ptr) _tmp; \ + _tmp = panthor_get_uobj(_usr_ptr, _usr_size, \ + PANTHOR_UOBJ_MIN_SIZE(_tmp[0])); \ + if (!IS_ERR(_tmp)) \ + _dest_ptr = _tmp; \ + PTR_ERR_OR_ZERO(_tmp); \ + }) + /** * PANTHOR_UOBJ_GET_ARRAY() - Copy a user object array to a kernel accessible * object array. @@ -1339,6 +1396,83 @@ static int panthor_ioctl_vm_get_state(struct drm_device *ddev, void *data, return 0; } +#define perf_cmd(command) \ + ({ \ + struct drm_panthor_perf_cmd_##command *command##_args __free(kvfree) = NULL; \ + int _ret = PANTHOR_UOBJ_GET(command##_args, args->size, args->pointer); \ + if (_ret) \ + return _ret; \ + return panthor_perf_session_##command(pfile, ptdev->perf, args->handle, \ + command##_args->user_data); \ + }) + +static int panthor_ioctl_perf_control(struct drm_device *ddev, void *data, + struct drm_file *file) +{ + struct panthor_device *ptdev = container_of(ddev, struct panthor_device, base); + struct panthor_file *pfile = file->driver_priv; + struct drm_panthor_perf_control *args = data; + int ret; + + if (!args->pointer) { + switch (args->cmd) { + case DRM_PANTHOR_PERF_COMMAND_SETUP: + args->size = sizeof(struct drm_panthor_perf_cmd_setup); + return 0; + + case DRM_PANTHOR_PERF_COMMAND_TEARDOWN: + args->size = 0; + return 0; + + case DRM_PANTHOR_PERF_COMMAND_START: + args->size = sizeof(struct drm_panthor_perf_cmd_start); + return 0; + + case DRM_PANTHOR_PERF_COMMAND_STOP: + args->size = sizeof(struct drm_panthor_perf_cmd_stop); + return 0; + + case DRM_PANTHOR_PERF_COMMAND_SAMPLE: + args->size = sizeof(struct drm_panthor_perf_cmd_sample); + return 0; + + default: + return -EINVAL; + } + } + + switch (args->cmd) { + case DRM_PANTHOR_PERF_COMMAND_SETUP: + { + struct drm_panthor_perf_cmd_setup *setup_args __free(kvfree) = NULL; + + ret = PANTHOR_UOBJ_GET(setup_args, args->size, args->pointer); + if (ret) + return -EINVAL; + + return panthor_perf_session_setup(ptdev, ptdev->perf, setup_args, pfile); + } + case DRM_PANTHOR_PERF_COMMAND_TEARDOWN: + { + return panthor_perf_session_teardown(pfile, ptdev->perf, args->handle); + } + case DRM_PANTHOR_PERF_COMMAND_START: + { + perf_cmd(start); + } + case DRM_PANTHOR_PERF_COMMAND_STOP: + { + perf_cmd(stop); + } + case DRM_PANTHOR_PERF_COMMAND_SAMPLE: + { + perf_cmd(sample); + } + default: + return -EINVAL; + } +} + static int panthor_open(struct drm_device *ddev, struct drm_file *file) { @@ -1409,6 +1543,7 @@ static const struct drm_ioctl_desc panthor_drm_driver_ioctls[] = { PANTHOR_IOCTL(TILER_HEAP_CREATE, tiler_heap_create, DRM_RENDER_ALLOW), PANTHOR_IOCTL(TILER_HEAP_DESTROY, tiler_heap_destroy, DRM_RENDER_ALLOW), PANTHOR_IOCTL(GROUP_SUBMIT, group_submit, DRM_RENDER_ALLOW), + PANTHOR_IOCTL(PERF_CONTROL, perf_control, DRM_RENDER_ALLOW), }; static int panthor_mmap(struct file *filp, struct vm_area_struct *vma) @@ -1518,6 +1653,8 @@ static void panthor_debugfs_init(struct drm_minor *minor) * - 1.2 - adds DEV_QUERY_GROUP_PRIORITIES_INFO query * - adds PANTHOR_GROUP_PRIORITY_REALTIME priority * - 1.3 - adds DRM_PANTHOR_GROUP_STATE_INNOCENT flag + * - 1.4 - adds DEV_QUERY_PERF_INFO query + * - adds PERF_CONTROL ioctl */ static const struct drm_driver panthor_drm_driver = { .driver_features = DRIVER_RENDER | DRIVER_GEM | DRIVER_SYNCOBJ | @@ -1531,7 +1668,7 @@ static const struct drm_driver panthor_drm_driver = { .name = "panthor", .desc = "Panthor DRM driver", .major = 1, - .minor = 3, + .minor = 4, .gem_create_object = panthor_gem_create_object, .gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,