Skip to contentSkip to conversation

tests/kms_display_modes: Add negative test for extended display

PATCH Superseded Mohammed Thasleem 3 participants 6 messages May 2, 2023 – May 3, 2023 Library code

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tests/kms_display_modes: Add negative test for extended display

Added negative test to validte ENOSPC when two 2k-4k or 4k-4k moniters connected through MST.
This test added to provide bandwidth issue in MST config.

Example:
When two monitors connected through MST, the second monitor also tries to use the same mode. So two such modes may not fit into the link bandwidth. So, iterate through connected outputs & modes and find a invalid combination.

v2: Rebased on tip.
v3: -Code cleanup and updated description.
-Free path_blob before call return. (Kamil)
v4: Updated code formatting and function description. (Jeevan)
v5: Updated commit description and minor changes.

---
 tests/kms_display_modes.c | 166 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 166 insertions(+)
tests/kms_display_modes.c +166 -0
index d69c7b931..27c13ba05 100644
@@ -26,14 +26,113 @@
 
 #include "igt.h"
 
+#define HDISPLAY_2K	2560
+#define VDISPLAY_2K	1440
+
+#define HDISPLAY_4K	3840
+#define VDISPLAY_4K	2160
+
 IGT_TEST_DESCRIPTION("Test Display Modes");
 
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
+	drmModeModeInfo mode_mst[2];
+	igt_output_t *mst_output[2];
 	int n_pipes;
 } data_t;
 
+/*Get higher mode supported by panel*/
+static drmModeModeInfo *get_highres_mode(igt_output_t *output)
+{
+	drmModeConnector *connector = output->config.connector;
+	drmModeModeInfo *highest_mode = NULL;
+
+	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
+	highest_mode = &connector->modes[0];
+
+	return highest_mode;
+}
+
+/*Get the 4k or less then 4k mode of connected panel*/
+static drmModeModeInfo *get_mode(igt_output_t *output)
+{
+	int j;
+	drmModeModeInfo *required_mode = NULL;
+	drmModeConnector *connector = output->config.connector;
+
+	required_mode = igt_output_get_mode(output);
+	if (required_mode->vdisplay <= VDISPLAY_4K &&
+	    required_mode->hdisplay <= HDISPLAY_4K) {
+		return required_mode;
+	}
+
+	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
+	for (j = 0; j < connector->count_modes; j++) {
+		if (connector->modes[j].vdisplay <= VDISPLAY_4K &&
+		    connector->modes[j].hdisplay <= HDISPLAY_4K) {
+			required_mode = &connector->modes[j];
+			break;
+		}
+	}
+
+	return required_mode;
+}
+
+static int parse_path_blob(char *blob_data)
+{
+	int connector_id;
+	char *encoder;
+
+	encoder = strtok(blob_data, ":");
+	igt_assert_f(!strcmp(encoder, "mst"), "PATH connector property expected to have 'mst'\n");
+
+	connector_id = atoi(strtok(NULL, "-"));
+
+	return connector_id;
+}
+
+static bool output_is_dp_mst(data_t *data, igt_output_t *output, int i)
+{
+	drmModePropertyBlobPtr path_blob = NULL;
+	uint64_t path_blob_id;
+	drmModeConnector *connector = output->config.connector;
+	struct kmstest_connector_config config;
+	const char *encoder;
+	int connector_id;
+	static int prev_connector_id;
+
+	kmstest_get_connector_config(data->drm_fd, output->config.connector->connector_id,
+				     -1, &config);
+	encoder = kmstest_encoder_type_str(config.encoder->encoder_type);
+
+	if (strcmp(encoder, "DP MST"))
+		return false;
+
+	igt_assert(kmstest_get_property(data->drm_fd, connector->connector_id,
+		   DRM_MODE_OBJECT_CONNECTOR, "PATH", NULL,
+		   &path_blob_id, NULL));
+
+	igt_assert(path_blob = drmModeGetPropertyBlob(data->drm_fd, path_blob_id));
+
+	connector_id = parse_path_blob((char *) path_blob->data);
+
+	drmModeFreePropertyBlob(path_blob);
+
+	/*
+	 * Discarding outputs of other DP MST topology.
+	 * Testing only on outputs on the topology we got previously
+	 */
+	if (i == 0) {
+		prev_connector_id = connector_id;
+	} else {
+		if (connector_id != prev_connector_id)
+			return false;
+	}
+
+	return true;
+}
+
 static void run_extendedmode_basic(data_t *data,
 				   enum pipe pipe1, igt_output_t *output1,
 				   enum pipe pipe2, igt_output_t *output2)
