Skip to contentSkip to conversation

add support for choosing big joiner mode

PATCH In review Kunal Joshi 3 participants 5 messages Jan 12, 2024 – Jan 18, 2024 Library code

lore
Share & tools
lore
#0 lore raw

cover add support for choosing big joiner mode

add support to choose big joiner mode with environment variable, use mode with highest clock if no mode with big joiner found.

Kunal Joshi (2):
lib/igt_kms: move bigjoiner_mode_found to lib. lib/igt_kms: add support for choosing big joiner mode

 lib/igt_kms.c                | 25 ++++++++++++++++++++++++-
 lib/igt_kms.h                |  3 +++
 tests/intel/kms_big_joiner.c | 14 ++------------
 3 files changed, 29 insertions(+), 13 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 lib/igt_kms: move bigjoiner_mode_found to lib.

move bigjoiner_mode_found to lib/igt_kms with some modification

Cc Karthik B S <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
---
 lib/igt_kms.c                | 19 +++++++++++++++++++
 lib/igt_kms.h                |  3 +++
 tests/intel/kms_big_joiner.c | 14 ++------------
 3 files changed, 24 insertions(+), 12 deletions(-)
lib/igt_kms.c +19 -0
index e4dea1a60..2c55af05f 100644
@@ -6142,6 +6142,25 @@ bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock)
 		mode->clock > max_dotclock);
 }
 
+/**
+ * bigjoiner_mode_found:
+ * @connector: libdrm connector
+ * @sort_method: comparator method
+ * @mode: libdrm mode
+ *
+ * Returns: True if big joiner found in connector modes
+ */
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+			  int (*sort_method)(const void *, const void*),
+			  drmModeModeInfo *mode)
+{
+        igt_sort_connector_modes(connector, sort_method);
+        *mode = connector->modes[0];
+
+        return igt_bigjoiner_possible(mode,
+				      igt_get_max_dotclock(drm_fd));
+}
+
 /**
  * igt_check_bigjoiner_support:
  * @display: a pointer to an #igt_display_t structure
lib/igt_kms.h +3 -0
index b3882808b..9f5676d35 100644
@@ -1212,6 +1212,9 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
 		igt_output_t *output, int bpc);
 int igt_get_max_dotclock(int fd);
 bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+                                 int (*sort_method)(const void *, const void*),
+                                 drmModeModeInfo *mode);
 bool igt_check_bigjoiner_support(igt_display_t *display);
 bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
 bool intel_pipe_output_combo_valid(igt_display_t *display);
tests/intel/kms_big_joiner.c +2 -12
index aba2adfbe..1858c6362 100644
@@ -199,16 +199,6 @@ static void test_dual_display(data_t *data)
 	igt_display_commit2(display, COMMIT_ATOMIC);
 }
 
-static bool bigjoiner_mode_found(drmModeConnector *connector,
-				 int (*sort_method)(const void *, const void*),
-				 drmModeModeInfo *mode)
-{
-	igt_sort_connector_modes(connector, sort_method);
-	*mode = connector->modes[0];
-
-	return igt_bigjoiner_possible(mode, max_dotclock);
-}
-
 igt_main
 {
 	data_t data;
@@ -235,8 +225,8 @@ igt_main
 			 * Bigjoiner will come in to the picture when the
 			 * resolution > 5K or clock > max-dot-clock.
 			 */
-			found = (bigjoiner_mode_found(connector, sort_drm_modes_by_res_dsc, &mode) ||
-				 bigjoiner_mode_found(connector, sort_drm_modes_by_clk_dsc, &mode)) ?
+			found = (bigjoiner_mode_found(data.drm_fd, connector, sort_drm_modes_by_res_dsc, &mode) ||
+				 bigjoiner_mode_found(data.drm_fd, connector, sort_drm_modes_by_clk_dsc, &mode)) ?
 					true : false;
 
 			if (found) {
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH i-g-t 1/2] lib/igt_kms: move bigjoiner_mode_found to lib.

Hi Kunal,

Quoted 23 lines · Kunal Joshi

move bigjoiner_mode_found to lib/igt_kms with some modification

Cc Karthik B S <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
---
  lib/igt_kms.c                | 19 +++++++++++++++++++
  lib/igt_kms.h                |  3 +++
  tests/intel/kms_big_joiner.c | 14 ++------------
  3 files changed, 24 insertions(+), 12 deletions(-)
lib/igt_kms.c +4 -0
index e4dea1a60..2c55af05f 100644
@@ -6142,6 +6142,25 @@ bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock)
  		mode->clock > max_dotclock);
  }
 
+/**
+ * bigjoiner_mode_found:
+ * @connector: libdrm connector
+ * @sort_method: comparator method

lib/igt_kms.c bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock) · line 6158

Quoted 10 lines
lib/igt_kms.c +10 -0
+ * @mode: libdrm mode
+ *
+ * Returns: True if big joiner found in connector modes
+ */
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+			  int (*sort_method)(const void *, const void*),
+			  drmModeModeInfo *mode)
+{
+        igt_sort_connector_modes(connector, sort_method);
+        *mode = connector->modes[0];

IMHO, Instead of calling this helper multiple times with different sort methods, let's consolidate here only. Example below:

bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
int max_dotclock)
{
igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc); if (igt_bigjoiner_possible(&connector->modes[0], max_dotclock))

    return true;

igt_sort_connector_modes(connector, sort_drm_modes_by_clk_dsc); return igt_bigjoiner_possible(&connector->modes[0], max_dotclock);
}

