Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rex Zhu and committed by
Alex Deucher
b02d4081 58a6a7dd

+4 -6
+2 -4
drivers/gpu/drm/amd/amdgpu/cz_dpm.c
··· 2111 2111 2112 2112 if (gate) { 2113 2113 if (pi->caps_uvd_pg) { 2114 - /* disable clockgating so we can properly shut down the block */ 2115 2114 ret = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_UVD, 2116 - AMD_CG_STATE_UNGATE); 2115 + AMD_CG_STATE_GATE); 2117 2116 if (ret) { 2118 2117 DRM_ERROR("UVD DPM Power Gating failed to set clockgating state\n"); 2119 2118 return; ··· 2158 2159 return; 2159 2160 } 2160 2161 2161 - /* enable clockgating. hw will dynamically gate/ungate clocks on the fly */ 2162 2162 ret = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_UVD, 2163 - AMD_CG_STATE_GATE); 2163 + AMD_CG_STATE_UNGATE); 2164 2164 if (ret) { 2165 2165 DRM_ERROR("UVD DPM Power Gating Failed to set clockgating state\n"); 2166 2166 return;
+2 -2
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
··· 169 169 if (bgate) { 170 170 cgs_set_clockgating_state(hwmgr->device, 171 171 AMD_IP_BLOCK_TYPE_UVD, 172 - AMD_CG_STATE_UNGATE); 172 + AMD_CG_STATE_GATE); 173 173 cgs_set_powergating_state(hwmgr->device, 174 174 AMD_IP_BLOCK_TYPE_UVD, 175 175 AMD_PG_STATE_GATE); ··· 182 182 AMD_CG_STATE_UNGATE); 183 183 cgs_set_clockgating_state(hwmgr->device, 184 184 AMD_IP_BLOCK_TYPE_UVD, 185 - AMD_PG_STATE_GATE); 185 + AMD_PG_STATE_UNGATE); 186 186 cz_dpm_update_uvd_dpm(hwmgr, false); 187 187 } 188 188