This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9195 - LCD disable for sansa c200
Attached to Project:
Rockbox
Opened by Bertrik Sikken (bertrik) - Tuesday, 15 July 2008, 20:37 GMT+2
Last edited by Bertrik Sikken (bertrik) - Tuesday, 05 August 2008, 22:19 GMT+2
Opened by Bertrik Sikken (bertrik) - Tuesday, 15 July 2008, 20:37 GMT+2
Last edited by Bertrik Sikken (bertrik) - Tuesday, 05 August 2008, 22:19 GMT+2
|
DetailsAttached patch adds LCD enable/disable support for the sansa c200.
The sansa c200 has a display that is not readable when the backlight is off, so it makes sense to turn off the display and put the display controller in standby to save a little more power when the backlight is turned off. The actual amount of power saved by this patch has not been measured yet. |
This task depends upon
Closed by Bertrik Sikken (bertrik)
Tuesday, 05 August 2008, 22:19 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as r18198
Tuesday, 05 August 2008, 22:19 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as r18198
I'll have a look how it behaves now with mpegplayer.
The patch could use a little more sophistication, like not updating the display if it is disabled anyway. This may save some additional power, since the c200 display is updated through a slow LCD bridge requiring busy-waits that burn cpu cycles.
I wonder if we can/should implement the lcd_sleep functions too.
As far as I understand the datasheet, turning the display off does just that, keeping the image contents. I'm not so sure if they are retained when going into standby.
Basically for external GRAM type displays it goes like so:
if (enable) {
... turn hardware ON ...
lcd_enabled = true; /* Unblock display updates before trying to perform them */
lcd_update(); /* Sync interal GRAM */
lcd_call_enable_hook(); /* Let whoever cares know - they can update items drawn with performance functions */
} else {
lcd_enabled = false; /* Block display updates before hardware is turned off */
... turn hardware OFF ...
}
I tried to implement something like that (i.e. not updating the display when the display is off and forcing an update when the display comes back on), see attached patch.
It works fine for the menus and the WPS. When playing a video with the mpeg plugin, the display seems to get corrupted after turning the display on and off a few times (I use the hold switch for this, with display off on hold). When it goes wrong I usually just see a blank screen, but I've also seen a rather 'stripey' screen and a screen where only on the left side some text would be visible.
I still don't know for sure why the second patch fails with mpegplayer, but I'm guessing it has something to do with concurrent access to the display between the main cpu and the cop (mpegplayer explicitly uses the cop, right?)
I'm inclined to commit the first simple patch and perhaps later refine it with the callback.