diff options
author | Shyam Sundar S K <Shyam-sundar.S-k@amd.com> | 2022-08-02 18:11:46 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-08-15 14:23:38 +0300 |
commit | 3f5571d9952473c183762b801c61c42b9dbe1903 (patch) | |
tree | 1e215b0ed738b2b3155a2bf17e8f3dfa1e68f9ee /drivers/platform/x86/amd/pmf/acpi.c | |
parent | 1a409b35c9956617f9e201120225f230f1695d6e (diff) | |
download | linux-3f5571d9952473c183762b801c61c42b9dbe1903.tar.xz |
platform/x86/amd/pmf: Add support for Auto mode feature
This feature has 3 modes quiet, balanced, performance
The objective of this feature is to track the moving average of system
power over the time period specified and switch to the subsequent mode.
In order to do this, PMF driver will get the moving average of APU power
from PMFW and power threshold, time constants, system config parameters
from OEM inputs.
System power as read by PMF driver from PMFW is the filtered value over
the sampling window. Every sampling window, moving average of system power
is computed. At the end of the monitoring window, the moving average is
compared against the threshold for mode switch for decision making.
With AMD managing the system config limits, any mode switch within
auto-mode will result in limits of fPPT/sPPT/STAPM or STT being scaled
down.
When "auto mode" is enabled, the static slider control remains out of
the PMF driver, so the platform_profile registration would not
happen in PMF driver.
The transition to auto-mode only happens when the APMF fn5 is enabled
in BIOS, platform_profile set to "balanced" and a AMT
(Auto Mode transition) is received.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20220802151149.2123699-9-Shyam-sundar.S-k@amd.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/amd/pmf/acpi.c')
-rw-r--r-- | drivers/platform/x86/amd/pmf/acpi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c index 1fc4d1400364..401fee381e90 100644 --- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -144,6 +144,11 @@ out: return err; } +int apmf_get_auto_mode_def(struct amd_pmf_dev *pdev, struct apmf_auto_mode *data) +{ + return apmf_if_call_store_buffer(pdev, APMF_FUNC_AUTO_MODE, data, sizeof(*data)); +} + static int apmf_if_verify_interface(struct amd_pmf_dev *pdev) { struct apmf_verify_interface output; |