drm/amdgpu: when dpm disabled, also need to stop/start vce.
authorRex Zhu <Rex.Zhu@amd.com>
Sat, 7 Oct 2017 22:37:46 +0000 (22:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 09:06:29 +0000 (10:06 +0100)
[ Upstream commit 28ed5504ab4b211a4e589e648e5ebd1e0caa7a6a ]

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c

index bb0da76051a18f2bd9941617d0f0635ccdce990e..e5da6f19b9b8732a0dd9d8cd6d778493047097a6 100644 (file)
@@ -284,6 +284,10 @@ static void amdgpu_vce_idle_work_handler(struct work_struct *work)
                        amdgpu_dpm_enable_vce(adev, false);
                } else {
                        amdgpu_asic_set_vce_clocks(adev, 0, 0);
+                       amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+                                                           AMD_PG_STATE_GATE);
+                       amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+                                                           AMD_CG_STATE_GATE);
                }
        } else {
                schedule_delayed_work(&adev->vce.idle_work,
@@ -315,6 +319,11 @@ static void amdgpu_vce_note_usage(struct amdgpu_device *adev)
                        amdgpu_dpm_enable_vce(adev, true);
                } else {
                        amdgpu_asic_set_vce_clocks(adev, 53300, 40000);
+                       amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+                                                           AMD_CG_STATE_UNGATE);
+                       amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCE,
+                                                           AMD_PG_STATE_UNGATE);
+
                }
        }
 }