Skip to content

Commit 111821e

Browse files
pldrcalexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0e7581e commit 111821e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,9 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
443443
fences += fence[i];
444444

445445
if (!fences && !atomic_read(&vcn_inst->total_submission_cnt)) {
446+
mutex_lock(&vcn_inst->vcn_pg_lock);
446447
vcn_inst->set_pg_state(vcn_inst, AMD_PG_STATE_GATE);
448+
mutex_unlock(&vcn_inst->vcn_pg_lock);
447449
mutex_lock(&adev->vcn.workload_profile_mutex);
448450
if (adev->vcn.workload_profile_active) {
449451
r = amdgpu_dpm_switch_power_profile(adev, PP_SMC_POWER_PROFILE_VIDEO,

0 commit comments

Comments
 (0)