@@ -173,8 +272,46 @@ static void run_extendedmode_test(data_t *data) {
 	}
 }
 
+static void run_extendedmode_negative(data_t *data, int pipe1, int pipe2)
+{
+	struct igt_fb fbs[2];
+	igt_display_t *display = &data->display;
+	igt_plane_t *plane[2];
+	int ret;
+
+	igt_display_reset(display);
+
+	igt_output_set_pipe(data->mst_output[0], pipe1);
+	igt_output_set_pipe(data->mst_output[1], pipe2);
+
+	igt_create_color_fb(data->drm_fd, data->mode_mst[0].hdisplay, data->mode_mst[0].vdisplay,
+			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, 1, 0, 0, &fbs[0]);
+	igt_create_color_fb(data->drm_fd, data->mode_mst[1].hdisplay, data->mode_mst[1].vdisplay,
+			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, 0, 0, 1, &fbs[1]);
+
+	plane[0] = igt_pipe_get_plane_type(&display->pipes[pipe1], DRM_PLANE_TYPE_PRIMARY);
+	plane[1] = igt_pipe_get_plane_type(&display->pipes[pipe2], DRM_PLANE_TYPE_PRIMARY);
+
+	igt_plane_set_fb(plane[0], &fbs[0]);
+	igt_fb_set_size(&fbs[0], plane[0], data->mode_mst[0].hdisplay, data->mode_mst[0].vdisplay);
+	igt_plane_set_size(plane[0], data->mode_mst[0].hdisplay, data->mode_mst[0].vdisplay);
+
+	igt_plane_set_fb(plane[1], &fbs[1]);
+	igt_fb_set_size(&fbs[1], plane[1], data->mode_mst[1].hdisplay, data->mode_mst[1].vdisplay);
+	igt_plane_set_size(plane[1], data->mode_mst[1].hdisplay, data->mode_mst[1].vdisplay);
+
+	igt_output_override_mode(data->mst_output[0], &data->mode_mst[0]);
+	igt_output_override_mode(data->mst_output[1], &data->mode_mst[1]);
+
+	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
+	igt_assert(ret != 0 && errno == ENOSPC);
+}
+
 igt_main
 {
+	int dp_mst_outputs = 0, count = 0;
+	enum pipe pipe1, pipe2;
+	igt_output_t *output;
 	data_t data;
 
 	igt_fixture {
@@ -182,12 +319,41 @@ igt_main
 		kmstest_set_vt_graphics_mode();
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
+
+		for_each_connected_output(&data.display, output) {
+			data.mst_output[count++] = output;
+			if (output_is_dp_mst(&data, output, dp_mst_outputs))
+				dp_mst_outputs++;
+		}
 	}
 
 	igt_describe("Test for validating display extended mode with a pair of connected displays");
 	igt_subtest_with_dynamic("extended-mode-basic")
 		run_extendedmode_test(&data);
 
+	igt_describe("Negative test for validating display extended mode with a pair of connected "
+		     "2k-4k or 4k-4k displays");
+	igt_subtest_with_dynamic("mst-extended-mode-negative") {
+		igt_require_f(dp_mst_outputs > 1, "MST not found more then one\n");
+
+		 memcpy(&data.mode_mst[0], get_mode(data.mst_output[0]), sizeof(drmModeModeInfo));
+		 memcpy(&data.mode_mst[1], get_highres_mode(data.mst_output[1]),
+				 sizeof(drmModeModeInfo));
+		igt_require_f((data.mode_mst[1].hdisplay >= HDISPLAY_4K &&
+			       data.mode_mst[1].vdisplay >= VDISPLAY_4K), "4k panel not found\n");
+
+		for_each_pipe(&data.display, pipe1) {
+			for_each_pipe(&data.display, pipe2) {
+				if (pipe1 == pipe2)
+					continue;
+
+				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe1),
+					      kmstest_pipe_name(pipe2))
+					run_extendedmode_negative(&data, pipe1, pipe2);
+			}
+		}
+	}
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 	}
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 lib/igt_kms: bandwidth failure should return ENOSPC

