All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhou1, Tao" <Tao.Zhou1@amd.com>
To: "Chen, Jiansong (Simon)" <Jiansong.Chen@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Feng, Kenneth" <Kenneth.Feng@amd.com>,
	"Chen, Jiansong \(Simon\)" <Jiansong.Chen@amd.com>
Subject: RE: [PATCH] drm/amd/powerplay: retrieve VCN dpm table per instances
Date: Tue, 21 Jul 2020 09:20:35 +0000	[thread overview]
Message-ID: <BYAPR12MB28886358935A6C7097EE37EBB0780@BYAPR12MB2888.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20200721090109.2733-1-Jiansong.Chen@amd.com>

[AMD Official Use Only - Internal Distribution Only]

With my comment below fixed, the patch is:

Reviewed-by: Tao Zhou <tao.zhou1@amd.com>

-----Original Message-----
From: Jiansong Chen <Jiansong.Chen@amd.com>
Sent: Tuesday, July 21, 2020 5:01 PM
To: amd-gfx@lists.freedesktop.org
Cc: Zhou1, Tao <Tao.Zhou1@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Chen, Jiansong (Simon) <Jiansong.Chen@amd.com>
Subject: [PATCH] drm/amd/powerplay: retrieve VCN dpm table per instances

To accommodate VCN instances variance, otherwise it may trigger smu response error for configuration with less instances.

Signed-off-by: Jiansong Chen <Jiansong.Chen@amd.com>
Change-Id: I0bfe31f1f5638d539ac6ded3bffee8f57574bafa
---
 .../drm/amd/powerplay/sienna_cichlid_ppt.c    | 68 +++++++++++--------
 1 file changed, 38 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
index 87eedd7c28ec..c8b59a891f5d 100644
--- a/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
@@ -525,6 +525,7 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
 struct smu_11_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
 PPTable_t *driver_ppt = smu->smu_table.driver_pptable;
 struct smu_11_0_dpm_table *dpm_table;
+struct amdgpu_device *adev = smu->adev;
 int ret = 0;

 /* socclk dpm table setup */
@@ -617,22 +618,26 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
 dpm_table->max = dpm_table->dpm_levels[0].value;
 }

+
[Tao]: Please remove the redundant line.

 /* vclk1 dpm table setup */
-dpm_table = &dpm_context->dpm_tables.vclk1_table;
-if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
-ret = smu_v11_0_set_single_dpm_table(smu,
-     SMU_VCLK1,
-     dpm_table);
-if (ret)
-return ret;
-dpm_table->is_fine_grained =
-!driver_ppt->DpmDescriptor[PPCLK_VCLK_1].SnapToDiscrete;
-} else {
-dpm_table->count = 1;
-dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.vclk / 100;
-dpm_table->dpm_levels[0].enabled = true;
-dpm_table->min = dpm_table->dpm_levels[0].value;
-dpm_table->max = dpm_table->dpm_levels[0].value;
+if (adev->vcn.num_vcn_inst > 1) {
+dpm_table = &dpm_context->dpm_tables.vclk1_table;
+if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
+ret = smu_v11_0_set_single_dpm_table(smu,
+     SMU_VCLK1,
+     dpm_table);
+if (ret)
+return ret;
+dpm_table->is_fine_grained =
+!driver_ppt->DpmDescriptor[PPCLK_VCLK_1].SnapToDiscrete;
+} else {
+dpm_table->count = 1;
+dpm_table->dpm_levels[0].value =
+smu->smu_table.boot_values.vclk / 100;
+dpm_table->dpm_levels[0].enabled = true;
+dpm_table->min = dpm_table->dpm_levels[0].value;
+dpm_table->max = dpm_table->dpm_levels[0].value;
+}
 }

 /* dclk0 dpm table setup */
@@ -654,21 +659,24 @@ static int sienna_cichlid_set_default_dpm_table(struct smu_context *smu)
 }

 /* dclk1 dpm table setup */
-dpm_table = &dpm_context->dpm_tables.dclk1_table;
-if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
-ret = smu_v11_0_set_single_dpm_table(smu,
-     SMU_DCLK1,
-     dpm_table);
-if (ret)
-return ret;
-dpm_table->is_fine_grained =
-!driver_ppt->DpmDescriptor[PPCLK_DCLK_1].SnapToDiscrete;
-} else {
-dpm_table->count = 1;
-dpm_table->dpm_levels[0].value = smu->smu_table.boot_values.dclk / 100;
-dpm_table->dpm_levels[0].enabled = true;
-dpm_table->min = dpm_table->dpm_levels[0].value;
-dpm_table->max = dpm_table->dpm_levels[0].value;
+if (adev->vcn.num_vcn_inst > 1) {
+dpm_table = &dpm_context->dpm_tables.dclk1_table;
+if (smu_cmn_feature_is_enabled(smu, SMU_FEATURE_MM_DPM_PG_BIT)) {
+ret = smu_v11_0_set_single_dpm_table(smu,
+     SMU_DCLK1,
+     dpm_table);
+if (ret)
+return ret;
+dpm_table->is_fine_grained =
+!driver_ppt->DpmDescriptor[PPCLK_DCLK_1].SnapToDiscrete;
+} else {
+dpm_table->count = 1;
+dpm_table->dpm_levels[0].value =
+smu->smu_table.boot_values.dclk / 100;
+dpm_table->dpm_levels[0].enabled = true;
+dpm_table->min = dpm_table->dpm_levels[0].value;
+dpm_table->max = dpm_table->dpm_levels[0].value;
+}
 }

 /* dcefclk dpm table setup */
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2020-07-21  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  9:01 [PATCH] drm/amd/powerplay: retrieve VCN dpm table per instances Jiansong Chen
2020-07-21  9:20 ` Zhou1, Tao [this message]
2020-07-21  9:53 ` 答复: " Gao, Likun

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=BYAPR12MB28886358935A6C7097EE37EBB0780@BYAPR12MB2888.namprd12.prod.outlook.com \
    --to=tao.zhou1@amd.com \
    --cc=Jiansong.Chen@amd.com \
    --cc=Kenneth.Feng@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.