[Intel-gfx] [PATCH i-g-t] overlay/intel-gpu-overlay Fix power consumption not being displayed
Chris Wilson
chris at chris-wilson.co.uk
Wed Nov 18 04:44:44 PST 2015
On Wed, Nov 18, 2015 at 02:36:22PM +0200, Marius Vlad wrote:
> The power metter was not showing up due to a check over I915_PERF_ENERGY.
> ENOENT is returned when I915_PERF_ENERGY is not available, and we use
> that for relaying on debugfs i915_energy_uJ.
>
> Signed-off-by: Marius Vlad <marius.c.vlad at intel.com>
> ---
> overlay/power.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/overlay/power.c b/overlay/power.c
> index 6c5c374..6873e7f 100644
> --- a/overlay/power.c
> +++ b/overlay/power.c
> @@ -60,7 +60,7 @@ int power_init(struct power *power)
> memset(power, 0, sizeof(*power));
>
> power->fd = perf_open();
> - if (power->fd != -1)
> + if (power->fd != -ENOENT)
Nope. The bug is
diff --git a/overlay/power.c b/overlay/power.c
index 6c5c374..2f1521b 100644
--- a/overlay/power.c
+++ b/overlay/power.c
@@ -45,7 +45,7 @@ static int perf_open(void)
attr.type = i915_type_id();
if (attr.type == 0)
- return -ENOENT;
+ return -1;
attr.config = I915_PERF_ENERGY;
attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED;
and the more pressing concern is that we still don't have support for the
more accurate tracking from the kernel.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list