All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 0/2] Force joiner support in bigjoiner checks
@ 2024-04-17 12:33 Bhanuprakash Modem
  2024-04-17 12:33 ` [PATCH i-g-t 1/2] lib/igt_kms: New helper to check force joiner status Bhanuprakash Modem
  2024-04-17 12:33 ` [PATCH i-g-t 2/2] lib/igt_kms: Force joiner support in bigjoiner checks Bhanuprakash Modem
  0 siblings, 2 replies; 3+ messages in thread
From: Bhanuprakash Modem @ 2024-04-17 12:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem

As we recently introduced the option (through debugfs) to
force the bigjoiner, needs to extend the support in bigjoiner
checks to handle the force joiner.

Bhanuprakash Modem (2):
  lib/igt_kms: New helper to check force joiner status
  lib/igt_kms: Force joiner support in bigjoiner checks

 lib/igt_kms.c | 37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

-- 
2.43.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH i-g-t 1/2] lib/igt_kms: New helper to check force joiner status
  2024-04-17 12:33 [PATCH i-g-t 0/2] Force joiner support in bigjoiner checks Bhanuprakash Modem
@ 2024-04-17 12:33 ` Bhanuprakash Modem
  2024-04-17 12:33 ` [PATCH i-g-t 2/2] lib/igt_kms: Force joiner support in bigjoiner checks Bhanuprakash Modem
  1 sibling, 0 replies; 3+ messages in thread
From: Bhanuprakash Modem @ 2024-04-17 12:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Kunal Joshi

Add a new static function to check the force joiner status
on selected connecter, so that it would be helpful to check
the force joiner status from other places too.

Cc: Kunal Joshi <kunal1.joshi@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/igt_kms.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 3216fe7e4..9ff80378d 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6255,6 +6255,22 @@ bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
 	return ret >= 0;
 }
 
+static bool check_force_bigjoiner_status(int drmfd, char *connector_name, bool enable)
+{
+	int debugfs_fd, ret;
+	char buf[512];
+
+	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
+	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
+
+	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+	close(debugfs_fd);
+	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
+
+	return enable ? strstr(buf, "Y") :
+			strstr(buf, "N");
+}
+
 /**
  * Forces the enable/disable state of big joiner for a specific connector.
  *
@@ -6268,19 +6284,15 @@ bool igt_has_force_joiner_debugfs(int drmfd, igt_output_t *output)
 bool igt_force_and_check_bigjoiner_status(int drmfd, char *connector_name, bool enable)
 {
 	int debugfs_fd, ret;
-	char buf[512];
 
 	igt_assert_f(connector_name, "Connector name cannot be NULL\n");
 	debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_DIRECTORY);
 	igt_assert_f(debugfs_fd >= 0, "Could not open debugfs for connector %s\n", connector_name);
 	ret = igt_sysfs_write(debugfs_fd, "i915_bigjoiner_force_enable", enable ? "1" : "0", 1);
 	igt_assert_f(ret > 0, "Could not write i915_bigjoiner_force_enable for connector %s\n", connector_name);
-	ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
 	close(debugfs_fd);
-	igt_assert_f(ret > 0, "Could not read i915_bigjoiner_force_enable for connector %s\n", connector_name);
 
-	return enable ? strstr(buf, "Y") :
-			strstr(buf, "N");
+	return check_force_bigjoiner_status(drmfd, connector_name, enable);
 }
 
 /**
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH i-g-t 2/2] lib/igt_kms: Force joiner support in bigjoiner checks
  2024-04-17 12:33 [PATCH i-g-t 0/2] Force joiner support in bigjoiner checks Bhanuprakash Modem
  2024-04-17 12:33 ` [PATCH i-g-t 1/2] lib/igt_kms: New helper to check force joiner status Bhanuprakash Modem
@ 2024-04-17 12:33 ` Bhanuprakash Modem
  1 sibling, 0 replies; 3+ messages in thread
From: Bhanuprakash Modem @ 2024-04-17 12:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Bhanuprakash Modem, Kunal Joshi

As we recently introduced the option (through debugfs) to
force the bigjoiner, needs to extend the support in bigjoiner
checks to handle the force joiner.

Cc: Kunal Joshi <kunal1.joshi@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/igt_kms.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 9ff80378d..d2bb4727a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6316,6 +6316,7 @@ bool igt_check_bigjoiner_support(igt_display_t *display)
 	struct {
 		enum pipe idx;
 		drmModeModeInfo *mode;
+		bool force_joiner;
 	} pipes[IGT_MAX_PIPES];
 	int max_dotclock;
 
@@ -6333,6 +6334,9 @@ bool igt_check_bigjoiner_support(igt_display_t *display)
 
 		pipes[pipes_in_use].idx = output->pending_pipe;
 		pipes[pipes_in_use].mode = igt_output_get_mode(output);
+		pipes[pipes_in_use].force_joiner =
+			(igt_has_force_joiner_debugfs(display->drm_fd, output) &&
+			 check_force_bigjoiner_status(display->drm_fd, output->name, true));
 		pipes_in_use++;
 	}
 
@@ -6344,21 +6348,24 @@ bool igt_check_bigjoiner_support(igt_display_t *display)
 	max_dotclock = igt_get_max_dotclock(display->drm_fd);
 
 	/*
-	 * if mode resolution > 5K (or) mode.clock > max dot-clock, then ignore
+	 * if force joiner (or) mode resolution > 5K (or) mode.clock > max dot-clock,
+	 * then ignore
 	 *  - if the consecutive pipe is not available
 	 *  - last crtc in single/multi-connector config
 	 *  - consecutive crtcs in multi-connector config
 	 *
 	 * in multi-connector config ignore if
-	 *  - previous crtc (mode resolution > 5K or mode.clock > max dot-clock) and
+	 *  - previous crtc (force joiner or mode resolution > 5K or mode.clock > max dot-clock) and
 	 *  - current & previous crtcs are consecutive
 	 */
 	for (i = 0; i < pipes_in_use; i++) {
-		if ((igt_bigjoiner_possible(pipes[i].mode, max_dotclock) &&
+		if (((pipes[i].force_joiner ||
+		      igt_bigjoiner_possible(pipes[i].mode, max_dotclock)) &&
 		     ((pipes[i].idx >= (total_pipes - 1)) ||
 		      (!display->pipes[pipes[i].idx + 1].enabled) ||
 		      ((i < (pipes_in_use - 1)) && (abs(pipes[i + 1].idx - pipes[i].idx) <= 1)))) ||
-		    ((i > 0) && igt_bigjoiner_possible(pipes[i - 1].mode, max_dotclock) &&
+		    ((i > 0) && (pipes[i - 1].force_joiner ||
+				 igt_bigjoiner_possible(pipes[i - 1].mode, max_dotclock)) &&
 		     ((!display->pipes[pipes[i - 1].idx + 1].enabled) ||
 		      (abs(pipes[i].idx - pipes[i - 1].idx) <= 1)))) {
 			igt_debug("Pipe/Output combo is not possible with selected mode(s).\n");
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-17 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 12:33 [PATCH i-g-t 0/2] Force joiner support in bigjoiner checks Bhanuprakash Modem
2024-04-17 12:33 ` [PATCH i-g-t 1/2] lib/igt_kms: New helper to check force joiner status Bhanuprakash Modem
2024-04-17 12:33 ` [PATCH i-g-t 2/2] lib/igt_kms: Force joiner support in bigjoiner checks Bhanuprakash Modem

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.