[PATCH 2/2] drm/amdgpu/userq: fix hardcoded uq functions
Saleemkhan jamadar
sjamadar at amd.com
Mon Feb 24 05:44:13 UTC 2025
Hi Alex,
Change looks good to me.
Reviewed-by: Saleemkhan Jamadar <saleemkhan.jamadar at amd.com>
Regards,
Saleem
On 2/21/2025 8:20 PM, Alex Deucher wrote:
> Use the IP type to look up the userq functions rather
> than hardcoding it.
>
> Signed-off-by: Alex Deucher<alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
> index f1d4e29772a53..0664e04828c07 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c
> @@ -415,11 +415,11 @@ amdgpu_userqueue_resume_all(struct amdgpu_userq_mgr *uq_mgr)
> int queue_id;
> int ret = 0;
>
> - userq_funcs = adev->userq_funcs[AMDGPU_HW_IP_GFX];
> -
> /* Resume all the queues for this process */
> - idr_for_each_entry(&uq_mgr->userq_idr, queue, queue_id)
> + idr_for_each_entry(&uq_mgr->userq_idr, queue, queue_id) {
> + userq_funcs = adev->userq_funcs[queue->queue_type];
> ret = userq_funcs->resume(uq_mgr, queue);
> + }
>
> if (ret)
> DRM_ERROR("Failed to resume all the queue\n");
> @@ -570,11 +570,11 @@ amdgpu_userqueue_suspend_all(struct amdgpu_userq_mgr *uq_mgr)
> int queue_id;
> int ret = 0;
>
> - userq_funcs = adev->userq_funcs[AMDGPU_HW_IP_GFX];
> -
> /* Try to suspend all the queues in this process ctx */
> - idr_for_each_entry(&uq_mgr->userq_idr, queue, queue_id)
> + idr_for_each_entry(&uq_mgr->userq_idr, queue, queue_id) {
> + userq_funcs = adev->userq_funcs[queue->queue_type];
> ret += userq_funcs->suspend(uq_mgr, queue);
> + }
>
> if (ret)
> DRM_ERROR("Couldn't suspend all the queues\n");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20250224/67f3bd75/attachment-0001.htm>
More information about the amd-gfx
mailing list