Hi,
Here's a patch to hardware-manager that allows setting who has control
of the video output -- the CPU's graphics hardware, or the DCON's
internal framebuffer.
The motivation for doing this is so that we can modify Read.activity
to do power-saving when it isn't rendering an update. We can start
by setting the source to DCON each time it finishes rendering, and
then setting back to CPU after the next render. We'll turn the CPU
off all the way after a longer period of idleness, too.
Thanks,
- Chris.
diff --git a/hardwaremanager.py b/hardwaremanager.py
index e04f9de..4c97174 100755
--- a/hardwaremanager.py
+++ b/hardwaremanager.py
@@ -33,14 +33,31 @@ HARDWARE_MANAGER_OBJECT_PATH = '/org/laptop/HardwareManager'
COLOR_MODE = 0
BLACK_AND_WHITE_MODE = 1
+DCON_IS_SOURCE = 0
+CPU_IS_SOURCE = 1
_KEYBOARD_BRIGHTNESS_KEY = '/sys/class/leds/olpc:keyboard/brightness'
_DISPLAY_BRIGHTNESS_KEY = '/sys/class/backlight/dcon-bl/brightness'
_DISPLAY_MODE_KEY = '/sys/devices/platform/dcon/output'
+_DCON_SOURCE_KEY = '/sys/devices/platform/dcon/source'
class HardwareManagerService(dbus.service.Object):
@dbus.service.method(HARDWARE_MANAGER_INTERFACE,
in_signature='i', out_signature='')
+ def set_dcon_source(self, source):
+ if source != DCON_IS_SOURCE and source != CPU_IS_SOURCE:
+ logging.error('Invalid DCON source %d' % source)
+ return
+
+ try:
+ f = open(_DCON_SOURCE_KEY, 'w')
+ f.write(str(source))
+ f.close()
+ except IOError:
+ logging.error('Cannot write DCON source to sysfs.')
+
+ @dbus.service.method(HARDWARE_MANAGER_INTERFACE,
+ in_signature='i', out_signature='')
def set_display_mode(self, mode):
if mode != COLOR_MODE and mode != BLACK_AND_WHITE_MODE:
logging.error('Invalid mode %d' % mode)
--
Chris Ball <[EMAIL PROTECTED]>
_______________________________________________
Sugar mailing list
[email protected]
http://mailman.laptop.org/mailman/listinfo/sugar