On 6/3/26 18:33, Srinivasan Shanmugam wrote:
> Store a direct pointer from amdgpu_userq_mgr to the per-file eventfd
> manager embedded in amdgpu_fpriv.
> 
> This lets IRQ-side paths signal the correct render-node eventfd manager
> directly, without walking back through drm_file -> driver_priv.
> 
> The pointer is optional and may be NULL until the manager is initialized.
> 
> Cc: Alex Deucher <[email protected]>
> Suggested-by: Christian König <[email protected]>
> Signed-off-by: Srinivasan Shanmugam <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 3 +++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index 99c711ddf71e..93e9cef9856e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> @@ -1168,10 +1168,13 @@ amdgpu_userq_evict(struct amdgpu_userq_mgr *uq_mgr)
>  int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct 
> drm_file *file_priv,
>                         struct amdgpu_device *adev)
>  {
> +     struct amdgpu_fpriv *fpriv = file_priv->driver_priv;
> +
>       mutex_init(&userq_mgr->userq_mutex);
>       xa_init_flags(&userq_mgr->userq_xa, XA_FLAGS_ALLOC);
>       userq_mgr->adev = adev;
>       userq_mgr->file = file_priv;
> +     userq_mgr->eventfd_mgr = fpriv ? &fpriv->eventfd_mgr : NULL;
>  
>       INIT_DELAYED_WORK(&userq_mgr->resume_work, amdgpu_userq_restore_worker);
>       INIT_WORK(&userq_mgr->reset_work, amdgpu_userq_mgr_reset_work);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
> index d1751febaefe..baafa066097e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
> @@ -127,6 +127,7 @@ struct amdgpu_userq_mgr {
>       struct amdgpu_device            *adev;
>       struct delayed_work             resume_work;
>       struct drm_file                 *file;
> +     struct amdgpu_eventfd_mgr       *eventfd_mgr;

We already have a link back to the drm_file, just make an accessor for the 
eventfd_mgr who extracts the pointer.

Christian.

>  
>       /**
>        * @reset_work:

Reply via email to