diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vi.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vi.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 9ff69b90df36..f3cfef48aa99 100644 --- a/drivers/gpu/drm/amd/amdgpu/vi.c +++ b/drivers/gpu/drm/amd/amdgpu/vi.c | |||
@@ -1254,7 +1254,6 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1254 | uint32_t msg_id, pp_state = 0; | 1254 | uint32_t msg_id, pp_state = 0; |
1255 | uint32_t pp_support_state = 0; | 1255 | uint32_t pp_support_state = 0; |
1256 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1256 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1257 | void *pp_handle = adev->powerplay.pp_handle; | ||
1258 | 1257 | ||
1259 | if (adev->cg_flags & (AMD_CG_SUPPORT_MC_LS | AMD_CG_SUPPORT_MC_MGCG)) { | 1258 | if (adev->cg_flags & (AMD_CG_SUPPORT_MC_LS | AMD_CG_SUPPORT_MC_MGCG)) { |
1260 | if (adev->cg_flags & AMD_CG_SUPPORT_MC_LS) { | 1259 | if (adev->cg_flags & AMD_CG_SUPPORT_MC_LS) { |
@@ -1271,7 +1270,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1271 | PP_BLOCK_SYS_MC, | 1270 | PP_BLOCK_SYS_MC, |
1272 | pp_support_state, | 1271 | pp_support_state, |
1273 | pp_state); | 1272 | pp_state); |
1274 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1273 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1274 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | if (adev->cg_flags & (AMD_CG_SUPPORT_SDMA_LS | AMD_CG_SUPPORT_SDMA_MGCG)) { | 1277 | if (adev->cg_flags & (AMD_CG_SUPPORT_SDMA_LS | AMD_CG_SUPPORT_SDMA_MGCG)) { |
@@ -1289,7 +1289,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1289 | PP_BLOCK_SYS_SDMA, | 1289 | PP_BLOCK_SYS_SDMA, |
1290 | pp_support_state, | 1290 | pp_support_state, |
1291 | pp_state); | 1291 | pp_state); |
1292 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1292 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1293 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1293 | } | 1294 | } |
1294 | 1295 | ||
1295 | if (adev->cg_flags & (AMD_CG_SUPPORT_HDP_LS | AMD_CG_SUPPORT_HDP_MGCG)) { | 1296 | if (adev->cg_flags & (AMD_CG_SUPPORT_HDP_LS | AMD_CG_SUPPORT_HDP_MGCG)) { |
@@ -1307,7 +1308,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1307 | PP_BLOCK_SYS_HDP, | 1308 | PP_BLOCK_SYS_HDP, |
1308 | pp_support_state, | 1309 | pp_support_state, |
1309 | pp_state); | 1310 | pp_state); |
1310 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1311 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1312 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1311 | } | 1313 | } |
1312 | 1314 | ||
1313 | 1315 | ||
@@ -1321,7 +1323,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1321 | PP_BLOCK_SYS_BIF, | 1323 | PP_BLOCK_SYS_BIF, |
1322 | PP_STATE_SUPPORT_LS, | 1324 | PP_STATE_SUPPORT_LS, |
1323 | pp_state); | 1325 | pp_state); |
1324 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1326 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1327 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1325 | } | 1328 | } |
1326 | if (adev->cg_flags & AMD_CG_SUPPORT_BIF_MGCG) { | 1329 | if (adev->cg_flags & AMD_CG_SUPPORT_BIF_MGCG) { |
1327 | if (state == AMD_CG_STATE_UNGATE) | 1330 | if (state == AMD_CG_STATE_UNGATE) |
@@ -1333,7 +1336,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1333 | PP_BLOCK_SYS_BIF, | 1336 | PP_BLOCK_SYS_BIF, |
1334 | PP_STATE_SUPPORT_CG, | 1337 | PP_STATE_SUPPORT_CG, |
1335 | pp_state); | 1338 | pp_state); |
1336 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1339 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1340 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1337 | } | 1341 | } |
1338 | 1342 | ||
1339 | if (adev->cg_flags & AMD_CG_SUPPORT_DRM_LS) { | 1343 | if (adev->cg_flags & AMD_CG_SUPPORT_DRM_LS) { |
@@ -1347,7 +1351,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1347 | PP_BLOCK_SYS_DRM, | 1351 | PP_BLOCK_SYS_DRM, |
1348 | PP_STATE_SUPPORT_LS, | 1352 | PP_STATE_SUPPORT_LS, |
1349 | pp_state); | 1353 | pp_state); |
1350 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1354 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1355 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1351 | } | 1356 | } |
1352 | 1357 | ||
1353 | if (adev->cg_flags & AMD_CG_SUPPORT_ROM_MGCG) { | 1358 | if (adev->cg_flags & AMD_CG_SUPPORT_ROM_MGCG) { |
@@ -1361,7 +1366,8 @@ static int vi_common_set_clockgating_state_by_smu(void *handle, | |||
1361 | PP_BLOCK_SYS_ROM, | 1366 | PP_BLOCK_SYS_ROM, |
1362 | PP_STATE_SUPPORT_CG, | 1367 | PP_STATE_SUPPORT_CG, |
1363 | pp_state); | 1368 | pp_state); |
1364 | amd_set_clockgating_by_smu(pp_handle, msg_id); | 1369 | if (adev->powerplay.pp_funcs->set_clockgating_by_smu) |
1370 | amdgpu_dpm_set_clockgating_by_smu(adev, msg_id); | ||
1365 | } | 1371 | } |
1366 | return 0; | 1372 | return 0; |
1367 | } | 1373 | } |