summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-23 15:59:06 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-23 16:00:16 +0100
commitb22e90bc8b9c7fe27556558c31f00e35e689a12e (patch)
treeab3844b5012a310fe4a4c6bfedcc17f564438489 /overlay
parent9574cb1a3de0dfe45c59420e2cb9a74fc23baecc (diff)
overlay: Distinguish the root debugfs path and our dri node
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay')
-rw-r--r--overlay/debugfs.c13
-rw-r--r--overlay/debugfs.h2
-rw-r--r--overlay/gem-objects.c4
-rw-r--r--overlay/gpu-freq.c4
-rw-r--r--overlay/power.c2
5 files changed, 15 insertions, 10 deletions
diff --git a/overlay/debugfs.c b/overlay/debugfs.c
index ccce2279..9f3e5ccb 100644
--- a/overlay/debugfs.c
+++ b/overlay/debugfs.c
@@ -26,10 +26,12 @@
#include <sys/mount.h>
#include <errno.h>
#include <stdio.h>
+#include <string.h>
#include "debugfs.h"
char debugfs_path[128];
+char debugfs_dri_path[128];
int debugfs_init(void)
{
@@ -52,15 +54,16 @@ int debugfs_init(void)
return errno;
find_minor:
+ strcpy(debugfs_path, path);
for (n = 0; n < 16; n++) {
- int len = sprintf(debugfs_path, "%s/dri/%d", path, n);
- sprintf(debugfs_path + len, "/i915_error_state");
- if (stat(debugfs_path, &st) == 0) {
- debugfs_path[len] = '\0';
+ int len = sprintf(debugfs_dri_path, "%s/dri/%d", path, n);
+ sprintf(debugfs_dri_path + len, "/i915_error_state");
+ if (stat(debugfs_dri_path, &st) == 0) {
+ debugfs_dri_path[len] = '\0';
return 0;
}
}
- debugfs_path[0] = '\0';
+ debugfs_dri_path[0] = '\0';
return ENOENT;
}
diff --git a/overlay/debugfs.h b/overlay/debugfs.h
index 0e5ad95d..8a1c60a5 100644
--- a/overlay/debugfs.h
+++ b/overlay/debugfs.h
@@ -26,6 +26,8 @@
#define DEBUGFS_H
extern char debugfs_path[128];
+extern char debugfs_dri_path[128];
+
int debugfs_init(void);
#endif /* DEBUGFS_H */
diff --git a/overlay/gem-objects.c b/overlay/gem-objects.c
index 14427a73..8c8ae21b 100644
--- a/overlay/gem-objects.c
+++ b/overlay/gem-objects.c
@@ -53,7 +53,7 @@ int gem_objects_init(struct gem_objects *obj)
memset(obj, 0, sizeof(*obj));
- sprintf(buf, "%s/i915_gem_objects", debugfs_path);
+ sprintf(buf, "%s/i915_gem_objects", debugfs_dri_path);
fd = open(buf, 0);
if (fd < 0)
return errno;
@@ -99,7 +99,7 @@ int gem_objects_update(struct gem_objects *obj)
freed = obj->comm;
obj->comm = NULL;
- sprintf(buf, "%s/i915_gem_objects", debugfs_path);
+ sprintf(buf, "%s/i915_gem_objects", debugfs_dri_path);
fd = open(buf, 0);
if (fd < 0) {
ret = errno;
diff --git a/overlay/gpu-freq.c b/overlay/gpu-freq.c
index b34f66f2..0a400be6 100644
--- a/overlay/gpu-freq.c
+++ b/overlay/gpu-freq.c
@@ -38,7 +38,7 @@ int gpu_freq_init(struct gpu_freq *gf)
memset(gf, 0, sizeof(*gf));
- sprintf(buf, "%s/i915_cur_delayinfo", debugfs_path);
+ sprintf(buf, "%s/i915_cur_delayinfo", debugfs_dri_path);
fd = open(buf, 0);
if (fd < 0)
return gf->error = errno;
@@ -85,7 +85,7 @@ int gpu_freq_update(struct gpu_freq *gf)
if (gf->error)
return gf->error;
- sprintf(buf, "%s/i915_cur_delayinfo", debugfs_path);
+ sprintf(buf, "%s/i915_cur_delayinfo", debugfs_dri_path);
fd = open(buf, 0);
if (fd < 0)
return gf->error = errno;
diff --git a/overlay/power.c b/overlay/power.c
index e69b1a19..62aba8b5 100644
--- a/overlay/power.c
+++ b/overlay/power.c
@@ -42,7 +42,7 @@ int power_init(struct power *power)
memset(power, 0, sizeof(*power));
- sprintf(buf, "%s/i915_energy_uJ", debugfs_path);
+ sprintf(buf, "%s/i915_energy_uJ", debugfs_dri_path);
fd = open(buf, 0);
if (fd < 0)
return power->error = errno;