diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-16 14:46:39 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-17 09:47:50 +0100 |
commit | 9a7609a8e48ac69bfd786087abd18c8a858d6ad3 (patch) | |
tree | 0fd68f8486c43a908520fd9496d3b5412951e7b8 /lib/igt_debugfs.c | |
parent | f04f17bcd404d7be720148fee6bb425cdb41dab1 (diff) |
lib/igt_debugfs: Remove debugfs from igt_debugfs_fopen
Also add a missing igt_assert to kms_fbc_crc and again add the missing
Returns: section to the api doc.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_debugfs.c')
-rw-r--r-- | lib/igt_debugfs.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index b92bd091..142c7385 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -162,18 +162,25 @@ int igt_debugfs_open(const char *filename, int mode) /** * igt_debugfs_fopen: - * @debugfs: debugfs access structure * @filename: name of the debugfs node to open * @mode: mode string as used by fopen() * * This opens a debugfs file as a libc FILE. The filename should be * relative to the drm device's root, i.e without "drm/<minor>". + * + * Returns: + * The libc FILE pointer for the debugfs file or NULL if that didn't work out. */ -FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename, +FILE *igt_debugfs_fopen(const char *filename, const char *mode) { char buf[1024]; + igt_debugfs_t *debugfs = __igt_debugfs_singleton(); + + if (!debugfs) + return NULL; + sprintf(buf, "%s/%s", debugfs->dri_path, filename); return fopen(buf, mode); } @@ -334,7 +341,7 @@ void igt_pipe_crc_check(igt_debugfs_t *debugfs) size_t written; int ret; - ctl = igt_debugfs_fopen(debugfs, "i915_display_crc_ctl", "r+"); + ctl = igt_debugfs_fopen("i915_display_crc_ctl", "r+"); igt_require_f(ctl, "No display_crc_ctl found, kernel too old\n"); written = fwrite(cmd, 1, strlen(cmd), ctl); |