aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/pm/amdgpu_pm.c
Commit message (Collapse)AuthorAgeFilesLines
...
* drm/amd/pm: Add reset option for fan_ctrl interfacesMa Jun2023-10-131-0/+12
| | | | | | | | | | | | Add reset option for fan_ctrl interfaces. For example: User can use the "echo r > acoustic_limit_rpm_threshold" command to reset acoustic_limit_rpm_threshold to boot value Signed-off-by: Ma Jun <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Add GC v9.4.3 thermal limits to hwmonLijo Lazar2023-10-041-7/+12
| | | | | | | | | | Publish max operating temperature of SOC and memory as temp*_emergency nodes in hwmon. temp*_crit will show the throttle temperature limits. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Disallow managing power profiles on SRIOV for gc11.0.3Victor Zhao2023-09-281-1/+2
| | | | | | | | | disable pp_power_profile_mode for sriov on gc11.0.3 as not supported by smu Signed-off-by: Victor Zhao <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add xgmi_plpd_policy sysfs node for user to change plpd policyLe Ma2023-09-261-0/+68
| | | | | | | | | | | | | | | | Add xgmi_plpd_policy sysfs node for users to check and select xgmi per-link power down policy: - arg 0: disallow plpd - arg 1: default policy - arg 2: optimized policy v2: split from smu v13.0.6 code and miscellaneous updates v3: add usage comments around set/get functions Signed-off-by: Le Ma <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Add reset option for fan_curve on smu13_0_0Ma Jun2023-09-261-0/+8
| | | | | | | | | | Add reset option for fan_curve. User can use command "echo r > fan_cure" to reset the fan_curve to boot value Signed-off-by: Ma Jun <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add unique_id for gc 11.0.3Kenneth Feng2023-09-261-0/+1
| | | | | | | | add unique_id for gc 11.0.3 Signed-off-by: Kenneth Feng <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* Documentation/amdgpu: Modify pp_dpm_*clk detailsLijo Lazar2023-09-201-1/+9
| | | | | | | | | pp_dpm_*clk nodes also could show the frequencies when a clock is in 'sleep' state. Add documentation related to that. Signed-off-by: Lijo Lazar <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Use function for IP version checkLijo Lazar2023-09-201-6/+6
| | | | | | | | | Use an inline function for version check. Gives more flexibility to handle any format changes. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add fan minimum pwm OD setting support for SMU13Evan Quan2023-08-311-0/+64
| | | | | | | | Add SMU13 fan minimum pwm OD setting support. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add fan target temperature OD setting support for SMU13Evan Quan2023-08-311-0/+66
| | | | | | | | Add SMU13 fan target temperature OD setting support. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add fan acoustic target OD setting support for SMU13Evan Quan2023-08-311-0/+65
| | | | | | | | Add SMU13 fan acoustic target OD setting support. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add fan acoustic limit OD setting support for SMU13Evan Quan2023-08-311-0/+63
| | | | | | | | 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]>
* drm/amd/pm: add fan temperature/pwm curve OD setting support for SMU13Evan Quan2023-08-311-1/+209
| | | | | | | | 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]>
* drm/amd/pm: introduce a new set of OD interfacesEvan Quan2023-08-311-2/+262
| | | | | | | | | | | 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]>
* drm/amd/pm: correct SMU13 gfx voltage related OD settingsEvan Quan2023-08-301-27/+16
| | | | | | | | | 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]>
* drm/amd/pm: Fixes incorrect type in 'amdgpu_hwmon_show_power_avg() & _input()'Srinivasan Shanmugam2023-08-301-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]>
* drm/amd/pm: fix error flow in sensor fetchingAlex Deucher2023-08-301-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]>
* drm/amd/pm: fix debugfs pm_info outputAlex Deucher2023-08-301-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]>
* drm/amd/pm: Add critical temp for GC v9.4.3Asad Kamal2023-08-301-4/+4
| | | | | | | | | | | | | | | 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]>
* drm/amd: Hide unsupported power attributesMario Limonciello2023-08-151-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]>
* drm/amd: Rename AMDGPU_PP_SENSOR_GPU_POWERMario Limonciello2023-08-151-2/+2
| | | | | | | | 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]>
* drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`Mario Limonciello2023-08-151-1/+1
| | | | | | | | | | | | 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]>
* drm/amd: Add a new hwmon attribute for instantaneous powerMario Limonciello2023-08-151-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]>
* drm/amd: Add amdgpu_hwmon_get_sensor_generic()Mario Limonciello2023-08-151-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]>
* drm/amd/pm: Add vclk and dclk sysnode for GC 9.4.3Asad Kamal2023-08-151-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]>
* drm/amd/pm: Clean up errors in amdgpu_pm.cRan Sun2023-08-091-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]>
* drm/amd/pm: fix variable dereferenced issue in amdgpu_device_attr_create()Yang Wang2023-08-071-3/+7
| | | | | | | | | | | - fix variable ('attr') dereferenced issue. - using condition check instead of BUG_ON(). Fixes: 4e01847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code") Cc: Dan Carpenter <[email protected]> Signed-off-by: Yang Wang <[email protected]> Reviewed-by: Kenneth Feng <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: disbale dcefclk device sysnode on GFX v9.4.3 chipYang Wang2023-07-101-2/+1
| | | | | | | | | | | | v1: the dceflck sysnode is not aviable on GFX v9.4.3 chip. v2: simplify code logic using helper function: amdgpu_device_has_display_hardware(). Signed-off-by: Yang Wang <[email protected]> Reviewed-by: Kenneth Feng <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Add GFX v9.4.3 unique id to sysfsLijo Lazar2023-06-301-0/+1
| | | | | | | | | Expose unique id of GFX v9.4.3 ASICs as device attribute. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Enable pp_feature attributeLijo Lazar2023-06-301-1/+3
| | | | | | | | on APUs with GFX v9.4.3 Signed-off-by: Lijo Lazar <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Move clocks closer to its only usage in amdgpu_parse_cg_state()Nathan Chancellor2023-06-231-38/+38
| | | | | | | | | | | | | | | | | | After commit 8020f0f9316b ("drm/amd/amdgpu: enable W=1 for amdgpu"), there is an instance of -Wunused-const-variable when CONFIG_DEBUG_FS is disabled: drivers/gpu/drm/amd/amdgpu/../pm/amdgpu_pm.c:38:34: error: unused variable 'clocks' [-Werror,-Wunused-const-variable] 38 | static const struct cg_flag_name clocks[] = { | ^ 1 error generated. clocks is only used when CONFIG_DEBUG_FS is set, so move the definition into the CONFIG_DEBUG_FS block right above its only usage to clear up the warning. Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: fulfill SMU13 OD settings init and restoreEvan Quan2023-06-091-7/+19
| | | | | | | | | Gfxclk fmin/fmax, Uclk fmin/fmax and Gfx v/f curve voltage offset OD settings are supported for SMU13. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Fix output of pp_od_clk_voltageJonatas Esteves2023-06-091-7/+5
| | | | | | | | | | | | | | | Printing the other clock types should not be conditioned on being able to print OD_SCLK. Some GPUs currently have limited capability of only printing a subset of these. Since this condition was introduced in v5.18-rc1, reading from `pp_od_clk_voltage` has been returning empty on the Asus ROG Strix G15 (2021). Fixes: 79c65f3fcbb1 ("drm/amd/pm: do not expose power implementation details to amdgpu_pm.c") Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Jonatas Esteves <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Expose mem temperature for GC version 9.4.3Asad Kamal2023-06-091-5/+5
| | | | | | | | Add mem temperature as part of hw mon attributes for GC version 9.4.3 Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Update hw mon attributes for GC version 9.4.3Asad Kamal2023-06-091-11/+25
| | | | | | | | | | | | Update hw mon attributes for GC Version 9.4.3 to valid ones on APU and Non APU systems v2: Group checks along existing one Added power limit & mclock for gc version 9.4.3 Signed-off-by: Asad Kamal <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Fix incorrect comment about Vangogh power cap supportGuilherme G. Piccoli2023-04-111-2/+2
| | | | | | | | | | | | The comment mentions that power1 cap attributes are not supported on Vangogh, but the opposite is indeed valid: for APUs, only Vangogh is supported. While at it, also fixed the Renoir comment below (thanks Melissa for noticing that!). Cc: Lijo Lazar <[email protected]> Cc: Melissa Wen <[email protected]> Signed-off-by: Guilherme G. Piccoli <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: enable sysfs node vclk1 and dclk1 for NV3XTong Liu012023-03-311-2/+6
| | | | | | | | Enable node pp_dpm_vclk1 and pp_dpm_dclk1 for gc11.0.2 and gc11.0.3 Signed-off-by: Tong Liu01 <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: enable sysfs node vclk1 and dclk1 for NV2XTong Liu012023-03-311-0/+8
| | | | | | | | Enable vclk1 and dclk1 node for gc10.3.0 and gc10.3.1 Signed-off-by: Tong Liu01 <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: add sysfs node vclk1 and dclk1Tong Liu012023-03-311-0/+32
| | | | | | | | | User can check pp_dpm_vclk1 and pp_dpm_dclk1 for DPM frequency of vcn and dcn Signed-off-by: Tong Liu01 <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/pm: add capped/uncapped power profile modesPerry Yuan2023-03-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Capped and uncapped workload types switching are supported on Vangogh, User can switch the power profile and check current type with below commands. 1) switch to capped mode: `# echo 8 > /sys/class/drm/card0/device/pp_power_profile_mode` 2) switch to uncapped mode: `# echo 9 > /sys/class/drm/card0/device/pp_power_profile_mode` 3) check current mode: $ cat /sys/class/drm/card0/device/pp_power_profile_mode 1 3D_FULL_SCREEN 3 VIDEO 4 VR 5 COMPUTE 6 CUSTOM 8 CAPPED 9 UNCAPPED* Acked-by: Kenneth Feng <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Perry Yuan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: remove dead codeMuhammad Usama Anjum2023-03-071-1/+1
| | | | | | | | | The less than zero comparison of unsigned variable "value" is never true. Remove dead code. Fixes: c3ed0e72c872 ("drm/amdgpu: added a sysfs interface for thermal throttling") Signed-off-by: Muhammad Usama Anjum <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: added a sysfs interface for thermal throttlingKun Liu2023-02-231-0/+77
| | | | | | | | | added a sysfs interface for thermal throttling, then userspace can get/update thermal limit Signed-off-by: Kun Liu <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Add unique_id support for GC 11.0.1/2Kent Russell2023-02-081-0/+2
| | | | | | | | | These can support unique_id, so create the sysfs file for them Signed-off-by: Kent Russell <[email protected]> Reviewed-by: Harish Kasiviswanathan <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Enable vclk dclk node for gc11.0.3Yiqing Yao2023-01-311-2/+4
| | | | | | | | These sysfs nodes are tested supported, so enable them. Signed-off-by: Yiqing Yao <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu/pm: update hwmon power documentationAlex Deucher2023-01-171-1/+1
| | | | | | | | | Power reporting is socket power. On APUs this includes the CPU. Update the documentation to clarify this. Reviewed-by: Aaron Liu <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Init pm_attr_list when dpm is disabledZhenGuo Yin2022-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | [Why] In SRIOV multi-vf, dpm is always disabled, and pm_attr_list won't be initialized. There will be a NULL pointer call trace after removing the dpm check condition in amdgpu_pm_sysfs_fini. BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:amdgpu_device_attr_remove_groups+0x20/0x90 [amdgpu] Call Trace: <TASK> amdgpu_pm_sysfs_fini+0x2f/0x40 [amdgpu] amdgpu_device_fini_hw+0xdf/0x290 [amdgpu] [How] List pm_attr_list should be initialized when dpm is disabled. Fixes: a6ad27cec585fe ("drm/amd/pm: Remove redundant check condition") Signed-off-by: ZhenGuo Yin <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: Remove redundant check conditionYiPeng Chai2022-09-191-3/+0
| | | | | | | | | | | | | | | | | | | | V3: [Why]: Since ASICs using smu v13_0_2 have called smu .suspend before calling amdgpu_pm_sysfs_fini, pm.dpm_enabled was already set to 0 when smu .suspend was called. This makes it impossible to delete all pm sys nodes. [How]: Since all functions in amdgpu_pm_sysfs_fini have their own condition checks, so the first conditional check in amdgpu_pm_sysfs_fini can be removed. Signed-off-by: YiPeng Chai <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: consistent approach for smartshiftSathishkumar S2022-05-161-67/+61
| | | | | | | | | | | | | | | | | create smartshift sysfs attributes from dGPU device even on smartshift 1.0 platform to be consistent. Do not populate the attributes on platforms that have APU only but not dGPU or vice versa. V2: avoid checking for the number of VGA/DISPLAY devices (Lijo) move code to read from dGPU or APU into a function and reuse (Lijo) Suggested-by: Alex Deucher <[email protected]> Signed-off-by: Sathishkumar S <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* amdgpu/pm: Disallow managing power profiles on SRIOV for Sienna CichlidDanijel Slivka2022-05-101-0/+9
| | | | | | | | | | Managing power profiles mode is not allowed in SRIOV mode for Sienna Cichlid. This patch is adjusting the "pp_power_profile_mode" and "power_dpm_force_performance_level" accordingly. Signed-off-by: Danijel Slivka <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amd/pm: enable workload type change on smu_v13_0_7Kenneth Feng2022-05-061-1/+2
| | | | | | | | | | enable workload type change on smu_v13_0_7 v2: squash in out of bounds fix (Alex) Signed-off-by: Kenneth Feng <[email protected]> Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>