All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Deucher, Alexander" <Alexander.Deucher@amd.com>
To: "Quan, Evan" <Evan.Quan@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Lazar, Lijo" <Lijo.Lazar@amd.com>
Subject: Re: [PATCH V3 6/7] drm/amd/pm: avoid consecutive retrieving for enabled ppfeatures
Date: Fri, 28 Jan 2022 14:56:15 +0000	[thread overview]
Message-ID: <BL1PR12MB5144B4652B0296AF5AEE2973F7229@BL1PR12MB5144.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220128070455.202014-6-evan.quan@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]

[Public]

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
________________________________
From: Quan, Evan <Evan.Quan@amd.com>
Sent: Friday, January 28, 2022 2:04 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Quan, Evan <Evan.Quan@amd.com>
Subject: [PATCH V3 6/7] drm/amd/pm: avoid consecutive retrieving for enabled ppfeatures

As the enabled ppfeatures are just retrieved ahead. We can use
that directly instead of retrieving again and again.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Change-Id: I08827437fcbbc52084418c8ca6a90cfa503306a9
---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
index 3d263b27b6c2..acb9f0ca191b 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
@@ -680,6 +680,7 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,
         int8_t sort_feature[SMU_FEATURE_COUNT];
         size_t size = 0;
         int ret = 0, i;
+       int feature_id;

         ret = smu_cmn_get_enabled_mask(smu,
                                        &feature_mask);
@@ -708,11 +709,18 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,
                 if (sort_feature[i] < 0)
                         continue;

+               /* convert to asic spcific feature ID */
+               feature_id = smu_cmn_to_asic_specific_index(smu,
+                                                           CMN2ASIC_MAPPING_FEATURE,
+                                                           sort_feature[i]);
+               if (feature_id < 0)
+                       continue;
+
                 size += sysfs_emit_at(buf, size, "%02d. %-20s (%2d) : %s\n",
                                 count++,
                                 smu_get_feature_name(smu, sort_feature[i]),
                                 i,
-                               !!smu_cmn_feature_is_enabled(smu, sort_feature[i]) ?
+                               !!test_bit(feature_id, (unsigned long *)&feature_mask) ?
                                 "enabled" : "disabled");
         }

--
2.29.0


[-- Attachment #2: Type: text/html, Size: 6020 bytes --]

  reply	other threads:[~2022-01-28 14:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  7:04 [PATCH V3 1/7] drm/amd/pm: correct the way for retrieving enabled ppfeatures on Renoir Evan Quan
2022-01-28  7:04 ` [PATCH V3 2/7] drm/amd/pm: unify the interface for retrieving enabled ppfeatures Evan Quan
2022-01-28 14:53   ` Deucher, Alexander
2022-01-28  7:04 ` [PATCH V3 3/7] drm/amd/pm: update the data type " Evan Quan
2022-01-28  7:04 ` [PATCH V3 4/7] drm/amd/pm: correct the usage for 'supported' member of smu_feature structure Evan Quan
2022-01-28 14:54   ` Deucher, Alexander
2022-02-08 18:24   ` Nathan Chancellor
2022-01-28  7:04 ` [PATCH V3 5/7] drm/amd/pm: drop the cache for enabled ppfeatures Evan Quan
2022-01-28 14:55   ` Deucher, Alexander
2022-01-28  7:04 ` [PATCH V3 6/7] drm/amd/pm: avoid consecutive retrieving " Evan Quan
2022-01-28 14:56   ` Deucher, Alexander [this message]
2022-01-28  7:04 ` [PATCH V3 7/7] drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception Evan Quan
2022-01-28 14:58   ` Deucher, Alexander

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=BL1PR12MB5144B4652B0296AF5AEE2973F7229@BL1PR12MB5144.namprd12.prod.outlook.com \
    --to=alexander.deucher@amd.com \
    --cc=Evan.Quan@amd.com \
    --cc=Lijo.Lazar@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.