Queue USERQ_EOP event records into the per-file wait-event manager from the gfx11 EOP interrupt path.
This wires the first producer into the WAIT_EVENT path. Use the doorbell offset as the current queue selector for queue-scoped waiting. This keeps the initial wait path independent of a separate logical queue id definition. Cc: Alex Deucher <[email protected]> Cc: Christian König <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c index ea11070abbd4..29fd98b7ef50 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c @@ -1327,6 +1327,7 @@ int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *f userq_mgr->adev = adev; userq_mgr->file = file_priv; userq_mgr->eventfd_mgr = fpriv ? &fpriv->eventfd_mgr : NULL; + userq_mgr->wait_event_mgr = fpriv ? &fpriv->wait_event_mgr : NULL; INIT_DELAYED_WORK(&userq_mgr->resume_work, amdgpu_userq_restore_worker); return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h index 8ce039eec2b3..725c33ab5c44 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h @@ -106,6 +106,7 @@ struct amdgpu_userq_mgr { struct delayed_work resume_work; struct drm_file *file; struct amdgpu_eventfd_mgr *eventfd_mgr; + struct amdgpu_wait_event_mgr *wait_event_mgr; atomic_t userq_count[AMDGPU_RING_TYPE_MAX]; }; diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c index ff43902a9c48..20864d12ab33 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c @@ -6546,6 +6546,10 @@ static int gfx_v11_0_eop_irq(struct amdgpu_device *adev, DRM_AMDGPU_EVENT_TYPE_USERQ_EOP, queue_key); + if (mgr && mgr->wait_event_mgr) + amdgpu_wait_event_push_userq_eop(mgr->wait_event_mgr, + queue_key, 0, 0, 0); + xa_unlock_irqrestore(xa, flags); } else { me_id = (entry->ring_id & 0x0c) >> 2; -- 2.34.1
