public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v4 1/2] lib/debugfs: connector debugfs director
@ 2018-10-22 14:23 Ramalingam C
  2018-10-22 14:23 ` [igt-dev] [PATCH i-g-t v4 2/2] kms_content_protection: Add Content Protection test Ramalingam C
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ramalingam C @ 2018-10-22 14:23 UTC (permalink / raw)
  To: igt-dev, daniel.vetter

Function to open a debugfs director of a connector associated to
a device.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 lib/igt_debugfs.c | 24 ++++++++++++++++++++++++
 lib/igt_debugfs.h |  1 +
 2 files changed, 25 insertions(+)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index baedc2255ac9..f545e8a3eec9 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -237,6 +237,30 @@ int igt_debugfs_dir(int device)
 }
 
 /**
+ * igt_debugfs_connector_dir:
+ * @device: fd of the device
+ * @conn_name: conenctor name
+ *
+ * This opens the debugfs directory corresponding to connector on the device
+ * for use with igt_sysfs_get() and related functions.
+ *
+ * Returns:
+ * The directory fd, or -1 on failure.
+ */
+int igt_debugfs_connector_dir(int device, char *conn_name)
+{
+	char path[200], base_path[200];
+
+	if (!igt_debugfs_path(device, base_path, sizeof(base_path)))
+		return -1;
+
+	snprintf(path, sizeof(path), "%s/%s", base_path, conn_name);
+
+	igt_debug("Opening debugfs connector directory '%s'\n", path);
+	return open(path, O_RDONLY);
+}
+
+/**
  * igt_debugfs_open:
  * @filename: name of the debugfs node to open
  * @mode: mode bits as used by open()
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index ff8612dc66c2..4c2f992732cf 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -35,6 +35,7 @@ const char *igt_debugfs_mount(void);
 char *igt_debugfs_path(int device, char *path, int pathlen);
 
 int igt_debugfs_dir(int device);
+int igt_debugfs_connector_dir(int device, char *conn_name);
 
 int igt_debugfs_open(int fd, const char *filename, int mode);
 void __igt_debugfs_read(int fd, const char *filename, char *buf, int size);
-- 
2.7.4

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-22 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-22 14:23 [igt-dev] [PATCH i-g-t v4 1/2] lib/debugfs: connector debugfs director Ramalingam C
2018-10-22 14:23 ` [igt-dev] [PATCH i-g-t v4 2/2] kms_content_protection: Add Content Protection test Ramalingam C
2018-10-22 14:56   ` Daniel Vetter
2018-10-22 14:58 ` [igt-dev] [PATCH i-g-t v4 1/2] lib/debugfs: connector debugfs director Chris Wilson
2018-10-22 16:32   ` C, Ramalingam
2018-10-22 21:07 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v4,1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox