diff options
author | Evan Quan <evan.quan@amd.com> | 2018-01-02 03:57:48 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-19 14:17:09 -0500 |
commit | 31a47dcab86a09ef52b5fa644f0926afe367cb90 (patch) | |
tree | feb8e8e2198b3e8f03f5fff22a133e5fe8756dbf | |
parent | 4ba082572a42f515e66f0dece2936fde1160eb33 (diff) |
drm/amd/powerplay: export the thermal ranges of Carrizo (V2)
V2: reuse the SMUThermal structure defined in pp_thermal.h
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>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c index b314d09d41af..0b8aa4473473 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "cz_hwmgr.h" | 38 | #include "cz_hwmgr.h" |
39 | #include "power_state.h" | 39 | #include "power_state.h" |
40 | #include "cz_clockpowergating.h" | 40 | #include "cz_clockpowergating.h" |
41 | #include "pp_thermal.h" | ||
41 | 42 | ||
42 | #define ixSMUSVI_NB_CURRENTVID 0xD8230044 | 43 | #define ixSMUSVI_NB_CURRENTVID 0xD8230044 |
43 | #define CURRENT_NB_VID_MASK 0xff000000 | 44 | #define CURRENT_NB_VID_MASK 0xff000000 |
@@ -1858,6 +1859,19 @@ static int cz_notify_cac_buffer_info(struct pp_hwmgr *hwmgr, | |||
1858 | return 0; | 1859 | return 0; |
1859 | } | 1860 | } |
1860 | 1861 | ||
1862 | static int cz_get_thermal_temperature_range(struct pp_hwmgr *hwmgr, | ||
1863 | struct PP_TemperatureRange *thermal_data) | ||
1864 | { | ||
1865 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); | ||
1866 | |||
1867 | memcpy(thermal_data, &SMU7ThermalPolicy[0], sizeof(struct PP_TemperatureRange)); | ||
1868 | |||
1869 | thermal_data->max = (cz_hwmgr->thermal_auto_throttling_treshold + | ||
1870 | cz_hwmgr->sys_info.htc_hyst_lmt) * | ||
1871 | PP_TEMPERATURE_UNITS_PER_CENTIGRADES; | ||
1872 | |||
1873 | return 0; | ||
1874 | } | ||
1861 | 1875 | ||
1862 | static const struct pp_hwmgr_func cz_hwmgr_funcs = { | 1876 | static const struct pp_hwmgr_func cz_hwmgr_funcs = { |
1863 | .backend_init = cz_hwmgr_backend_init, | 1877 | .backend_init = cz_hwmgr_backend_init, |
@@ -1890,6 +1904,7 @@ static const struct pp_hwmgr_func cz_hwmgr_funcs = { | |||
1890 | .power_state_set = cz_set_power_state_tasks, | 1904 | .power_state_set = cz_set_power_state_tasks, |
1891 | .dynamic_state_management_disable = cz_disable_dpm_tasks, | 1905 | .dynamic_state_management_disable = cz_disable_dpm_tasks, |
1892 | .notify_cac_buffer_info = cz_notify_cac_buffer_info, | 1906 | .notify_cac_buffer_info = cz_notify_cac_buffer_info, |
1907 | .get_thermal_temperature_range = cz_get_thermal_temperature_range, | ||
1893 | }; | 1908 | }; |
1894 | 1909 | ||
1895 | int cz_init_function_pointers(struct pp_hwmgr *hwmgr) | 1910 | int cz_init_function_pointers(struct pp_hwmgr *hwmgr) |