drm/amd/pm: revise the implementation of smu_cmn_disable_all_features_with_exception
authorEvan Quan <evan.quan@amd.com>
Wed, 8 Dec 2021 07:47:58 +0000 (15:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Feb 2022 23:01:16 +0000 (18:01 -0500)
As there is no internal cache for enabled ppfeatures now. Thus the 2nd
parameter will be not needed any more.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h
drivers/gpu/drm/amd/pm/swsmu/smu_internal.h

index 1d526ae..7925edc 100644 (file)
@@ -1360,9 +1360,7 @@ static int smu_disable_dpms(struct smu_context *smu)
                case IP_VERSION(11, 5, 0):
                case IP_VERSION(11, 0, 12):
                case IP_VERSION(11, 0, 13):
-                       return smu_disable_all_features_with_exception(smu,
-                                                                      true,
-                                                                      SMU_FEATURE_COUNT);
+                       return 0;
                default:
                        break;
                }
@@ -1378,9 +1376,7 @@ static int smu_disable_dpms(struct smu_context *smu)
                case IP_VERSION(11, 0, 0):
                case IP_VERSION(11, 0, 5):
                case IP_VERSION(11, 0, 9):
-                       return smu_disable_all_features_with_exception(smu,
-                                                                      true,
-                                                                      SMU_FEATURE_BACO_BIT);
+                       return 0;
                default:
                        break;
                }
@@ -1392,7 +1388,6 @@ static int smu_disable_dpms(struct smu_context *smu)
         */
        if (use_baco && smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT)) {
                ret = smu_disable_all_features_with_exception(smu,
-                                                             false,
                                                              SMU_FEATURE_BACO_BIT);
                if (ret)
                        dev_err(adev->dev, "Failed to disable smu features except BACO.\n");
index c69c80a..218de8f 100644 (file)
@@ -1004,7 +1004,6 @@ struct pptable_funcs {
         *                                       exception to those in &mask.
         */
        int (*disable_all_features_with_exception)(struct smu_context *smu,
-                                                  bool no_hw_disablement,
                                                   enum smu_feature_mask mask);
 
        /**
index 1a54447..efb5531 100644 (file)
@@ -767,9 +767,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,
  *                                               @mask
  *
  * @smu:               smu_context pointer
- * @no_hw_disablement: whether real dpm disablement should be performed
- *                     true: update the cache(about dpm enablement state) only
- *                     false: real dpm disablement plus cache update
  * @mask:              the dpm feature which should not be disabled
  *                     SMU_FEATURE_COUNT: no exception, all dpm features
  *                     to disable
@@ -778,7 +775,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,
  * 0 on success or a negative error code on failure.
  */
 int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,
-                                               bool no_hw_disablement,
                                                enum smu_feature_mask mask)
 {
        uint64_t features_to_disable = U64_MAX;
@@ -794,9 +790,6 @@ int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,
                features_to_disable &= ~(1ULL << skipped_feature_id);
        }
 
-       if (no_hw_disablement)
-               return 0;
-
        return smu_cmn_feature_update_enable_state(smu,
                                                   features_to_disable,
                                                   0);
index bfe3430..a4c593e 100644 (file)
@@ -79,7 +79,6 @@ int smu_cmn_set_pp_feature_mask(struct smu_context *smu,
                                uint64_t new_mask);
 
 int smu_cmn_disable_all_features_with_exception(struct smu_context *smu,
-                                               bool no_hw_disablement,
                                                enum smu_feature_mask mask);
 
 int smu_cmn_get_smc_version(struct smu_context *smu,
index 0063346..530be44 100644 (file)
@@ -57,7 +57,7 @@
 #define smu_feature_set_allowed_mask(smu)                              smu_ppt_funcs(set_allowed_mask, 0, smu)
 #define smu_feature_get_enabled_mask(smu, mask)                                smu_ppt_funcs(get_enabled_mask, 0, smu, mask)
 #define smu_feature_is_enabled(smu, mask)                              smu_ppt_funcs(feature_is_enabled, 0, smu, mask)
-#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)
+#define smu_disable_all_features_with_exception(smu, mask)             smu_ppt_funcs(disable_all_features_with_exception, 0, smu, mask)
 #define smu_is_dpm_running(smu)                                                smu_ppt_funcs(is_dpm_running, 0 , smu)
 #define smu_notify_display_change(smu)                                 smu_ppt_funcs(notify_display_change, 0, smu)
 #define smu_populate_umd_state_clk(smu)                                        smu_ppt_funcs(populate_umd_state_clk, 0, smu)