On 9/23/26 21:33, Shahyan Soltani wrote:
> From: Pierre-Eric Pelloux-Prayer <[email protected]>
> 
> Wake up the GPU while setting up user pages and validating the buffer.
> 
> Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
> Co-developed-by: Shahyan Soltani <[email protected]>
> Signed-off-by: Shahyan Soltani <[email protected]>

Reviewed-by: Christian König <[email protected]>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 5d2802009cd9..e1760e112ec0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -590,6 +590,11 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, 
> void *data,
>                       amdgpu_hmm_range_free(range);
>                       goto release_object;
>               }
> +
> +             r = pm_runtime_resume_and_get(adev->dev);
> +             if (r < 0)
> +                     goto user_pages_done;
> +
>               r = amdgpu_bo_reserve(bo, true);
>               if (r)
>                       goto user_pages_done;
> @@ -599,6 +604,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void 
> *data,
>               amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_GTT);
>               r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
>               amdgpu_bo_unreserve(bo);
> +
> +             pm_runtime_put_autosuspend(adev->dev);
> +
>               if (r)
>                       goto user_pages_done;
>       }

Reply via email to