amdgpu: Add queue id support to the user queue wait IOCTL
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Add queue id support to the user queue wait IOCTL
drm_amdgpu_userq_wait structure.

This is required to retrieve the wait user queue and maintain
the fence driver references in it so that the user queue in
the same context releases their reference to the fence drivers
at some point before queue destruction.

Otherwise, we would gather those references until we
don't have any more space left and crash.

Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34493>
This commit is contained in:
Arunpravin Paneer Selvam 2025-04-12 12:28:11 +05:30 committed by Marge Bot
parent 949d2e507d
commit 84f18f31ad
2 changed files with 7 additions and 0 deletions

View file

@ -502,6 +502,12 @@ struct drm_amdgpu_userq_fence_info {
}; };
struct drm_amdgpu_userq_wait { struct drm_amdgpu_userq_wait {
/**
* @waitq_id: Queue handle used by the userq wait IOCTL to retrieve the
* wait queue and maintain the fence driver references in it.
*/
__u32 waitq_id;
__u32 pad;
/** /**
* @syncobj_handles: The list of syncobj handles submitted by the user queue * @syncobj_handles: The list of syncobj handles submitted by the user queue
* job to get the va/value pairs. * job to get the va/value pairs.

View file

@ -1495,6 +1495,7 @@ static int amdgpu_cs_submit_ib_userq(struct amdgpu_userq *userq,
struct drm_amdgpu_userq_fence_info *fence_info; struct drm_amdgpu_userq_fence_info *fence_info;
struct drm_amdgpu_userq_wait userq_wait_data = { struct drm_amdgpu_userq_wait userq_wait_data = {
.waitq_id = userq->userq_handle,
.syncobj_handles = (uintptr_t)syncobj_dependencies_list, .syncobj_handles = (uintptr_t)syncobj_dependencies_list,
.syncobj_timeline_handles = (uintptr_t)&syncobj_timeline_dependency, .syncobj_timeline_handles = (uintptr_t)&syncobj_timeline_dependency,
.syncobj_timeline_points = (uintptr_t)&syncobj_timeline_dependency_point, .syncobj_timeline_points = (uintptr_t)&syncobj_timeline_dependency_point,