• J
    drm/i915: Expose energy counter on SNB+ through debugfs · ec013e7f
    Jesse Barnes 提交于
    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: NJesse 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: NBen 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: NChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
    ec013e7f
i915_reg.h 189.9 KB