[igt-dev] [i-g-t 01/51] lib/igt_kms: Add a helper for igt test constraint

Bhanuprakash Modem bhanuprakash.modem at intel.com
Sun Aug 14 18:08:18 UTC 2022


This patch will create a helper with super set of all test constraints.

Example:
* Pipe-D can't support mode > 5K
* To use 8K mode on a pipe then consecutive pipe must be available & free.
* MSO is supported only on PIPE_A/PIPE_B.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 lib/igt_kms.c | 22 ++++++++++++++++++++++
 lib/igt_kms.h |  1 +
 2 files changed, 23 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 1ba3bd2a..e1a65244 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -5803,3 +5803,25 @@ bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode)
 
 	return true;
 }
+
+/*
+ * igt_test_constraint:
+ * @display: a pointer to an #igt_display_t structure
+ *
+ * Get all active pipes from connected outputs (i.e. pending_pipe != PIPE_NONE)
+ * and check those pipes supports the selected mode(s).
+ *
+ * This is a super set of all test constraints.
+ *
+ * Example:
+ *  * Pipe-D can't support mode > 5K
+ *  * To use 8K mode on a pipe then consecutive pipe must be free.
+ *  * MSO is supported only on PIPE_A/PIPE_B.
+ *
+ * Returns: true if a valid crtc/connector mode combo found, else false
+ */
+bool igt_test_constraint(igt_display_t *display)
+{
+	/* TODO: Add all possible test constraints here. */
+	return igt_check_bigjoiner_support(display);
+}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index a2cf0937..82186cfe 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -975,5 +975,6 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
 		igt_output_t *output, int bpc);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
+bool igt_test_constraint(igt_display_t *display);
 
 #endif /* __IGT_KMS_H__ */
-- 
2.35.1



More information about the igt-dev mailing list