From ec2bd244b6de77105d6dc60bed6150b9ee3d7f8c Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 6 Jan 2022 01:37:46 +0000 Subject: [PATCH] drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled From chen gong 28863ffe21ff711d5109e3c208676258bdec3a1f in linux 5.10.y/5.10.90 b7865173cf6ae59942e2c69326a06e1c1df5ecf6 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/vcn_v1_0.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/pci/drm/amd/amdgpu/vcn_v1_0.c b/sys/dev/pci/drm/amd/amdgpu/vcn_v1_0.c index 5f800c325e3..c0986099ee0 100644 --- a/sys/dev/pci/drm/amd/amdgpu/vcn_v1_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/vcn_v1_0.c @@ -260,6 +260,13 @@ static int vcn_v1_0_suspend(void *handle) { int r; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + bool idle_work_unexecuted; + + idle_work_unexecuted = cancel_delayed_work_sync(&adev->vcn.idle_work); + if (idle_work_unexecuted) { + if (adev->pm.dpm_enabled) + amdgpu_dpm_enable_uvd(adev, false); + } r = vcn_v1_0_hw_fini(adev); if (r) -- 2.20.1