Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, Jeevan B <jeevan.b@intel.com>
Subject: [PATCH i-g-t 2/3] lib/igt_kms: Add support to check joiner mode limit
Date: Tue,  4 Feb 2025 23:57:33 +0530	[thread overview]
Message-ID: <20250204182734.793645-3-jeevan.b@intel.com> (raw)
In-Reply-To: <20250204182734.793645-1-jeevan.b@intel.com>

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@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


  parent reply	other threads:[~2025-02-04 18:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 18:27 [PATCH i-g-t 0/3] tests/intel/kms_joiner: Add a new test to validate non-joiner mode Jeevan B
2025-02-04 18:27 ` [PATCH i-g-t 1/3] lib/igt_kms: Add lib changes to check joiner is enabled Jeevan B
2025-02-07  5:51   ` Karthik B S
2025-02-04 18:27 ` Jeevan B [this message]
2025-02-07  8:22   ` [PATCH i-g-t 2/3] lib/igt_kms: Add support to check joiner mode limit Karthik B S
2025-02-04 18:27 ` [PATCH i-g-t 3/3] tests/intel/kms_joiner: Add a new test to validate non-joiner mode Jeevan B
2025-02-07  8:25   ` Karthik B S
2025-02-05  1:48 ` ✗ GitLab.Pipeline: warning for tests/intel/kms_joiner: Add a new test to validate non-joiner mode (rev5) Patchwork
2025-02-05  2:18 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-05  2:21 ` ✓ i915.CI.BAT: " Patchwork
2025-02-05  9:08 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-05 10:14 ` ✗ i915.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-02-10 18:36 [PATCH i-g-t 0/3] tests/intel/kms_joiner: Add a new test to validate non-joiner mode Jeevan B
2025-02-10 18:36 ` [PATCH i-g-t 2/3] lib/igt_kms: Add support to check joiner mode limit Jeevan B
2025-02-12  7:36 [PATCH i-g-t 0/3] tests/intel/kms_joiner: Add a new test to validate non-joiner mode Jeevan B
2025-02-12  7:36 ` [PATCH i-g-t 2/3] lib/igt_kms: Add support to check joiner mode limit Jeevan B
2025-02-12 10:46   ` Karthik B S

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=20250204182734.793645-3-jeevan.b@intel.com \
    --to=jeevan.b@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@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