drm/amdgpu: Simplify calculation in *get_sleep_divider_id_from_clock
a / (1 << b) is equivalent to a >> b for unsigned values Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

szülő
9887e425f9
commit
354ef928a0
@@ -1907,7 +1907,7 @@ static uint8_t fiji_get_sleep_divider_id_from_clock(struct pp_hwmgr *hwmgr,
|
||||
|
||||
PP_ASSERT_WITH_CODE((clock >= min), "Engine clock can't satisfy stutter requirement!", return 0);
|
||||
for (i = FIJI_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
|
||||
temp = clock / (1UL << i);
|
||||
temp = clock >> i;
|
||||
|
||||
if (temp >= min || i == 0)
|
||||
break;
|
||||
|
@@ -1177,7 +1177,7 @@ static int polaris10_populate_single_graphic_level(struct pp_hwmgr *hwmgr,
|
||||
*/
|
||||
PP_ASSERT_WITH_CODE((clock >= POLARIS10_MINIMUM_ENGINE_CLOCK), "Engine clock can't satisfy stutter requirement!", return 0);
|
||||
for (i = POLARIS10_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
|
||||
temp = clock / (1UL << i);
|
||||
temp = clock >> i;
|
||||
|
||||
if (temp >= POLARIS10_MINIMUM_ENGINE_CLOCK || i == 0)
|
||||
break;
|
||||
|
@@ -2426,7 +2426,7 @@ static uint8_t tonga_get_sleep_divider_id_from_clock(struct pp_hwmgr *hwmgr,
|
||||
"Engine clock can't satisfy stutter requirement!", return 0);
|
||||
|
||||
for (i = TONGA_MAX_DEEPSLEEP_DIVIDER_ID;; i--) {
|
||||
temp = engine_clock / (1 << i);
|
||||
temp = engine_clock >> i;
|
||||
|
||||
if(temp >= min || i == 0)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user