All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: offering a standardized (/sys/class) userspace API for selecting system/laptop performance-profiles
@ 2020-09-17 11:22 Hans de Goede
  2020-09-17 11:50 ` Bastien Nocera
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Hans de Goede @ 2020-09-17 11:22 UTC (permalink / raw)
  To: Elia Devito, Mark Pearson
  Cc: Benjamin Berg, Bastien Nocera, Jared Dominguez,
	platform-driver-x86, Andy Shevchenko

Hi Elia, Mark, et al.

Elia, Mark I'm mailing you both because both of you have pdx86 patches pending to add a vendor
specific sysfs-attribute for selecting performance-profiles for resp. HP and Lenovo Thinkpad laptops.

I think that this shows that we might need to start thinking
about a generic kernel API for this, otherwise we will
end up with slight different options per vendor ...

So it seems we may need something like:

/sys/class/system_performance_profile

Where we would then get e.g.:

/sys/class/system_performance_profile/thinkpad_acpi/performance_profile

And then we need to standardize on the names/values which
performance_profile can show / accept when written too.

The big question is what do we do if there are more then 3 profiles?

One option would be something like the following:

cat /sys/class/system_performance_profile/thinkpad_acpi/performance_profile

low-power [balanced] performance

cat /sys/class/system_performance_profile/thinkpad_acpi/extra_performance_profiles

extra-low-power balanced-performance-mix

So we add an optional extra_performance_profiles sysfs attribute and we ask all
drivers implemeting this class to implement at least the 3 standard profiles
(by mapping 3 of their options to these) and optional they can offer extra
profiles (with free form names) in the extra_performance_profiles
sysfs attribute under the class-device.

The idea behind putting the extra profiles in a separate sysfs-attribute
is that reading the main performance_profile attribute will always show
one selected, even if one of the extra profiles is actually in use,
then the driver should also show the closest standardized profile as
being active.

This will allow userspace code to always rely on the standard interface
both for getting a representation of the currently active profile as well
as for setting the active profile.

Elia, Mark, I assume that both of you want to get your patches for this
upstream sooner, rather then later. But I think we should put them on
hold until we have an agreement on a shared userspace API for this.

I would like to think that the above proposal is a good start,
if we can quickly (*) decide on an userspace API here

Regards,

Hans

p.s.

I guess we should also add an optional lap_mode sysfs attribute
to the class-device, to have all the info for the Thinkpads in
one place.


*) but not too quickly, it is important we get this right


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2020-09-24 11:48 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 11:22 RFC: offering a standardized (/sys/class) userspace API for selecting system/laptop performance-profiles Hans de Goede
2020-09-17 11:50 ` Bastien Nocera
2020-09-17 12:51   ` Hans de Goede
2020-09-17 13:00     ` Bastien Nocera
2020-09-17 13:50     ` Benjamin Berg
2020-09-17 13:54       ` Hans de Goede
2020-09-17 14:10         ` Benjamin Berg
2020-09-17 16:58           ` [External] " Mark Pearson
2020-09-17 17:03             ` Hans de Goede
2020-09-17 17:16               ` Mark Pearson
2020-09-17 18:16                 ` Benjamin Berg
2020-09-21  9:03                   ` Elia Devito
2020-09-22 10:43                     ` Hans de Goede
2020-09-24  2:10                       ` Mark Pearson
2020-09-24  8:21                         ` Hans de Goede
2020-09-24 11:48                     ` Benjamin Berg
2020-09-22 10:30                 ` Hans de Goede
2020-09-24  1:44                   ` Mark Pearson
2020-09-17 13:36   ` Mark Pearson
2020-09-17 14:04     ` Hans de Goede
2020-09-17 16:51       ` Mark Pearson
2020-09-17 12:22 ` Benjamin Berg
2020-09-17 12:45   ` Hans de Goede
2020-09-17 13:07     ` Bastien Nocera
2020-09-17 13:46       ` Hans de Goede
2020-09-17 13:02 ` Barnabás Pőcze
2020-09-17 13:24   ` Hans de Goede
2020-09-17 13:28     ` Bastien Nocera
2020-09-17 13:51       ` Hans de Goede
2020-09-17 13:59     ` Benjamin Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.