aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm
AgeCommit message (Collapse)AuthorFilesLines
2023-08-31drm/amd/pm: add fan acoustic limit OD setting support for SMU13Evan Quan6-2/+168
Add SMU13 fan acoustic limit OD setting support. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-31drm/amd/pm: add fan temperature/pwm curve OD setting support for SMU13Evan Quan6-7/+414
Add SMU13 fan temperature/pwm curve OD setting support. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-31drm/amd/pm: introduce a new set of OD interfacesEvan Quan2-2/+264
There will be multiple interfaces(sysfs files) exposed with each representing a single OD functionality. And all those interface will be arranged in a tree liked hierarchy with the top dir as "gpu_od". Meanwhile all functionalities for the same component will be arranged under the same directory. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-31amdgpu/pm: Optimize emit_clock_levels for arcturus - part 3Darren Powell1-53/+24
split switch statement into two and consolidate the common code for printing most of the types of clock speeds Signed-off-by: Darren Powell <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30amdgpu/pm: Optimize emit_clock_levels for arcturus - part 2Darren Powell1-23/+22
Use variables to remove ternary expression in print statement and improve readability. This will help to optimize the code duplication in the switch statement Also Changed: replaced single_dpm_table->count as iterator in for loops with safer clocks_num_levels value replaced dpm_table.value usage with local var clocks_mhz Signed-off-by: Darren Powell <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30amdgpu/pm: Optimize emit_clock_levels for arcturus - part 1Darren Powell1-69/+57
Use variables to remove the multiple nested ternary expressions and improve readability. This will help to optimize the code duplication in the switch statement Also Changed: Modify function arcturus_get_clk_table to void function as it always returns 0 Use const string "attempt_string" to cut down on repetition Signed-off-by: Darren Powell <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amdgpu: Add SMU v13.0.6 default reset methodsLijo Lazar1-2/+1
For APUs with SMU v13.0.6, mode-2 reset is kept as default and for others mode-1 is the default reset method. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Tested-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd: Fix spelling mistake "throtting" -> "throttling"Colin Ian King3-9/+9
There is a spelling mistake in variable throtting_events, rename it to throttling_events. Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30amdgpu/pm: Replace print_clock_levels with emit_clock_levels for arcturusDarren Powell1-27/+27
Replace print_clock_levels with emit_clock_levels for arcturus * replace .print_clk_levels with .emit_clk_levels in arcturus_ppt_funcs * added extra parameter int *offset * removed var size, uses arg *offset instead * removed call to smu_cmn_get_sysfs_buf * errors are returned to caller * returns 0 on success additional incidental changes * changed type of var i, now to remove comparing mismatch types * renamed var s/now/cur_value/ * switch statement default now returns -EINVAL * RAS Recovery returns -EBUSY Based on commit b06b48d7ddae ("amdgpu/pm: Implement emit_clk_levels for navi10") Signed-off-by: Darren Powell <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: fulfill the support for SMU13 `pp_dpm_dcefclk` interfaceEvan Quan2-0/+54
Fulfill the incomplete SMU13 `pp_dpm_dcefclk` implementation. Reported-by: Guan Yu <[email protected]> Signed-off-by: Evan Quan <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: correct SMU13 gfx voltage related OD settingsEvan Quan3-64/+43
The voltage offset setting will be applied to the whole v/f curve line instead of per anchor point base. Signed-off-by: Evan Quan <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amdgpu/pm: Remove the duplicate dpm status checkJesse Zhang1-1/+1
Since the smu firmware has fixed the issue that described in the commit 60d61f4ed6ea ("drm/amdgpu/pm: fix the Stable pstate Test in amdgpu_test"). So we only need keep dpm status check in the funciton - smu_v13_0_5_set_soft_freq_limited_range. Signed-off-by: Jesse Zhang <[email protected]> Reviewed-by: Yifan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: Vangogh: Get average_* from average field of gpu_metrics_tableKun Liu1-12/+12
for older BIOS, smu won't fill average field of gpu_metrics_table, so we acquire average_* from current field. but now average value is available in gpu_metrics_v2_4 Signed-off-by: Kun Liu <[email protected]> Acked-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: Fixes incorrect type in 'amdgpu_hwmon_show_power_avg() & _input()'Srinivasan Shanmugam1-4/+4
The val is defined as unsigned int type, if(val<0) is invalid, hence modified its type to ssize_t Fixes the below: drivers/gpu/drm/amd/pm/amdgpu_pm.c:2800:5-8: WARNING: Unsigned expression compared with zero: val < 0 drivers/gpu/drm/amd/pm/amdgpu_pm.c:2813:5-8: WARNING: Unsigned expression compared with zero: val < 0 Cc: Guchun Chen <[email protected]> Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "Pan, Xinhui" <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: fix error flow in sensor fetchingAlex Deucher1-7/+7
Sensor fetching functions should return an signed int to handle errors properly. Reviewed-by: Srinivasan Shanmugam <[email protected]> Reported-by: Jiapeng Chong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: fix debugfs pm_info outputAlex Deucher1-0/+3
Print both input and avg power. Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`") Reviewed-by: Guchun Chen <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: Fix critical temp unit of SMU v13.0.6Asad Kamal1-4/+5
Critical Temperature needs to be reported in millidegree Celsius. Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Yang Wang <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: Add critical temp for GC v9.4.3Asad Kamal3-4/+55
Add critical temperature message support func for smu v13.0.6 and expose critical temperature as part of hw mon attributes for GC v9.4.3 v2: Added comment for pmfw version requirement & move the check to get_thermal_temperature_range function Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amd/pm: Update SMUv13.0.6 PMFW headersAsad Kamal2-3/+17
Update PMFW interface headers for updated metrics table and critical temperature message Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-30drm/amdgpu/pm: Add notification for no DC supportBokun Zhang5-12/+11
- There is a DPM issue where if DC is not present, FCLK will stay at low level. We need to send a SMU message to configure the DPM - Reuse smu_v13_0_notify_display_change() for this purpose Reviewed-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Bokun Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-16drm/amd/pm: Update pci link speed for smu v13.0.6Asad Kamal7-6/+36
Update pcie link speed registers for smu v13.0.6 & populate gpu metric table with pcie link speed rather than gen for smu v13_0_0, smu v13_0_6 & smu v13_0_7 v2: Update ESM register address Used macro to convert pcie gen to speed v3: Chaged macro to inline function for pcie gen to speed Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-16drm/amd/pm: allow the user to force BACO on smu v13.0.0/7Kenneth Feng3-3/+5
allow the user to force BACO on smu v13.0.0/7 Signed-off-by: Kenneth Feng <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-16drm/amd/pm: Update pci link width for smu v13.0.6Asad Kamal1-2/+8
Update addresses of PCIE link width registers, & link width format used to populate gpu metrics table for smu v13.0.6 v2: Removed ESM register update v3: Updated patch subject and message Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Hide unsupported power attributesMario Limonciello1-0/+9
Some ASICS only offer one type of power attribute, so in the visible callback check whether the attributes are supported and hide if not supported. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Rename AMDGPU_PP_SENSOR_GPU_POWERMario Limonciello15-12/+17
Use the clearer name `AMDGPU_PP_SENSOR_GPU_AVG_POWER` instead. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Show both power attributes for vega20Mario Limonciello1-5/+13
Vega20 can offer average power in some versions of the PMFW and current power in others. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Fix the return for average power on aldebaranMario Limonciello1-3/+4
Aldebaran can only return average socket power for the first die. The other dies return 0. Instead of returning a bad value, return -EOPNOTSUPP so that the attribute will be hidden. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Drop unnecessary helper for aldebaranMario Limonciello1-12/+3
aldebaran_get_gpu_power() is only called by one place and just calls aldebaran_get_smu_metrics_data(), so drop the helper. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Fix SMU 13.0.4/13.0.11 GPU metrics average powerMario Limonciello1-1/+1
The average power for the GPU metrics sysfs file contains the input power not the average power. The member that is set is called average power though, so correct it to the right value. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: Clean up errors in amdgpu_smu.hRan Sun1-24/+12
Fix the following errors reported by checkpatch: ERROR: open brace '{' following enum go on the same line ERROR: open brace '{' following struct go on the same line Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: Clean up errors in smu_v11_0_pptable.hRan Sun1-9/+6
Fix the following errors reported by checkpatch: ERROR: trailing whitespace ERROR: open brace '{' following struct go on the same line ERROR: code indent should use tabs where possible Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`Mario Limonciello19-27/+56
Some GPUs have been overloading average power values and input power values. To disambiguate these, introduce a new `AMDGPU_PP_SENSOR_GPU_INPUT_POWER` and the GPUs that share input power update to use this instead of average power. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2746 Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Add a new hwmon attribute for instantaneous powerMario Limonciello1-0/+17
Some GPUs provide support for current power, some average power, and some both. To be able to support all these combinations, introduce a new attribute. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd: Add amdgpu_hwmon_get_sensor_generic()Mario Limonciello1-233/+88
Many sensor function have a lot of boilerplate checks. Move these into a generic amdgpu_hwmon_get_sensor_generic() instead. No intended functional changes. Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: bump SMU v13.0.5 driver_if header versionTim Huang1-2/+1
Align the SMU driver interface version with PMFW to suppress the version mismatch message on driver loading. Signed-off-by: Tim Huang <[email protected]> Reviewed-by: Yifan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: correct the logics for retreiving SMU13 OD setting limitsEvan Quan2-76/+64
To better meet the growing demainds for more OD features. Signed-off-by: Evan Quan <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: correct the way for checking custom OD settingsEvan Quan2-16/+16
`FeatureCtrlMask` should not be included in those settings interested. Signed-off-by: Evan Quan <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: Fix temperature unit of SMU v13.0.6Lijo Lazar1-3/+6
Temperature needs to be reported in millidegree Celsius. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amdgpu/pm: fix throttle_status for other than MP1 11.0.7Umio Yasuno1-7/+7
Use the right metrics table version based on the firmware. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2720 Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Umio Yasuno <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: avoid driver getting empty metrics table for the first timeYang Wang1-5/+15
add metrics.AccumulationCouter check to avoid driver getting an empty metrics data since metrics table not updated completely in pmfw side. Signed-off-by: Yang Wang <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Tested-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: Add vclk and dclk sysnode for GC 9.4.3Asad Kamal1-2/+4
Expose sysfs vclck and dclk entries for GC version 9.4.3 Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-15drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0Kenneth Feng1-0/+4
drm/amd/pm: disallow the fan setting if there is no fan on smu 13.0.0 V2: depend on pm.no_fan to check Signed-off-by: Kenneth Feng <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in smu73_discrete.hRan Sun1-44/+29
Fix the following errors reported by checkpatch: ERROR: open brace '{' following struct go on the same line ERROR: trailing whitespace ERROR: space prohibited before open square bracket '[' Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in amdgpu_pm.cRan Sun1-2/+3
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space required before the open parenthesis '(' Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in sislands_smc.hRan Sun1-42/+21
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in r600_dpm.hRan Sun1-2/+1
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drivers/amd/pm: Clean up errors in smu8_smumgr.hRan Sun1-31/+17
Fix the following errors reported by checkpatch: ERROR: that open brace { should be on the previous line ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in smu75.hRan Sun1-6/+6
Fix the following errors reported by checkpatch: ERROR: space prohibited before open square bracket '[' ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in smu73.hRan Sun1-28/+17
Fix the following errors reported by checkpatch: ERROR: open brace '{' following struct go on the same line ERROR: space prohibited before open square bracket '[' ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2023-08-09drm/amd/pm: Clean up errors in hwmgr.hRan Sun1-5/+3
Fix the following errors reported by checkpatch: ERROR: open brace '{' following struct go on the same line ERROR: Use C99 flexible arrays Signed-off-by: Ran Sun <[email protected]> Signed-off-by: Alex Deucher <[email protected]>