1. Introduction 1.1. Project/Component Working Name: GNOME Power Manager 1.2. Name of Document Author/Supplier: Author: Simon Zheng 1.3 Date of This Document: Dec 27th, 2007 2. Background This project provides Solaris users with a GNOME Power Manager infrastructure. Solaris has integrated HAL via PSARC/2005/399 Tamarack project, and PSARC 2006/601 Battery project and PSARC/2007/679 CPUFreq HAL enhance more power management properties. Based on them, GNOME Power Manager will be able to support many power management features, such as suspending, hibernating, brightness adjustment, lid closure action, CPU frequency scaling, and etc. 3. Business Consideration GNOME Power Manager[1] supplies many modern power management features. It's valuable to attract more developer users for Solaris, especially laptop users. Also, it has been a part of official GNOME release since GNOME 2.14 and is delivered in many Linux distributions at present. So this project can fill the gap between Linux and Solaris too. 4. Technical Description This project will port GNOME Power Manager to Solaris, which stems from GNOME community. Then we'll keep tracking community and provide upstream changes back to them. 4.1 Framework +-----------------------------------------------------------------------+ | | |gnome-brightness-applet gnome-power-statistics gnome-power-preference | | | +--------------------------------+ | | D-Bus interface | | | org.freedesktop.PowerManagement| | +--------------------------------+ | | gnome-power-manager | | | daemon | | +--------------------------------+--------------------------------------+ ^ | (D-bus) | JDS consolidation (up) -----------------+-------------------------------------------------------------- | ON consolidation (below) | (D-bus) v +-----------------------------------------+ | HAL daemon (hald) | +----------------+ +------------------+ | |hald-addon-acpi | |hald-addon-cpufreq| | |daemon | |daemon | | +-------------------------------------+---+ ^ | | +-----------------+ | | Power.conf | | | pmconfig utility| | +-----------------+ | | user space ---------+-------------------------+--------------------------------------- | | kernel space v v +-------------------+ +-------------------+ | battery, lid | | power management | | brightness drivers| | framewok | +-------------------+ +-------------------+ GNOME Power Manager infrastructure is composed of several parts, gnome-power-manager daemon, gnome-power-preferences, gnome-power-statistics, gnome-brightness and D-Bus interfaces "org.freedesktop.PowerManagement". gnome-power-manager daemon is a backend session-daemon which is automatically started by gnome-session when logging in GNOME desktop session. It provides a complete and integrated solution to power management under GNOME desktop environment. It supports suspending, hibernating, screen blanking, lid closure action, CPU frequency scaling, and etc. gnome-power-preferences is a GUI configuration program. It allows users to define their favorite policies in terms of power source. These policies are enforced by gnome-power-manager daemon. gnome-power-statistics is also a GUI program and allows users to visualize the power consumption of laptop hardware. gnome-brightness-applet is a gnome-panel applet, which serves for displaying and adjusting LCD screen brightness level. And D-Bus interfaces "org.freedesktop.PowerManagement" are exported to be used for other up-level applications. 4.2 Battery monitor & configuration switching GNOME Power Manager not only reports battery status but also supports power management policies. Using gnome-power-preferences users are able to define different policies for AC and battery. The policy may be an action when battery becomes very low, or what action would be triggered when lid is closed. Then, when switching the power source, corresponding policy will be switched accordingly. For example, unplugging AC adapter, GNOME Power Manager immediately replaces battery's policy with AC's. This makes system look smarter. 4.3 Brightness, lid and power buttons On laptop, when brightness up/down is pressed, gnome-power-manager will receive relevant button event and then pop up a progress bar to show brightness status. When lid is closed, GNOME Power Manager will trigger a defined action, such as blank screen, suspend, hibernate. Pressing power button, it will also do the specified policy. All above buttons events require HAL support. 4.4 CPU frequency scaling At present, CPUFreq HAL supports two types of CPU power management policies, "On Demand" and "Performance". "On Demand" means dynamic CPU frequency scaling is performed by monitoring CPU utilization and scaling the frequency when appropriate. "Performance" means getting full CPU utilization all the time. Both policies can be configured from GNOME Power Manager. 4.5 Suspend/hibernate and its capability and authorization checking Suspend (suspend to RAM) and hibernate (suspend to disk) functionalities are based on the HAL D-Bus interface "org.freedesktop.Hal.Device.SystemPowerManagement". Before showing users suspend/hibernate configuration, GNOME Power Manager will check both hardware capability and user authorization. Hardware capability checking relies on HAL's interface "power_management.can_suspend", and user authorization checking uses HAL's libpolkit. 4.6 Dependency GNOME Power Manager heavily depends on HAL layer. Some basic HAL calling methods, such as "GetPropertyString" and "SetPropertyString", are provided by "Removable Media Enhancements in Solaris" (PSARC/2005/399). Libpolkit is also from the same. Battery interfaces are from Battery Project (PSARC/2006/601). CPUFreq scaling interfaces is supplied by CPUFreq HAL (PSARC/2007/679). Other interfaces about suspend/hibernate, Brightness, lid and power button are under development and will be provided soon. In addition, screen blanking depends on X11 DPMS extension (PSARC/1998/299). 5. Interface Tables Exported Interface Interface Name Classification Comment ------------------- --------------- -------------- SUNWgnome-power-manager-root Uncommitted GNOME Power Manager - / filesystem /etc/gconf/schemas/gnome-power-manager.schemas Volatile Gconf schema definition file SUNWgnome-power-manager Uncommitted GNOME Power Manager /usr/bin/gnome-power-manager Volatile Session daemon /usr/bin/gnome-power-preferences Volatile Configuration GUI /usr/bin/gnome-power-statistic Volatile GUI to show power consumption statistic /usr/lib/gnome-brightness-applet Volatile gnome-panel applet to adjust brightness /usr/lib/gnome-power-bugreport.sh Volatile Bug reporter tool /usr/lib/gnome-power-cmd.sh Volatile Command-line tool to run suspend/hibernate/shutdown. /usr/lib/bonobo/servers/GNOME_BrightnessApplet.server Volatile Bonobo service configuration file /usr/share/applications/gnome-power-preferences.desktop Volatile Start menu configuration file /usr/share/applications/gnome-power-statistic.desktop Volatile The same as above /usr/share/gnome/autostart/gnome-power-manager.desktop Volatile Autostart configuration /usr/share/dbus-1/services/gnome-power-manager.service Volatile D-Bus services configuration file /usr/share/gnome-2.0/ui/GNOME_BrightnessApplet.xml Volatile Gnome-panel configuration file /usr/share/gnome-power-manager Volatile Installation location for glade files, images /usr/share/gnome/help/gnome-power-manager Volatile GNOME help documentation Exported Interface Please see ./power-management-spec-0.2.html. All interfaces are Volatile. Imported Interface Interface Name Classification ARC Case Comment ------------------- --------------- -------------- --------------------------------- GNOME Committed Platform Libraries Committed LSARC/2007/520 GTK+ library GNOME 2.20 gnome-panel Volatile LSARC/2001/348 Window Navigator Construction Kit GNOME Panel D-BUS Volatile LSARC/2006/368 D-Bus library. D-BUS Message Bus System libXext/libX11 Committed PSARC/1998/299 DPMS extension X11R6.4: Update/upgrade of X Server HAL API Volatile PSARC/2005/399 Basic HAL API Tamarack: Removable Media Enhancements libpolkit Volatile PSARC/2005/399 Check permission to suspend/hibernate Tamarack: Removable Media Enhancements Battery HAL Volatile PSARC/2006/601 Transfer ACPI battery event Battery Project CPUfreq HAL Volatile PSARC/2007/679 Supply CPU freq scaling backend CPUfreq HAL HAL suspend/hibernate,lid, Volatile TBD in PSARC soon Transfer suspend/hibernate, ACPI lid, brightness, power buttons event brightness and power buttons event 6. Resources and Schedule 6.1 Release Binding Target to a minor release of Solaris 6.2 Resources: 4.00 man month Development Engineering 1.0 man month Test Engineering 0.25 man month RE integration 0.5 man month Doc. writer 0.5 man month Program management 6.3. Consolidation C-team Name: JDS/GNOME 6.4. ARC review type: FastTrack 7. References [1] GNOME Power Mnanger homepage www.gnome.org/projects/gnome-power-manager [2] OpenSolaris laptop project http://www.opensolaris.org/os/community/laptop/ Related ARC case LSARC/2007/520 GNOME 2.20 LSARC/2001/348 GNOME Panel LSARC/2006/368 D-BUS Message Bus System PSARC/1998/299 X11R6.4: Update/upgrade of X Server PSARC/2005/399 Tamarack: Removable Media Enhancements in Solaris PSARC/2006/601 Battery Project PSARC/2007/679 CPUFreq HAL TBD in PSARC soon Suspend/hibernate, lid, brightness and power buttons HAL & driver