aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2017-10-20 03:42:34 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-10-25 23:09:38 -0400
commit0722382dcc4fd4e53c12db2c2eda9c5c9c903432 (patch)
tree53827990394e6582fcf44ee35eef04c4b89c68fe /drivers
parentb87079ec7b4d38efee015367315958ce5495ba93 (diff)
drm/amd/powerplay: retrieve the real-time coreClock values
- Currently, the coreClock value for min/max performance level on raven is hard-coded. Use the real-time value retrieved by GetGfxMinFreqLimit and GetGfxMaxFreqLimit PPSMC messages Signed-off-by: Evan Quan <evan.quan@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
index 938010842c7d..3e0b267c74a8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c
@@ -672,36 +672,20 @@ static int rv_get_performance_level(struct pp_hwmgr *hwmgr, const struct pp_hw_p
672 PHM_PerformanceLevelDesignation designation, uint32_t index, 672 PHM_PerformanceLevelDesignation designation, uint32_t index,
673 PHM_PerformanceLevel *level) 673 PHM_PerformanceLevel *level)
674{ 674{
675 const struct rv_power_state *ps;
676 struct rv_hwmgr *data; 675 struct rv_hwmgr *data;
677 uint32_t level_index;
678 uint32_t i;
679 uint32_t vol_dep_record_index = 0;
680 676
681 if (level == NULL || hwmgr == NULL || state == NULL) 677 if (level == NULL || hwmgr == NULL || state == NULL)
682 return -EINVAL; 678 return -EINVAL;
683 679
684 data = (struct rv_hwmgr *)(hwmgr->backend); 680 data = (struct rv_hwmgr *)(hwmgr->backend);
685 ps = cast_const_rv_ps(state);
686
687 level_index = index > ps->level - 1 ? ps->level - 1 : index;
688 level->coreClock = 30000;
689 681
690 if (designation == PHM_PerformanceLevelDesignation_PowerContainment) { 682 if (index == 0) {
691 for (i = 1; i < ps->level; i++) {
692 if (ps->levels[i].engine_clock > data->dce_slow_sclk_threshold) {
693 level->coreClock = 30000;
694 break;
695 }
696 }
697 }
698
699 if (level_index == 0) {
700 vol_dep_record_index = data->clock_vol_info.vdd_dep_on_fclk->count - 1;
701 level->memory_clock =
702 data->clock_vol_info.vdd_dep_on_fclk->entries[vol_dep_record_index].clk;
703 } else {
704 level->memory_clock = data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk; 683 level->memory_clock = data->clock_vol_info.vdd_dep_on_fclk->entries[0].clk;
684 level->coreClock = data->gfx_min_freq_limit;
685 } else {
686 level->memory_clock = data->clock_vol_info.vdd_dep_on_fclk->entries[
687 data->clock_vol_info.vdd_dep_on_fclk->count - 1].clk;
688 level->coreClock = data->gfx_max_freq_limit;
705 } 689 }
706 690
707 level->nonLocalMemoryFreq = 0; 691 level->nonLocalMemoryFreq = 0;