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 (4):
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
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 21 +++
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 137 ++++++++++++++++++
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 ++
include/uapi/drm/amdgpu_drm.h | 35 ++++-
8 files changed, 219 insertions(+), 2 deletions(-)
--
2.34.1