1. Introduction 1.1. Project/Component Working Name: GNOME Power Manager Support 1.2. Name of Document Author/Supplier: Author: Phi Tran 1.3 Date of This Document: 1/10/07 4. Technical Description 4.1 Details This project enhances the battery driver (PSARC/2006/601) and HAL (PSARC/2005/399) to provide lid, brightness, power button, suspend, and hibernate support for Gnome Power Manager (LSARC/2007/702). Lid --- GPM allows the user to set actions for lid close such as suspend, hibernate, and shutdown. Suspend and hibernate actions will be available if supported by the system. In addition, the actions will be allowed if the user is the console owner or has the appropriate RBAC authorization. ACPI lid event notifications will be handled by the driver to trigger lid sysevents if the lid is closed or opened. HAL is notified by the sysevents, and GPM communicates with HAL through D-BUS. LCD Brightness Control ---------------------- There will be two methods implemented to control LCD brightness. The first way to control LCD brightness is by pressing the laptop brightness hotkeys which will generate ACPI events for brightness up or down that the battery driver will handle to change the brightness. The driver will also generate sysevents to notify HAL about the brightness change. GPM communicates with HAL through D-BUS. The second method to change brightness is through the GPM brightness applet. Support for the applet is handled through the HAL interfaces which call driver ioctls to set and get the brightness levels. In both methods, setting the brightness level will be allowed for the user who is the console owner or has the RBAC authorization. Power Button ------------ GPM allows for the configuration of power button actions such as shutdown, suspend, and hibernate. These actions will be allowed if the system supports the action, and the user is either the console owner or has the RBAC authorization. Currently, power button support is handled by the power driver and powerd. powerd polls for the button action. To enable GPM power button actions, the polling will be replaced by sysevents and HAL will handle the sysevent to notify GPM through D-BUS. powerd will no longer handle the power button press. 4.2 Interface HAL interfaces -------------- Interface level: Volatile Method Name Return Parameters Comments --------------------------------------------------------------------------- GetBrightness int status Get the current brightness. SetBrightness int level Set the current brightness. Suspend int status Put the system into ACPI S3 state. Hibernate int status Put the system into ACPI S4 state. Shutdown int status Reboot int status --------------------------------------------------------------------------- Interface Type Comments -------------------------------------------------------------------------- can.suspend bool The ability to suspend as determined by uadmin(2). can.hibernate bool The ability to hibernate as determined by uadmin(2). button.type string Identifies buttons such as lid or power. button.has_state bool True if button maintains state, e.g. can be toggled on/off. button.state.value bool State of the button, TRUE if it is enabled. ButtonPressed string Emitted when a button is pressed such as power, lid, brightness-up, or brightness-down. laptop_panel.num_levels int The brightness levels supported by the adapter. -------------------------------------------------------------------------- More information can be found in hal-spec.html of the materials directory. Brightness Ioctls ----------------- Interface level: Project Private BATT_IOC_GET_BRIGHTNESS BATT_IOC_SET_BRIGHTNESS Sysevents --------- Interface level: Project Private The EC_ACPIEV class defined in PSARC/2006/601 Battery Project will be extended to include the following subclasses. ESC_ACPIEV_BRIGHTNESS_UP ESC_ACPIEV_BRIGHTNESS_DOWN ESC_ACPIEV_POWER_BUTTON The event attributes will be the same as existing EC_ACPIEV subclasses. Security -------- Interface level: Volatile The following RBAC authorizations and profiles will be added. Authorization Names: solaris.system.power.:::System Power Management::help=SystemPowerMgmt.html solaris.system.power.suspend::: Suspend the System::help=Suspend.html solaris.system.power.suspend.ram::: Suspend to RAM::help=SuspendToRam.html solaris.system.power.brightness::: Control LCD Brightness::help=Brightness.html Profiles: System Power:::For authorized users to manage system power: auths=solaris.system.power;help=RtSystemPowerMngmnt.html Suspend:::For authorized users to Suspend system: auths=solaris.system.power.suspend;help=RtSuspend.html SuspendToRam:::For authorized users to Suspend to RAM: auths=solaris.system.power.suspend.ram;help=RtSuspendToRam.html Brightness:::For authorized users to Control LCD Brightness: auths=solaris.system.power.brightness;help=RtBrightness.html *Will consult with the audit team to enable auditing. libpolkit interfaces -------------------- Interface level: Volatile The following privileges are mapped to RBAC authorizations for the solaris backend. hal-power-suspend hal-power-hibernate hal-power-shutdown hal-power-cpu hal-power-brightness 4.3 References LSARC/2007/702 Gnome Power Manager PSARC/2007/679 CPUFreq HAL PSARC/2006/601 Battery Project LSARC/2006/368 D-BUS Message Bus System PSARC/2005/399 Tamarack: Removable Media Enhancements in Solaris HAL specification http://people.freedesktop.org/~david/hal-spec/hal-spec.html ACPI 3.0b http://www.acpi.info/spec.htm 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5. ARC review type: FastTrack 6.6. ARC Exposure: open