diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-06-19 00:41:11 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2023-06-19 00:41:11 +0000 |
commit | 8f7d897aab6e0fa036d40dfd7f32fdd169040af8 (patch) | |
tree | b959da147fdf6d6340438cf69153e36952b1f8da | |
parent | cdb6ea53f95532d28c56abe42203055966114f19 (diff) |
drm/amd/pm: reverse mclk and fclk clocks levels for vangogh
From Tim Huang
e0a0f5d2ba593bbf155a41890f675390fd312e2c in linux-6.1.y/6.1.33
bfc03568d9d81332382c73a1985a90c4506bd36c in mainline linux
-rw-r--r-- | sys/dev/pci/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/sys/dev/pci/drm/amd/pm/swsmu/smu11/vangogh_ppt.c index d6353157889..5bc1eba779c 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/sys/dev/pci/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -588,7 +588,7 @@ static int vangogh_print_legacy_clk_levels(struct smu_context *smu, DpmClocks_t *clk_table = smu->smu_table.clocks_table; SmuMetrics_legacy_t metrics; struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); - int i, size = 0, ret = 0; + int i, idx, size = 0, ret = 0; uint32_t cur_value = 0, value = 0, count = 0; bool cur_value_match_level = false; @@ -662,7 +662,8 @@ static int vangogh_print_legacy_clk_levels(struct smu_context *smu, case SMU_MCLK: case SMU_FCLK: for (i = 0; i < count; i++) { - ret = vangogh_get_dpm_clk_limited(smu, clk_type, i, &value); + idx = (clk_type == SMU_FCLK || clk_type == SMU_MCLK) ? (count - i - 1) : i; + ret = vangogh_get_dpm_clk_limited(smu, clk_type, idx, &value); if (ret) return ret; if (!value) @@ -689,7 +690,7 @@ static int vangogh_print_clk_levels(struct smu_context *smu, DpmClocks_t *clk_table = smu->smu_table.clocks_table; SmuMetrics_t metrics; struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); - int i, size = 0, ret = 0; + int i, idx, size = 0, ret = 0; uint32_t cur_value = 0, value = 0, count = 0; bool cur_value_match_level = false; uint32_t min, max; @@ -771,7 +772,8 @@ static int vangogh_print_clk_levels(struct smu_context *smu, case SMU_MCLK: case SMU_FCLK: for (i = 0; i < count; i++) { - ret = vangogh_get_dpm_clk_limited(smu, clk_type, i, &value); + idx = (clk_type == SMU_FCLK || clk_type == SMU_MCLK) ? (count - i - 1) : i; + ret = vangogh_get_dpm_clk_limited(smu, clk_type, idx, &value); if (ret) return ret; if (!value) |