diff options
author | Sonny Jiang <sonny.jiang@amd.com> | 2015-05-28 15:47:53 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-10 11:54:16 -0400 |
commit | b7a0776949a8f9db835ab652b6fa96b6e7d6972d (patch) | |
tree | ee3b6b1779bf9fd680c496553a591bbaf9a00540 /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | b97aab014c6ba6133df1e26bd20c1ad7f50a5bff (diff) |
drm/amdgpu: enable vce powergating
Enable VCE dpm and powergating. VCE dpm dynamically scales the VCE clocks on
demand.
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 605a9e42f943..ed13baa7c976 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -656,19 +656,27 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable) | |||
656 | 656 | ||
657 | void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable) | 657 | void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable) |
658 | { | 658 | { |
659 | if (enable) { | 659 | if (adev->pm.funcs->powergate_vce) { |
660 | mutex_lock(&adev->pm.mutex); | 660 | mutex_lock(&adev->pm.mutex); |
661 | adev->pm.dpm.vce_active = true; | 661 | /* enable/disable VCE */ |
662 | /* XXX select vce level based on ring/task */ | 662 | amdgpu_dpm_powergate_vce(adev, !enable); |
663 | adev->pm.dpm.vce_level = AMDGPU_VCE_LEVEL_AC_ALL; | 663 | |
664 | mutex_unlock(&adev->pm.mutex); | 664 | mutex_unlock(&adev->pm.mutex); |
665 | } else { | 665 | } else { |
666 | mutex_lock(&adev->pm.mutex); | 666 | if (enable) { |
667 | adev->pm.dpm.vce_active = false; | 667 | mutex_lock(&adev->pm.mutex); |
668 | mutex_unlock(&adev->pm.mutex); | 668 | adev->pm.dpm.vce_active = true; |
669 | } | 669 | /* XXX select vce level based on ring/task */ |
670 | adev->pm.dpm.vce_level = AMDGPU_VCE_LEVEL_AC_ALL; | ||
671 | mutex_unlock(&adev->pm.mutex); | ||
672 | } else { | ||
673 | mutex_lock(&adev->pm.mutex); | ||
674 | adev->pm.dpm.vce_active = false; | ||
675 | mutex_unlock(&adev->pm.mutex); | ||
676 | } | ||
670 | 677 | ||
671 | amdgpu_pm_compute_clocks(adev); | 678 | amdgpu_pm_compute_clocks(adev); |
679 | } | ||
672 | } | 680 | } |
673 | 681 | ||
674 | void amdgpu_pm_print_power_states(struct amdgpu_device *adev) | 682 | void amdgpu_pm_print_power_states(struct amdgpu_device *adev) |