mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
overlay: Fix power reading from debugfs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
b22e90bc8b
commit
1b6480114e
@ -53,6 +53,10 @@ int power_init(struct power *power)
|
|||||||
if (len < 0)
|
if (len < 0)
|
||||||
return power->error = errno;
|
return power->error = errno;
|
||||||
|
|
||||||
|
buf[len] = '\0';
|
||||||
|
if (strtoull(buf, 0, 0) == 0)
|
||||||
|
return power->error = EINVAL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +65,7 @@ static uint64_t file_to_u64(const char *name)
|
|||||||
char buf[4096];
|
char buf[4096];
|
||||||
int fd, len;
|
int fd, len;
|
||||||
|
|
||||||
sprintf(buf, "%s/i915_energy_uJ", name);
|
sprintf(buf, "%s/%s", debugfs_dri_path, name);
|
||||||
fd = open(buf, 0);
|
fd = open(buf, 0);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user