[Intel-gfx] [PATCH] drm/i915: Expose energy counter on SNB+ through debugfs

Daniel Vetter daniel at ffwll.ch
Tue Aug 20 15:16:58 CEST 2013


On Tue, Aug 20, 2013 at 10:29:23AM +0100, Chris Wilson wrote:
> From: Jesse Barnes <jbarnes at virtuousgeek.org>
> 
> On SNB and IVB, there's an MSR (also exposed through MCHBAR) we can use
> to read out the amount of energy used over time.  Expose this in sysfs
> to make it easy to do power comparisons with different configurations.
> 
> If the platform supports it, the file will show up under the
> drm/card0/power subdirectory of the PCI device in sysfs as gt_energy_uJ.
> The value in the file is a running total of energy (in microjoules)
> consumed by the graphics device.
> 
> v2: move to sysfs (Ben, Daniel)
>     expose a simple value (Chris)
>     drop unrelated hunk (Ben)
> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> 
> v3: by Ben
> Tied it into existing rc6  sysfs entries and named that a more generic
> "power attrs." Fixed rebase conflicts.
> 
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> 
> v4: Since RAPL is a real driver that already exists to serve power
> monitoring, place our entry in debugfs. This gives me a fallback
> location for systems that do not expose it otherwise.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

Yeah, makes sense to keep this handy for our own tooling. Queued for
-next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list