diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2016-11-10 22:18:07 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-11-23 15:08:39 -0500 |
commit | b02d4081a5260778ec9d20ac1f079c2b503d9943 (patch) | |
tree | e218336ddad103867d827635c8f7b0bfee576a00 | |
parent | 58a6a7dd19980087f5bbbcf7fcfc02a90b72de79 (diff) |
drm/amdgpu: refine cz uvd clock gate logic.
sw clockgate was used on uvd6.0.
when uvd is idle, we gate the uvd clock.
when decode, we ungate the uvd clock.
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c index 41fa351aa241..ba2b66be9022 100644 --- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c | |||
@@ -2111,9 +2111,8 @@ static void cz_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate) | |||
2111 | 2111 | ||
2112 | if (gate) { | 2112 | if (gate) { |
2113 | if (pi->caps_uvd_pg) { | 2113 | if (pi->caps_uvd_pg) { |
2114 | /* disable clockgating so we can properly shut down the block */ | ||
2115 | ret = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_UVD, | 2114 | ret = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_UVD, |
2116 | AMD_CG_STATE_UNGATE); | 2115 | AMD_CG_STATE_GATE); |
2117 | if (ret) { | 2116 | if (ret) { |
2118 | DRM_ERROR("UVD DPM Power Gating failed to set clockgating state\n"); | 2117 | DRM_ERROR("UVD DPM Power Gating failed to set clockgating state\n"); |
2119 | return; | 2118 | return; |
@@ -2159,9 +2158,8 @@ static void cz_dpm_powergate_uvd(struct amdgpu_device *adev, bool gate) | |||
2159 | return; | 2158 | return; |
2160 | } | 2159 | } |
2161 | 2160 | ||
2162 | /* enable clockgating. hw will dynamically gate/ungate clocks on the fly */ | ||
2163 | ret = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_UVD, | 2161 | ret = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_UVD, |
2164 | AMD_CG_STATE_GATE); | 2162 | AMD_CG_STATE_UNGATE); |
2165 | if (ret) { | 2163 | if (ret) { |
2166 | DRM_ERROR("UVD DPM Power Gating Failed to set clockgating state\n"); | 2164 | DRM_ERROR("UVD DPM Power Gating Failed to set clockgating state\n"); |
2167 | return; | 2165 | return; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c index 2028980f1ed4..b0c63c5f54c9 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c | |||
@@ -169,7 +169,7 @@ int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | |||
169 | if (bgate) { | 169 | if (bgate) { |
170 | cgs_set_clockgating_state(hwmgr->device, | 170 | cgs_set_clockgating_state(hwmgr->device, |
171 | AMD_IP_BLOCK_TYPE_UVD, | 171 | AMD_IP_BLOCK_TYPE_UVD, |
172 | AMD_CG_STATE_UNGATE); | 172 | AMD_CG_STATE_GATE); |
173 | cgs_set_powergating_state(hwmgr->device, | 173 | cgs_set_powergating_state(hwmgr->device, |
174 | AMD_IP_BLOCK_TYPE_UVD, | 174 | AMD_IP_BLOCK_TYPE_UVD, |
175 | AMD_PG_STATE_GATE); | 175 | AMD_PG_STATE_GATE); |
@@ -182,7 +182,7 @@ int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | |||
182 | AMD_CG_STATE_UNGATE); | 182 | AMD_CG_STATE_UNGATE); |
183 | cgs_set_clockgating_state(hwmgr->device, | 183 | cgs_set_clockgating_state(hwmgr->device, |
184 | AMD_IP_BLOCK_TYPE_UVD, | 184 | AMD_IP_BLOCK_TYPE_UVD, |
185 | AMD_PG_STATE_GATE); | 185 | AMD_PG_STATE_UNGATE); |
186 | cz_dpm_update_uvd_dpm(hwmgr, false); | 186 | cz_dpm_update_uvd_dpm(hwmgr, false); |
187 | } | 187 | } |
188 | 188 | ||