diff options
Diffstat (limited to 'lib/igt_debugfs.c')
-rw-r--r-- | lib/igt_debugfs.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 05067078..c4dab392 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -261,6 +261,27 @@ int igt_debugfs_connector_dir(int device, char *conn_name, int mode) } /** + * igt_debugfs_pipe_dir: + * @device: fd of the device + * @pipe: index of pipe + * @mode: mode bits as used by open() + * + * This opens the debugfs directory corresponding to the pipe index on the + * device for use with igt_sysfs_get() and related functions. This is just + * syntax sugar for igt_debugfs_open(). + * + * Returns: + * The directory fd, or -1 on failure. + */ +int igt_debugfs_pipe_dir(int device, int pipe, int mode) +{ + char buf[128]; + + snprintf(buf, sizeof(buf), "crtc-%d", pipe); + return igt_debugfs_open(device, buf, mode); +} + +/** * igt_debugfs_open: * @filename: name of the debugfs node to open * @mode: mode bits as used by open() |