<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Friday, January 28, 2022 2:04 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Quan, Evan <Evan.Quan@amd.com><br>
<b>Subject:</b> [PATCH V3 7/7] drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">As there is no internal cache for enabled ppfeatures now. Thus the 2nd<br>
parameter will be not needed any more.<br>
<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
Change-Id: I0c1811f216c55d6ddfabdc9e099dc214c21bdf2e<br>
---<br>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 ++-------<br>
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 -<br>
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 7 -------<br>
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h | 1 -<br>
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 2 +-<br>
5 files changed, 3 insertions(+), 17 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
index 59be1c822b2c..1c9c11a92d42 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
@@ -1360,9 +1360,7 @@ static int smu_disable_dpms(struct smu_context *smu)<br>
case IP_VERSION(11, 5, 0):<br>
case IP_VERSION(11, 0, 12):<br>
case IP_VERSION(11, 0, 13):<br>
- return smu_disable_all_features_with_exception(smu,<br>
- true,<br>
- SMU_FEATURE_COUNT);<br>
+ return 0;<br>
default:<br>
break;<br>
}<br>
@@ -1378,9 +1376,7 @@ static int smu_disable_dpms(struct smu_context *smu)<br>
case IP_VERSION(11, 0, 0):<br>
case IP_VERSION(11, 0, 5):<br>
case IP_VERSION(11, 0, 9):<br>
- return smu_disable_all_features_with_exception(smu,<br>
- true,<br>
- SMU_FEATURE_BACO_BIT);<br>
+ return 0;<br>
default:<br>
break;<br>
}<br>
@@ -1392,7 +1388,6 @@ static int smu_disable_dpms(struct smu_context *smu)<br>
*/<br>
if (use_baco && smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) {<br>
ret = smu_disable_all_features_with_exception(smu,<br>
- false,<br>
SMU_FEATURE_BACO_BIT);<br>
if (ret)<br>
dev_err(adev->dev, "Failed to disable smu features except BACO.\n");<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
index 721b4080d3e6..55b24988455d 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
@@ -990,7 +990,6 @@ struct pptable_funcs {<br>
* exception to those in &mask.<br>
*/<br>
int (*disable_all_features_with_exception)(struct smu_context *smu,<br>
- bool no_hw_disablement,<br>
enum smu_feature_mask mask);<br>
<br>
/**<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c<br>
index acb9f0ca191b..2a6b752a6996 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c<br>
@@ -767,9 +767,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,<br>
* @mask<br>
*<br>
* @smu: smu_context pointer<br>
- * @no_hw_disablement: whether real dpm disablement should be performed<br>
- * true: update the cache(about dpm enablement state) only<br>
- * false: real dpm disablement plus cache update<br>
* @mask: the dpm feature which should not be disabled<br>
* SMU_FEATURE_COUNT: no exception, all dpm features<br>
* to disable<br>
@@ -778,7 +775,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,<br>
* 0 on success or a negative error code on failure.<br>
*/<br>
int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,<br>
- bool no_hw_disablement,<br>
enum smu_feature_mask mask)<br>
{<br>
uint64_t features_to_disable = U64_MAX;<br>
@@ -794,9 +790,6 @@ int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,<br>
features_to_disable &= ~(1ULL << skipped_feature_id);<br>
}<br>
<br>
- if (no_hw_disablement)<br>
- return 0;<br>
-<br>
return smu_cmn_feature_update_enable_state(smu,<br>
features_to_disable,<br>
0);<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h<br>
index bfe3430829c7..a4c593ed8b03 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h<br>
@@ -79,7 +79,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,<br>
uint64_t new_mask);<br>
<br>
int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,<br>
- bool no_hw_disablement,<br>
enum smu_feature_mask mask);<br>
<br>
int smu_cmn_get_smc_version(struct smu_context *smu,<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
index 0063346ed163..530be44e00ec 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
@@ -57,7 +57,7 @@<br>
#define smu_feature_set_allowed_mask(smu) smu_ppt_funcs(set_allowed_mask, 0, smu)<br>
#define smu_feature_get_enabled_mask(smu, mask) smu_ppt_funcs(get_enabled_mask, 0, smu, mask)<br>
#define smu_feature_is_enabled(smu, mask) smu_ppt_funcs(feature_is_enabled, 0, smu, mask)<br>
-#define smu_disable_all_features_with_exception(smu, no_hw_disablement, mask) smu_ppt_funcs(disable_all_features_with_exception, 0, smu, no_hw_disablement, mask)<br>
+#define smu_disable_all_features_with_exception(smu, mask) smu_ppt_funcs(disable_all_features_with_exception, 0, smu, mask)<br>
#define smu_is_dpm_running(smu) smu_ppt_funcs(is_dpm_running, 0 , smu)<br>
#define smu_notify_display_change(smu) smu_ppt_funcs(notify_display_change, 0, smu)<br>
#define smu_populate_umd_state_clk(smu) smu_ppt_funcs(populate_umd_state_clk, 0, smu)<br>
-- <br>
2.29.0<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>