public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Pranay Samala <pranay.samala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, sameer.lattannavar@intel.com,
	pranay.samala@intel.com,
	Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
Subject: [PATCH i-g-t v2 1/2] lib/igt_kms: Add helper to get non-joiner mode
Date: Wed,  4 Mar 2026 13:47:45 +0530	[thread overview]
Message-ID: <20260304081746.2083480-2-pranay.samala@intel.com> (raw)
In-Reply-To: <20260304081746.2083480-1-pranay.samala@intel.com>

Add igt_get_non_joiner_mode() helper function to find a suitable
display mode from an output that does not require Big Joiner or
Ultra Joiner support. This is useful for tests that want to avoid
joiner modes and use a single pipe configuration.

The function returns a pointer to the mode if found, or NULL if
all modes require joiner support.

v2:
- Rebase

Signed-off-by: Pranay Samala <pranay.samala@intel.com>
Reviewed-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
---
 lib/igt_kms.c | 31 +++++++++++++++++++++++++++++++
 lib/igt_kms.h |  1 +
 2 files changed, 32 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 6087de365..e4a7e1ffa 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6994,6 +6994,37 @@ bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
 	return found;
 }
 
+/**
+ * igt_get_non_joiner_mode:
+ * @drm_fd: drm file descriptor
+ * @output: pointer to the output structure
+ *
+ * Finds the display mode from the output that does not require
+ * Big Joiner or Ultra Joiner.
+ *
+ * Returns: Pointer to non-joiner mode, or NULL if not found.
+ */
+drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output)
+{
+	drmModeConnector *connector;
+	int max_dotclock;
+
+	connector = output->config.connector;
+	max_dotclock = igt_get_max_dotclock(drm_fd);
+
+	for (int i = 0; i < connector->count_modes; i++) {
+		drmModeModeInfo *current_mode = &connector->modes[i];
+
+		/* Check if mode requires joiner */
+		if (!igt_bigjoiner_possible(drm_fd, current_mode, max_dotclock) &&
+		    !igt_ultrajoiner_possible(drm_fd, current_mode, max_dotclock)) {
+			return current_mode;
+		}
+	}
+
+	return NULL;
+}
+
 /**
  * is_joiner_mode:
  * @drm_fd: drm file descriptor
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 1e1f3ead5..f39042cd5 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1262,6 +1262,7 @@ bool igt_ultrajoiner_possible(int drmfd, 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);
+drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output);
 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.34.1


  reply	other threads:[~2026-03-04  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  8:17 [PATCH i-g-t v2 0/2] Add helper to select non-joiner mode Pranay Samala
2026-03-04  8:17 ` Pranay Samala [this message]
2026-03-04  8:17 ` [PATCH i-g-t v2 2/2] tests/intel/kms_sharpness_filter: Detect and bypass joiner modes Pranay Samala
2026-03-09  8:51   ` Reddy Guddati, Santhosh
2026-03-04 10:45 ` ✓ i915.CI.BAT: success for Add helper to select non-joiner mode (rev2) Patchwork
2026-03-04 11:22 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-05  6:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-05 12:05 ` ✓ i915.CI.Full: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260304081746.2083480-2-pranay.samala@intel.com \
    --to=pranay.samala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=sameer.lattannavar@intel.com \
    --cc=santhosh.reddy.guddati@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox