v2:
Added PASID→fpriv registry and KFD→render-node eventfd bridge patches.
Series builds cleanly and is compilation-tested.
v1:
This series introduces a render-node based eventfd subscription
mechanism in amdgpu. It allows userspace to bind an eventfd to a
userspace-defined event_id on a per-drm_file basis and receive
interrupt-driven notifications via poll/epoll.
The goal is to move KFD-style event signaling semantics into the DRM
render node path as a step toward KFD/KGD event unification. Today,
HSA-style events are managed in /dev/kfd. This series enables similar
functionality directly via /dev/dri/renderD*, reducing duplication
and moving toward a single kernel event model.
The series consists of:
1) UAPI additions for EVENTFD bind/unbind ioctls.
2) Per-drm_file eventfd registry stored in amdgpu_fpriv.
3) IRQ-safe signaling helper using RCU + lockless xa_load().
4) Minimal producer wiring on GFX11 MES EOP IRQ path.
High-level design
-----------------
- Binding is per drm_file (per-process / per-PASID).
- Each event_id maps to a struct amdgpu_eventfd_entry containing
an eventfd_ctx.
- Bind replaces existing mappings.
- Unbind removes mappings.
- IRQ path uses:
rcu_read_lock()
xa_load()
eventfd_signal()
guaranteeing lockless, IRQ-safe behavior.
- Teardown uses call_rcu() + synchronize_rcu() to ensure safe lifetime.
The MES EOP wiring is intentionally minimal and uses a fixed
event_id as a proof-of-concept producer.
Srinivasan Shanmugam (8):
drm/amdgpu/uapi: Add EVENTFD bind/unbind ioctls for render node
drm/amdgpu: Add per-drm_file eventfd registry for render node
drm/amdgpu: Add IRQ-safe eventfd signal helper
drm/amdgpu/gfx11: Wire MES EOP IRQ to render-node eventfd
drm/amdgpu: Add PASID->fpriv registry for KFD->render eventfd bridge
drm/amdgpu: Register/unregister fpriv in PASID registry on
open/postclose
drm/amdgpu: Add amdgpu_eventfd_notify(pasid,event_id,count)
drm/amdkfd: Notify render-node eventfd subscribers for KFD events
drivers/gpu/drm/amd/amdgpu/Makefile | 3 +-
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 25 +++
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +
.../gpu/drm/amd/amdgpu/amdgpu_eventfd_pasid.c | 141 ++++++++++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 150 +++++++++++++++++-
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 +-
.../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 5 +
.../gpu/drm/amd/amdgpu/amdgpu_userq_fence.h | 4 +
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 14 ++
drivers/gpu/drm/amd/amdkfd/kfd_events.c | 76 ++++++++-
include/uapi/drm/amdgpu_drm.h | 35 +++-
11 files changed, 447 insertions(+), 11 deletions(-)
create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_eventfd_pasid.c
--
2.34.1