drm/i915: support low power watermarks on Ironlake
Subsystems (2)
PATCH 1/1 drm/i915: support low power watermarks on Ironlake
This patch actually makes the watermark code even uglier (if that's possible), but has the advantage of sharing code between SNB and ILK at least. Longer term we should refactor the watermark stuff into its own file and clean it up now that we know how it's supposed to work.
Supporting WM2 on my Vaio reduced power consumption by around 0.5W, so this patch is definitely worthwhile (though it also needs lots of test coverage).
drivers/gpu/drm/i915/i915_reg.h +5 -0
@@ -2345,8 +2345,13 @@/* Memory latency timer register */ #define MLTR_ILK 0x11222 +#define MLTR_WM1_SHIFT 0 +#define MLTR_WM2_SHIFT 8/* the unit of memory self-refresh latency time is 0.5us */ #define ILK_SRLT_MASK 0x3f +#define ILK_LATENCY (shift) (I915_READ(MLTR_ILK) >> (shift) & ILK_SRLT_MASK) +#define ILK_READ_WM1_LATENCY () ILK_LATENCY(MLTR_WM1_SHIFT) +#define ILK_READ_WM2_LATENCY () ILK_LATENCY(MLTR_WM2_SHIFT)/* define the fifo size on Ironlake */ #define ILK_DISPLAY_FIFO 128
drivers/gpu/drm/i915/intel_display.c +108 -108
275 lines not on this page · raw message
Quoted 8 lines · Jesse Barnes
This patch actually makes the watermark code even uglier (if that's possible), but has the advantage of sharing code between SNB and ILK at least. Longer term we should refactor the watermark stuff into its own file and clean it up now that we know how it's supposed to work.
Supporting WM2 on my Vaio reduced power consumption by around 0.5W, so this patch is definitely worthwhile (though it also needs lots of test coverage).
I tweaked the patch to pass the watermark structs through to the check routine. The box survives s2ram, but I have now also experienced the mysterious slow down after resuming.
Pushed to -next for wider testing,
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 3 lines · Chris Wilson
I tweaked the patch to pass the watermark structs through to the check routine. The box survives s2ram, but I have now also experienced the mysterious slow down after resuming.
As Eric first said the cause for the slow down is that writing through the GTT becomes very slow:
Before suspending:
Time to pwrite 16k through the CPU: 0.000004s
Time to read 16k through a GTT map: 0.000901s
Time to write 16k through a GTT map: 0.000023s
Time to read 16k (again) through a GTT map: 0.000900s
Time to pwrite 16k through the GTT: 0.000007s
After resume:
Time to pwrite 16k through the CPU: 0.000004s
Time to read 16k through a GTT map: 0.000900s
Time to write 16k through a GTT map: 0.000876s
Time to read 16k (again) through a GTT map: 0.000899s
Time to pwrite 16k through the GTT: 0.000431s
The implication being that our mapping goes from write-combining to uncached?
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 22 lines · On Thu, 23 Dec 2010 12:30:29 +0000 Chris Wilson <[email protected]>…
Quoted 3 lines · Chris Wilson
I tweaked the patch to pass the watermark structs through to the check routine. The box survives s2ram, but I have now also experienced the mysterious slow down after resuming.
As Eric first said the cause for the slow down is that writing through the GTT becomes very slow:
Before suspending:
Time to pwrite 16k through the CPU: 0.000004s
Time to read 16k through a GTT map: 0.000901s
Time to write 16k through a GTT map: 0.000023s
Time to read 16k (again) through a GTT map: 0.000900s
Time to pwrite 16k through the GTT: 0.000007sAfter resume:
Time to pwrite 16k through the CPU: 0.000004s
Time to read 16k through a GTT map: 0.000900s
Time to write 16k through a GTT map: 0.000876s
Time to read 16k (again) through a GTT map: 0.000899s
Time to pwrite 16k through the GTT: 0.000431s
Quoted 2 lines
The implication being that our mapping goes from write-combining to uncached?
I wonder if the PAT code is somehow failing to set up WC pages on resume?
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 2 lines · Jesse Barnes
I wonder if the PAT code is somehow failing to set up WC pages on resume?
Indeed it appears to be.
Tearing down and recreating the gtt_mapping across suspend restores the expected behaviour.
Now to understand if the x86 pagetable code is actually meant to restore those flags on resume...
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 22 lines · Chris Wilson
Quoted 3 lines · Chris Wilson
I tweaked the patch to pass the watermark structs through to the check routine. The box survives s2ram, but I have now also experienced the mysterious slow down after resuming.
As Eric first said the cause for the slow down is that writing through the GTT becomes very slow:
Before suspending:
Time to pwrite 16k through the CPU: 0.000004s
Time to read 16k through a GTT map: 0.000901s
Time to write 16k through a GTT map: 0.000023s
Time to read 16k (again) through a GTT map: 0.000900s
Time to pwrite 16k through the GTT: 0.000007sAfter resume:
Time to pwrite 16k through the CPU: 0.000004s
Time to read 16k through a GTT map: 0.000900s
Time to write 16k through a GTT map: 0.000876s
Time to read 16k (again) through a GTT map: 0.000899s
Time to pwrite 16k through the GTT: 0.000431s
Quoted 3 lines
The implication being that our mapping goes from write-combining to uncached?
-Chris
I found that the results were not just "slow like no write combining", but timing-dependent, too. Repeated runs of a timing app would get fast sometimes, slow other times, and sometimes the switch from fast->slow or slow->fast would happen in the middle of a run.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx