AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Quan <evan.quan@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alexander.Deucher@amd.com, Evan Quan <evan.quan@amd.com>
Subject: [PATCH 03/10] drm/amd/pm: correct SMU13.0.0 pstate profiling clock settings
Date: Fri, 9 Dec 2022 11:48:06 +0800	[thread overview]
Message-ID: <20221209034813.2373727-3-evan.quan@amd.com> (raw)
In-Reply-To: <20221209034813.2373727-1-evan.quan@amd.com>

Correct the pstate standard/peak profiling mode clock settings
for SMU13.0.0.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Change-Id: Ic47b18904b1fa021588b6d4b599f1cf0fe4b7a58
---
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c  | 22 +++++++++++++------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
index c2fcff384bab..4adbab62e9dd 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
@@ -1305,9 +1305,17 @@ static int smu_v13_0_0_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;
@@ -1324,12 +1332,12 @@ static int smu_v13_0_0_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.34.1


  parent reply	other threads:[~2022-12-09  3:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  3:48 [PATCH 01/10] drm/amd/pm: enable GPO dynamic control support for SMU13.0.0 Evan Quan
2022-12-09  3:48 ` [PATCH 02/10] drm/amd/pm: enable GPO dynamic control support for SMU13.0.7 Evan Quan
2022-12-09  3:48 ` Evan Quan [this message]
2022-12-09  3:48 ` [PATCH 04/10] drm/amd/pm: drop unused SMU v13 API Evan Quan
2022-12-09  3:48 ` [PATCH 05/10] drm/amd/pm: fulfill swsmu peak profiling mode shader/memory clock settings Evan Quan
2022-12-09  3:48 ` [PATCH 06/10] drm/amd/pm: fulfill powerplay " Evan Quan
2022-12-09  3:48 ` [PATCH 07/10] drm/amdgpu: expose peak profiling mode shader/memory clocks Evan Quan
2022-12-09  3:48 ` [PATCH 08/10] drm/amdgpu: expose the minimum shader/memory clock frequency Evan Quan
2022-12-09  3:48 ` [PATCH 09/10] drm/amdgpu: bump minor version number for DEV_INFO and SENSOR IOCTLs update Evan Quan
2022-12-09 21:58   ` Alex Deucher
2022-12-09  3:48 ` [PATCH 10/10] drm/amd/pm: update SMU13.0.0 reported maximum shader clock Evan Quan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221209034813.2373727-3-evan.quan@amd.com \
    --to=evan.quan@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox