drm/amd/powerplay: drop redundant .set_min_dcefclk_deep_sleep API (v2)
authorEvan Quan <evan.quan@amd.com>
Mon, 8 Jun 2020 11:31:03 +0000 (19:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2020 05:59:19 +0000 (01:59 -0400)
It has exactly the same functionality as .set_deep_sleep_dcefclk.

V2: correct the macro name for better trace

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/powerplay/amdgpu_smu.c
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h
drivers/gpu/drm/amd/powerplay/navi10_ppt.c
drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c
drivers/gpu/drm/amd/powerplay/smu_internal.h
drivers/gpu/drm/amd/powerplay/smu_v11_0.c

index 6beae3b496be1a8adb4733bf8c3dfa023f0f4a08..89dd12536d586d61ba98be277db9afd6b6a591af 100644 (file)
@@ -1269,7 +1269,8 @@ static int smu_smc_hw_setup(struct smu_context *smu)
         * Set min deep sleep dce fclk with bootup value from vbios via
         * SetMinDeepSleepDcefclk MSG.
         */
-       ret = smu_set_min_dcef_deep_sleep(smu);
+       ret = smu_set_min_dcef_deep_sleep(smu,
+                                         smu->smu_table.boot_values.dcefclk / 100);
        if (ret)
                return ret;
 
@@ -1584,9 +1585,8 @@ int smu_display_configuration_change(struct smu_context *smu,
 
        mutex_lock(&smu->mutex);
 
-       if (smu->ppt_funcs->set_deep_sleep_dcefclk)
-               smu->ppt_funcs->set_deep_sleep_dcefclk(smu,
-                               display_config->min_dcef_deep_sleep_set_clk / 100);
+       smu_set_min_dcef_deep_sleep(smu,
+                                   display_config->min_dcef_deep_sleep_set_clk / 100);
 
        for (index = 0; index < display_config->num_path_including_non_display; index++) {
                if (display_config->displays[index].controller_id != 0)
@@ -2482,8 +2482,7 @@ int smu_set_deep_sleep_dcefclk(struct smu_context *smu, int clk)
 
        mutex_lock(&smu->mutex);
 
-       if (smu->ppt_funcs->set_deep_sleep_dcefclk)
-               ret = smu->ppt_funcs->set_deep_sleep_dcefclk(smu, clk);
+       ret = smu_set_min_dcef_deep_sleep(smu, clk);
 
        mutex_unlock(&smu->mutex);
 
index c104844b28f165bb12e1366a94cef17e88edfce6..2a9818a6bf80ddd19e1296a3348204e87d55ba9d 100644 (file)
@@ -2590,7 +2590,6 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
        .populate_smc_tables = smu_v11_0_populate_smc_pptable,
        .check_fw_version = smu_v11_0_check_fw_version,
        .write_pptable = smu_v11_0_write_pptable,
-       .set_min_dcef_deep_sleep = NULL,
        .set_driver_table_location = smu_v11_0_set_driver_table_location,
        .set_tool_table_location = smu_v11_0_set_tool_table_location,
        .notify_memory_pool_location = smu_v11_0_notify_memory_pool_location,
@@ -2605,7 +2604,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
        .init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
        .enable_thermal_alert = smu_v11_0_enable_thermal_alert,
        .disable_thermal_alert = smu_v11_0_disable_thermal_alert,
-       .set_deep_sleep_dcefclk = smu_v11_0_set_deep_sleep_dcefclk,
+       .set_min_dcef_deep_sleep = NULL,
        .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request,
        .get_fan_control_mode = smu_v11_0_get_fan_control_mode,
        .set_fan_control_mode = smu_v11_0_set_fan_control_mode,
index 8eaa6338ad44dc062378aaf46aab770d41b13213..5f90ecd810c8f0ac58a76e9a5a49405c6dd844f0 100644 (file)
@@ -510,7 +510,6 @@ struct pptable_funcs {
        int (*powergate_sdma)(struct smu_context *smu, bool gate);
        int (*set_gfx_cgpg)(struct smu_context *smu, bool enable);
        int (*write_pptable)(struct smu_context *smu);
-       int (*set_min_dcef_deep_sleep)(struct smu_context *smu);
        int (*set_driver_table_location)(struct smu_context *smu);
        int (*set_tool_table_location)(struct smu_context *smu);
        int (*notify_memory_pool_location)(struct smu_context *smu);
@@ -527,7 +526,7 @@ struct pptable_funcs {
        int (*init_max_sustainable_clocks)(struct smu_context *smu);
        int (*enable_thermal_alert)(struct smu_context *smu);
        int (*disable_thermal_alert)(struct smu_context *smu);
-       int (*set_deep_sleep_dcefclk)(struct smu_context *smu, uint32_t clk);
+       int (*set_min_dcef_deep_sleep)(struct smu_context *smu, uint32_t clk);
        int (*set_active_display_count)(struct smu_context *smu, uint32_t count);
        int (*store_cc6_data)(struct smu_context *smu, uint32_t separation_time,
                              bool cc6_disable, bool pstate_disable,
index 2e9939beb128bc7a5e8bac61768553793961c4a9..debb30aa78c517b02af71dfba3622b06d15b0747 100644 (file)
@@ -170,8 +170,6 @@ int smu_v11_0_check_fw_version(struct smu_context *smu);
 
 int smu_v11_0_write_pptable(struct smu_context *smu);
 
-int smu_v11_0_set_min_dcef_deep_sleep(struct smu_context *smu);
-
 int smu_v11_0_set_driver_table_location(struct smu_context *smu);
 
 int smu_v11_0_set_tool_table_location(struct smu_context *smu);
@@ -215,7 +213,7 @@ int smu_v11_0_read_sensor(struct smu_context *smu,
                                 enum amd_pp_sensors sensor,
                                 void *data, uint32_t *size);
 
-int smu_v11_0_set_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk);
+int smu_v11_0_set_min_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk);
 
 int
 smu_v11_0_display_clock_voltage_request(struct smu_context *smu,
index 11579455719045a78db298ea8a2e6af8155792dd..616bf466f203642de9aeafd3e04f635121d61cde 100644 (file)
@@ -2426,7 +2426,6 @@ static const struct pptable_funcs navi10_ppt_funcs = {
        .populate_smc_tables = smu_v11_0_populate_smc_pptable,
        .check_fw_version = smu_v11_0_check_fw_version,
        .write_pptable = smu_v11_0_write_pptable,
-       .set_min_dcef_deep_sleep = smu_v11_0_set_min_dcef_deep_sleep,
        .set_driver_table_location = smu_v11_0_set_driver_table_location,
        .set_tool_table_location = smu_v11_0_set_tool_table_location,
        .notify_memory_pool_location = smu_v11_0_notify_memory_pool_location,
@@ -2441,7 +2440,7 @@ static const struct pptable_funcs navi10_ppt_funcs = {
        .init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
        .enable_thermal_alert = smu_v11_0_enable_thermal_alert,
        .disable_thermal_alert = smu_v11_0_disable_thermal_alert,
-       .set_deep_sleep_dcefclk = smu_v11_0_set_deep_sleep_dcefclk,
+       .set_min_dcef_deep_sleep = smu_v11_0_set_min_deep_sleep_dcefclk,
        .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request,
        .get_fan_control_mode = smu_v11_0_get_fan_control_mode,
        .set_fan_control_mode = smu_v11_0_set_fan_control_mode,
index 81cc04de9b06337ce8a9a3e2eb7a3db79a8fa402..127df2953979ada428a192923ba547cb96a0b5a5 100644 (file)
@@ -2596,7 +2596,6 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = {
        .populate_smc_tables = smu_v11_0_populate_smc_pptable,
        .check_fw_version = smu_v11_0_check_fw_version,
        .write_pptable = smu_v11_0_write_pptable,
-       .set_min_dcef_deep_sleep = NULL,
        .set_driver_table_location = smu_v11_0_set_driver_table_location,
        .set_tool_table_location = smu_v11_0_set_tool_table_location,
        .notify_memory_pool_location = smu_v11_0_notify_memory_pool_location,
@@ -2611,7 +2610,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = {
        .init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
        .enable_thermal_alert = smu_v11_0_enable_thermal_alert,
        .disable_thermal_alert = smu_v11_0_disable_thermal_alert,
-       .set_deep_sleep_dcefclk = smu_v11_0_set_deep_sleep_dcefclk,
+       .set_min_dcef_deep_sleep = NULL,
        .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request,
        .get_fan_control_mode = smu_v11_0_get_fan_control_mode,
        .set_fan_control_mode = smu_v11_0_set_fan_control_mode,
index 094db34ddbd1211309f447686f1662500f125089..935460f2ceadf35686b537ee0d38feb8b51cf627 100644 (file)
@@ -51,8 +51,8 @@
        ((smu)->ppt_funcs->check_fw_version ? (smu)->ppt_funcs->check_fw_version((smu)) : 0)
 #define smu_write_pptable(smu) \
        ((smu)->ppt_funcs->write_pptable ? (smu)->ppt_funcs->write_pptable((smu)) : 0)
-#define smu_set_min_dcef_deep_sleep(smu) \
-       ((smu)->ppt_funcs->set_min_dcef_deep_sleep ? (smu)->ppt_funcs->set_min_dcef_deep_sleep((smu)) : 0)
+#define smu_set_min_dcef_deep_sleep(smu, clk) \
+       ((smu)->ppt_funcs->set_min_dcef_deep_sleep ? (smu)->ppt_funcs->set_min_dcef_deep_sleep((smu), (clk)) : 0)
 #define smu_set_driver_table_location(smu) \
        ((smu)->ppt_funcs->set_driver_table_location ? (smu)->ppt_funcs->set_driver_table_location((smu)) : 0)
 #define smu_set_tool_table_location(smu) \
index e60b7cb95f37dc54cf7d04c316c93820e63b89d6..0a8645854b469df349308f61cfecabddf8457531 100644 (file)
@@ -770,7 +770,7 @@ int smu_v11_0_write_pptable(struct smu_context *smu)
        return ret;
 }
 
-int smu_v11_0_set_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk)
+int smu_v11_0_set_min_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk)
 {
        int ret;
 
@@ -782,16 +782,6 @@ int smu_v11_0_set_deep_sleep_dcefclk(struct smu_context *smu, uint32_t clk)
        return ret;
 }
 
-int smu_v11_0_set_min_dcef_deep_sleep(struct smu_context *smu)
-{
-       struct smu_table_context *table_context = &smu->smu_table;
-
-       if (!table_context)
-               return -EINVAL;
-
-       return smu_v11_0_set_deep_sleep_dcefclk(smu, table_context->boot_values.dcefclk / 100);
-}
-
 int smu_v11_0_set_driver_table_location(struct smu_context *smu)
 {
        struct smu_table *driver_table = &smu->smu_table.driver_table;