Xiaojian Du 37030aba0f drm/amd/pm: improve the fine grain tuning function for RV/RV2/PCO
This patch is to improve the fine grain tuning function for RV/RV2/PCO.
This patch adds two new commands: "restore" and "commit".
This function uses the pp_od_clk_voltage sysfs file to configure the min
and max value of gfx clock frequency manually or restore the default value.

Command guide:
echo "s level value" > pp_od_clk_voltage
        "s" - set the sclk frequency
        "level" - 0 or 1, "0" represents the min value,  "1" represents
        the max value
        "value" - the target value of sclk frequency, it should be limited in the
        safe range
echo "r" > pp_od_clk_voltage
        "r" - reset the sclk frequency, restore the default value instantly
echo "c" > pp_od_clk_voltage
        "c" - commit the min and max value of sclk frequency to the system
        only after the commit command, the target values set by "s" command
        will take effect.
Example:
1)change power profile from "auto" to "manual"
        $ cat power_dpm_force_performance_level
        auto
        $ echo "manual" > power_dpm_force_performance_level
        $ cat power_dpm_force_performance_level
        manual
2)check the default sclk frequency
        $ cat pp_od_clk_voltage
        OD_SCLK:
        0:        200Mhz
        1:       1400Mhz
        OD_RANGE:
        SCLK:     200MHz       1400MHz
3)use "s" -- set command to configure the min and max sclk frequency
        $ echo "s 0 600" > pp_od_clk_voltage
        $ echo "s 1 1000" > pp_od_clk_voltage
        $ echo "c" > pp_od_clk_voltage
        $ cat pp_od_clk_voltage
        OD_SCLK:
        0:        600Mhz
        1:       1000Mhz
        OD_RANGE:
        SCLK:     200MHz       1400MHz
4)use "r" -- reset command to restore the min or max sclk frequency
        $ echo "r" > pp_od_clk_voltage
        $ cat pp_od_clk_voltage
        OD_SCLK:
        0:        200Mhz
        1:       1400Mhz
        OD_RANGE:
        SCLK:     200MHz       1400MHz

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-01-06 16:11:44 -05:00
..
2020-12-14 11:07:56 -08:00
2020-12-15 10:21:48 +01:00
2020-12-14 11:07:56 -08:00
2020-12-14 11:07:56 -08:00
2020-08-06 14:27:31 -07:00
2020-11-13 14:53:34 +10:00
2020-12-15 10:21:48 +01:00
2020-12-14 11:07:56 -08:00
2020-12-15 10:21:48 +01:00
2020-12-15 10:21:48 +01:00
2020-12-15 10:21:48 +01:00
2020-12-14 11:07:56 -08:00
2020-12-14 11:07:56 -08:00
2020-12-14 11:07:56 -08:00
2020-12-16 16:24:25 +01:00
2020-12-15 10:21:48 +01:00
2020-05-27 14:31:42 +03:00
2020-11-06 10:31:26 +01:00
2020-11-16 20:48:20 +01:00
2020-05-29 12:58:11 +02:00
2020-09-21 10:45:08 +02:00
2020-08-11 11:58:31 +10:00
2020-11-16 20:48:20 +01:00
2020-08-11 11:58:31 +10:00