Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, santhosh.reddy.guddati@intel.com,
	kunal1.joshi@intel.com, Karthik B S <karthik.b.s@intel.com>
Subject: [PATCH i-g-t v3 2/3] lib/kms: Update force joiner helpers to accomodate ultrajoiner
Date: Wed, 18 Sep 2024 13:04:12 +0530	[thread overview]
Message-ID: <20240918073413.28598-3-karthik.b.s@intel.com> (raw)
In-Reply-To: <20240918073413.28598-1-karthik.b.s@intel.com>

v2: Split the lib updates to separate patch (Ankit)

v3: Use enum for joined pipes (Santhosh)

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 lib/igt_kms.c            | 33 +++++++++++++++++++++++++--------
 lib/igt_kms.h            | 16 +++++++++++++++-
 tests/intel/kms_joiner.c |  2 +-
 3 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index cf453dcfc..a39d1176f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1720,34 +1720,51 @@ bool kmstest_force_connector(int drm_fd, drmModeConnector *connector,
 	return true;
 }
 
-static bool force_connector_bigjoiner(int drm_fd,
+static bool force_connector_joiner(int drm_fd,
 				      drmModeConnector *connector,
 				      const char *value)
 {
 	return connector_attr_set_debugfs(drm_fd, connector,
-					  "i915_bigjoiner_force_enable",
+					  "i915_joiner_force_enable",
 					  value, "0");
 }
 
 /**
- * kmstest_force_connector_bigjoiner:
+ * kmstest_force_connector_joiner:
  * @fd: drm file descriptor
  * @connector: connector
  *
- * Enable force bigjoiner state on the specified connector
+ * Enable force joiner state on the specified connector
  * and install exit handler for resetting
  *
  * Returns: True on success
  */
-bool kmstest_force_connector_bigjoiner(int drm_fd, drmModeConnector *connector)
+bool kmstest_force_connector_joiner(int drm_fd, drmModeConnector *connector, int joined_pipes)
 {
-	const char *value = "1";
+	const char *value;
 	drmModeConnector *temp;
 
+	switch (joined_pipes) {
+	case JOINED_PIPES_DEFAULT:
+		value = "0";
+		break;
+	case JOINED_PIPES_NONE:
+		value = "1";
+		break;
+	case JOINED_PIPES_BIG_JOINER:
+		value = "2";
+		break;
+	case JOINED_PIPES_ULTRA_JOINER:
+		value = "4";
+		break;
+	default:
+		igt_assert(0);
+	}
+
 	if (!is_intel_device(drm_fd))
 		return false;
 
-	if (!force_connector_bigjoiner(drm_fd, connector, value))
+	if (!force_connector_joiner(drm_fd, connector, value))
 		return false;
 
 	dump_connector_attrs();
@@ -6420,7 +6437,7 @@ bool igt_has_force_joiner_debugfs(int drmfd, char *conn_name)
 	if (debugfs_fd < 0)
 		return false;
 
-	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_joiner_force_enable", buf, sizeof(buf));
 	close(debugfs_fd);
 
 	return ret >= 0;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 4455632f4..2461fa47c 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -260,9 +260,23 @@ enum intel_broadcast_rgb_mode {
 
 struct edid;
 
+/**
+ * joined_pipes:
+ * @JOINED_PIPES_DEFAULT: Default setting with no force joiner
+ * @JOINED_PIPES_NONE: Force to exactly one pipe
+ * @JOINED_PIPES_BIG_JOINER: Join two pipes big joiner
+ * @JOINED_PIPES_ULTRA_JOINER: Join four pipes for ultra joiner
+ */
+enum joined_pipes {
+	JOINED_PIPES_DEFAULT,
+	JOINED_PIPES_NONE,
+	JOINED_PIPES_BIG_JOINER,
+	JOINED_PIPES_ULTRA_JOINER = 4
+};
+
 bool kmstest_force_connector(int fd, drmModeConnector *connector,
 			     enum kmstest_force_connector_state state);
-bool kmstest_force_connector_bigjoiner(int drm_fd, drmModeConnector *connector);
+bool kmstest_force_connector_joiner(int drm_fd, drmModeConnector *connector, int joined_pipes);
 void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
 			const struct edid *edid);
 
diff --git a/tests/intel/kms_joiner.c b/tests/intel/kms_joiner.c
index 633bf51c7..e193f9071 100644
--- a/tests/intel/kms_joiner.c
+++ b/tests/intel/kms_joiner.c
@@ -106,7 +106,7 @@ static void enable_force_joiner_on_all_non_big_joiner_outputs(data_t *data)
 
 	for (i = 0; i < data->non_big_joiner_output_count; i++) {
 		output = data->non_big_joiner_output[i];
-		status = kmstest_force_connector_bigjoiner(data->drm_fd, output->config.connector);
+		status = kmstest_force_connector_joiner(data->drm_fd, output->config.connector, JOINED_PIPES_BIG_JOINER);
 		igt_assert_f(status, "Failed to toggle force joiner\n");
 	}
 }
-- 
2.39.1


  parent reply	other threads:[~2024-09-18  7:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  7:34 [PATCH i-g-t v3 0/3] Add tests for ultrajoiner validation Karthik B S
2024-09-18  7:34 ` [PATCH i-g-t v3 1/3] tests/kms_joiner: " Karthik B S
2024-09-18  7:34 ` Karthik B S [this message]
2024-09-18 10:39   ` [PATCH i-g-t v3 2/3] lib/kms: Update force joiner helpers to accomodate ultrajoiner Nautiyal, Ankit K
2024-09-18 10:54   ` Reddy Guddati, Santhosh
2024-09-18  7:34 ` [PATCH i-g-t v3 3/3] tests/kms_joiner: Add subtests for force ultrajoiner validation Karthik B S
2024-09-18 10:44   ` Nautiyal, Ankit K
2024-09-18 10:52     ` Karthik B S
2024-09-18  8:33 ` ✓ Fi.CI.BAT: success for Add tests for ultrajoiner validation (rev3) Patchwork
2024-09-18  8:50 ` ✗ CI.xeBAT: failure " Patchwork
2024-09-18 10:49 ` ✗ CI.xeFULL: " Patchwork
2024-09-19  1:52 ` ✗ Fi.CI.IGT: " 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=20240918073413.28598-3-karthik.b.s@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@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