diff options
| author | Rex Zhu <Rex.Zhu@amd.com> | 2017-01-26 03:25:05 -0500 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-02-08 17:22:27 -0500 |
| commit | beeea9819d1b85ea4f4beb09d176de9889079c75 (patch) | |
| tree | b521cb3f6828d641a42cc7b0b15e5e9b269b261c /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
| parent | 28ed5504ab4b211a4e589e648e5ebd1e0caa7a6a (diff) | |
drm/amdgpu: refine code for VCE2.0 and related dpm code.
v2: clean up vce cg function.
use sw cg when vce stoped.
1. implement vce_stop function.
2. not start vce when hw_init.
3. refine vce cg/pg code.
4. delete bypass mode.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index a61882ddc804..95e026a4a2de 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
| @@ -1142,12 +1142,22 @@ void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable) | |||
| 1142 | /* XXX select vce level based on ring/task */ | 1142 | /* XXX select vce level based on ring/task */ |
| 1143 | adev->pm.dpm.vce_level = AMD_VCE_LEVEL_AC_ALL; | 1143 | adev->pm.dpm.vce_level = AMD_VCE_LEVEL_AC_ALL; |
| 1144 | mutex_unlock(&adev->pm.mutex); | 1144 | mutex_unlock(&adev->pm.mutex); |
| 1145 | amdgpu_pm_compute_clocks(adev); | ||
| 1146 | amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCE, | ||
| 1147 | AMD_PG_STATE_UNGATE); | ||
| 1148 | amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_VCE, | ||
| 1149 | AMD_CG_STATE_UNGATE); | ||
| 1145 | } else { | 1150 | } else { |
| 1151 | amdgpu_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCE, | ||
| 1152 | AMD_PG_STATE_GATE); | ||
| 1153 | amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_VCE, | ||
| 1154 | AMD_CG_STATE_GATE); | ||
| 1146 | mutex_lock(&adev->pm.mutex); | 1155 | mutex_lock(&adev->pm.mutex); |
| 1147 | adev->pm.dpm.vce_active = false; | 1156 | adev->pm.dpm.vce_active = false; |
| 1148 | mutex_unlock(&adev->pm.mutex); | 1157 | mutex_unlock(&adev->pm.mutex); |
| 1158 | amdgpu_pm_compute_clocks(adev); | ||
| 1149 | } | 1159 | } |
| 1150 | amdgpu_pm_compute_clocks(adev); | 1160 | |
| 1151 | } | 1161 | } |
| 1152 | } | 1162 | } |
| 1153 | 1163 | ||