Return failure for ENOSPC on fit to bandwidth failure in MST config.

---
 lib/igt_kms.c | 2 ++
 1 file changed, 2 insertions(+)
lib/igt_kms.c +2 -0
index c12823d31..790fbca2e 100644
@@ -4534,6 +4534,8 @@ bool __override_all_active_output_modes_to_fit_bw(igt_display_t *display,
 
 		if (!ret)
 			return true;
+		else if (ret == -ENOSPC)
+			return false;
 	}
 
 	return false;
Signature · 1 line
2.25.1
#2 lore raw

Re: [igt-dev] [PATCH i-g-t 2/2] lib/igt_kms: bandwidth failure should return ENOSPC

Hi Thasleem,

lib/igt_kms: bandwidth failure should return ENOSPC ---------------------------------------------^ We are returning bool not ENOSPC, please fix the title.

Quoted 1 line · Mohammed Thasleem

Return failure for ENOSPC on fit to bandwidth failure in MST config.

Please elaborate about this patch.

Quoted 11 lines
---
  lib/igt_kms.c | 2 ++
  1 file changed, 2 insertions(+)
lib/igt_kms.c +0 -0
index c12823d31..790fbca2e 100644

lib/igt_kms.c bool __override_all_active_output_modes_to_fit_bw(igt_display_t *display, · line 4537

Quoted 4 lines
lib/igt_kms.c +1 -0
@@ -4534,6 +4534,8 @@ bool __override_all_active_output_modes_to_fit_bw(igt_display_t *display,
 
  		if (!ret)
  			return true;
+		else if (ret == -ENOSPC)

-----------------------------^
It must be "!=", right?

Everytime we get the no space error, we need to retry with another mode till we get the valid one. For other errors, just return false.

- Bhanu

Quoted 4 lines
lib/igt_kms.c +1 -0
+			return false;
  	}
 
  	return false;
#3 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_display_modes: Add negative test for extended display

In reply to Mohammed Thasleem
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] tests/kms_display_modes: Add negative test for extended display
URL : https://patchwork.freedesktop.org/series/117195/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13096 -> IGTPW_8896
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (38 -> 37)
------------------------------

