[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240828172605.19176-8-mihail.atanassov@arm.com>
Date: Wed, 28 Aug 2024 18:26:03 +0100
From: Mihail Atanassov <mihail.atanassov@....com>
To: linux-kernel@...r.kernel.org,
Boris Brezillon <boris.brezillon@...labora.com>,
Liviu Dudau <liviu.dudau@....com>,
Steven Price <steven.price@....com>
Cc: dri-devel@...ts.freedesktop.org,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
Xinhui Pan <Xinhui.Pan@....com>,
Shashank Sharma <shashank.sharma@....com>,
Ketil Johnsen <ketil.johnsen@....com>,
Akash Goel <akash.goel@....com>,
Mihail Atanassov <mihail.atanassov@....com>
Subject: [PATCH 7/8] drm/panthor: Add sync_update eventfd handling
Expose the SYNC_UPDATE event to userspace so it can respond to changes
in syncobj state.
Signed-off-by: Mihail Atanassov <mihail.atanassov@....com>
---
drivers/gpu/drm/panthor/panthor_sched.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index 92172b2c6253..67c27fcc3345 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -643,6 +643,9 @@ struct panthor_group {
* panthor_group::groups::waiting list.
*/
struct list_head wait_node;
+
+ /** @eventfd_sync_update_ctx: eventfd context to signal on GPU_SYNC_UPDATE */
+ struct eventfd_ctx *eventfd_sync_update_ctx;
};
/**
@@ -797,6 +800,10 @@ static void group_release_work(struct work_struct *work)
panthor_kernel_bo_destroy(group->syncobjs);
panthor_vm_put(group->vm);
+
+ if (group->eventfd_sync_update_ctx)
+ eventfd_ctx_put(group->eventfd_sync_update_ctx);
+
kfree(group);
}
@@ -1501,6 +1508,9 @@ static void csg_slot_sync_update_locked(struct panthor_device *ptdev,
/* Rerun XGS jobs immediately, as this can potentially unblock the group */
panthor_xgs_queue_pool_recheck(group->pfile);
+ if (group->eventfd_sync_update_ctx)
+ eventfd_signal(group->eventfd_sync_update_ctx);
+
if (!group->user_submit)
group_queue_work(group, sync_upd);
}
@@ -3204,9 +3214,18 @@ int panthor_group_create(struct panthor_file *pfile,
INIT_WORK(&group->tiler_oom_work, group_tiler_oom_work);
INIT_WORK(&group->release_work, group_release_work);
- if (group_args->flags & DRM_PANTHOR_GROUP_CREATE_USER_SUBMIT)
+ if (group_args->flags & DRM_PANTHOR_GROUP_CREATE_USER_SUBMIT) {
group->user_submit = true;
+ if (group_args->eventfd_sync_update >= 0) {
+ group->eventfd_sync_update_ctx = eventfd_ctx_fdget(
+ group_args->eventfd_sync_update);
+ ret = PTR_ERR_OR_ZERO(group->eventfd_sync_update_ctx);
+ if (ret)
+ goto err_put_group;
+ }
+ }
+
group->vm = panthor_vm_pool_get_vm(pfile->vms, group_args->vm_id);
if (!group->vm) {
ret = -EINVAL;
--
2.45.0
Powered by blists - more mailing lists