mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2025-12-20 04:30:09 +01:00
platform-profile: Add debugging message for AMD PMF
If the system is using AMD PMF then APU coefficients are available in debugfs. This can be useful to confirm that an ACPI platform profile is functioning as intended. Add a debug statement if this file is available.
This commit is contained in:
parent
ff7900812c
commit
c811b29721
1 changed files with 17 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#define LAPMODE_SYSFS_NAME "dytc_lapmode"
|
||||
#define ACPI_PLATFORM_PROFILE_PATH "/sys/firmware/acpi/platform_profile"
|
||||
#define ACPI_PLATFORM_PROFILE_CHOICES_PATH "/sys/firmware/acpi/platform_profile_choices"
|
||||
#define AMD_PMF_DEBUG "/sys/kernel/debug/amd_pmf/current_power_limits"
|
||||
|
||||
struct _PpdDriverPlatformProfile
|
||||
{
|
||||
|
|
@ -226,6 +227,18 @@ acpi_platform_profile_changed (GFileMonitor *monitor,
|
|||
update_acpi_platform_profile_state (self);
|
||||
}
|
||||
|
||||
static void
|
||||
ppd_driver_platform_profile_debugging (void)
|
||||
{
|
||||
if (g_file_test (AMD_PMF_DEBUG, G_FILE_TEST_EXISTS)) {
|
||||
g_autofree char *pmf_debug = NULL;
|
||||
|
||||
if (g_file_get_contents (AMD_PMF_DEBUG, &pmf_debug, NULL, NULL))
|
||||
g_debug ("AMD PMF current power limits '%s'",
|
||||
g_strchomp(pmf_debug));
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ppd_driver_platform_profile_activate_profile (PpdDriver *driver,
|
||||
PpdProfile profile,
|
||||
|
|
@ -267,6 +280,9 @@ ppd_driver_platform_profile_activate_profile (PpdDriver *drive
|
|||
|
||||
g_debug ("Successfully switched to profile %s", ppd_profile_to_str (profile));
|
||||
self->acpi_platform_profile = profile;
|
||||
|
||||
ppd_driver_platform_profile_debugging();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -338,6 +354,7 @@ out:
|
|||
|
||||
g_debug ("%s a dytc_lapmode sysfs attribute to thinkpad_acpi",
|
||||
self->device ? "Found" : "Didn't find");
|
||||
ppd_driver_platform_profile_debugging();
|
||||
return PPD_PROBE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue