All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude <lyude@redhat.com>
To: igt-dev@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v5 3/5] lib/igt_debugfs: Add igt_debugfs_pipe_dir()
Date: Wed, 30 Sep 2020 13:31:48 -0400	[thread overview]
Message-ID: <20200930173150.431995-4-lyude@redhat.com> (raw)
In-Reply-To: <20200930173150.431995-1-lyude@redhat.com>

From: Lyude Paul <lyude@redhat.com>

Like igt_debugfs_connector_dir(), but for pipes instead.

Changes since v4:
* Make igt_debugfs_pipe_dir() much smaller - jcline
* Fixup docs - jcline

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 lib/igt_debugfs.c | 21 +++++++++++++++++++++
 lib/igt_debugfs.h |  1 +
 2 files changed, 22 insertions(+)

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
@@ -260,6 +260,27 @@ int igt_debugfs_connector_dir(int device, char *conn_name, int mode)
 	return ret;
 }
 
+/**
+ * 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
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 722c5cc3..d43ba6c6 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -36,6 +36,7 @@ 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 mode);
+int igt_debugfs_pipe_dir(int device, int pipe, int mode);
 
 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.26.2

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

WARNING: multiple messages have this Message-ID (diff)
From: Lyude <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: igt-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH i-g-t v5 3/5] lib/igt_debugfs: Add igt_debugfs_pipe_dir()
Date: Wed, 30 Sep 2020 13:31:48 -0400	[thread overview]
Message-ID: <20200930173150.431995-4-lyude@redhat.com> (raw)
In-Reply-To: <20200930173150.431995-1-lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

From: Lyude Paul <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Like igt_debugfs_connector_dir(), but for pipes instead.

Changes since v4:
* Make igt_debugfs_pipe_dir() much smaller - jcline
* Fixup docs - jcline

Signed-off-by: Lyude Paul <lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 lib/igt_debugfs.c | 21 +++++++++++++++++++++
 lib/igt_debugfs.h |  1 +
 2 files changed, 22 insertions(+)

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
@@ -260,6 +260,27 @@ int igt_debugfs_connector_dir(int device, char *conn_name, int mode)
 	return ret;
 }
 
+/**
+ * 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
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 722c5cc3..d43ba6c6 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -36,6 +36,7 @@ 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 mode);
+int igt_debugfs_pipe_dir(int device, int pipe, int mode);
 
 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.26.2

  parent reply	other threads:[~2020-09-30 17:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 17:31 [igt-dev] [PATCH i-g-t v5 0/5] Add nouveau-crc tests Lyude
2020-09-30 17:31 ` Lyude
2020-09-30 17:31 ` [igt-dev] [PATCH i-g-t v5 1/5] lib/igt_core: Fix igt_assert_fd() documentation Lyude
2020-09-30 17:31   ` Lyude
2020-10-01  6:49   ` [igt-dev] " Petri Latvala
2020-10-01  6:49     ` Petri Latvala
2020-09-30 17:31 ` [igt-dev] [PATCH i-g-t v5 2/5] lib/igt_core: Add igt_require_fd() Lyude
2020-09-30 17:31   ` Lyude
2020-10-01  6:50   ` [igt-dev] " Petri Latvala
2020-10-01  6:50     ` Petri Latvala
2020-09-30 17:31 ` Lyude [this message]
2020-09-30 17:31   ` [PATCH i-g-t v5 3/5] lib/igt_debugfs: Add igt_debugfs_pipe_dir() Lyude
2020-09-30 17:31 ` [igt-dev] [PATCH i-g-t v5 4/5] lib/igt_kms: Hook up connector dithering prop Lyude
2020-09-30 17:31   ` Lyude
2020-09-30 17:31 ` [igt-dev] [PATCH i-g-t v5 5/5] tests: Add nouveau-crc tests Lyude
2020-09-30 17:31   ` Lyude
2020-09-30 18:32   ` [igt-dev] " Jeremy Cline
2020-09-30 18:32     ` Jeremy Cline
2020-09-30 18:33 ` [igt-dev] [PATCH i-g-t v5 0/5] " Jeremy Cline
2020-09-30 18:33   ` Jeremy Cline
2020-09-30 19:05 ` [igt-dev] ✓ Fi.CI.BAT: success for Add nouveau-crc tests (rev5) Patchwork
2020-09-30 22:59 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200930173150.431995-4-lyude@redhat.com \
    --to=lyude@redhat.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.