summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-06-12 11:03:22 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-06-14 10:11:32 +0200
commit0b8933d09978d2845744b1e70bc69acaaeb21f3c (patch)
tree3d74fd1170e5788f896fc81d5b6cc879152e211e /lib/igt_kms.c
parentef48fc8233872545243e9a41df498fceedece978 (diff)
lib/igt_kms: Add igt_display_require_output(/on_pipe)
Most KMS users open code this. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5e2ef97b..2d775106 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1845,6 +1845,30 @@ int igt_display_get_n_pipes(igt_display_t *display)
return display->n_pipes;
}
+void igt_display_require_output(igt_display_t *display)
+{
+ enum pipe pipe;
+ igt_output_t *output;
+
+ for_each_pipe_with_valid_output(display, pipe, output)
+ return;
+
+ igt_skip("No valid crtc/connector combinations found.\n");
+}
+
+void igt_display_require_output_on_pipe(igt_display_t *display, enum pipe pipe)
+{
+ igt_output_t *output;
+
+ igt_skip_on_f(igt_display_get_n_pipes(display) < pipe,
+ "Pipe %s does not exist.\n", kmstest_pipe_name(pipe));
+
+ for_each_valid_output_on_pipe(display, pipe, output)
+ return;
+
+ igt_skip("No valid connector found on pipe %s\n", kmstest_pipe_name(pipe));
+}
+
/**
* igt_output_from_connector:
* @display: a pointer to an #igt_display_t structure