drm/amd/pm: add set_performance_level function for yellow carp
authorXiaomeng Hou <Xiaomeng.Hou@amd.com>
Thu, 8 Apr 2021 01:44:02 +0000 (09:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Jun 2021 20:03:24 +0000 (16:03 -0400)
commit6c83a0151b8f028eedd51f618a17cb838c11d217
tree694efdb70b142040491c0cb88a18519c8d78dda5
parent0cf6faafc43d46b4b3714159c7a9e8ecd2b11bd6
drm/amd/pm: add set_performance_level function for yellow carp

This patch enables editing sysfs file power_dpm_force_performance_level
for yellow carp. User could thus adjust the dpm forced level.

v2: enable fine grain control of GFXCLK only when in manual performance
level mode. In other mode, the min/max range of GFXCLK will be reset to
corresponding values.

Ex: To enable min 300MHz / max 600MHz gfx clocks

1) echo manual > /sys/bus/pci/devices/.../power_dpm_force_performance_level
2) echo s 0 300 > /sys/bus/pci/devices/.../pp_od_clk_voltage
3) echo s 1 600 > /sys/bus/pci/devices/.../pp_od_clk_voltage
4) echo c > /sys/bus/pci/devices/.../pp_od_clk_voltage

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c