Quoted 54 lines
lib/igt_kms.c +5 -0
+
+        return igt_bigjoiner_possible(mode,
+				      igt_get_max_dotclock(drm_fd));
+}
+
  /**
   * igt_check_bigjoiner_support:
   * @display: a pointer to an #igt_display_t structure
lib/igt_kms.h +3 -0
index b3882808b..9f5676d35 100644
@@ -1212,6 +1212,9 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
  		igt_output_t *output, int bpc);
  int igt_get_max_dotclock(int fd);
  bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
+bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
+                                 int (*sort_method)(const void *, const void*),
+                                 drmModeModeInfo *mode);
  bool igt_check_bigjoiner_support(igt_display_t *display);
  bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
  bool intel_pipe_output_combo_valid(igt_display_t *display);
tests/intel/kms_big_joiner.c +2 -12
index aba2adfbe..1858c6362 100644
@@ -199,16 +199,6 @@ static void test_dual_display(data_t *data)
  	igt_display_commit2(display, COMMIT_ATOMIC);
  }
 
-static bool bigjoiner_mode_found(drmModeConnector *connector,
-				 int (*sort_method)(const void *, const void*),
-				 drmModeModeInfo *mode)
-{
-	igt_sort_connector_modes(connector, sort_method);
-	*mode = connector->modes[0];
-
-	return igt_bigjoiner_possible(mode, max_dotclock);
-}
-
  igt_main
  {
  	data_t data;
@@ -235,8 +225,8 @@ igt_main
  			 * Bigjoiner will come in to the picture when the
  			 * resolution > 5K or clock > max-dot-clock.
  			 */
-			found = (bigjoiner_mode_found(connector, sort_drm_modes_by_res_dsc, &mode) ||
-				 bigjoiner_mode_found(connector, sort_drm_modes_by_clk_dsc, &mode)) ?
+			found = (bigjoiner_mode_found(data.drm_fd, connector, sort_drm_modes_by_res_dsc, &mode) ||
+				 bigjoiner_mode_found(data.drm_fd, connector, sort_drm_modes_by_clk_dsc, &mode)) ?
  					true : false;
 
  			if (found) {
#3 lore raw

PATCH 2/2 lib/igt_kms: add support for choosing big joiner mode

In reply to Kunal Joshi

add support to choose big joiner mode with environment variable, use mode with highest clock if no mode with big joiner found.

v2: reuse bigjoiner_mode_found (Bhanu)

Cc Karthik B S <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
---
 lib/igt_kms.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
lib/igt_kms.c +5 -1
index 2c55af05f..c4ecb0907 100644
@@ -1788,7 +1788,11 @@ bool kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector,
 		 * 0/lowest: Choose connector mode with lowest possible resolution.
 		 * 1/highest: Choose connector mode with highest possible resolution.
 		 */
-		if (!strcmp(env, "highest") || !strcmp(env, "1"))
+		if (!strcmp(env, "joiner") || !strcmp(env, "2"))
+			return bigjoiner_mode_found(drm_fd, connector, sort_drm_modes_by_clk_dsc, mode) ||
+			       bigjoiner_mode_found(drm_fd, connector, sort_drm_modes_by_res_dsc, mode) ||
+			       bigjoiner_mode_found(drm_fd, connector, sort_drm_modes_by_clk_dsc, mode);
+		else if (!strcmp(env, "highest") || !strcmp(env, "1"))
 			igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
 		else if (!strcmp(env, "lowest") || !strcmp(env, "0"))
 			igt_sort_connector_modes(connector, sort_drm_modes_by_res_asc);
Signature · 1 line
2.25.1
#4 lore raw

✗ Fi.CI.BAT: failure for add support for choosing big joiner mode

In reply to Kunal Joshi
== Series Details ==

== Series Details ==

Series: add support for choosing big joiner mode
URL : https://patchwork.freedesktop.org/series/128706/
State : failure

== Summary ==

CI Bug Log - changes from IGT_7671 -> IGTPW_10522
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_10522 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes
introduced in IGTPW_10522, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10522/index.html

Participating hosts (39 -> 14)
------------------------------

ERROR: It appears as if the changes made in IGTPW_10522 prevented too many machines from booting.

Missing (25): fi-rkl-11600 fi-snb-2520m bat-rpls-3 fi-pnv-d510 fi-blb-e6850 fi-skl-6600u fi-bsw-n3050 bat-adlm-1 fi-ilk-650 fi-ivb-3770 fi-elk-e7500 fi-bsw-nick fi-kbl-7567u bat-dg1-7 bat-kbl-2 bat-adlp-9 fi-cfl-8700k bat-mtlp-8 bat-jsl-1 fi-tgl-1115g4 fi-cfl-guc fi-kbl-guc fi-cfl-8109u bat-dg2-14 bat-dg2-13

Known issues
------------

Here are the changes found in IGTPW_10522 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@reset:
- fi-apl-guc: [PASS][1] -> [DMESG-WARN][2] ([i915#9730]) +31 other tests dmesg-warn
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7671/fi-apl-guc/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10522/fi-apl-guc/igt@i915_selftest@[email protected]

* igt@i915_suspend@basic-s2idle-without-i915:
- fi-apl-guc: [PASS][3] -> [DMESG-WARN][4] ([i915#180] / [i915#1982])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7671/fi-apl-guc/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10522/fi-apl-guc/igt@[email protected]

[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#9730]: https://gitlab.freedesktop.org/drm/intel/issues/9730

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7671 -> IGTPW_10522

CI-20190529: 20190529
CI_DRM_14116: 3b92a66f4bc89f4fa6e9e9369ac8243e23670030 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10522: 10522
IGT_7671: 7671

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10522/index.html