summaryrefslogtreecommitdiff
path: root/lib/drmtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r--lib/drmtest.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index e55f63a..8518bde 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -916,3 +916,16 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
fflush(stdout);
}
+int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id)
+{
+ struct drm_i915_get_pipe_from_crtc_id pfci;
+ int ret;
+
+ memset(&pfci, 0, sizeof(pfci));
+ pfci.crtc_id = crtc_id;
+ ret = drmIoctl(fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, &pfci);
+ assert(ret == 0);
+
+ return pfci.pipe;
+}
+