Signed-off-by: Rex Zhu <rex....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 3549481..94b221f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -207,11 +207,13 @@ static void amdgpu_vcn_idle_work_handler(struct 
work_struct *work)
        unsigned fences = amdgpu_fence_count_emitted(&adev->vcn.ring_dec);
 
        if (fences == 0) {
-               if (adev->pm.dpm_enabled)
+               if (adev->pm.dpm_enabled) {
+                       amdgpu_dpm_switch_power_profile(adev, 
PP_SMC_POWER_PROFILE_VIDEO, false);
                        amdgpu_dpm_enable_uvd(adev, false);
-               else
+               } else {
                        amdgpu_device_ip_set_powergating_state(adev, 
AMD_IP_BLOCK_TYPE_VCN,
                                                               
AMD_PG_STATE_GATE);
+               }
        } else {
                schedule_delayed_work(&adev->vcn.idle_work, VCN_IDLE_TIMEOUT);
        }
@@ -223,11 +225,13 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
        bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);
 
        if (set_clocks && adev->pm.dpm_enabled) {
-               if (adev->pm.dpm_enabled)
+               if (adev->pm.dpm_enabled) {
                        amdgpu_dpm_enable_uvd(adev, true);
-               else
+                       amdgpu_dpm_switch_power_profile(adev, 
PP_SMC_POWER_PROFILE_VIDEO, true);
+               } else {
                        amdgpu_device_ip_set_powergating_state(adev, 
AMD_IP_BLOCK_TYPE_VCN,
                                                               
AMD_PG_STATE_UNGATE);
+               }
        }
 }
 
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to