Matthew Garrett ([info]mjg59) wrote,
@ 2008-06-24 12:56:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:advogato, fedora

Intel power saving
It's sometimes surprising where power goes in a laptop. One of the things busily consuming power is the digital link between the graphics hardware and the TFT, which is busily updating your screen 50 or 60 times a second. That's kind of unfortunate, because most of the time nothing's actually changed. Unlike CRTs, TFTs don't have the same requirement for rapid updates to maintain an image - reducing the vertical refresh rate (within reason) won't result in any reduction in image quality. What it will do is result in jerky movement and blurring, though, so doing this by default is a problem.

The obvious way to handle this would be to downclock the display when it's idle and upclock it again when it's active. Doing so gives the benefit of reduced power consumption when not much is going on (most of the time) and not impairing image quality. Programming clocks takes a noticable amount of time, and doing it while they're controlling the display results in nasty screen flicker. Thankfully, Intel hardware has two sets of clocks per output. One can be programmed at high frequency, and the other at low frequency. On pre-965 chipsets, we can then simply flick between them whenever the screen becomes idle or active - the clocks are already set up and the hardware waits for the next vblank before actually performing the switch, so there's no blurring or flicker. 965 theoretically does all of this in hardware, but I haven't actually tested that yet. In principle the patch sets it up, but...

The savings seem to be on the order of 0.5W or so, though that'll probably depend on your screen resolution. Patch against current git is here, and a precompiled version of the driver for 32-bit is here. The most likely problem is screen flicker when idle, so if anyone sees that then let me know and we'll see if it can be tuned.




(Post a new comment)

thankyou
[info]enervation.myopenid.com
2008-06-24 01:29 pm UTC (link)
I have neither the expertise nor the spare hardware to test this, but I just wanted to say thankyou. Battery life is very important to me and stuff like this is brilliant!

(Reply to this) (Thread)

Re: thankyou
(Anonymous)
2008-06-24 01:43 pm UTC (link)
Me too. Know that the effort is very much appreciated! :) I have an i965 and on this laptop, Vista, before I blasted it to kingdom come, had almost an hour more battery life than (insert choice of Linux Desktop here). Anything helps! :)

(Reply to this) (Parent)

(Reply from suspended user)
How do you measure power consumption?
(Anonymous)
2008-06-24 03:12 pm UTC (link)
Is there an ACPI interface that exports some information about current power consumption?

I was looking for this some time ago, but I still don't know how people can tell :-)

(Reply to this) (Thread)

Re: How do you measure power consumption?
[info]mjg59
2008-06-24 03:13 pm UTC (link)
On laptops, /proc/acpi/battery/*/state will give you a reading. Accuracy may vary.

(Reply to this) (Parent)

(Reply from suspended user)

(Reply from suspended user)
It does what it says on the tin....
(Anonymous)
2008-06-24 05:49 pm UTC (link)
pre-patch: 14.3-14.5 W (~23-24 wps)
post-patch 13.9-14.0W (~23-24 wps)

Toshiba R500 (945GM or similar), HD, backlight at max, with WiFi active and UHCI loaded, running twm.

I see a "kind of" flicker when moving the mouse cursor over areas where the cursor changes shape. A bit hard to describe, but it is as if the entire framebuffer jumps a bit. Yes, it is a bit annoying... :-)
But the patch saves power, that's for sure.

Dag B

(Reply to this) (Thread)

Re: It does what it says on the tin....
(Anonymous)
2008-06-24 07:10 pm UTC (link)
For the benefit of people reading this at a later time. The "jumps" were eliminated, at the cost of some powersaving. A modified patch saves me .3W.

(Reply to this) (Parent)

(Reply from suspended user)

(Reply from suspended user)

[info]lionsphil
2008-06-24 09:42 pm UTC (link)
Are these the same shenanigans Windows pulls that you talked about in your LUG Radio talk?

(Reply to this) (Thread)


[info]mjg59
2008-06-24 09:44 pm UTC (link)
Yup, they are.

(Reply to this) (Parent)

(Reply from suspended user)
Thinkpad X300
[info]shenki [myopenid.com]
2008-06-26 12:40 pm UTC (link)
I tried the patch on my 965GM system but I'm not sure it changed anything.

On the first go, it appeared to save 200mW (stock: 8.1W, patched: 7.9W). But then I switched back to the 'stock' driver (2:2.3.2-1ubuntu2) and this was now idling at 7.9W (instead of 8.1W).

*shrug*

(Reply to this)

Screen flicker
(Anonymous)
2008-09-26 11:55 pm UTC (link)
Hi Matthew,

I just stumbled across your patch, and applied it to the Intrepid intel driver. Unfortunately, I get quite nasty flickering. Looks like a low Hz refresh when idle, but if I move the mouse quickly, I get more dramatic flickering.

If you're still in Cambridge, I could probably put you in front of the HW if that helps.

Laptop: HP nc6320
Chipset: 945GM
Screen : 1400x1050 (LG Philips LP150E06 (A3)(K2))

I only know the make / model because I pulled the damned thing out yesterday to try and fix the intermittent missing / flickery left-hand-side of the screen. No luck there though, its still intermittent, and I couldn't identify where (if anywhere) the tab-bonding / panel driver silicon / driver-board can be poked to fix it.

Unfortunately I think the screen flickering with this patch is real, not some artifact of my dying screen.

(Reply to this) (Thread)

Re: Screen flicker
(Anonymous)
2008-09-26 11:57 pm UTC (link)
(pcjc2@...)

(Reply to this) (Parent)

saves power but proves unstable
[info]bmidgley
2008-11-04 05:01 pm UTC (link)
Matthew, according to powertop, this change saves me maybe 400mW... not bad... my total was around 8.2W with the display dimmed and wifi off.

However, I started getting really freaky behavior. Powertop locked up completely and then I couldn't sudo su in any other shells. It happened again after a fresh reboot. Everything is back to normal after restoring the original intel_drv.o.

I used your prebuilt binary on an eeepc 1000 with ubuntu 8.10 + the 2.6.27-7-eeepc kernel.

(Reply to this)

Works Perfectly
(Anonymous)
2008-12-07 07:18 pm UTC (link)
Works fine on the Acer Aspire one, .3 watts less power consumption. There is just a little flickering if I try and scrutinize the screen for it. I used your patch against xf86-video-intel version 2.4.3 and xserver 1.5.3

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…