[PATCH i-g-t 2/3] lib/igt_kms: Add support to check joiner mode limit

Jeevan B jeevan.b at intel.com
Tue Feb 4 18:27:33 UTC 2025


Added library changes to find the non-joiner mode by selecting
the top threshold mode for joiner mode. This helps in determining
the maximum resolution or clock frequency that does not require a
big joiner configuration.

Signed-off-by: Jeevan B <jeevan.b at intel.com>
---
 lib/igt_kms.c | 35 +++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  2 ++
 2 files changed, 37 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d4980d2ac..3c73f57fc 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6406,6 +6406,41 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * non_joiner_mode_found:
+ * @drm_fd: drm file descriptor
+ * @connector: libdrm connector
+ * @max_dot_clock: max dot clock frequency
+ * @mode: libdrm mode to be filled
+ *
+ * Non-Joiner will come in to the picture when the
+ * resolution > 5K/6K or clock < max-dot-clock.
+ *
+ * Returns: True if big joiner found in connector modes
+ */
+bool non_joiner_mode_found(int drm_fd, drmModeConnector *connector,
+			   int max_dotclock, drmModeModeInfo *mode)
+{
+	bool found = false;
+	int max_hdisplay, dev_id;
+
+	dev_id = intel_get_drm_devid(drm_fd);
+	max_hdisplay = (intel_display_ver(dev_id) >= 30) ? HDISPLAY_6K_PER_PIPE :
+			HDISPLAY_5K_PER_PIPE;
+
+	for (int i = 0; i < connector->count_modes; i++) {
+		drmModeModeInfo *current_mode = &connector->modes[i];
+
+		if ((current_mode->hdisplay == max_hdisplay &&
+		    current_mode->vrefresh == 30) || current_mode->clock < max_dotclock) {
+			*mode = connector->modes[i];
+			found = true;
+			break;
+		}
+	}
+	return found;
+}
+
 /**
  * igt_is_joiner_enabled:
  * @drmfd: A drm file descriptor
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 7df53ec9c..069444667 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1250,6 +1250,8 @@ bool igt_ultrajoiner_possible(drmModeModeInfo *mode, int max_dotclock);
 bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
 			  int max_dotclock, drmModeModeInfo *mode);
 bool igt_has_force_joiner_debugfs(int drmfd, char *conn_name);
+bool non_joiner_mode_found(int drm_fd, drmModeConnector *connector,
+			   int max_dotclock, drmModeModeInfo *mode);
 bool is_joiner_mode(int drm_fd, igt_output_t *output);
 bool igt_check_force_joiner_status(int drmfd, char *connector_name);
 bool igt_check_bigjoiner_support(igt_display_t *display);
-- 
2.25.1



More information about the igt-dev mailing list