From patchwork Fri Oct 18 15:41:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Coster X-Patchwork-Id: 13841988 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 B7524D30019 for ; Fri, 18 Oct 2024 15:42:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 297AD10E19A; Fri, 18 Oct 2024 15:42:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=imgtec.com header.i=@imgtec.com header.b="Er5wgY1j"; dkim=pass (1024-bit key; unprotected) header.d=IMGTecCRM.onmicrosoft.com header.i=@IMGTecCRM.onmicrosoft.com header.b="D4muzv0i"; 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 DDA7B10E19A for ; Fri, 18 Oct 2024 15:41:58 +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 49IBSmvl018297; Fri, 18 Oct 2024 16:41:39 +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=BZKcoAYwqQov8ijGzTVVKFXh1 9Hql2U8WjaG+HOgDjI=; b=Er5wgY1jKZ8XRAe/Nx+FPA+B5c5NSHkXU1QL/rWKp Qup1B8ux0ldGCkvhDytKmJ/wfhfhwDC/31LWMaSN42Qs1cSK6lgDwzFi6ArpLLLT N8IEn7QAqB18ZrAclrxnz6kI5tWrpuCW8+Vtk9Da97yTG5vWwl+cYhZsg5Vl7i+N o7qoycgHaYLopO8ZUT2xbmHAwIAuheQgmsVbm2fUmdhWMwBg6qJRaj+iuNWlhk/t FpGeN6TcjF5cKYCVgYukLuhMgBav00xY+wusGQQ9x5H2SYvSNDibIT2EvWPHJmWW 631UnpudrQPtO8omndsV7BcjIliglN1UzwtsPVmknGpgQ== Received: from cwxp265cu008.outbound.protection.outlook.com (mail-ukwestazlp17010003.outbound.protection.outlook.com [40.93.68.3]) by mx08-00376f01.pphosted.com (PPS) with ESMTPS id 42a3ac2nwm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Oct 2024 16:41:38 +0100 (BST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d2fj0pUwQRAXVAu6IUM/8MM2sr33/52J35XVXJZXeg7etEU26dK2HDz/zF+RgUglLgYsX24r0ahHzyaw5KKJQaIYE3ShKuOH7/Rjop5dBT2kysSLt7A9Ya1dCkEPkVwCrWjjetf/IcfmijjNVMEBg2lNzWgAfaVP4T2cBFMUk9lfz1PdDE2CeB0omJTJNxhwpONrz8On53t7hxvZx7KvBBuGGW9byhme0baIRtKJ8Xf2d1RffS/Z6SRrdOS5IzVyBN8pdw+4EP2xpigcSxY7/vzyiIezpadL2+mezS/yPCItLwN2YhFSheQr3q5ghrb3py2E8v+BuXL+vC7eW/T2dg== 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=BZKcoAYwqQov8ijGzTVVKFXh19Hql2U8WjaG+HOgDjI=; b=J0WjVGUWeKAUN+ilT6/xt5/mmz41Hr9hpIGnrU+b2lm2QyjddWVZonw9cMP0V1hGDQMTBeZTzezaHLSyB3geRrYWTlQL05mOVCKdXdwUiNNnrMjPyuAc2ZwJjCeuBscbWDxFZ6eYZyeLKcUEyiZvvzbOrxYjE4ZAWBC8Kase30Qr2v9KuIe31qcCmiKdSvpbfMZRmFE9Dt5bUNrLovYOvJ/EMvXUb/7f/76d7KLgXeeA3JFBcofFSJnIzwWsAJwH17NkPEWKdaHZETa5fFQM9J3ih2lMFLVrqPm7qTcYllOofoLf7TlVJzxl+A3+d/WgkKLD7CJL6cOKRuLH7hf4Zg== 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=BZKcoAYwqQov8ijGzTVVKFXh19Hql2U8WjaG+HOgDjI=; b=D4muzv0iEl/ctaN1KgXxMT7yUgdvxQWJwK52k/xg9H+yxQy3X7ilCge5MGLwwfbASvBmS4RWFoIBu++a8kNfcbxMsIw7iWn6kUJntHQ8yQex6MsStSlUn/F4K8uPvSeICx0763N0WdXflgY9lQ4hrtjy16n/xK04GAsL8+vgNKw= Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:e7::8) by CWLP265MB2259.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:6b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 15:41:36 +0000 Received: from CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM ([fe80::8e9d:6b2f:9881:1e15]) by CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM ([fe80::8e9d:6b2f:9881:1e15%6]) with mapi id 15.20.8069.020; Fri, 18 Oct 2024 15:41:36 +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 v3 1/2] drm/imagination: Add a per-file PVR context list Thread-Topic: [PATCH v3 1/2] drm/imagination: Add a per-file PVR context list Thread-Index: AQHbIXQ3By0tkWHfnE+2c5pxM7UKeQ== Date: Fri, 18 Oct 2024 15:41:36 +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_|CWLP265MB2259:EE_ x-ms-office365-filtering-correlation-id: 4a5b3e7f-0f72-4954-3b17-08dcef8b5995 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?aYHn1n9YW71nbzW3rr5ZEOlZEdx5MIf?= =?utf-8?q?Njj5kCW8GxAb4Q5CA1AUMk2mmN6veNjGdhQC+Gu3UEKHGvC6STZ/55YfRsmfWLsS0?= =?utf-8?q?/s6GF/QZPs5z89Ewq6EylNT+uHqRFWI+Hx30Z7gdboQg/Cj8isSlEOmCyTw1tKV0Y?= =?utf-8?q?kybInKzfAp7Wp6IU8yy77c3Or99bxrkP8txtGguAeSwnTAEdWQrWsviniKXjRjkyM?= =?utf-8?q?rhASl10JucKgtooq8fFP+ZLVgFvcECTXxB3BK6dL3Mu3uZBNCE1F6hM75bp0wu76O?= =?utf-8?q?JCaTEqsHCaKfknFp+zETCK0+KqN1va4V8iIJizeVlE6R/HedxX3BHU2OZWbrpKmE1?= =?utf-8?q?IaOeCIVsGs505cvnQhnDhzXpCSlxAhROy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SZ0XbBWWD15R/oUBCEPjH1wmjDVpqsGjuQPkO/Gw?= =?utf-8?q?ZfGiUnuwcMOfLy/w1GTc66SIXxYmhTsC33SJakz/YitiO4i8atp69/DcJzajJgXik?= =?utf-8?q?6olX1sIY3FQ3?= 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)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?pt/OQHPIUF2T+GZ8dao8iXYLBiYo?= =?utf-8?q?DaDlSSSf5PvQNl8nBFF4qx5pDxAPQaNR8Z+vE2ZeCXVTfxPu2PTffVV4hAY4xO/t2?= =?utf-8?q?r6RCBNloskzwyx7AT2p/fRZl6lXYCH1+/1lvoOOmxPvrdH+mvTzkC27YNJcGimr72?= =?utf-8?q?i3WoPXvISc5EHsTEH+JSplNhEXhhUbLf8264SidkvCbBYOED9CBsNL0ggcEZ/cmlB?= =?utf-8?q?+PlMJQNtoS+4elE/gAn0uhDs7yvCtwumhd81gevrPdlIeeXX7VYcddn/Ra5Q2bcWM?= =?utf-8?q?WY/XBfjPh/zBP48JcRc9pYAMy1b7sTFpXM+qQNG6W9MXWQi/TwV80JfvROFw0LjNM?= =?utf-8?q?DVEW56LU+DOz0bnrfAqrzal9wJmTrBMmoh026qL5DxhXYeT95lSqqVL/2x8SGk2dn?= =?utf-8?q?vQdi28/WFmz5ygH4911rMLnLqbsU7hsrME2lg6kqOyXnL+2oTcxHJs/puVrG8fe5H?= =?utf-8?q?Z7jdxIaRB23KphslEJAlvPdWk3f+nZm4a3TW5MYXKEVHl44rxxEOK01DBc4MLWc5I?= =?utf-8?q?9PrBSSIXuNM7o72JRbgdf53CkXRweJlctCeQJJbiGHvCD7G/258UaxFQTuF2SI8B8?=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=?utf-8?q?TYorEfHpnS0uceKOBROjLOBN8nV0+9EveWxVctUfU4ioJC3vl6PaC/fjEI5zj/AK8?= =?utf-8?q?eZU+KMMnLuVZuw+Jt+1nooF4Fer2dmtQCg=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: imgtec.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CWXP265MB3397.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 4a5b3e7f-0f72-4954-3b17-08dcef8b5995 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2024 15:41:36.1641 (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: VOK57d2WcCabwPD4onX3hJlJjOJFZmXJwh8fG5t6ymbIe8S+VkCo1aGuTFnOeHGm90EiV2XCl6zsl/neVRDJ/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB2259 X-Authority-Analysis: v=2.4 cv=AcbjHGXG c=1 sm=1 tr=0 ts=671281b3 cx=c_pps a=Du42DVBbjaS4S3NNO6dabQ==:117 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=DAUX931o1VcA:10 a=WnR_qW7rlZcA:10 a=NgoYpvdbvlAA:10 a=r_1tXGB3AAAA:8 a=VwQbUJbxAAAA:8 a=ve1ODSZ0aD4dUIyBzsEA:9 a=QEXdDO2ut3YA:10 a=8WOXGegX6ja1v6kmIbUA:9 a=FfaGCDsud1wA:10 a=t8nPyN_e6usw4ciXM-Pk:22 X-Proofpoint-ORIG-GUID: ciBiJjBNHKyQ5E9F18mak3vZ0RkbKmas X-Proofpoint-GUID: ciBiJjBNHKyQ5E9F18mak3vZ0RkbKmas 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 adds a linked list of VM contexts which is needed for the next patch to be able to correctly track VM contexts for destruction on file close. It is only safe for VM contexts to be removed from the list and destroyed when not in interrupt context. Signed-off-by: Brendan King Signed-off-by: Matt Coster Reviewed-by: Frank Binns Cc: stable@vger.kernel.org --- Changes in v1 -> v2: - Add justification to the commit message so it stands on its own (e.g. during bisect) Changes in v2 -> v3: - Add Frank's Rb [1] - Add Cc: stable tag [1]: https://lore.kernel.org/dri-devel/1a206b08485a1ebea0aeff5306c0f5b6eb7c315d.camel@imgtec.com/ --- 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 b574e23d484b..6d0dfacb677b 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);