diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2025-04-16 16:43:52 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2025-04-22 08:51:45 -0400 |
commit | 11772eb73bb75558b530162fc0eb669e5bbc1d19 (patch) | |
tree | 68b756e6b6f29c9b89f68d9644de6bc2fd687da5 /drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | |
parent | 4b27406380b0b9ada6b4893bc8f6766dd34fff36 (diff) |
drm/amdgpu/userq: add a helper to check which IPs are enabled
Add a helper to get a mask of IPs which support user queues.
Use this in the INFO IOCTL to get the IP mask to replace
the current code.
Reviewed-by: Prike Liang <Prike.Liang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c index 8f6510b78dee..59488acd89fa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c @@ -31,6 +31,19 @@ #include "amdgpu_userqueue.h" #include "amdgpu_userq_fence.h" +u32 amdgpu_userqueue_get_supported_ip_mask(struct amdgpu_device *adev) +{ + int i; + u32 userq_ip_mask = 0; + + for (i = 0; i < AMDGPU_HW_IP_NUM; i++) { + if (adev->userq_funcs[i]) + userq_ip_mask |= (1 << i); + } + + return userq_ip_mask; +} + static void amdgpu_userqueue_cleanup(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_usermode_queue *queue, |