From 81d0bca004c160d91be21809111045a62c214755 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Apr 20 2023 11:01:02 +0000 Subject: drm/amd/pm: correct SMU13.0.7 pstate profiling clock settings (bsc#1012628). --- diff --git a/patches.kernel.org/6.2.12-120-drm-amd-pm-correct-SMU13.0.7-pstate-profiling-.patch b/patches.kernel.org/6.2.12-120-drm-amd-pm-correct-SMU13.0.7-pstate-profiling-.patch new file mode 100644 index 0000000..deac7ad --- /dev/null +++ b/patches.kernel.org/6.2.12-120-drm-amd-pm-correct-SMU13.0.7-pstate-profiling-.patch @@ -0,0 +1,67 @@ +From: Horatio Zhang +Date: Thu, 6 Apr 2023 11:17:38 +0800 +Subject: [PATCH] drm/amd/pm: correct SMU13.0.7 pstate profiling clock settings +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: f06b8887e3ef4f50098d3a949aef392c529c831a + +commit f06b8887e3ef4f50098d3a949aef392c529c831a upstream. + +Correct the pstate standard/peak profiling mode clock +settings for SMU13.0.7. + +Signed-off-by: Horatio Zhang +Reviewed-by: Kenneth Feng +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org # 6.1.x +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 22 +++++++++++++------ + 1 file changed, 15 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +index 8432357e..37739f5e 100644 +--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c ++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +@@ -1329,9 +1329,17 @@ static int smu_v13_0_7_populate_umd_state_clk(struct smu_context *smu) + &dpm_context->dpm_tables.fclk_table; + struct smu_umd_pstate_table *pstate_table = + &smu->pstate_table; ++ struct smu_table_context *table_context = &smu->smu_table; ++ PPTable_t *pptable = table_context->driver_pptable; ++ DriverReportedClocks_t driver_clocks = ++ pptable->SkuTable.DriverReportedClocks; + + pstate_table->gfxclk_pstate.min = gfx_table->min; +- pstate_table->gfxclk_pstate.peak = gfx_table->max; ++ if (driver_clocks.GameClockAc && ++ (driver_clocks.GameClockAc < gfx_table->max)) ++ pstate_table->gfxclk_pstate.peak = driver_clocks.GameClockAc; ++ else ++ pstate_table->gfxclk_pstate.peak = gfx_table->max; + + pstate_table->uclk_pstate.min = mem_table->min; + pstate_table->uclk_pstate.peak = mem_table->max; +@@ -1348,12 +1356,12 @@ static int smu_v13_0_7_populate_umd_state_clk(struct smu_context *smu) + pstate_table->fclk_pstate.min = fclk_table->min; + pstate_table->fclk_pstate.peak = fclk_table->max; + +- /* +- * For now, just use the mininum clock frequency. +- * TODO: update them when the real pstate settings available +- */ +- pstate_table->gfxclk_pstate.standard = gfx_table->min; +- pstate_table->uclk_pstate.standard = mem_table->min; ++ if (driver_clocks.BaseClockAc && ++ driver_clocks.BaseClockAc < gfx_table->max) ++ pstate_table->gfxclk_pstate.standard = driver_clocks.BaseClockAc; ++ else ++ pstate_table->gfxclk_pstate.standard = gfx_table->max; ++ pstate_table->uclk_pstate.standard = mem_table->max; + pstate_table->socclk_pstate.standard = soc_table->min; + pstate_table->vclk_pstate.standard = vclk_table->min; + pstate_table->dclk_pstate.standard = dclk_table->min; +-- +2.35.3 + diff --git a/series.conf b/series.conf index 0c0a120..c98751d 100644 --- a/series.conf +++ b/series.conf @@ -2347,6 +2347,7 @@ patches.kernel.org/6.2.12-117-cgroup-cpuset-Wake-up-cpuset_attach_wq-tasks-i.patch patches.kernel.org/6.2.12-118-cgroup-cpuset-Make-cpuset_fork-handle-CLONE_IN.patch patches.kernel.org/6.2.12-119-cgroup-cpuset-Add-cpuset_can_fork-and-cpuset_c.patch + patches.kernel.org/6.2.12-120-drm-amd-pm-correct-SMU13.0.7-pstate-profiling-.patch ######################################################## # Build fixes that apply to the vanilla kernel too.