All of lore.kernel.org
 help / color / mirror / Atom feed
From: marius.c.vlad@intel.com
To: marius.vlad0@gmail.com, intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] overlay/intel-gpu-overlay Fix power consumption not being displayed
Date: Wed, 18 Nov 2015 14:39:09 +0200	[thread overview]
Message-ID: <1447850349-7842-1-git-send-email-marius.c.vlad@intel.com> (raw)

From: Marius Vlad <marius.c.vlad@intel.com>

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@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)
 		return 0;
 
 	sprintf(buf, "%s/i915_energy_uJ", debugfs_dri_path);
@@ -121,7 +121,7 @@ int power_update(struct power *power)
 	if (power->error)
 		return power->error;
 
-	if (power->fd != -1) {
+	if (power->fd != -ENOENT) {
 		uint64_t data[2];
 		int len;
 
-- 
2.6.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2015-11-18 12:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 12:39 marius.c.vlad [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-11-18 12:43 [PATCH i-g-t] overlay/intel-gpu-overlay Fix power consumption not being displayed marius.c.vlad
2015-11-18 12:36 Marius Vlad
2015-11-18 12:44 ` Chris Wilson
2015-11-18 12:50   ` Vlad, Marius C
2015-11-18 12:55     ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447850349-7842-1-git-send-email-marius.c.vlad@intel.com \
    --to=marius.c.vlad@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=marius.vlad0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.