Power Management Subsystem Enhancements and Bugfixes#74
Merged
jandryuk merged 7 commits intoOpenXT:masterfrom Oct 25, 2022
Merged
Power Management Subsystem Enhancements and Bugfixes#74jandryuk merged 7 commits intoOpenXT:masterfrom
jandryuk merged 7 commits intoOpenXT:masterfrom
Conversation
Contributor
Author
|
Depends on OpenXT/idl#45 |
tsirakisn
reviewed
Oct 10, 2022
tsirakisn
approved these changes
Oct 10, 2022
jandryuk
reviewed
Oct 11, 2022
jandryuk
reviewed
Oct 11, 2022
Contributor
Author
|
Updated. Addressed comments. |
crogers1
commented
Oct 11, 2022
This module allows xcpmd to react to events occuring to the db with respect to power management actions. For example, this will allow xcpmd to define rules that increase or decrease the screen brightness when the fn keys are pressed. vGlass handles the input and calls xcpmd add_var over dbus and the rule ensures backlightSet is called with the new brightness value. This is just one example of a rule that can be defined to react to db events. Add the sources and module spec to the Makefile. This commit also includes enhancements and bugfixes to db-helper so we can make use of the db-events. Signed-off-by: Chris Rogers <crogers122@gmail.com>
Signed-off-by: Chris Rogers <crogers122@gmail.com>
This module defines three actions to take for host power events triggered by a ruleset in xcpmd. The calls are ultimately punted to xenmgr where the shutdown or reboot action is executed. Signed-off-by: Chris Rogers <crogers122@gmail.com>
Moved backlight module into xcpmd so that xcpmd can be responsible for handling brightness. Integrated backlight module functions into xcpmd's acpi module, and updated makefile accordingly. Brightness is no longer dependent on glass and can be handled almost entirely inside xcpmd minus user generated actions to adjust brightness from keystrokes or UIVM slider. Signed-off-by: nate <zogbyn@ainfosec.com> Signed-off-by: Chris Rogers <crogers122@gmail.com>
- added logic to allow xcpmd to receive lid_state_changed signals over dbus. once that signal is received, xenstore's lid_state value is then updated. this allows guest vm's to accurately be aware of lid state changes. - note that after OpenXT restarts, xenstore will not contain any lid_state information until the lid is closed/opened. when qemu tries to retrieve lid state in this situation, it will simply tell guest vm's that the lid is open to avoid unwanted sleeping/suspending issues. - code to handle lid events triggered from acpi was removed, as it is now deprecated and will not be used. Signed-off-by: Reed McFadden <mcfaddenr@ainfosec.com> Signed-off-by: Chris Rogers <crogers122@gmail.com>
Signed-off-by: Chris Rogers <crogers122@gmail.com>
Add a reasonable default power management ruleset for xcpmd. This
is only parsed into the db if no existing ruleset exists. A user
can further modify the ruleset directly through the db after this
has been parsed and added. The rule syntax is straightforward
to convey meaning in plain english, but the section below will
clarify some of the rules and variables.
- critical_batt is the battery percentage we consider to be a
critical level
- normal_batt is used as conditional to set the backlight on
battery power to the 'batt_dim_backlight' level. This reads
as "when we have sufficient battery power, set the backlight
to the most recent level when we were last using battery
power." There is a separate rule to use the 'critical_backlight'
var to set the backlight percentage level when we are on a
critical level of battery.
- 'ac_dim_backlight' is the same as 'batt_dim_backlight' for when
we're using AC power.
- 'shutdown_on_idle` is a 1 or 0 (bool) to tell the workstation
to shutdown after the period of time specified by 'shutdown_idle'
if the user has not interacted with the system. 'shutdown_idle'
is in minutes.
Signed-off-by: Chris Rogers <crogers122@gmail.com>
jandryuk
approved these changes
Oct 12, 2022
Contributor
jandryuk
left a comment
There was a problem hiding this comment.
Looks good - thanks.
This depends on IDL, and IDL depends on a XenMmgr PR. Holding off merge for the time being.
Contributor
|
xcpmd/src/default.rules needs to get installed into POLICY_FILE_PATH "/usr/share/xcpmd/default.rules" |
Contributor
|
This commit adds rule installation, and bitbake packages it in the xcpmd package: I haven't tested xcpmd loading them yet since I have some rules in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains a series of commits that provide enhancements and bugfixes for the current power management subsystem. Some of the features provided in this PR depend on some forthcoming changes in other components like glass and xenmgr to fully function, but it can be merged safely before those are ready. Refer to each commit for more information.