Top |
char * | driver-name | Read / Write / Construct Only |
char * | performance-degraded | Read / Write |
PpdProfile | profiles | Read / Write / Construct Only |
struct | PpdDriverClass |
PpdDriver | |
enum | PpdProbeResult |
enum | PpdProfileActivationReason |
Profile drivers are the implementation of the different profiles for
the whole system. A driver will need to implement support power-saver
and balanced
at a minimum.
All drivers should be derived from either PpdDriverCpu or PpdDriverPlatform
When a driver implements the performance
profile, it might set the
“performance-degraded” property if the profile isn't running to
its fullest performance for any reason, such as thermal limits being
reached, or because a part of the user's body is too close for safety,
for example.
struct PpdDriverClass { GObjectClass parent_class; PpdProbeResult (* probe) (PpdDriver *driver); gboolean (* activate_profile) (PpdDriver *driver, PpdProfile profile, PpdProfileActivationReason reason, GError **error); gboolean (* power_changed) (PpdDriver *driver, PpdPowerChangedReason reason, GError **error); gboolean (* prepare_to_sleep) (PpdDriver *driver, gboolean start, GError **error); };
New profile drivers should not derive from PpdDriver. They should
derive from the child from PpdDriverCpu or PpdDriverPlatform drivers
and implement at least one of probe()
and activate_profile
.
Those are the three possible values returned by a driver probe, along with an unset value for convenience.
Those are possible reasons for a profile being activated. Based on those reasons, drivers can choose whether or not that changes the effective profile internally.
the driver profile changed internally, usually because of a key combination. |
||
setting profile on startup, or because drivers are getting reprobed. |
||
setting profile because the user requested it. |
||
setting profile because preference is lost during suspend. |
||
setting profile because a program
requested it through the |
“driver-name”
property “driver-name” char *
Profile driver name.
Owner: PpdDriver
Flags: Read / Write / Construct Only
Default value: NULL
“performance-degraded”
property “performance-degraded” char *
Why the performance profile is degraded, if set.
Owner: PpdDriver
Flags: Read / Write
Default value: NULL
“profiles”
property“profiles” PpdProfile
Profiles implemented by this driver.
Owner: PpdDriver
Flags: Read / Write / Construct Only
“probe-request”
signalvoid user_function (PpdDriver *ppddriver, gpointer user_data)
The driver requested to be reprobed, because it became available.
Flags: Run Last
“profile-changed”
signalvoid user_function (PpdDriver *profile, PpdProfile arg1, gpointer user_data)
Emitted when the profile was changed from the outside, usually by key combinations implemented in firmware.
profile |
the updated PpdProfile |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last