[PATCH i-g-t v4 2/2] lib/igt_kms: Add igt_is_joiner_mode

Santhosh Reddy Guddati santhosh.reddy.guddati at intel.com
Tue Nov 19 05:11:42 UTC 2024


Add function igt_is_joiner_mode` to verify if the display is in
big joiner or ultra joiner mode.

Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
---
 lib/igt_kms.c | 29 +++++++++++++++++++++++++++++
 lib/igt_kms.h |  2 +-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 76f32e1e0..de8dca163 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6441,6 +6441,35 @@ bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * igt_is_joiner_mode
+ * @display: a pointer to an #igt_display_t structure
+ *
+ * Check if the display is in joiner mode.
+ *
+ * Returns: True if the display is in joiner mode, else False.
+ */
+bool igt_is_joiner_mode(igt_display_t *display, igt_output_t *output)
+{
+	bool is_joiner = false;
+	bool is_ultra_joiner = false;
+	int max_dotclock;
+	drmModeModeInfo mode;
+
+	max_dotclock = igt_get_max_dotclock(display->drm_fd);
+	is_joiner = bigjoiner_mode_found(display->drm_fd,
+					 output->config.connector,
+					 max_dotclock, &mode);
+	is_ultra_joiner = ultrajoiner_mode_found(display->drm_fd,
+						 output->config.connector,
+						 max_dotclock, &mode);
+
+	if (is_joiner || is_ultra_joiner)
+		return true;
+
+	return false;
+}
+
 /**
  * igt_has_force_joiner_debugfs
  * @drmfd: A drm file descriptor
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 301f370df..c94dc0612 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1268,5 +1268,5 @@ int igt_get_dp_pending_retrain(int drm_fd, igt_output_t *output);
 void igt_reset_link_params(int drm_fd, igt_output_t *output);
 int igt_backlight_read(int *result, const char *fname, igt_backlight_context_t *context);
 int igt_backlight_write(int value, const char *fname, igt_backlight_context_t *context);
-
+bool igt_is_joiner_mode(igt_display_t *display, igt_output_t *output);
 #endif /* __IGT_KMS_H__ */
-- 
2.34.1



More information about the igt-dev mailing list