[PATCH i-g-t] overlay/intel-gpu-overlay Fix power consumption not being displayed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marius Vlad <marius.c.vlad@xxxxxxxxx>

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@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux