summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
Commit message (Collapse)AuthorAgeFilesLines
* drm/amd/powerplay: correct navi10 vcn powergateEvan Quan2019-08-031-0/+1
| | | | | | | | vcn dpm on is a prerequisite for vcn power gate control. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add callback function of get_thermal_temperature_rangeKevin Wang2019-07-311-1/+0Star
| | | | | | | | | | | | | 1. the thermal temperature is asic related data, move the code logic to xxx_ppt.c. 2. replace data structure PP_TemperatureRange with smu_temperature_range. 3. change temperature uint from temp*1000 to temp (temperature uint). Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Signed-off-by: Kenneth Feng <kenneth.feng@amd.com> Acked-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amdgpu/smu: move fan rpm query into the asic specific codeAlex Deucher2019-07-221-3/+3
| | | | | | | | On vega20, there is an SMU message to query it. On navi, it's fetched from the metrics table. Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: custom peak clock freq for navi10Kevin Wang2019-07-221-0/+4
| | | | | | | | | | | | | | | | | | v2: add function smu_default_set_performance_level as default dpm level handler. change function name smu_set_performance_level to smu_asic_set_performance_level v1: 1.NAVI10_PEAK_SCLK_XTX 1830 Mhz 2.NAVI10_PEAK_SCLK_XT 1755 Mhz 3.NAVI10_PEAK_SCLK_XL 1625 Mhz Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Jack Gui <Jack.Gui@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: correct smu_update_table usageEvan Quan2019-07-171-1/+1
| | | | | | | | | | The interface was used in a confusing way. In profile mode scenario, the 2nd parameter of the interface was used in a different way from other scenarios. 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>
* drm/amd/powerplay: add helper of smu_clk_dpm_is_enabled for smuKevin Wang2019-07-161-0/+1
| | | | | | | | | v2: change function name to smu_clk_dpm_is_enabled. add this helper function to check dpm clk feature is enabled. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add baco smu reset function for smu11Kevin Wang2019-07-051-0/+26
| | | | | | | | | add baco reset support for smu11. it can help gpu do asic reset when gpu recovery. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add interface to get uclk dpm tablehersen wu2019-06-221-0/+4
| | | | | | | | | dc needs get uclk dpm table for bandwidth calculation Signed-off-by: hersen wu <hersenxs.wu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powrplay: add interface for dc to get max clock valueshersen wu2019-06-221-0/+4
| | | | | | | | | | dc (display component) needs maximum clock values of uclock, socclk, dcefclk, to calculate display bandwidth. Signed-off-by: hersen wu <hersenxs.wu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: simplified od_settings for each asicKevin Wang2019-06-221-6/+1Star
| | | | | | | | the od_settings is asic related data, so move it to asic file. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move od_default_setting callback to asic fileKevin Wang2019-06-221-4/+3Star
| | | | | | | | | the set default od_setting is asic related function, so move thic code to vega20_ppt file. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move od8_setting helper function to vega20_pptKevin Wang2019-06-221-10/+0Star
| | | | | | | | | these callback functions is only used for vega20 asic, to be compatible other asics,need to move this code to vega20_ppt file Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: fix clk type name error OD_SCLK OD_MCLKKevin Wang2019-06-221-2/+2
| | | | | | | | use sw-smu clk type name to replace legacy clk type name Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add interface to get uclk dpm tablehersen wu2019-06-221-0/+3
| | | | | | | | | dc needs get uclk dpm table for bandwidth calculation Signed-off-by: hersen wu <hersenxs.wu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: wake up azalia from d3 by sending smu messagehersen wu2019-06-221-0/+4
| | | | | | | | | | | | | | | | this is hw workaround to wake up azalia from d3. display asic and azalia are two different pci devices. while display asic wake from d3, current hw does not send signal to azalia. workaround: display driver ask smu send message to azalia device to let azalia wake up. Defintion of SMU message, like PPSMC_MSG_BacroAudioD3PME, is per asic. It is shared by different OS. Signed-off-by: hersen wu <hersenxs.wu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: notify smu with active display counthersen wu2019-06-221-3/+5
| | | | | | | | | | | when dc update clocks via smu, smu needs to know how many displays active. this interface is for dc notify number of active displays to smu. Signed-off-by: hersen wu <hersenxs.wu@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: remove smu callback funciton get_mclk(get_sclk)Kevin Wang2019-06-221-6/+0Star
| | | | | | | | | remove smu callback: get_mclk, get_sclk. because the function smu_get_dpm_freq_range has the same function. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add thermal ctf support for navi10Kevin Wang2019-06-221-0/+4
| | | | | | | | | add sw-CTF support for navi10 Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move get_thermal_temperature_range to ppt funcsHawking Zhang2019-06-221-0/+14
| | | | | | | | | The thermal policy could be ASIC specific ones and depends on structures in pptable. As a result, get_thermal_temperature_range should be implemented as ppt funcs instead of smu funcs Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move function get_metrics_table to vega20_pptKevin Wang2019-06-221-3/+3
| | | | | | | | the SmuMetrics_t table is asic related data structure. so move vega20_ppt file to implement. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move power_dpm_force_performance_level to amdgpu_smu fileKevin Wang2019-06-221-6/+2Star
| | | | | | | | | because this callback is not asic related function, so move it to top code level to support more asic (eg: navi10) Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: simplify the interface of get_gpu_powerKevin Wang2019-06-221-3/+0Star
| | | | | | | | | this callback function is only call in read_sensor in smu_v11_0.c, so move this code to {asic}_ppt.c to implement as asic related function. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: simplify the interface of get_current_activity_percentKevin Wang2019-06-221-5/+0Star
| | | | | | | | | this callback function is only call in read_sensor in smu_v11_0.c, so move this code to {asic}_ppt.c to implement as asic related function. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* amd/powerplay: update the vcn pgKenneth Feng2019-06-221-0/+6
| | | | | | | | update the vcn pg function in navi10. Signed-off-by: Kenneth Feng <kenneth.feng@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add function get_workload_type_map for swsmuKevin Wang2019-06-221-3/+3
| | | | | | | | | 1.add new callback function get_workload_byte for smu 2.remove old workload map function Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: remove upload_dpm_level function for vega20Kevin Wang2019-06-221-4/+0Star
| | | | | | | | | the function upload_dpm_level is an internal function, so remove public interface. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add function get_clock_by_type_with_latency for navi10Kevin Wang2019-06-221-3/+3
| | | | | | | | add callback function get_clock_by_type_with_latency for navi10 asic Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add function force_clk_levels for navi10Kevin Wang2019-06-221-3/+3
| | | | | | | | add sysfs interface of force_clk_levels sysfs for navi10. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add helper function of smu_set_hard_freq_rangeKevin Wang2019-06-221-0/+2
| | | | | | | | add this function to get dpm clock information. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add helper function of smu_set_soft_freq_rangeKevin Wang2019-06-221-0/+2
| | | | | | | | add this helper function to get dpm clk information. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add helper function of smu_get_dpm_freq_rangeKevin Wang2019-06-221-0/+2
| | | | | | | | add this helper function to get dpm clk information (min, max); Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add function print_clk_levels for navi10Kevin Wang2019-06-221-3/+10
| | | | | | | | add sysfs interface of print_clk_levels sysfs for navi10. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add helper function to get dpm freq informationsKevin Wang2019-06-221-0/+4
| | | | | | | | this function can help driver to get ppclk informations Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add function get current clock freq interface for navi10Kevin Wang2019-06-221-0/+5
| | | | | | | | add function of get_current_clk_freq_by_table for navi10. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add new interface for vcn powergatingKenneth Feng2019-06-221-0/+4
| | | | | | | | | | add new interface for vcn powrergating and vcn dpm as well. Signed-off-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Jack Xiao <Jack.Xiao@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: introduce smu power source type to handle AC/DC source ↵Huang Rui2019-06-221-0/+10
| | | | | | | | | | | | | for each asic This patch introduces new smu power source type, it's to handle the different AC/DC source defines for each asic with the same smu ip. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move Watermarks_t uses into asic levelHuang Rui2019-06-221-0/+4
| | | | | | | | | | | This patch moves the rest of Watermarks_t uses into asic level. It's to avoid the conflicts with different asic. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move SmuMetrics_t uses into asic levelHuang Rui2019-06-221-0/+8
| | | | | | | | | | | This patch moves the rest of SmuMetrics_t uses into asic level. It's to avoid the conflicts with different asic. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move PPTable_t uses into asic levelHuang Rui2019-06-221-2/+5
| | | | | | | | | | | This patch moves the rest of PPTable_t uses into asic level. It's to avoid the conflicts with different asic. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay/smu11: remove smu_update_table_with_argAlex Deucher2019-06-221-3/+1Star
| | | | | | | Nothing was using it. Just replace with smu_update_table which is what everything was using via a wrapper anyway. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: add tables_init interface for each asicHuang Rui2019-06-221-0/+3
| | | | | | | | | | The smc tables defines should be in the asic level. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: introduce smu table id type to handle the smu table for ↵Huang Rui2019-06-221-0/+20
| | | | | | | | | | | | | each asic This patch introduces new smu table type, it's to handle the different smu table defines for each asic with the same smu ip. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: introduce smu feature type to handle feature mask for ↵Huang Rui2019-06-221-4/+68
| | | | | | | | | | | | | each asic This patch introduces new smu feature type, it's to handle the different feature mask defines for each asic with the same smu ip. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: introduce smu clk type to handle ppclk for each asicHuang Rui2019-06-221-1/+20
| | | | | | | | | | | This patch introduces new smu clk type, it's to handle the different ppclk defines for each asic with the same smu ip. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd: add gfxoff support on navi10Kenneth Feng2019-06-221-1/+4
| | | | | | | | add the gfxoff interface to navi10,it's disabled by default. Signed-off-by: Kenneth Feng <kenneth.feng@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: optimization feature mask function for asicKevin Wang2019-06-221-3/+3
| | | | | | | | | | 1.change function return value type: from "unallowed" to "allowed" 2.replace feature mask number with feature macro, the code will clear. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: implement smc firmware v2.1 for smu11Kevin Wang2019-06-221-3/+3
| | | | | | | | | | 1.add smc_firmware_header_v2_1 hfirmware support, support more pptable in smc firmware. 2.optimization current pptable load framework. 3.rename read_pptable_from_vbios with setup_pptable. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move the function of is_dpm_running to asic fileKevin Wang2019-06-221-2/+2
| | | | | | | | | the function os is_dpm_running is aisc related function, so move them to asic file. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move the function of read_sensor to asic fileKevin Wang2019-06-221-0/+4
| | | | | | | | | The read_sensor functions has asic related parts code, so move them to asic file to implement. Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/amd/powerplay: move the function of uvd&vce dpm to asic fileKevin Wang2019-06-221-4/+4
| | | | | | Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>