]> git.baikalelectronics.ru Git - kernel.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>
Fri, 23 Aug 2013 12:52:25 +0000 (14:52 +0200)
commit7b85dfe36a258fe67cd08a1dcb324e9b735c5563
treebd157fb038274acf22d08daae0f236b645285788
parent9f36f74564b9b09b7942c428fe7c090e2a631d39
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