drm/amdgpu/swsmu: add new callback for getting fan parameters
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Aug 2020 03:22:24 +0000 (23:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Sep 2020 18:46:54 +0000 (14:46 -0400)
To fetch the max rpm from pptable.

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

index 4c5c041..787fc68 100644 (file)
@@ -452,6 +452,9 @@ struct smu_context
 
        struct work_struct throttling_logging_work;
        atomic64_t throttle_int_counter;
+
+       unsigned fan_max_rpm;
+       unsigned manual_fan_speed_rpm;
 };
 
 struct i2c_adapter;
@@ -598,6 +601,7 @@ struct pptable_funcs {
        int (*enable_mgpu_fan_boost)(struct smu_context *smu);
        int (*gfx_ulv_control)(struct smu_context *smu, bool enablement);
        int (*deep_sleep_control)(struct smu_context *smu, bool enablement);
+       int (*get_fan_parameters)(struct smu_context *smu);
 };
 
 typedef enum {
index 8462b30..114e856 100644 (file)
@@ -504,6 +504,8 @@ static int smu_late_init(void *handle)
 
        smu_get_unique_id(smu);
 
+       smu_get_fan_parameters(smu);
+
        smu_handle_task(&adev->smu,
                        smu->smu_dpm.dpm_level,
                        AMD_PP_TASK_COMPLETE_INIT,
index c88f8fa..38c1017 100644 (file)
@@ -94,6 +94,7 @@
 #define smu_set_pp_feature_mask(smu, new_mask)                         smu_ppt_funcs(set_pp_feature_mask, 0, smu, new_mask)
 #define smu_gfx_ulv_control(smu, enablement)                           smu_ppt_funcs(gfx_ulv_control, 0, smu, enablement)
 #define smu_deep_sleep_control(smu, enablement)                                smu_ppt_funcs(deep_sleep_control, 0, smu, enablement)
+#define smu_get_fan_parameters(smu)                                    smu_ppt_funcs(get_fan_parameters, 0, smu)
 
 #endif
 #endif