aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2016-08-25 13:02:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-08-25 14:02:55 -0400
commit15f441db96adcac1dc86196b301f4204452bfe0c (patch)
tree49f243286040afcd2459dc2c73d30fda74ef147e
parente701f97ff34a3ec904c19d72a7ca81eed98d5ad9 (diff)
drm/amd/amdgpu: Tidy up cz_dpm.c
Various minor formatting changes. Signed-off-by: Tom St Denis <tom.stdenis@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.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
index e7ea28c0c5b8..f80a0834e889 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
@@ -678,17 +678,12 @@ static void cz_reset_ap_mask(struct amdgpu_device *adev)
678 struct cz_power_info *pi = cz_get_pi(adev); 678 struct cz_power_info *pi = cz_get_pi(adev);
679 679
680 pi->active_process_mask = 0; 680 pi->active_process_mask = 0;
681
682} 681}
683 682
684static int cz_dpm_download_pptable_from_smu(struct amdgpu_device *adev, 683static int cz_dpm_download_pptable_from_smu(struct amdgpu_device *adev,
685 void **table) 684 void **table)
686{ 685{
687 int ret = 0; 686 return cz_smu_download_pptable(adev, table);
688
689 ret = cz_smu_download_pptable(adev, table);
690
691 return ret;
692} 687}
693 688
694static int cz_dpm_upload_pptable_to_smu(struct amdgpu_device *adev) 689static int cz_dpm_upload_pptable_to_smu(struct amdgpu_device *adev)
@@ -828,9 +823,9 @@ static void cz_init_sclk_limit(struct amdgpu_device *adev)
828 pi->sclk_dpm.hard_min_clk = 0; 823 pi->sclk_dpm.hard_min_clk = 0;
829 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxSclkLevel); 824 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxSclkLevel);
830 level = cz_get_argument(adev); 825 level = cz_get_argument(adev);
831 if (level < table->count) 826 if (level < table->count) {
832 clock = table->entries[level].clk; 827 clock = table->entries[level].clk;
833 else { 828 } else {
834 DRM_ERROR("Invalid SLCK Voltage Dependency table entry.\n"); 829 DRM_ERROR("Invalid SLCK Voltage Dependency table entry.\n");
835 clock = table->entries[table->count - 1].clk; 830 clock = table->entries[table->count - 1].clk;
836 } 831 }
@@ -856,9 +851,9 @@ static void cz_init_uvd_limit(struct amdgpu_device *adev)
856 pi->uvd_dpm.hard_min_clk = 0; 851 pi->uvd_dpm.hard_min_clk = 0;
857 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxUvdLevel); 852 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxUvdLevel);
858 level = cz_get_argument(adev); 853 level = cz_get_argument(adev);
859 if (level < table->count) 854 if (level < table->count) {
860 clock = table->entries[level].vclk; 855 clock = table->entries[level].vclk;
861 else { 856 } else {
862 DRM_ERROR("Invalid UVD Voltage Dependency table entry.\n"); 857 DRM_ERROR("Invalid UVD Voltage Dependency table entry.\n");
863 clock = table->entries[table->count - 1].vclk; 858 clock = table->entries[table->count - 1].vclk;
864 } 859 }
@@ -884,9 +879,9 @@ static void cz_init_vce_limit(struct amdgpu_device *adev)
884 pi->vce_dpm.hard_min_clk = table->entries[0].ecclk; 879 pi->vce_dpm.hard_min_clk = table->entries[0].ecclk;
885 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxEclkLevel); 880 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxEclkLevel);
886 level = cz_get_argument(adev); 881 level = cz_get_argument(adev);
887 if (level < table->count) 882 if (level < table->count) {
888 clock = table->entries[level].ecclk; 883 clock = table->entries[level].ecclk;
889 else { 884 } else {
890 /* future BIOS would fix this error */ 885 /* future BIOS would fix this error */
891 DRM_ERROR("Invalid VCE Voltage Dependency table entry.\n"); 886 DRM_ERROR("Invalid VCE Voltage Dependency table entry.\n");
892 clock = table->entries[table->count - 1].ecclk; 887 clock = table->entries[table->count - 1].ecclk;
@@ -913,9 +908,9 @@ static void cz_init_acp_limit(struct amdgpu_device *adev)
913 pi->acp_dpm.hard_min_clk = 0; 908 pi->acp_dpm.hard_min_clk = 0;
914 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxAclkLevel); 909 cz_send_msg_to_smc(adev, PPSMC_MSG_GetMaxAclkLevel);
915 level = cz_get_argument(adev); 910 level = cz_get_argument(adev);
916 if (level < table->count) 911 if (level < table->count) {
917 clock = table->entries[level].clk; 912 clock = table->entries[level].clk;
918 else { 913 } else {
919 DRM_ERROR("Invalid ACP Voltage Dependency table entry.\n"); 914 DRM_ERROR("Invalid ACP Voltage Dependency table entry.\n");
920 clock = table->entries[table->count - 1].clk; 915 clock = table->entries[table->count - 1].clk;
921 } 916 }
@@ -940,7 +935,6 @@ static void cz_init_sclk_threshold(struct amdgpu_device *adev)
940 struct cz_power_info *pi = cz_get_pi(adev); 935 struct cz_power_info *pi = cz_get_pi(adev);
941 936
942 pi->low_sclk_interrupt_threshold = 0; 937 pi->low_sclk_interrupt_threshold = 0;
943
944} 938}
945 939
946static void cz_dpm_setup_asic(struct amdgpu_device *adev) 940static void cz_dpm_setup_asic(struct amdgpu_device *adev)
@@ -1213,7 +1207,7 @@ static int cz_enable_didt(struct amdgpu_device *adev, bool enable)
1213 int ret; 1207 int ret;
1214 1208
1215 if (pi->caps_sq_ramping || pi->caps_db_ramping || 1209 if (pi->caps_sq_ramping || pi->caps_db_ramping ||
1216 pi->caps_td_ramping || pi->caps_tcp_ramping) { 1210 pi->caps_td_ramping || pi->caps_tcp_ramping) {
1217 if (adev->gfx.gfx_current_status != AMDGPU_GFX_SAFE_MODE) { 1211 if (adev->gfx.gfx_current_status != AMDGPU_GFX_SAFE_MODE) {
1218 ret = cz_disable_cgpg(adev); 1212 ret = cz_disable_cgpg(adev);
1219 if (ret) { 1213 if (ret) {
@@ -1287,7 +1281,7 @@ static void cz_apply_state_adjust_rules(struct amdgpu_device *adev,
1287 ps->force_high = false; 1281 ps->force_high = false;
1288 ps->need_dfs_bypass = true; 1282 ps->need_dfs_bypass = true;
1289 pi->video_start = new_rps->dclk || new_rps->vclk || 1283 pi->video_start = new_rps->dclk || new_rps->vclk ||
1290 new_rps->evclk || new_rps->ecclk; 1284 new_rps->evclk || new_rps->ecclk;
1291 1285
1292 if ((new_rps->class & ATOM_PPLIB_CLASSIFICATION_UI_MASK) == 1286 if ((new_rps->class & ATOM_PPLIB_CLASSIFICATION_UI_MASK) ==
1293 ATOM_PPLIB_CLASSIFICATION_UI_BATTERY) 1287 ATOM_PPLIB_CLASSIFICATION_UI_BATTERY)
@@ -1345,7 +1339,6 @@ static int cz_dpm_enable(struct amdgpu_device *adev)
1345 } 1339 }
1346 1340
1347 cz_reset_acp_boot_level(adev); 1341 cz_reset_acp_boot_level(adev);
1348
1349 cz_update_current_ps(adev, adev->pm.dpm.boot_ps); 1342 cz_update_current_ps(adev, adev->pm.dpm.boot_ps);
1350 1343
1351 return 0; 1344 return 0;
@@ -1675,7 +1668,6 @@ static void cz_dpm_post_set_power_state(struct amdgpu_device *adev)
1675 struct amdgpu_ps *ps = &pi->requested_rps; 1668 struct amdgpu_ps *ps = &pi->requested_rps;
1676 1669
1677 cz_update_current_ps(adev, ps); 1670 cz_update_current_ps(adev, ps);
1678
1679} 1671}
1680 1672
1681static int cz_dpm_force_highest(struct amdgpu_device *adev) 1673static int cz_dpm_force_highest(struct amdgpu_device *adev)
@@ -2207,7 +2199,6 @@ static int cz_update_vce_dpm(struct amdgpu_device *adev)
2207 /* Stable Pstate is enabled and we need to set the VCE DPM to highest level */ 2199 /* Stable Pstate is enabled and we need to set the VCE DPM to highest level */
2208 if (pi->caps_stable_power_state) { 2200 if (pi->caps_stable_power_state) {
2209 pi->vce_dpm.hard_min_clk = table->entries[table->count-1].ecclk; 2201 pi->vce_dpm.hard_min_clk = table->entries[table->count-1].ecclk;
2210
2211 } else { /* non-stable p-state cases. without vce.Arbiter.EcclkHardMin */ 2202 } else { /* non-stable p-state cases. without vce.Arbiter.EcclkHardMin */
2212 /* leave it as set by user */ 2203 /* leave it as set by user */
2213 /*pi->vce_dpm.hard_min_clk = table->entries[0].ecclk;*/ 2204 /*pi->vce_dpm.hard_min_clk = table->entries[0].ecclk;*/