Missing (1): fi-snb-2520m

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@gt_lrc:
- bat-dg2-11: [PASS][1] -> [INCOMPLETE][2] ([i915#7609] / [i915#7913])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-dg2-11/igt@i915_selftest@live@gt_lrc.html

* igt@i915_selftest@live@requests:
- bat-rpls-1: [PASS][3] -> [ABORT][4] ([i915#7911] / [i915#7920])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/bat-rpls-1/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-rpls-1/igt@i915_selftest@[email protected]

* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-rplp-1: NOTRUN -> [SKIP][5] ([i915#7828])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-rplp-1/igt@[email protected]

* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
- bat-dg2-11: NOTRUN -> [SKIP][6] ([i915#1845] / [i915#5354]) +1 similar issue
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-dg2-11/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@migrate:
- bat-adlp-6: [DMESG-FAIL][7] ([i915#7699] / [i915#7913]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/bat-adlp-6/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-adlp-6/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@requests:
- bat-rplp-1: [ABORT][9] ([i915#7913] / [i915#7920]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/bat-rplp-1/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-rplp-1/igt@i915_selftest@[email protected]
- {bat-mtlp-8}: [ABORT][11] ([i915#4983] / [i915#7920]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/bat-mtlp-8/igt@i915_selftest@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/bat-mtlp-8/igt@i915_selftest@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#7609]: https://gitlab.freedesktop.org/drm/intel/issues/7609
[i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920

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

* CI: CI-20190529 -> None
* IGT: IGT_7277 -> IGTPW_8896

CI-20190529: 20190529
CI_DRM_13096: ec374264576fb8b33a27098e4b2ceeb99712007d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8896: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/index.html
IGT_7277: 1cb3507f3ff28d11bd5cfabcde576fe78ddab571 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

Testlist changes
----------------

+igt@kms_display_modes@mst-extended-mode-negative

== Logs ==

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

#4 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tests/kms_display_modes: Add negative test for extended display

In reply to Mohammed Thasleem
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] tests/kms_display_modes: Add negative test for extended display
URL : https://patchwork.freedesktop.org/series/117195/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13096_full -> IGTPW_8896_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

Participating hosts (7 -> 7)
------------------------------

No changes in participating hosts

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_8896_full:

### IGT changes ###

#### Possible regressions ####

* {igt@kms_display_modes@mst-extended-mode-negative} (NEW):
- {shard-rkl}: NOTRUN -> [SKIP][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-rkl-3/igt@[email protected]
- {shard-dg1}: NOTRUN -> [SKIP][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-dg1-15/igt@[email protected]
- {shard-tglu}: NOTRUN -> [SKIP][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-tglu-2/igt@[email protected]

New tests
---------

New tests have been introduced between CI_DRM_13096_full and IGTPW_8896_full:

### New IGT tests (1) ###

* igt@kms_display_modes@mst-extended-mode-negative:
- Statuses : 6 skip(s)
- Exec time: [0.0] s

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_ccs@block-copy-compressed:
- shard-snb: NOTRUN -> [SKIP][4] ([fdo#109271]) +112 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-snb2/igt@[email protected]

* igt@gem_exec_fair@basic-pace@vcs0:
- shard-glk: [PASS][5] -> [FAIL][6] ([i915#2842]) +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-glk1/igt@gem_exec_fair@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk4/igt@gem_exec_fair@[email protected]

* igt@gem_pxp@create-regular-context-1:
- shard-glk: NOTRUN -> [SKIP][7] ([fdo#109271]) +5 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk9/igt@[email protected]

* igt@gen9_exec_parse@allowed-single:
- shard-glk: [PASS][8] -> [ABORT][9] ([i915#5566])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-glk6/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk5/igt@[email protected]

* {igt@kms_display_modes@mst-extended-mode-negative} (NEW):
- shard-apl: NOTRUN -> [SKIP][10] ([fdo#109271])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-apl6/igt@[email protected]

* igt@kms_plane_alpha_blend@constant-alpha-max@pipe-c-hdmi-a-1:
- shard-glk: NOTRUN -> [FAIL][11] ([i915#4573]) +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk5/igt@kms_plane_alpha_blend@[email protected]

#### Possible fixes ####

* igt@drm_fdinfo@virtual-idle:
- {shard-rkl}: [FAIL][12] ([i915#7742]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-rkl-1/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-rkl-7/igt@[email protected]

* igt@gem_barrier_race@remote-request@rcs0:
- shard-glk: [ABORT][14] ([i915#7461] / [i915#8211]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-glk3/igt@gem_barrier_race@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk4/igt@gem_barrier_race@[email protected]

* igt@gem_eio@hibernate:
- {shard-dg1}: [ABORT][16] ([i915#7975] / [i915#8213]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-dg1-14/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-dg1-16/igt@[email protected]
- {shard-tglu}: [ABORT][18] ([i915#7975] / [i915#8213] / [i915#8398]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-tglu-10/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-tglu-8/igt@[email protected]

* igt@gem_eio@unwedge-stress:
- {shard-dg1}: [FAIL][20] ([i915#5784]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-dg1-16/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-dg1-12/igt@[email protected]

* igt@gem_exec_fair@basic-deadline:
- shard-glk: [FAIL][22] ([i915#2846]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-glk1/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk9/igt@[email protected]

* igt@gem_exec_fair@basic-none-solo@rcs0:
- shard-apl: [FAIL][24] ([i915#2842]) -> [PASS][25] +1 similar issue
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-apl7/igt@gem_exec_fair@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-apl7/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none@bcs0:
- {shard-rkl}: [FAIL][26] ([i915#2842]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-rkl-7/igt@gem_exec_fair@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-rkl-2/igt@gem_exec_fair@[email protected]

* igt@i915_module_load@reload-no-display:
- shard-snb: [ABORT][28] ([i915#4528] / [i915#8393]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-snb4/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-snb1/igt@[email protected]

* igt@i915_pm_rps@reset:
- shard-snb: [DMESG-FAIL][30] ([i915#8319]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-snb7/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-snb6/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-glk: [FAIL][32] ([i915#2346]) -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-glk1/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-glk4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

* igt@kms_flip@flip-vs-rmfb@a-hdmi-a1:
- {shard-tglu}: [INCOMPLETE][34] -> [PASS][35]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13096/shard-tglu-4/igt@kms_flip@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/shard-tglu-7/igt@kms_flip@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#3023]: https://gitlab.freedesktop.org/drm/intel/issues/3023
[i915#315]: https://gitlab.freedesktop.org/drm/intel/issues/315
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
[i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3989]: https://gitlab.freedesktop.org/drm/intel/issues/3989
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
[i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
[i915#4573]: https://gitlab.freedesktop.org/drm/intel/issues/4573
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6786]: https://gitlab.freedesktop.org/drm/intel/issues/6786
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7461]: https://gitlab.freedesktop.org/drm/intel/issues/7461
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8211]: https://gitlab.freedesktop.org/drm/intel/issues/8211
[i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
[i915#8229]: https://gitlab.freedesktop.org/drm/intel/issues/8229
[i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292
[i915#8319]: https://gitlab.freedesktop.org/drm/intel/issues/8319
[i915#8381]: https://gitlab.freedesktop.org/drm/intel/issues/8381
[i915#8393]: https://gitlab.freedesktop.org/drm/intel/issues/8393
[i915#8398]: https://gitlab.freedesktop.org/drm/intel/issues/8398

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

* CI: CI-20190529 -> None
* IGT: IGT_7277 -> IGTPW_8896
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_13096: ec374264576fb8b33a27098e4b2ceeb99712007d @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_8896: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8896/index.html
IGT_7277: 1cb3507f3ff28d11bd5cfabcde576fe78ddab571 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#5 lore raw
In reply to Mohammed Thasleem

Hi Thasleem,

Quoted 27 lines · Mohammed Thasleem

Added negative test to validte ENOSPC when two 2k-4k or 4k-4k moniters connected through MST.
This test added to provide bandwidth issue in MST config.

Example:
When two monitors connected through MST, the second monitor also tries to use the same mode. So two such modes may not fit into the link bandwidth. So, iterate through connected outputs & modes and find a invalid combination.

v2: Rebased on tip.
v3: -Code cleanup and updated description.
-Free path_blob before call return. (Kamil)
v4: Updated code formatting and function description. (Jeevan)
v5: Updated commit description and minor changes.

---
  tests/kms_display_modes.c | 166 ++++++++++++++++++++++++++++++++++++++
  1 file changed, 166 insertions(+)
tests/kms_display_modes.c +0 -0
index d69c7b931..27c13ba05 100644

tests/kms_display_modes.c line 30

Quoted 5 lines
tests/kms_display_modes.c +2 -0
@@ -26,14 +26,113 @@
 
  #include "igt.h"
 
+#define HDISPLAY_2K	2560
+#define VDISPLAY_2K	1440

Unused macros, please drop.

Quoted 5 lines
tests/kms_display_modes.c +4 -0
+
+#define HDISPLAY_4K	3840
+#define VDISPLAY_4K	2160
+
  IGT_TEST_DESCRIPTION("Test Display Modes");

tests/kms_display_modes.c line 45

Quoted 10 lines
tests/kms_display_modes.c +3 -0
 
  typedef struct {
  	int drm_fd;
  	igt_display_t display;
+	drmModeModeInfo mode_mst[2];
+	igt_output_t *mst_output[2];
  	int n_pipes;
  } data_t;
 
+/*Get higher mode supported by panel*/

Please follow the proper commenting style.

Example:
/* This is single line comment. */

/*
* This is multi-line
* comment.
*/

Quoted 13 lines
tests/kms_display_modes.c +13 -0
+static drmModeModeInfo *get_highres_mode(igt_output_t *output)
+{
+	drmModeConnector *connector = output->config.connector;
+	drmModeModeInfo *highest_mode = NULL;
+
+	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
+	highest_mode = &connector->modes[0];
+
+	return highest_mode;
+}
+
+/*Get the 4k or less then 4k mode of connected panel*/
+static drmModeModeInfo *get_mode(igt_output_t *output)

tests/kms_display_modes.c line 68

Quoted 10 lines
tests/kms_display_modes.c +10 -0
+{
+	int j;
+	drmModeModeInfo *required_mode = NULL;
+	drmModeConnector *connector = output->config.connector;
+
+	required_mode = igt_output_get_mode(output);
+	if (required_mode->vdisplay <= VDISPLAY_4K &&
+	    required_mode->hdisplay <= HDISPLAY_4K) {
+		return required_mode;
+	}

Please write a comment about this logic.

Quoted 53 lines
tests/kms_display_modes.c +53 -0
+
+	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
+	for (j = 0; j < connector->count_modes; j++) {
+		if (connector->modes[j].vdisplay <= VDISPLAY_4K &&
+		    connector->modes[j].hdisplay <= HDISPLAY_4K) {
+			required_mode = &connector->modes[j];
+			break;
+		}
+	}
+
+	return required_mode;
+}
+
+static int parse_path_blob(char *blob_data)
+{
+	int connector_id;
+	char *encoder;
+
+	encoder = strtok(blob_data, ":");
+	igt_assert_f(!strcmp(encoder, "mst"), "PATH connector property expected to have 'mst'\n");
+
+	connector_id = atoi(strtok(NULL, "-"));
+
+	return connector_id;
+}
+
+static bool output_is_dp_mst(data_t *data, igt_output_t *output, int i)
+{
+	drmModePropertyBlobPtr path_blob = NULL;
+	uint64_t path_blob_id;
+	drmModeConnector *connector = output->config.connector;
+	struct kmstest_connector_config config;
+	const char *encoder;
+	int connector_id;
+	static int prev_connector_id;
+
+	kmstest_get_connector_config(data->drm_fd, output->config.connector->connector_id,
+				     -1, &config);
+	encoder = kmstest_encoder_type_str(config.encoder->encoder_type);
+
+	if (strcmp(encoder, "DP MST"))
+		return false;
+
+	igt_assert(kmstest_get_property(data->drm_fd, connector->connector_id,
+		   DRM_MODE_OBJECT_CONNECTOR, "PATH", NULL,
+		   &path_blob_id, NULL));
+
+	igt_assert(path_blob = drmModeGetPropertyBlob(data->drm_fd, path_blob_id));
+
+	connector_id = parse_path_blob((char *) path_blob->data);
+
+	drmModeFreePropertyBlob(path_blob);
+

tests/kms_display_modes.c line 131

Quoted 10 lines
tests/kms_display_modes.c +10 -0
+	/*
+	 * Discarding outputs of other DP MST topology.
+	 * Testing only on outputs on the topology we got previously
+	 */
+	if (i == 0) {
+		prev_connector_id = connector_id;
+	} else {
+		if (connector_id != prev_connector_id)
+			return false;
+	}

Not understood this block, we already checking the encoder == "DP MST" and again reading the connector_id from PATH property. Is it not a redundant?

Quoted 33 lines
tests/kms_display_modes.c +26 -0
+
+	return true;
+}
+
  static void run_extendedmode_basic(data_t *data,
  				   enum pipe pipe1, igt_output_t *output1,
  				   enum pipe pipe2, igt_output_t *output2)
@@ -173,8 +272,46 @@ static void run_extendedmode_test(data_t *data) {
  	}
  }
 
+static void run_extendedmode_negative(data_t *data, int pipe1, int pipe2)
+{
+	struct igt_fb fbs[2];
+	igt_display_t *display = &data->display;
+	igt_plane_t *plane[2];
+	int ret;
+
+	igt_display_reset(display);
+
+	igt_output_set_pipe(data->mst_output[0], pipe1);
+	igt_output_set_pipe(data->mst_output[1], pipe2);
+
+	igt_create_color_fb(data->drm_fd, data->mode_mst[0].hdisplay, data->mode_mst[0].vdisplay,
+			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, 1, 0, 0, &fbs[0]);
+	igt_create_color_fb(data->drm_fd, data->mode_mst[1].hdisplay, data->mode_mst[1].vdisplay,
+			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR, 0, 0, 1, &fbs[1]);
+
+	plane[0] = igt_pipe_get_plane_type(&display->pipes[pipe1], DRM_PLANE_TYPE_PRIMARY);
+	plane[1] = igt_pipe_get_plane_type(&display->pipes[pipe2], DRM_PLANE_TYPE_PRIMARY);
+
+	igt_plane_set_fb(plane[0], &fbs[0]);
+	igt_fb_set_size(&fbs[0], plane[0], data->mode_mst[0].hdisplay, data->mode_mst[0].vdisplay);

tests/kms_display_modes.c static void run_extendedmode_test(data_t *data) { · line 306

Quoted 10 lines
tests/kms_display_modes.c +10 -0
+	igt_plane_set_size(plane[0], data->mode_mst[0].hdisplay, data->mode_mst[0].vdisplay);
+
+	igt_plane_set_fb(plane[1], &fbs[1]);
+	igt_fb_set_size(&fbs[1], plane[1], data->mode_mst[1].hdisplay, data->mode_mst[1].vdisplay);
+	igt_plane_set_size(plane[1], data->mode_mst[1].hdisplay, data->mode_mst[1].vdisplay);
+
+	igt_output_override_mode(data->mst_output[0], &data->mode_mst[0]);
+	igt_output_override_mode(data->mst_output[1], &data->mode_mst[1]);
+
+	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);

Don't we need to check for the bigjoiner constraint?

Example: 4K on pipe-c + 8K on pipe-d will throw -EINVAL.

Quoted 24 lines
tests/kms_display_modes.c +12 -0
+	igt_assert(ret != 0 && errno == ENOSPC);
+}
+
  igt_main
  {
+	int dp_mst_outputs = 0, count = 0;
+	enum pipe pipe1, pipe2;
+	igt_output_t *output;
  	data_t data;
 
  	igt_fixture {
@@ -182,12 +319,41 @@ igt_main
  		kmstest_set_vt_graphics_mode();
  		igt_display_require(&data.display, data.drm_fd);
  		igt_display_require_output(&data.display);
+
+		for_each_connected_output(&data.display, output) {
+			data.mst_output[count++] = output;
+			if (output_is_dp_mst(&data, output, dp_mst_outputs))
+				dp_mst_outputs++;
+		}
  	}
 
  	igt_describe("Test for validating display extended mode with a pair of connected displays");

tests/kms_display_modes.c igt_main · line 340

Quoted 10 lines
tests/kms_display_modes.c +7 -0
  	igt_subtest_with_dynamic("extended-mode-basic")
  		run_extendedmode_test(&data);
 
+	igt_describe("Negative test for validating display extended mode with a pair of connected "
+		     "2k-4k or 4k-4k displays");
+	igt_subtest_with_dynamic("mst-extended-mode-negative") {
+		igt_require_f(dp_mst_outputs > 1, "MST not found more then one\n");
+
+		 memcpy(&data.mode_mst[0], get_mode(data.mst_output[0]), sizeof(drmModeModeInfo));
+		 memcpy(&data.mode_mst[1], get_highres_mode(data.mst_output[1]),

----------------^
Fix the alignment (an extra space)

Quoted 19 lines
tests/kms_display_modes.c +16 -0
+				 sizeof(drmModeModeInfo));
+		igt_require_f((data.mode_mst[1].hdisplay >= HDISPLAY_4K &&
+			       data.mode_mst[1].vdisplay >= VDISPLAY_4K), "4k panel not found\n");
+
+		for_each_pipe(&data.display, pipe1) {
+			for_each_pipe(&data.display, pipe2) {
+				if (pipe1 == pipe2)
+					continue;
+
+				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe1),
+					      kmstest_pipe_name(pipe2))
+					run_extendedmode_negative(&data, pipe1, pipe2);
+			}
+		}
+	}
+
  	igt_fixture {
  		igt_display_fini(&data.display);
  	}