drm/amdgpu/vcn2: notify SMU power up/down VCN
authorJack Xiao <Jack.Xiao@amd.com>
Thu, 18 Apr 2019 08:20:10 +0000 (16:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:59:27 +0000 (18:59 -0500)
For sw control power gating, it needs notify SMU to power up/down VCN
when enter/exit working state.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c

index b5f9afc08c4a66edfbb6f4eaa4772124045d7030..36a80e487b8d7d0799dd4d5849fe08c4d25efaa8 100644 (file)
@@ -27,6 +27,7 @@
 #include "amdgpu_vcn.h"
 #include "soc15.h"
 #include "soc15d.h"
+#include "amdgpu_pm.h"
 
 #include "vcn/vcn_2_0_0_offset.h"
 #include "vcn/vcn_2_0_0_sh_mask.h"
@@ -779,6 +780,9 @@ static int vcn_v2_0_start(struct amdgpu_device *adev)
        uint32_t lmi_swap_cntl;
        int i, j, r;
 
+       if (adev->pm.dpm_enabled)
+               amdgpu_dpm_enable_uvd(adev, true);
+
        vcn_v2_0_disable_static_power_gating(adev);
 
        /* set uvd status busy */
@@ -991,6 +995,9 @@ static int vcn_v2_0_stop(struct amdgpu_device *adev)
        vcn_v2_0_enable_clock_gating(adev);
        vcn_v2_0_enable_static_power_gating(adev);
 
+       if (adev->pm.dpm_enabled)
+               amdgpu_dpm_enable_uvd(adev, false);
+
        return 0;
 }