]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm/i915: Expose energy counter on SNB+ through debugfs
authorJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 20 Aug 2013 09:29:23 +0000 (10:29 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 20 Aug 2013 13:16:27 +0000 (15:16 +0200)
commitb6f586d6d95725d1e316431b22884ae108c5b2f8
tree80a0c4a413b1d5b38601f4f2cc3f75bc12354c48
parentd856358e6488a4b36068581834896ca924840b2e
drm/i915: Expose energy counter on SNB+ through debugfs

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@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@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@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_reg.h