]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amdgpu: Add preempt and restore callbacks to userq funcs
authorJesse.Zhang <Jesse.Zhang@amd.com>
Tue, 5 Aug 2025 03:26:15 +0000 (11:26 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 21:37:50 +0000 (17:37 -0400)
Add two new function pointers to struct amdgpu_userq_funcs:
- preempt: To handle preemption of user mode queues
- restore: To restore preempted user mode queues

These callbacks will allow the driver to properly manage queue
preemption and restoration when needed, such as during context
switching or priority changes.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h

index b1ca91b7cda4bd8b51152516e7df77fff9c42137..017efd2075df24f856dda3e19ee68e5685b27a22 100644 (file)
@@ -78,6 +78,10 @@ struct amdgpu_userq_funcs {
                     struct amdgpu_usermode_queue *queue);
        int (*map)(struct amdgpu_userq_mgr *uq_mgr,
                   struct amdgpu_usermode_queue *queue);
+       int (*preempt)(struct amdgpu_userq_mgr *uq_mgr,
+                  struct amdgpu_usermode_queue *queue);
+       int (*restore)(struct amdgpu_userq_mgr *uq_mgr,
+                  struct amdgpu_usermode_queue *queue);
 };
 
 /* Usermode queues for gfx */