aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Wallménius <nils.wallmenius@gmail.com>2016-05-05 03:07:45 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-05-11 12:31:22 -0400
commit859b8b6a27eb6f22d082282f5fd234d6323f849d (patch)
tree3b9bdbe88860b0a84c8eed58d6259ca36689f1a7
parentf9fbac64ebb0306d2b88479325aaa4e61f359cb6 (diff)
drm/amd/powerplay: Use defined constants for minium engine clock
Replacing magic numbers in calculation of sleep divider id for fiji and polaris. Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c3
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
index d05a5e0ab87f..c574afd5e12b 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
@@ -1903,7 +1903,8 @@ static uint8_t fiji_get_sleep_divider_id_from_clock(struct pp_hwmgr *hwmgr,
1903{ 1903{
1904 uint8_t i; 1904 uint8_t i;
1905 uint32_t temp; 1905 uint32_t temp;
1906 uint32_t min = clock_insr > 2500 ? clock_insr : 2500; 1906 uint32_t min = clock_insr > FIJI_MINIMUM_ENGINE_CLOCK ?
1907 clock_insr : FIJI_MINIMUM_ENGINE_CLOCK;
1907 1908
1908 PP_ASSERT_WITH_CODE((clock >= min), "Engine clock can't satisfy stutter requirement!", return 0); 1909 PP_ASSERT_WITH_CODE((clock >= min), "Engine clock can't satisfy stutter requirement!", return 0);
1909 for (i = FIJI_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) { 1910 for (i = FIJI_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
index dbdcc68b17b2..c911ab881d6a 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
@@ -1175,11 +1175,11 @@ static int polaris10_populate_single_graphic_level(struct pp_hwmgr *hwmgr,
1175 if (phm_cap_enabled(hwmgr->platformDescriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep)) 1175 if (phm_cap_enabled(hwmgr->platformDescriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep))
1176 level->DeepSleepDivId = PhwFiji_GetSleepDividerIdFromClock(hwmgr, clock, minClocks.engineClockInSR); 1176 level->DeepSleepDivId = PhwFiji_GetSleepDividerIdFromClock(hwmgr, clock, minClocks.engineClockInSR);
1177 */ 1177 */
1178 PP_ASSERT_WITH_CODE((clock >= 2500), "Engine clock can't satisfy stutter requirement!", return 0); 1178 PP_ASSERT_WITH_CODE((clock >= POLARIS10_MINIMUM_ENGINE_CLOCK), "Engine clock can't satisfy stutter requirement!", return 0);
1179 for (i = POLARIS10_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) { 1179 for (i = POLARIS10_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
1180 temp = clock / (1UL << i); 1180 temp = clock / (1UL << i);
1181 1181
1182 if (temp >= 2500 || i == 0) 1182 if (temp >= POLARIS10_MINIMUM_ENGINE_CLOCK || i == 0)
1183 break; 1183 break;
1184 } 1184 }
1185 1185