[PATCH 2/2] drm/amdgpu/vcn: Hold pg_lock before vcn power off

Liu, Leo Leo.Liu at amd.com
Wed Aug 6 12:34:14 UTC 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Leo Liu <leo.liu at amd.com>

> -----Original Message-----
> From: Sundararaju, Sathishkumar <Sathishkumar.Sundararaju at amd.com>
> Sent: August 6, 2025 3:17 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Liu, Leo
> <Leo.Liu at amd.com>; Sundararaju, Sathishkumar
> <Sathishkumar.Sundararaju at amd.com>
> Subject: [PATCH 2/2] drm/amdgpu/vcn: Hold pg_lock before vcn power off
>
> Acquire vcn_pg_lock before changes to vcn power state and release it after
> power off in idle work handler.
>
> Signed-off-by: Sathishkumar S <sathishkumar.sundararaju at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index b497a6714138..e965b624efdb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -443,7 +443,9 @@ static void amdgpu_vcn_idle_work_handler(struct
> work_struct *work)
>       fences += fence[i];
>
>       if (!fences && !atomic_read(&vcn_inst->total_submission_cnt)) {
> +             mutex_lock(&vcn_inst->vcn_pg_lock);
>               vcn_inst->set_pg_state(vcn_inst, AMD_PG_STATE_GATE);
> +             mutex_unlock(&vcn_inst->vcn_pg_lock);
>               mutex_lock(&adev->vcn.workload_profile_mutex);
>               if (adev->vcn.workload_profile_active) {
>                       r = amdgpu_dpm_switch_power_profile(adev,
> PP_SMC_POWER_PROFILE_VIDEO,
> --
> 2.48.1



More information about the amd-gfx mailing list