From patchwork Wed Sep 11 15:42:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Coster X-Patchwork-Id: 13800854 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 CA6ADEE49BC for ; Wed, 11 Sep 2024 15:43:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 49C0710E19E; Wed, 11 Sep 2024 15:43:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=imgtec.com header.i=@imgtec.com header.b="aV3CDMDl"; dkim=pass (1024-bit key; unprotected) header.d=IMGTecCRM.onmicrosoft.com header.i=@IMGTecCRM.onmicrosoft.com header.b="LHAkusia"; dkim-atps=neutral Received: from mx08-00376f01.pphosted.com (mx08-00376f01.pphosted.com [91.207.212.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89FD410E19E for ; Wed, 11 Sep 2024 15:43:15 +0000 (UTC) Received: from pps.filterd (m0168888.ppops.net [127.0.0.1]) by mx08-00376f01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48BE97iF025570; Wed, 11 Sep 2024 16:42:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imgtec.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=dk201812; bh=JMcVxzyx60Q2pBUVTJQoB9HgY FD7XVyQC21fhc6uRCY=; b=aV3CDMDlIggYC5qQyRdWZEqLOA7OgkiUhfmzgXT6Z 6jxbnqs2K9gcpxR8kBeICL/c9QTVCgCgxGGysFntPM/d9hRx3JMgddsa1Bq1nLjs ghxoFmPR4iQh3SMDUzCoRaD9GVRe2Gi8SN/dIVE/R4RoIfkru9ncsi1mfw+vpsv5 1k2ErzCLDKtQTo3Vna5d2vQbUYFP7jtPqZI0avFzjjibkgPaiO++xfRRJs/mYJ4N ELpBVD1hvxFw4FEl3YVoAs1oSNyVZo8vxjqLwU2oTO6nLejuITviPx1/2/Qnpc4e emG8KFOtOTaOh0vGwZZKDh8R/qMXfkofaGK+CfNpkrd7g== Received: from hhmail05.hh.imgtec.org ([217.156.249.195]) by mx08-00376f01.pphosted.com (PPS) with ESMTPS id 41gd3rayps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 11 Sep 2024 16:42:54 +0100 (BST) Received: from HHMAIL04.hh.imgtec.org (10.100.10.119) by HHMAIL05.hh.imgtec.org (10.100.10.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Wed, 11 Sep 2024 16:42:53 +0100 Received: from CWXP265CU008.outbound.protection.outlook.com (40.93.68.3) by email.imgtec.com (10.100.10.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37 via Frontend Transport; Wed, 11 Sep 2024 16:42:53 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XS/n2/+E7C6E45K5LeGI8g2Cn/KLtyQT1EvN8CiysVZYdxMsspY2hKlLDD31vUWEvHFEk5ym/baF+9d2hLYXiSBDxk9KanwnnPeACaRA+wGoHDq0DAWuODuevxLfGWQ7m4DholhWcDpymeZnJfuKXBlsfCUO9uSkvETLkqEOOXZGpjApiN7Zr6kJreOyhgZ+pm6dQBStbuM1+KTsXF6Qj2Xjswa6Miov54cJYkGVgnozWO7oo+4HMI0006gOzm7b0dwJrJTMqCa7ZMpE4elHSikh3HLNq0UuTT71nt2iOzaUkMBDNSndGEnuiydTeUegCTNY5QIc30YoxE6NVhDs0w== 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=JMcVxzyx60Q2pBUVTJQoB9HgYFD7XVyQC21fhc6uRCY=; b=Lu7O7yWtI8QzTZdGD/AKrWmu1jve2DG8w8XD+OfSOSjbxBO2khM+e9twEtJaPXr6HBWklIUjcIwQotoPRb8KhOFf81mu+ZgZ029iEbRu+kHimthgEoh9fOBqFgRKHDIGSvOZwsNOsuH4YaTOe/8WAqZuHfyv0Qi3G0E95RtIpcgjmfP1pXYSH9mDP/bHcel8hh4DUI1OSMOTJngx8vlZS2BbjiabIZZkzErKj6Jr25wKvN2zqctTr4wsEyssM7Dmb6juGNlKBjTZFwMxOvhmuqIvUUE+QjNT1dqiGeWv/JN5PNxKqAK5BAXgMQY21NZmsKIuG4MzGU7fXm4hWfAvSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=imgtec.com; dmarc=pass action=none header.from=imgtec.com; dkim=pass header.d=imgtec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=IMGTecCRM.onmicrosoft.com; s=selector2-IMGTecCRM-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JMcVxzyx60Q2pBUVTJQoB9HgYFD7XVyQC21fhc6uRCY=; b=LHAkusiaVQAW3Gds28Y6mcdx8nIh/m9WmUhAbObedsO/9WbccmMAFBCbtYoiVtctlKi5Lo1xyEWnWo3yW/DJcc5JnR+FLIQG47NrmvHSP7L0QUFkC/aSvwQO4BJCItg1vQnQGL7u7AomFPKI0Ru3s4tkhzYncwqJVA93gOXz6aU= Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:e7::8) by CWLP265MB6740.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:1ee::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Wed, 11 Sep 2024 15:42:50 +0000 Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM ([fe80::8e9d:6b2f:9881:1e15]) by CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM ([fe80::8e9d:6b2f:9881:1e15%3]) with mapi id 15.20.7962.016; Wed, 11 Sep 2024 15:42:48 +0000 From: Matt Coster To: "dri-devel@lists.freedesktop.org" CC: Brendan King , Frank Binns , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , "linux-kernel@vger.kernel.org" Subject: [PATCH 1/2] drm/imagination: Add a per-file PVR context list Thread-Topic: [PATCH 1/2] drm/imagination: Add a per-file PVR context list Thread-Index: AQHbBGFAoIxYip2DjkenFFxtsnCiZQ== Date: Wed, 11 Sep 2024 15:42:48 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CWXP265MB3397:EE_|CWLP265MB6740:EE_ x-ms-office365-filtering-correlation-id: 69641342-4363-4da0-0932-08dcd2786363 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?1RPO921JlEU4ToQTTlCpmSFGnI1oE4t?= =?utf-8?q?DSrrVXfH3gUdPItJi6j1XH/wfvud5Ur99/YCjxKKYgDKOEXJVcG+3lHWNj3H3t7iU?= =?utf-8?q?60gbE1Pn02oHwhzxEmRDd28Ud/cOH8DfyhNuikZMhtu0AYLaHv742eaVWE1D5LV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E7Y7fB?= =?utf-8?q?5T6CILcRnRDCN74BBNDLwqBTVKdrh5liTNuzyPVCPto8zZmsfOEOl7XnDDV3JDR2u?= =?utf-8?q?CYdC+/13Np4EQNVNhBSD/O4mdyaYIxBU3Xx4C1DSrXO/Gm0+8U9dAeg6Ua5xuctOf?= =?utf-8?q?WMy3AdMJm+UlavG0TNL2dnpBK3BfTdWsgL7dmNKyTZJqUoAaQfc8ZkIpQpjwtE35r?= =?utf-8?q?bzI0tsTnZGl/0uBj/15v3FsNA7EtfTn2lM82YLkm/qkZOyRjGg3ftQT+RxOaWZULN?= =?utf-8?q?dHx3bzuSKW6y3UZR0t0UgrLtkEc4ff/Cw3AQE+nIHxNs9Jgvwwvxy5KMtnmygRMxF?= =?utf-8?q?sNGWbHQnXCWavZ7TDYD5VFo8W5u5klFGLA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?SLCH+me02VF87nBqaV5try4il1RR?= =?utf-8?q?iPbZM5appOZwxTgsIrSaqoGzEnV1RRfqJUNh/wjXnUVaGUGht4/yqDUefQ0r7vXt4?= =?utf-8?q?v+18gU4M6+dNLysWfTRF7JHIUnZ+o1MLiKAI4ObVbJgsbfExH8y22CrTNxie4NI3E?= =?utf-8?q?jorHSiYOTsTqmBjbCDxOTuy2x3UU0W5X8a2NB9J8VW/n+0AvTuFOxeqxbCe4/O6AW?= =?utf-8?q?e5nTK0FlLVNiEvnXYn+xJwSey3MWUZ1Z+s12YTrLwx7QRcZ99txqAWXjf9PLD6Cr7?= =?utf-8?q?/m4ulKOyrjIHkcwDmD0Mt08RhDMfofBdVqkM6yArrdsWefLXQE8PP8+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KDBAtKrE?= =?utf-8?q?HPKstUl8laMgGzHXCvCfVUob+CA0Ub+u75UocBICAfHPUWsGlsGv+hrGL6AQLiYrf?= =?utf-8?q?o10SRqdmqfQ1FleQzIN6iHgFla6qioK8oEuHZWRTJ+o9CoZyn53CHlkE0JQGgH7B4?= =?utf-8?q?NoC38ieup8ksUihi6UJ8VzUK35rw0UHXYb9/AuquqYQ24WrWsL3HO2kwRRpOI4d5Z?= =?utf-8?q?sJLhnWhz3t3wG6UuD9uhwSJk6QExXT7g0gRJIexrOVvS3zbaVH1KeBWfPv8pYCGF2?= =?utf-8?q?Zn5rHwgvqsU3Jtz6gNjxqDXOiyqLTBCsOs/JpEBTChlCfONirT8z5oqra1fC8z0sj?= =?utf-8?q?Y41rnDXxctmaqBfF3AUxWbqbGhMM43r+UQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 69641342-4363-4da0-0932-08dcd2786363 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Sep 2024 15:42:48.5088 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0d5fd8bb-e8c2-4e0a-8dd5-2c264f7140fe X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gjMES48MerUYJpcYj/g47PnXLwIxR0EiTsuHpzl79sZiU3yhOd7ejvurwrHffCacdJm1IqHmu5WLZSrr4daTXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB6740 X-OriginatorOrg: imgtec.com X-EXCLAIMER-MD-CONFIG: 15a78312-3e47-46eb-9010-2e54d84a9631 X-Proofpoint-GUID: fCGDCMMu6LB7_1lAOPeeVmOzUx_y-37s X-Proofpoint-ORIG-GUID: fCGDCMMu6LB7_1lAOPeeVmOzUx_y-37s X-Authority-Analysis: v=2.4 cv=GIVaEfNK c=1 sm=1 tr=0 ts=66e1ba7f cx=c_pps a=6IdplsTJodF3+aqeaEJcqA==:117 a=6IdplsTJodF3+aqeaEJcqA==:17 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=EaEq8P2WXUwA:10 a=WnR_qW7rlZcA:10 a=NgoYpvdbvlAA:10 a=r_1tXGB3AAAA:8 a=VwQbUJbxAAAA:8 a=zfBPz-HDHTuPlw-aen4A:9 a=QEXdDO2ut3YA:10 a=L3WQYlS-Qr307JIZeJIA:9 a=FfaGCDsud1wA:10 a=t8nPyN_e6usw4ciXM-Pk:22 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" From: Brendan King This is in preparation for the next commit, which makes use of the list. Signed-off-by: Brendan King Signed-off-by: Matt Coster Cc: stable@vger.kernel.org --- drivers/gpu/drm/imagination/pvr_context.c | 14 ++++++++++++++ drivers/gpu/drm/imagination/pvr_context.h | 3 +++ drivers/gpu/drm/imagination/pvr_device.h | 10 ++++++++++ drivers/gpu/drm/imagination/pvr_drv.c | 3 +++ 4 files changed, 30 insertions(+) diff --git a/drivers/gpu/drm/imagination/pvr_context.c b/drivers/gpu/drm/imagination/pvr_context.c index eded5e955cc0..255c93582734 100644 --- a/drivers/gpu/drm/imagination/pvr_context.c +++ b/drivers/gpu/drm/imagination/pvr_context.c @@ -17,10 +17,14 @@ #include #include + +#include #include #include +#include #include #include +#include #include #include #include @@ -354,6 +358,10 @@ int pvr_context_create(struct pvr_file *pvr_file, struct drm_pvr_ioctl_create_co return err; } + spin_lock(&pvr_dev->ctx_list_lock); + list_add_tail(&ctx->file_link, &pvr_file->contexts); + spin_unlock(&pvr_dev->ctx_list_lock); + return 0; err_destroy_fw_obj: @@ -380,6 +388,11 @@ pvr_context_release(struct kref *ref_count) container_of(ref_count, struct pvr_context, ref_count); struct pvr_device *pvr_dev = ctx->pvr_dev; + WARN_ON(in_interrupt()); + spin_lock(&pvr_dev->ctx_list_lock); + list_del(&ctx->file_link); + spin_unlock(&pvr_dev->ctx_list_lock); + xa_erase(&pvr_dev->ctx_ids, ctx->ctx_id); pvr_context_destroy_queues(ctx); pvr_fw_object_destroy(ctx->fw_obj); @@ -451,6 +464,7 @@ void pvr_destroy_contexts_for_file(struct pvr_file *pvr_file) void pvr_context_device_init(struct pvr_device *pvr_dev) { xa_init_flags(&pvr_dev->ctx_ids, XA_FLAGS_ALLOC1); + spin_lock_init(&pvr_dev->ctx_list_lock); } /** diff --git a/drivers/gpu/drm/imagination/pvr_context.h b/drivers/gpu/drm/imagination/pvr_context.h index 0c7b97dfa6ba..a5b0a82a54a1 100644 --- a/drivers/gpu/drm/imagination/pvr_context.h +++ b/drivers/gpu/drm/imagination/pvr_context.h @@ -85,6 +85,9 @@ struct pvr_context { /** @compute: Transfer queue. */ struct pvr_queue *transfer; } queues; + + /** @file_link: pvr_file PVR context list link. */ + struct list_head file_link; }; static __always_inline struct pvr_queue * diff --git a/drivers/gpu/drm/imagination/pvr_device.h b/drivers/gpu/drm/imagination/pvr_device.h index ecdd5767d8ef..b1fbf9ccf19f 100644 --- a/drivers/gpu/drm/imagination/pvr_device.h +++ b/drivers/gpu/drm/imagination/pvr_device.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -293,6 +294,12 @@ struct pvr_device { /** @sched_wq: Workqueue for schedulers. */ struct workqueue_struct *sched_wq; + + /** + * @ctx_list_lock: Lock to be held when accessing the context list in + * struct pvr_file. + */ + spinlock_t ctx_list_lock; }; /** @@ -344,6 +351,9 @@ struct pvr_file { * This array is used to allocate handles returned to userspace. */ struct xarray vm_ctx_handles; + + /** @contexts: PVR context list. */ + struct list_head contexts; }; /** diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c index 1a0cb7aa9cea..fb17196e05f4 100644 --- a/drivers/gpu/drm/imagination/pvr_drv.c +++ b/drivers/gpu/drm/imagination/pvr_drv.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1326,6 +1327,8 @@ pvr_drm_driver_open(struct drm_device *drm_dev, struct drm_file *file) */ pvr_file->pvr_dev = pvr_dev; + INIT_LIST_HEAD(&pvr_file->contexts); + xa_init_flags(&pvr_file->ctx_handles, XA_FLAGS_ALLOC1); xa_init_flags(&pvr_file->free_list_handles, XA_FLAGS_ALLOC1); xa_init_flags(&pvr_file->hwrt_handles, XA_FLAGS_ALLOC1);