diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/kv_dpm.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index ecd60809db4e..c499dafd28fa 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c | |||
@@ -667,9 +667,8 @@ static int kv_program_bootup_state(struct radeon_device *rdev) | |||
667 | &rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk; | 667 | &rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk; |
668 | 668 | ||
669 | if (table && table->count) { | 669 | if (table && table->count) { |
670 | for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) { | 670 | for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) { |
671 | if ((table->entries[i].clk == pi->boot_pl.sclk) || | 671 | if (table->entries[i].clk == pi->boot_pl.sclk) |
672 | (i == 0)) | ||
673 | break; | 672 | break; |
674 | } | 673 | } |
675 | 674 | ||
@@ -682,9 +681,8 @@ static int kv_program_bootup_state(struct radeon_device *rdev) | |||
682 | if (table->num_max_dpm_entries == 0) | 681 | if (table->num_max_dpm_entries == 0) |
683 | return -EINVAL; | 682 | return -EINVAL; |
684 | 683 | ||
685 | for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) { | 684 | for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) { |
686 | if ((table->entries[i].sclk_frequency == pi->boot_pl.sclk) || | 685 | if (table->entries[i].sclk_frequency == pi->boot_pl.sclk) |
687 | (i == 0)) | ||
688 | break; | 686 | break; |
689 | } | 687 | } |
690 | 688 | ||
@@ -1588,13 +1586,11 @@ static void kv_set_valid_clock_range(struct radeon_device *rdev, | |||
1588 | } | 1586 | } |
1589 | } | 1587 | } |
1590 | 1588 | ||
1591 | for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) { | 1589 | for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) { |
1592 | if ((table->entries[i].clk <= new_ps->levels[new_ps->num_levels -1].sclk) || | 1590 | if (table->entries[i].clk <= new_ps->levels[new_ps->num_levels - 1].sclk) |
1593 | (i == 0)) { | ||
1594 | pi->highest_valid = i; | ||
1595 | break; | 1591 | break; |
1596 | } | ||
1597 | } | 1592 | } |
1593 | pi->highest_valid = i; | ||
1598 | 1594 | ||
1599 | if (pi->lowest_valid > pi->highest_valid) { | 1595 | if (pi->lowest_valid > pi->highest_valid) { |
1600 | if ((new_ps->levels[0].sclk - table->entries[pi->highest_valid].clk) > | 1596 | if ((new_ps->levels[0].sclk - table->entries[pi->highest_valid].clk) > |
@@ -1615,14 +1611,12 @@ static void kv_set_valid_clock_range(struct radeon_device *rdev, | |||
1615 | } | 1611 | } |
1616 | } | 1612 | } |
1617 | 1613 | ||
1618 | for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) { | 1614 | for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) { |
1619 | if (table->entries[i].sclk_frequency <= | 1615 | if (table->entries[i].sclk_frequency <= |
1620 | new_ps->levels[new_ps->num_levels - 1].sclk || | 1616 | new_ps->levels[new_ps->num_levels - 1].sclk) |
1621 | i == 0) { | ||
1622 | pi->highest_valid = i; | ||
1623 | break; | 1617 | break; |
1624 | } | ||
1625 | } | 1618 | } |
1619 | pi->highest_valid = i; | ||
1626 | 1620 | ||
1627 | if (pi->lowest_valid > pi->highest_valid) { | 1621 | if (pi->lowest_valid > pi->highest_valid) { |
1628 | if ((new_ps->levels[0].sclk - | 1622 | if ((new_ps->levels[0].sclk - |
@@ -1871,7 +1865,7 @@ static int kv_force_dpm_highest(struct radeon_device *rdev) | |||
1871 | if (ret) | 1865 | if (ret) |
1872 | return ret; | 1866 | return ret; |
1873 | 1867 | ||
1874 | for (i = SMU7_MAX_LEVELS_GRAPHICS - 1; i >= 0; i--) { | 1868 | for (i = SMU7_MAX_LEVELS_GRAPHICS - 1; i > 0; i--) { |
1875 | if (enable_mask & (1 << i)) | 1869 | if (enable_mask & (1 << i)) |
1876 | break; | 1870 | break; |
1877 | } | 1871 | } |
@@ -1911,9 +1905,9 @@ static u8 kv_get_sleep_divider_id_from_clock(struct radeon_device *rdev, | |||
1911 | if (!pi->caps_sclk_ds) | 1905 | if (!pi->caps_sclk_ds) |
1912 | return 0; | 1906 | return 0; |
1913 | 1907 | ||
1914 | for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i <= 0; i--) { | 1908 | for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i > 0; i--) { |
1915 | temp = sclk / sumo_get_sleep_divider_from_id(i); | 1909 | temp = sclk / sumo_get_sleep_divider_from_id(i); |
1916 | if ((temp >= min) || (i == 0)) | 1910 | if (temp >= min) |
1917 | break; | 1911 | break; |
1918 | } | 1912 | } |
1919 | 1913 | ||