All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
@ 2022-10-09 15:18 Alaa Emad
  2022-10-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Alaa Emad @ 2022-10-09 15:18 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
the execution is aborted instead of SKIP/FAIL, as in the following output:

$ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
(kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
(kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
(kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
Stack trace:
kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
Received signal SIGABRT.

The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.

This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
only dynamic subsubtests themselves will produce test results.

The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
by running all tests for one cursor size one by one, and check if cursor size is
supported or not before running the test.

Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")

Signed-off-by: Alaa Emad <aemad@igalia.com>
---
 tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
 1 file changed, 69 insertions(+), 67 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 8d3426dd..9b620389 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -72,7 +72,6 @@ typedef struct {
 	cairo_surface_t *surface;
 	uint32_t devid;
 	double alpha;
-	int vblank_wait_count; /* because of msm */
 } data_t;
 
 #define TEST_DPMS (1<<0)
@@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
 {
 	igt_plane_set_fb(data->cursor, NULL);
 	igt_plane_set_position(data->cursor, 0, 0);
-	igt_display_commit(&data->display);
-
-	/* do this wait here so it will not need to be added everywhere */
-	igt_wait_for_vblank_count(data->drm_fd,
-				  data->display.pipes[data->pipe].crtc_offset,
-				  data->vblank_wait_count);
 }
 
 static bool chv_cursor_broken(data_t *data, int x)
@@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
 		igt_display_commit(display);
 
 		/* Extra vblank wait is because nonblocking cursor ioctl */
-		igt_wait_for_vblank_count(data->drm_fd,
-					  display->pipes[data->pipe].crtc_offset,
-					  data->vblank_wait_count);
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
 
@@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
 
 		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
 		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
+
 		igt_display_commit(display);
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
+
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
 		igt_assert_crc_equal(&crc, hwcrc);
 	}
@@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
 	igt_plane_set_position(data->cursor, x, y);
 	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
 
+	igt_plane_set_position(data->cursor, 0, 0);
 	cursor_disable(data);
+	igt_display_commit(display);
 
 	igt_assert_eq(ret, expect);
 }
@@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
 	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
 }
 
-static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
-			   int w, int h)
+static void run_size_tests(data_t *data, int w, int h)
 {
 	enum pipe pipe;
+	int i;
+
+	struct
+	{
+		const char *name;
+		void (*testfunc)(data_t *);
+		const char *desc;
+	} size_tests[] = {
+		{"cursor-onscreen", test_crc_onscreen,
+		 "Check if a given-size cursor is well-positioned inside the screen."},
+		{"cursor-offscreen", test_crc_offscreen,
+		 "Check if a given-size cursor is well-positioned outside the screen."},
+		{"cursor-sliding", test_crc_sliding,
+		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
+		{"cursor-random", test_crc_random,
+		 "Check random placement of a cursor with given size."},
+		{"cursor-rapid-movement", test_rapid_movement,
+		 "Check the rapid update of given-size cursor movements."},
+	};
 
 	if (w == 0 && h == 0) {
 		w = data->cursor_max_w;
@@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
 		}
 	}
 
-	create_cursor_fb(data, w, h);
-	if (require_cursor_size(data, w, h)) {
-		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
-
-		igt_remove_fb(data->drm_fd, &data->fb);
-		return;
-	}
+	igt_fixture
+		create_cursor_fb(data, w, h);
 
-	for_each_pipe(&data->display, pipe) {
-		data->pipe = pipe;
-		igt_dynamic_f("pipe-%s-%s",
-			      kmstest_pipe_name(pipe), igt_output_name(data->output))
-			run_test(data, testfunc, w, h);
+	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
+	{
+		igt_describe(size_tests[i].desc);
+		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
+		{
+			for_each_pipe(&data->display, pipe)
+			{
+				data->pipe = pipe;
+				if (require_cursor_size(data, w, h))
+				{
+					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
+					continue;
+				}
+
+				igt_dynamic_f("pipe-%s-%s",
+							  kmstest_pipe_name(pipe), igt_output_name(data->output))
+					run_test(data, size_tests[i].testfunc, w, h);
+			}
+		}
 	}
 
-	igt_remove_fb(data->drm_fd, &data->fb);
+	igt_fixture
+		igt_remove_fb(data->drm_fd, &data->fb);
 }
 
 static void run_tests_on_pipe(data_t *data)
 {
 	enum pipe pipe;
 	int cursor_size;
-	int i;
-	struct {
-		const char *name;
-		void (*testfunc)(data_t *);
-		const char *desc;
-	} size_tests[] = {
-		{ "cursor-onscreen", test_crc_onscreen,
-			"Check if a given-size cursor is well-positioned inside the screen." },
-		{ "cursor-offscreen", test_crc_offscreen,
-			"Check if a given-size cursor is well-positioned outside the screen." },
-		{ "cursor-sliding", test_crc_sliding,
-			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
-		{ "cursor-random", test_crc_random,
-			"Check random placement of a cursor with given size." },
-		{ "cursor-rapid-movement", test_rapid_movement,
-			"Check the rapid update of given-size cursor movements." },
-	};
 
 	igt_fixture {
 		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
@@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
 	igt_fixture
 		igt_remove_fb(data->drm_fd, &data->fb);
 
-	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
-		igt_describe(size_tests[i].desc);
-		igt_subtest_group {
-			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
-				int w = cursor_size;
-				int h = cursor_size;
-
-				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
-					run_size_tests(data, size_tests[i].testfunc, w, h);
-
-				/*
-				 * Test non-square cursors a bit on the platforms
-				 * that support such things. And make it a bit more
-				 * interesting by using a non-pot height.
-				 */
-				h /= 3;
-				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
-					run_size_tests(data, size_tests[i].testfunc, w, h);
-			}
+	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
+	{
+		int w = cursor_size;
+		int h = cursor_size;
 
-			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
-				run_size_tests(data, size_tests[i].testfunc, 0, 0);
-		}
+		igt_subtest_group
+			run_size_tests(data, w, h);
+
+		/*
+		 * Test non-square cursors a bit on the platforms
+		 * that support such things. And make it a bit more
+		 * interesting by using a non-pot height.
+		 */
+		h /= 3;
+
+		igt_subtest_group
+			run_size_tests(data, w, h);
 	}
+	
+	run_size_tests(data, 0, 0);
 }
 
 static data_t data;
@@ -896,8 +901,6 @@ igt_main
 		kmstest_set_vt_graphics_mode();
 
 		igt_require_pipe_crc(data.drm_fd);
-
-		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
 	}
 
 	data.cursor_max_w = cursor_width;
@@ -913,6 +916,5 @@ igt_main
 		}
 
 		igt_display_fini(&data.display);
-		close(data.drm_fd);
 	}
 }
-- 
2.34.1

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-09 15:18 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails Alaa Emad
@ 2022-10-09 15:52 ` Patchwork
  2022-10-09 16:57 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2022-10-09 15:52 UTC (permalink / raw)
  To: Alaa Emad; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 4731 bytes --]

== Series Details ==

Series: tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
URL   : https://patchwork.freedesktop.org/series/109514/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12227 -> IGTPW_7933
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Participating hosts (45 -> 42)
------------------------------

  Missing    (3): fi-ctg-p8600 fi-tgl-dsi fi-hsw-4200u 

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@gt_heartbeat:
    - fi-bdw-5557u:       [PASS][1] -> [DMESG-FAIL][2] ([i915#5334])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/fi-bdw-5557u/igt@i915_selftest@live@gt_heartbeat.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/fi-bdw-5557u/igt@i915_selftest@live@gt_heartbeat.html

  * igt@i915_selftest@live@hangcheck:
    - fi-hsw-4770:        [PASS][3] -> [INCOMPLETE][4] ([i915#4785])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
    - fi-snb-2600:        [PASS][5] -> [INCOMPLETE][6] ([i915#6992])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/fi-snb-2600/igt@i915_selftest@live@hangcheck.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/fi-snb-2600/igt@i915_selftest@live@hangcheck.html

  * igt@runner@aborted:
    - fi-hsw-4770:        NOTRUN -> [FAIL][7] ([fdo#109271] / [i915#4312] / [i915#5594])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/fi-hsw-4770/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@gem_huc_copy@huc-copy:
    - {bat-dg2-11}:       [FAIL][8] ([i915#7029]) -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/bat-dg2-11/igt@gem_huc_copy@huc-copy.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/bat-dg2-11/igt@gem_huc_copy@huc-copy.html

  * igt@i915_module_load@load:
    - {bat-dg2-11}:       [DMESG-WARN][10] ([i915#7031]) -> [PASS][11]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/bat-dg2-11/igt@i915_module_load@load.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/bat-dg2-11/igt@i915_module_load@load.html

  * igt@i915_selftest@live@reset:
    - {bat-rpls-2}:       [DMESG-FAIL][12] ([i915#4983] / [i915#5828]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/bat-rpls-2/igt@i915_selftest@live@reset.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/bat-rpls-2/igt@i915_selftest@live@reset.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
  [i915#5594]: https://gitlab.freedesktop.org/drm/intel/issues/5594
  [i915#5828]: https://gitlab.freedesktop.org/drm/intel/issues/5828
  [i915#6559]: https://gitlab.freedesktop.org/drm/intel/issues/6559
  [i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818
  [i915#6992]: https://gitlab.freedesktop.org/drm/intel/issues/6992
  [i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
  [i915#7029]: https://gitlab.freedesktop.org/drm/intel/issues/7029
  [i915#7031]: https://gitlab.freedesktop.org/drm/intel/issues/7031


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

  * CI: CI-20190529 -> None
  * IGT: IGT_7003 -> IGTPW_7933

  CI-20190529: 20190529
  CI_DRM_12227: 74e2443e7681e4d442b45f551ddf12d09a6f00c3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7933: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/index.html
  IGT_7003: 1ea9ec5e7295fbc1cb784be4692971fd342bea53 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


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

-igt@kms_cursor_crc@cursor-offscreen-max-size
-igt@kms_cursor_crc@cursor-onscreen-max-size
-igt@kms_cursor_crc@cursor-random-max-size
-igt@kms_cursor_crc@cursor-rapid-movement-max-size
-igt@kms_cursor_crc@cursor-sliding-max-size

== Logs ==

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

[-- Attachment #2: Type: text/html, Size: 5239 bytes --]

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

* [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-09 15:18 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails Alaa Emad
  2022-10-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2022-10-09 16:57 ` Patchwork
  2022-10-10 11:16 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
  2022-10-11 12:56 ` Modem, Bhanuprakash
  3 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2022-10-09 16:57 UTC (permalink / raw)
  To: Alaa Emad; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 49786 bytes --]

== Series Details ==

Series: tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
URL   : https://patchwork.freedesktop.org/series/109514/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12227_full -> IGTPW_7933_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_7933_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_7933_full, please notify your bug team 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_7933/index.html

Participating hosts (12 -> 8)
------------------------------

  Missing    (4): pig-skl-6260u pig-kbl-iris shard-tglu pig-glk-j5005 

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@fbdev@read:
    - shard-iclb:         [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb7/igt@fbdev@read.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb6/igt@fbdev@read.html
    - shard-apl:          [PASS][3] -> [FAIL][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-apl7/igt@fbdev@read.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl3/igt@fbdev@read.html
    - shard-snb:          [PASS][5] -> [FAIL][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-snb7/igt@fbdev@read.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb6/igt@fbdev@read.html

  * igt@i915_module_load@reload-with-fault-injection:
    - shard-snb:          [PASS][7] -> [DMESG-WARN][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-snb2/igt@i915_module_load@reload-with-fault-injection.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb4/igt@i915_module_load@reload-with-fault-injection.html

  * igt@kms_fbcon_fbt@psr-suspend:
    - shard-tglb:         [PASS][9] -> [INCOMPLETE][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb1/igt@kms_fbcon_fbt@psr-suspend.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@kms_fbcon_fbt@psr-suspend.html

  
New tests
---------

  New tests have been introduced between CI_DRM_12227_full and IGTPW_7933_full:

### New IGT tests (4) ###

  * igt@kms_lease@lease_invalid_plane@pipe-a-hdmi-a-3:
    - Statuses : 1 pass(s)
    - Exec time: [0.14] s

  * igt@kms_lease@lease_invalid_plane@pipe-b-hdmi-a-3:
    - Statuses : 1 pass(s)
    - Exec time: [0.02] s

  * igt@kms_lease@lease_invalid_plane@pipe-c-hdmi-a-3:
    - Statuses : 1 pass(s)
    - Exec time: [0.02] s

  * igt@kms_lease@lease_invalid_plane@pipe-d-hdmi-a-3:
    - Statuses : 1 pass(s)
    - Exec time: [0.02] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@fbdev@read:
    - shard-tglb:         [PASS][11] -> [FAIL][12] ([i915#6724])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb8/igt@fbdev@read.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb2/igt@fbdev@read.html
    - shard-glk:          [PASS][13] -> [FAIL][14] ([i915#6724])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk9/igt@fbdev@read.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk5/igt@fbdev@read.html

  * igt@gem_ccs@block-copy-compressed:
    - shard-tglb:         NOTRUN -> [SKIP][15] ([i915#3555] / [i915#5325])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@gem_ccs@block-copy-compressed.html

  * igt@gem_ctx_persistence@engines-cleanup:
    - shard-snb:          NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#1099]) +1 similar issue
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb4/igt@gem_ctx_persistence@engines-cleanup.html

  * igt@gem_exec_balancer@parallel-out-fence:
    - shard-iclb:         [PASS][17] -> [SKIP][18] ([i915#4525])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb1/igt@gem_exec_balancer@parallel-out-fence.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb6/igt@gem_exec_balancer@parallel-out-fence.html

  * igt@gem_exec_capture@capture-invisible@smem0:
    - shard-tglb:         NOTRUN -> [SKIP][19] ([i915#6334])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@gem_exec_capture@capture-invisible@smem0.html

  * igt@gem_exec_fair@basic-none-solo@rcs0:
    - shard-tglb:         NOTRUN -> [FAIL][20] ([i915#2842])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@gem_exec_fair@basic-none-solo@rcs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [PASS][21] -> [FAIL][22] ([i915#2842])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb2/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fence@syncobj-backward-timeline-chain-engines:
    - shard-snb:          NOTRUN -> [SKIP][23] ([fdo#109271]) +63 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb4/igt@gem_exec_fence@syncobj-backward-timeline-chain-engines.html

  * igt@gem_exec_flush@basic-batch-kernel-default-cmd:
    - shard-iclb:         NOTRUN -> [SKIP][24] ([fdo#109313])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb5/igt@gem_exec_flush@basic-batch-kernel-default-cmd.html
    - shard-tglb:         NOTRUN -> [SKIP][25] ([fdo#109313])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@gem_exec_flush@basic-batch-kernel-default-cmd.html

  * igt@gem_exec_params@no-vebox:
    - shard-tglb:         NOTRUN -> [SKIP][26] ([fdo#109283] / [i915#4877])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@gem_exec_params@no-vebox.html

  * igt@gem_exec_params@secure-non-root:
    - shard-iclb:         NOTRUN -> [SKIP][27] ([fdo#112283])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb5/igt@gem_exec_params@secure-non-root.html
    - shard-tglb:         NOTRUN -> [SKIP][28] ([fdo#112283])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@gem_exec_params@secure-non-root.html

  * igt@gem_huc_copy@huc-copy:
    - shard-apl:          NOTRUN -> [SKIP][29] ([fdo#109271] / [i915#2190])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl7/igt@gem_huc_copy@huc-copy.html
    - shard-glk:          NOTRUN -> [SKIP][30] ([fdo#109271] / [i915#2190])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk2/igt@gem_huc_copy@huc-copy.html
    - shard-iclb:         NOTRUN -> [SKIP][31] ([i915#2190])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb1/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@verify-random-ccs:
    - shard-apl:          NOTRUN -> [SKIP][32] ([fdo#109271] / [i915#4613])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl2/igt@gem_lmem_swapping@verify-random-ccs.html

  * igt@gem_pxp@verify-pxp-stale-ctx-execution:
    - shard-tglb:         NOTRUN -> [SKIP][33] ([i915#4270])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb5/igt@gem_pxp@verify-pxp-stale-ctx-execution.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-apl:          NOTRUN -> [SKIP][34] ([fdo#109271] / [i915#3323])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl6/igt@gem_userptr_blits@dmabuf-sync.html
    - shard-glk:          NOTRUN -> [SKIP][35] ([fdo#109271] / [i915#3323])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk1/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gem_userptr_blits@input-checking:
    - shard-apl:          NOTRUN -> [DMESG-WARN][36] ([i915#4991])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl2/igt@gem_userptr_blits@input-checking.html

  * igt@gem_userptr_blits@vma-merge:
    - shard-apl:          NOTRUN -> [FAIL][37] ([i915#3318])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl1/igt@gem_userptr_blits@vma-merge.html

  * igt@gem_workarounds@suspend-resume:
    - shard-apl:          [PASS][38] -> [DMESG-WARN][39] ([i915#180]) +1 similar issue
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-apl6/igt@gem_workarounds@suspend-resume.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl2/igt@gem_workarounds@suspend-resume.html

  * igt@gen7_exec_parse@basic-offset:
    - shard-iclb:         NOTRUN -> [SKIP][40] ([fdo#109289])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb6/igt@gen7_exec_parse@basic-offset.html

  * igt@gen9_exec_parse@cmd-crossing-page:
    - shard-tglb:         NOTRUN -> [SKIP][41] ([i915#2527] / [i915#2856]) +2 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@gen9_exec_parse@cmd-crossing-page.html

  * igt@gen9_exec_parse@unaligned-access:
    - shard-iclb:         NOTRUN -> [SKIP][42] ([i915#2856])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@gen9_exec_parse@unaligned-access.html

  * igt@i915_pm_rpm@gem-execbuf-stress-pc8:
    - shard-tglb:         NOTRUN -> [SKIP][43] ([fdo#109506] / [i915#2411])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@i915_pm_rpm@gem-execbuf-stress-pc8.html

  * igt@i915_query@query-topology-known-pci-ids:
    - shard-tglb:         NOTRUN -> [SKIP][44] ([fdo#109303])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb5/igt@i915_query@query-topology-known-pci-ids.html
    - shard-iclb:         NOTRUN -> [SKIP][45] ([fdo#109303])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb3/igt@i915_query@query-topology-known-pci-ids.html

  * igt@i915_query@test-query-geometry-subslices:
    - shard-tglb:         NOTRUN -> [SKIP][46] ([i915#5723])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@i915_query@test-query-geometry-subslices.html

  * igt@kms_big_fb@4-tiled-max-hw-stride-64bpp-rotate-180-async-flip:
    - shard-tglb:         NOTRUN -> [SKIP][47] ([i915#5286]) +1 similar issue
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@kms_big_fb@4-tiled-max-hw-stride-64bpp-rotate-180-async-flip.html

  * igt@kms_big_fb@x-tiled-32bpp-rotate-270:
    - shard-tglb:         NOTRUN -> [SKIP][48] ([fdo#111614]) +1 similar issue
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_big_fb@x-tiled-32bpp-rotate-270.html
    - shard-iclb:         NOTRUN -> [SKIP][49] ([fdo#110725] / [fdo#111614])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb6/igt@kms_big_fb@x-tiled-32bpp-rotate-270.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0-async-flip:
    - shard-tglb:         NOTRUN -> [SKIP][50] ([fdo#111615]) +2 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0-async-flip.html

  * igt@kms_ccs@pipe-b-crc-primary-rotation-180-4_tiled_dg2_rc_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][51] ([i915#3689] / [i915#6095]) +1 similar issue
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb5/igt@kms_ccs@pipe-b-crc-primary-rotation-180-4_tiled_dg2_rc_ccs.html

  * igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
    - shard-apl:          NOTRUN -> [SKIP][52] ([fdo#109271] / [i915#3886]) +4 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl8/igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-crc-primary-rotation-180-y_tiled_gen12_mc_ccs:
    - shard-iclb:         NOTRUN -> [SKIP][53] ([fdo#109278] / [i915#3886]) +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb1/igt@kms_ccs@pipe-c-crc-primary-rotation-180-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-c-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][54] ([i915#3689] / [i915#3886]) +2 similar issues
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_ccs@pipe-c-crc-sprite-planes-basic-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-c-missing-ccs-buffer-yf_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][55] ([fdo#111615] / [i915#3689]) +1 similar issue
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb5/igt@kms_ccs@pipe-c-missing-ccs-buffer-yf_tiled_ccs.html

  * igt@kms_ccs@pipe-c-random-ccs-data-4_tiled_dg2_rc_ccs_cc:
    - shard-tglb:         NOTRUN -> [SKIP][56] ([i915#6095]) +3 similar issues
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb2/igt@kms_ccs@pipe-c-random-ccs-data-4_tiled_dg2_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_gen12_mc_ccs:
    - shard-glk:          NOTRUN -> [SKIP][57] ([fdo#109271] / [i915#3886]) +3 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk7/igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-d-bad-pixel-format-y_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][58] ([i915#3689]) +2 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_ccs@pipe-d-bad-pixel-format-y_tiled_ccs.html

  * igt@kms_ccs@pipe-d-crc-primary-basic-4_tiled_dg2_rc_ccs:
    - shard-iclb:         NOTRUN -> [SKIP][59] ([fdo#109278]) +5 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb3/igt@kms_ccs@pipe-d-crc-primary-basic-4_tiled_dg2_rc_ccs.html

  * igt@kms_cdclk@mode-transition:
    - shard-tglb:         NOTRUN -> [SKIP][60] ([i915#3742])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@kms_cdclk@mode-transition.html

  * igt@kms_chamelium@dp-audio:
    - shard-iclb:         NOTRUN -> [SKIP][61] ([fdo#109284] / [fdo#111827]) +4 similar issues
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb3/igt@kms_chamelium@dp-audio.html

  * igt@kms_chamelium@dp-hpd-fast:
    - shard-tglb:         NOTRUN -> [SKIP][62] ([fdo#109284] / [fdo#111827]) +8 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@kms_chamelium@dp-hpd-fast.html

  * igt@kms_chamelium@hdmi-crc-fast:
    - shard-glk:          NOTRUN -> [SKIP][63] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk1/igt@kms_chamelium@hdmi-crc-fast.html

  * igt@kms_chamelium@hdmi-hpd-storm:
    - shard-apl:          NOTRUN -> [SKIP][64] ([fdo#109271] / [fdo#111827]) +7 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl3/igt@kms_chamelium@hdmi-hpd-storm.html

  * igt@kms_color_chamelium@ctm-red-to-blue:
    - shard-snb:          NOTRUN -> [SKIP][65] ([fdo#109271] / [fdo#111827]) +4 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb6/igt@kms_color_chamelium@ctm-red-to-blue.html

  * igt@kms_content_protection@atomic-dpms:
    - shard-tglb:         NOTRUN -> [SKIP][66] ([i915#1063])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@kms_content_protection@atomic-dpms.html

  * igt@kms_flip@2x-flip-vs-fences-interruptible:
    - shard-tglb:         NOTRUN -> [SKIP][67] ([fdo#109274] / [fdo#111825] / [i915#3637]) +1 similar issue
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@kms_flip@2x-flip-vs-fences-interruptible.html

  * igt@kms_flip@2x-modeset-vs-vblank-race-interruptible:
    - shard-iclb:         NOTRUN -> [SKIP][68] ([fdo#109274])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb6/igt@kms_flip@2x-modeset-vs-vblank-race-interruptible.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a1:
    - shard-glk:          [PASS][69] -> [FAIL][70] ([i915#79])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk5/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a1.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk2/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-hdmi-a1.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1:
    - shard-glk:          [PASS][71] -> [FAIL][72] ([i915#2122])
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk5/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk2/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-hdmi-a1.html

  * igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling@pipe-a-valid-mode:
    - shard-iclb:         NOTRUN -> [SKIP][73] ([i915#2587] / [i915#2672])
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb6/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling@pipe-a-valid-mode.html

  * igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-32bpp-yftileccs-upscaling@pipe-a-valid-mode:
    - shard-tglb:         NOTRUN -> [SKIP][74] ([i915#2587] / [i915#2672]) +2 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-32bpp-yftileccs-upscaling@pipe-a-valid-mode.html

  * igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-32bpp-yftile-upscaling@pipe-a-default-mode:
    - shard-iclb:         NOTRUN -> [SKIP][75] ([i915#2672]) +3 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-yftile-to-32bpp-yftile-upscaling@pipe-a-default-mode.html

  * igt@kms_force_connector_basic@force-load-detect:
    - shard-tglb:         NOTRUN -> [SKIP][76] ([fdo#109285])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb3/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-blt:
    - shard-tglb:         NOTRUN -> [SKIP][77] ([i915#6497]) +4 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-blt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-shrfb-msflip-blt:
    - shard-glk:          NOTRUN -> [SKIP][78] ([fdo#109271]) +57 similar issues
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk9/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-shrfb-msflip-blt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-shrfb-draw-render:
    - shard-iclb:         NOTRUN -> [SKIP][79] ([fdo#109280]) +4 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-shrfb-draw-render.html

  * igt@kms_frontbuffer_tracking@fbcpsr-indfb-scaledprimary:
    - shard-apl:          NOTRUN -> [SKIP][80] ([fdo#109271]) +96 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl1/igt@kms_frontbuffer_tracking@fbcpsr-indfb-scaledprimary.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-fullscreen:
    - shard-tglb:         NOTRUN -> [SKIP][81] ([fdo#109280] / [fdo#111825]) +14 similar issues
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb5/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-fullscreen.html

  * igt@kms_hdr@static-swap:
    - shard-tglb:         NOTRUN -> [SKIP][82] ([i915#3555]) +2 similar issues
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_hdr@static-swap.html
    - shard-iclb:         NOTRUN -> [SKIP][83] ([i915#3555])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb8/igt@kms_hdr@static-swap.html

  * igt@kms_pipe_b_c_ivb@from-pipe-c-to-b-with-3-lanes:
    - shard-tglb:         NOTRUN -> [SKIP][84] ([fdo#109289]) +2 similar issues
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_pipe_b_c_ivb@from-pipe-c-to-b-with-3-lanes.html

  * igt@kms_plane_alpha_blend@alpha-opaque-fb@pipe-a-dp-1:
    - shard-apl:          NOTRUN -> [FAIL][85] ([i915#4573]) +2 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl8/igt@kms_plane_alpha_blend@alpha-opaque-fb@pipe-a-dp-1.html

  * igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-d-edp-1:
    - shard-tglb:         NOTRUN -> [SKIP][86] ([i915#5176]) +3 similar issues
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@kms_plane_scaling@plane-downscale-with-modifiers-factor-0-5@pipe-d-edp-1.html

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-edp-1:
    - shard-iclb:         [PASS][87] -> [SKIP][88] ([i915#5235]) +2 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb7/igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-edp-1.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-edp-1.html

  * igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf:
    - shard-tglb:         NOTRUN -> [SKIP][89] ([i915#2920])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         NOTRUN -> [SKIP][90] ([fdo#109441])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb7/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [PASS][91] -> [SKIP][92] ([fdo#109441]) +1 similar issue
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb3/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_psr@psr2_sprite_mmap_cpu:
    - shard-tglb:         NOTRUN -> [FAIL][93] ([i915#132] / [i915#3467]) +2 similar issues
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb2/igt@kms_psr@psr2_sprite_mmap_cpu.html

  * igt@kms_psr_stress_test@invalidate-primary-flip-overlay:
    - shard-tglb:         [PASS][94] -> [SKIP][95] ([i915#5519])
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb7/igt@kms_psr_stress_test@invalidate-primary-flip-overlay.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@kms_psr_stress_test@invalidate-primary-flip-overlay.html

  * igt@kms_rotation_crc@multiplane-rotation-cropping-top:
    - shard-glk:          [PASS][96] -> [DMESG-FAIL][97] ([i915#118] / [i915#1888])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk7/igt@kms_rotation_crc@multiplane-rotation-cropping-top.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk9/igt@kms_rotation_crc@multiplane-rotation-cropping-top.html

  * igt@kms_rotation_crc@primary-yf-tiled-reflect-x-270:
    - shard-tglb:         NOTRUN -> [SKIP][98] ([fdo#111615] / [i915#5289])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb7/igt@kms_rotation_crc@primary-yf-tiled-reflect-x-270.html

  * igt@kms_selftest@all:
    - shard-tglb:         NOTRUN -> [SKIP][99] ([i915#6433])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb5/igt@kms_selftest@all.html
    - shard-iclb:         NOTRUN -> [SKIP][100] ([i915#6433])
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb3/igt@kms_selftest@all.html

  * igt@kms_tv_load_detect@load-detect:
    - shard-tglb:         NOTRUN -> [SKIP][101] ([fdo#109309])
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@kms_tv_load_detect@load-detect.html
    - shard-iclb:         NOTRUN -> [SKIP][102] ([fdo#109309])
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb1/igt@kms_tv_load_detect@load-detect.html

  * igt@kms_vblank@pipe-d-wait-idle:
    - shard-apl:          NOTRUN -> [SKIP][103] ([fdo#109271] / [i915#533])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl7/igt@kms_vblank@pipe-d-wait-idle.html
    - shard-glk:          NOTRUN -> [SKIP][104] ([fdo#109271] / [i915#533])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk8/igt@kms_vblank@pipe-d-wait-idle.html

  * igt@kms_writeback@writeback-fb-id:
    - shard-apl:          NOTRUN -> [SKIP][105] ([fdo#109271] / [i915#2437])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl6/igt@kms_writeback@writeback-fb-id.html

  * igt@perf@polling-parameterized:
    - shard-glk:          [PASS][106] -> [FAIL][107] ([i915#5639])
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk2/igt@perf@polling-parameterized.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk2/igt@perf@polling-parameterized.html

  * igt@perf_pmu@module-unload:
    - shard-snb:          [PASS][108] -> [DMESG-WARN][109] ([i915#4528] / [i915#6864])
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-snb5/igt@perf_pmu@module-unload.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb5/igt@perf_pmu@module-unload.html

  * igt@sysfs_clients@sema-25:
    - shard-apl:          NOTRUN -> [SKIP][110] ([fdo#109271] / [i915#2994])
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl8/igt@sysfs_clients@sema-25.html

  * igt@sysfs_clients@split-50:
    - shard-tglb:         NOTRUN -> [SKIP][111] ([i915#2994])
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb1/igt@sysfs_clients@split-50.html

  
#### Possible fixes ####

  * igt@gem_ctx_persistence@legacy-engines-hang@blt:
    - {shard-rkl}:        [SKIP][112] ([i915#6252]) -> [PASS][113]
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-5/igt@gem_ctx_persistence@legacy-engines-hang@blt.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-4/igt@gem_ctx_persistence@legacy-engines-hang@blt.html

  * igt@gem_exec_balancer@parallel-contexts:
    - shard-iclb:         [SKIP][114] ([i915#4525]) -> [PASS][115] +1 similar issue
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb5/igt@gem_exec_balancer@parallel-contexts.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@gem_exec_balancer@parallel-contexts.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-glk:          [FAIL][116] ([i915#2846]) -> [PASS][117]
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk1/igt@gem_exec_fair@basic-deadline.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk3/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-flow@rcs0:
    - shard-tglb:         [FAIL][118] ([i915#2842]) -> [PASS][119]
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb3/igt@gem_exec_fair@basic-flow@rcs0.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb2/igt@gem_exec_fair@basic-flow@rcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-glk:          [FAIL][120] ([i915#2842]) -> [PASS][121]
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk2/igt@gem_exec_fair@basic-throttle@rcs0.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk5/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_exec_nop@basic-sequential:
    - {shard-rkl}:        [SKIP][122] ([fdo#109315]) -> [PASS][123] +15 similar issues
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-5/igt@gem_exec_nop@basic-sequential.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-2/igt@gem_exec_nop@basic-sequential.html

  * igt@gem_mmap_wc@set-cache-level:
    - {shard-rkl}:        [SKIP][124] ([i915#1850]) -> [PASS][125]
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-3/igt@gem_mmap_wc@set-cache-level.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-6/igt@gem_mmap_wc@set-cache-level.html

  * igt@gem_readwrite@beyond-eob:
    - {shard-rkl}:        [SKIP][126] ([i915#3282]) -> [PASS][127] +1 similar issue
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-4/igt@gem_readwrite@beyond-eob.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-5/igt@gem_readwrite@beyond-eob.html

  * igt@gem_set_tiling_vs_blt@tiled-to-untiled:
    - {shard-rkl}:        [SKIP][128] ([i915#3281]) -> [PASS][129] +2 similar issues
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-4/igt@gem_set_tiling_vs_blt@tiled-to-untiled.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-5/igt@gem_set_tiling_vs_blt@tiled-to-untiled.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-glk:          [DMESG-WARN][130] ([i915#5566] / [i915#716]) -> [PASS][131]
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk7/igt@gen9_exec_parse@allowed-single.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk3/igt@gen9_exec_parse@allowed-single.html

  * igt@i915_pm_backlight@fade_with_suspend:
    - {shard-rkl}:        [SKIP][132] ([i915#3012]) -> [PASS][133]
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-2/igt@i915_pm_backlight@fade_with_suspend.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-6/igt@i915_pm_backlight@fade_with_suspend.html

  * igt@i915_pm_rpm@sysfs-read:
    - {shard-rkl}:        [SKIP][134] ([i915#5174]) -> [PASS][135]
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-5/igt@i915_pm_rpm@sysfs-read.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-2/igt@i915_pm_rpm@sysfs-read.html

  * igt@i915_pm_rps@engine-order:
    - shard-apl:          [FAIL][136] ([i915#6537]) -> [PASS][137]
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-apl3/igt@i915_pm_rps@engine-order.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl1/igt@i915_pm_rps@engine-order.html

  * igt@i915_selftest@live@hangcheck:
    - shard-snb:          [INCOMPLETE][138] ([i915#6992]) -> [PASS][139]
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-snb5/igt@i915_selftest@live@hangcheck.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb6/igt@i915_selftest@live@hangcheck.html

  * igt@i915_suspend@sysfs-reader:
    - shard-apl:          [DMESG-WARN][140] ([i915#180]) -> [PASS][141] +2 similar issues
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-apl8/igt@i915_suspend@sysfs-reader.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-apl7/igt@i915_suspend@sysfs-reader.html

  * igt@kms_3d:
    - {shard-rkl}:        [SKIP][142] ([i915#2575]) -> [PASS][143] +9 similar issues
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-5/igt@kms_3d.html
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-2/igt@kms_3d.html

  * igt@kms_big_fb@linear-32bpp-rotate-0:
    - {shard-rkl}:        [SKIP][144] ([i915#1845] / [i915#4098]) -> [PASS][145] +15 similar issues
   [144]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-4/igt@kms_big_fb@linear-32bpp-rotate-0.html
   [145]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-6/igt@kms_big_fb@linear-32bpp-rotate-0.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-async-flip:
    - shard-snb:          [SKIP][146] ([fdo#109271]) -> [PASS][147]
   [146]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-snb6/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-async-flip.html
   [147]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-snb7/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-async-flip.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size:
    - shard-glk:          [FAIL][148] ([i915#2346]) -> [PASS][149] +1 similar issue
   [148]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size.html
   [149]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk1/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions-varying-size.html

  * igt@kms_cursor_legacy@flip-vs-cursor@varying-size:
    - shard-iclb:         [FAIL][150] ([i915#2346]) -> [PASS][151] +1 similar issue
   [150]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb7/igt@kms_cursor_legacy@flip-vs-cursor@varying-size.html
   [151]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@kms_cursor_legacy@flip-vs-cursor@varying-size.html

  * igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-cpu:
    - shard-tglb:         [INCOMPLETE][152] -> [PASS][153] +1 similar issue
   [152]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-cpu.html
   [153]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-cpu.html

  * igt@kms_frontbuffer_tracking@psr-rgb101010-draw-pwrite:
    - {shard-rkl}:        [SKIP][154] ([i915#1849] / [i915#4098]) -> [PASS][155] +8 similar issues
   [154]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-4/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-pwrite.html
   [155]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-6/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-pwrite.html

  * igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes:
    - {shard-rkl}:        [SKIP][156] ([i915#1849] / [i915#3558]) -> [PASS][157] +1 similar issue
   [156]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-5/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html
   [157]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-6/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-a-planes.html

  * igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-pixel-formats@pipe-b-edp-1:
    - shard-iclb:         [SKIP][158] ([i915#5176]) -> [PASS][159] +1 similar issue
   [158]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb3/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-pixel-formats@pipe-b-edp-1.html
   [159]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb1/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-pixel-formats@pipe-b-edp-1.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1:
    - shard-iclb:         [SKIP][160] ([i915#5235]) -> [PASS][161] +5 similar issues
   [160]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb2/igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1.html
   [161]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb5/igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1.html

  * igt@kms_psr2_su@frontbuffer-xrgb8888:
    - shard-iclb:         [SKIP][162] ([fdo#109642] / [fdo#111068] / [i915#658]) -> [PASS][163]
   [162]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb6/igt@kms_psr2_su@frontbuffer-xrgb8888.html
   [163]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@kms_psr2_su@frontbuffer-xrgb8888.html

  * igt@kms_psr@cursor_render:
    - {shard-rkl}:        [SKIP][164] ([i915#1072]) -> [PASS][165] +1 similar issue
   [164]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-4/igt@kms_psr@cursor_render.html
   [165]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-6/igt@kms_psr@cursor_render.html

  * igt@kms_psr@psr2_cursor_blt:
    - shard-iclb:         [SKIP][166] ([fdo#109441]) -> [PASS][167] +3 similar issues
   [166]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb3/igt@kms_psr@psr2_cursor_blt.html
   [167]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html

  * igt@kms_rotation_crc@primary-rotation-270:
    - shard-glk:          [FAIL][168] ([i915#1888]) -> [PASS][169]
   [168]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk5/igt@kms_rotation_crc@primary-rotation-270.html
   [169]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk3/igt@kms_rotation_crc@primary-rotation-270.html

  * igt@perf@gen8-unprivileged-single-ctx-counters:
    - {shard-rkl}:        [SKIP][170] ([i915#5608]) -> [PASS][171] +1 similar issue
   [170]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-rkl-5/igt@perf@gen8-unprivileged-single-ctx-counters.html
   [171]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-rkl-5/igt@perf@gen8-unprivileged-single-ctx-counters.html

  * igt@perf@polling-parameterized:
    - shard-tglb:         [FAIL][172] ([i915#5639]) -> [PASS][173]
   [172]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-tglb8/igt@perf@polling-parameterized.html
   [173]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-tglb8/igt@perf@polling-parameterized.html

  
#### Warnings ####

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-glk:          [INCOMPLETE][174] -> [FAIL][175] ([i915#4767])
   [174]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-glk7/igt@kms_fbcon_fbt@fbc-suspend.html
   [175]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-glk6/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area:
    - shard-iclb:         [SKIP][176] ([fdo#111068] / [i915#658]) -> [SKIP][177] ([i915#2920])
   [176]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb5/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area.html
   [177]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb2/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area.html

  * igt@kms_psr2_su@page_flip-nv12:
    - shard-iclb:         [FAIL][178] ([i915#5939]) -> [SKIP][179] ([fdo#109642] / [fdo#111068] / [i915#658])
   [178]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12227/shard-iclb2/igt@kms_psr2_su@page_flip-nv12.html
   [179]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shard-iclb7/igt@kms_psr2_su@page_flip-nv12.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [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#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
  [fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
  [fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
  [fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#110725]: https://bugs.freedesktop.org/show_bug.cgi?id=110725
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [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
  [fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
  [fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
  [i915#1063]: https://gitlab.freedesktop.org/drm/intel/issues/1063
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#1850]: https://gitlab.freedesktop.org/drm/intel/issues/1850
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
  [i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3467]: https://gitlab.freedesktop.org/drm/intel/issues/3467
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [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#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3810]: https://gitlab.freedesktop.org/drm/intel/issues/3810
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3938]: https://gitlab.freedesktop.org/drm/intel/issues/3938
  [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#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [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#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
  [i915#4573]: https://gitlab.freedesktop.org/drm/intel/issues/4573
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
  [i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#4877]: https://gitlab.freedesktop.org/drm/intel/issues/4877
  [i915#4880]: https://gitlab.freedesktop.org/drm/intel/issues/4880
  [i915#4885]: https://gitlab.freedesktop.org/drm/intel/issues/4885
  [i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
  [i915#5174]: https://gitlab.freedesktop.org/drm/intel/issues/5174
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5234]: https://gitlab.freedesktop.org/drm/intel/issues/5234
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#5519]: https://gitlab.freedesktop.org/drm/intel/issues/5519
  [i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
  [i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
  [i915#5608]: https://gitlab.freedesktop.org/drm/intel/issues/5608
  [i915#5639]: https://gitlab.freedesktop.org/drm/intel/issues/5639
  [i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#5939]: https://gitlab.freedesktop.org/drm/intel/issues/5939
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
  [i915#6252]: https://gitlab.freedesktop.org/drm/intel/issues/6252
  [i915#6258]: https://gitlab.freedesktop.org/drm/intel/issues/6258
  [i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
  [i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
  [i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#6537]: https://gitlab.freedesktop.org/drm/intel/issues/6537
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6724]: https://gitlab.freedesktop.org/drm/intel/issues/6724
  [i915#6864]: https://gitlab.freedesktop.org/drm/intel/issues/6864
  [i915#6914]: https://gitlab.freedesktop.org/drm/intel/issues/6914
  [i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
  [i915#6992]: https://gitlab.freedesktop.org/drm/intel/issues/6992
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79


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

  * CI: CI-20190529 -> None
  * IGT: IGT_7003 -> IGTPW_7933
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_12227: 74e2443e7681e4d442b45f551ddf12d09a6f00c3 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7933: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/index.html
  IGT_7003: 1ea9ec5e7295fbc1cb784be4692971fd342bea53 @ 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_7933/index.html

[-- Attachment #2: Type: text/html, Size: 54519 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-09 15:18 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails Alaa Emad
  2022-10-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2022-10-09 16:57 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
@ 2022-10-10 11:16 ` Juha-Pekka Heikkila
  2022-10-10 14:26   ` aemad
  2022-11-01 11:25   ` aemad
  2022-10-11 12:56 ` Modem, Bhanuprakash
  3 siblings, 2 replies; 25+ messages in thread
From: Juha-Pekka Heikkila @ 2022-10-10 11:16 UTC (permalink / raw)
  To: Alaa Emad, igt-dev, Sharma, Swati2, Modem, Bhanuprakash; +Cc: petri.latvala

Hi Alaa,

what's that invalid argument you're getting on addfb? I never tried this 
with vkms, normally just on i915. With i915 I cannot reproduce that 
abort you're seeing. Other kms tests run on your setup?

Anyway, that revert you're suggesting would remove support for msm 
driver on this test. Let's first summon those who made these changes to 
comment. (cc'ing Modem and Swati)

/Juha-Pekka

On 9.10.2022 18.18, Alaa Emad wrote:
> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
> the execution is aborted instead of SKIP/FAIL, as in the following output:
> 
> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
> Stack trace:
> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
> Received signal SIGABRT.
> 
> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
> 
> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
> only dynamic subsubtests themselves will produce test results.
> 
> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
> by running all tests for one cursor size one by one, and check if cursor size is
> supported or not before running the test.
> 
> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
> 
> Signed-off-by: Alaa Emad <aemad@igalia.com>
> ---
>   tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>   1 file changed, 69 insertions(+), 67 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 8d3426dd..9b620389 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -72,7 +72,6 @@ typedef struct {
>   	cairo_surface_t *surface;
>   	uint32_t devid;
>   	double alpha;
> -	int vblank_wait_count; /* because of msm */
>   } data_t;
>   
>   #define TEST_DPMS (1<<0)
> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>   {
>   	igt_plane_set_fb(data->cursor, NULL);
>   	igt_plane_set_position(data->cursor, 0, 0);
> -	igt_display_commit(&data->display);
> -
> -	/* do this wait here so it will not need to be added everywhere */
> -	igt_wait_for_vblank_count(data->drm_fd,
> -				  data->display.pipes[data->pipe].crtc_offset,
> -				  data->vblank_wait_count);
>   }
>   
>   static bool chv_cursor_broken(data_t *data, int x)
> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>   		igt_display_commit(display);
>   
>   		/* Extra vblank wait is because nonblocking cursor ioctl */
> -		igt_wait_for_vblank_count(data->drm_fd,
> -					  display->pipes[data->pipe].crtc_offset,
> -					  data->vblank_wait_count);
> +		igt_wait_for_vblank(data->drm_fd,
> +				display->pipes[data->pipe].crtc_offset);
>   
>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>   
> @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>   
>   		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>   		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
> +
>   		igt_display_commit(display);
> +		igt_wait_for_vblank(data->drm_fd,
> +				display->pipes[data->pipe].crtc_offset);
> +
>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>   		igt_assert_crc_equal(&crc, hwcrc);
>   	}
> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>   	igt_plane_set_position(data->cursor, x, y);
>   	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>   
> +	igt_plane_set_position(data->cursor, 0, 0);
>   	cursor_disable(data);
> +	igt_display_commit(display);
>   
>   	igt_assert_eq(ret, expect);
>   }
> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>   	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>   }
>   
> -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
> -			   int w, int h)
> +static void run_size_tests(data_t *data, int w, int h)
>   {
>   	enum pipe pipe;
> +	int i;
> +
> +	struct
> +	{
> +		const char *name;
> +		void (*testfunc)(data_t *);
> +		const char *desc;
> +	} size_tests[] = {
> +		{"cursor-onscreen", test_crc_onscreen,
> +		 "Check if a given-size cursor is well-positioned inside the screen."},
> +		{"cursor-offscreen", test_crc_offscreen,
> +		 "Check if a given-size cursor is well-positioned outside the screen."},
> +		{"cursor-sliding", test_crc_sliding,
> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
> +		{"cursor-random", test_crc_random,
> +		 "Check random placement of a cursor with given size."},
> +		{"cursor-rapid-movement", test_rapid_movement,
> +		 "Check the rapid update of given-size cursor movements."},
> +	};
>   
>   	if (w == 0 && h == 0) {
>   		w = data->cursor_max_w;
> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>   		}
>   	}
>   
> -	create_cursor_fb(data, w, h);
> -	if (require_cursor_size(data, w, h)) {
> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
> -
> -		igt_remove_fb(data->drm_fd, &data->fb);
> -		return;
> -	}
> +	igt_fixture
> +		create_cursor_fb(data, w, h);
>   
> -	for_each_pipe(&data->display, pipe) {
> -		data->pipe = pipe;
> -		igt_dynamic_f("pipe-%s-%s",
> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
> -			run_test(data, testfunc, w, h);
> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
> +	{
> +		igt_describe(size_tests[i].desc);
> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
> +		{
> +			for_each_pipe(&data->display, pipe)
> +			{
> +				data->pipe = pipe;
> +				if (require_cursor_size(data, w, h))
> +				{
> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
> +					continue;
> +				}
> +
> +				igt_dynamic_f("pipe-%s-%s",
> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
> +					run_test(data, size_tests[i].testfunc, w, h);
> +			}
> +		}
>   	}
>   
> -	igt_remove_fb(data->drm_fd, &data->fb);
> +	igt_fixture
> +		igt_remove_fb(data->drm_fd, &data->fb);
>   }
>   
>   static void run_tests_on_pipe(data_t *data)
>   {
>   	enum pipe pipe;
>   	int cursor_size;
> -	int i;
> -	struct {
> -		const char *name;
> -		void (*testfunc)(data_t *);
> -		const char *desc;
> -	} size_tests[] = {
> -		{ "cursor-onscreen", test_crc_onscreen,
> -			"Check if a given-size cursor is well-positioned inside the screen." },
> -		{ "cursor-offscreen", test_crc_offscreen,
> -			"Check if a given-size cursor is well-positioned outside the screen." },
> -		{ "cursor-sliding", test_crc_sliding,
> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
> -		{ "cursor-random", test_crc_random,
> -			"Check random placement of a cursor with given size." },
> -		{ "cursor-rapid-movement", test_rapid_movement,
> -			"Check the rapid update of given-size cursor movements." },
> -	};
>   
>   	igt_fixture {
>   		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>   	igt_fixture
>   		igt_remove_fb(data->drm_fd, &data->fb);
>   
> -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
> -		igt_describe(size_tests[i].desc);
> -		igt_subtest_group {
> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
> -				int w = cursor_size;
> -				int h = cursor_size;
> -
> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
> -					run_size_tests(data, size_tests[i].testfunc, w, h);
> -
> -				/*
> -				 * Test non-square cursors a bit on the platforms
> -				 * that support such things. And make it a bit more
> -				 * interesting by using a non-pot height.
> -				 */
> -				h /= 3;
> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
> -					run_size_tests(data, size_tests[i].testfunc, w, h);
> -			}
> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
> +	{
> +		int w = cursor_size;
> +		int h = cursor_size;
>   
> -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
> -		}
> +		igt_subtest_group
> +			run_size_tests(data, w, h);
> +
> +		/*
> +		 * Test non-square cursors a bit on the platforms
> +		 * that support such things. And make it a bit more
> +		 * interesting by using a non-pot height.
> +		 */
> +		h /= 3;
> +
> +		igt_subtest_group
> +			run_size_tests(data, w, h);
>   	}
> +	
> +	run_size_tests(data, 0, 0);
>   }
>   
>   static data_t data;
> @@ -896,8 +901,6 @@ igt_main
>   		kmstest_set_vt_graphics_mode();
>   
>   		igt_require_pipe_crc(data.drm_fd);
> -
> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>   	}
>   
>   	data.cursor_max_w = cursor_width;
> @@ -913,6 +916,5 @@ igt_main
>   		}
>   
>   		igt_display_fini(&data.display);
> -		close(data.drm_fd);
>   	}
>   }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-10 11:16 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
@ 2022-10-10 14:26   ` aemad
  2022-10-10 18:52     ` Juha-Pekka Heikkila
  2022-11-01 11:25   ` aemad
  1 sibling, 1 reply; 25+ messages in thread
From: aemad @ 2022-10-10 14:26 UTC (permalink / raw)
  To: juhapekka.heikkila; +Cc: igt-dev, petri.latvala

Hi Juha,

On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
> Hi Alaa,
> 
> what's that invalid argument you're getting on addfb? I never tried

I am not sure what is the invalid argument, but the failure of this test
with a cursor size 32x10 is that VKMS does not support this size yet so
the test unable to create a cursor FB.


> this with vkms, normally just on i915. With i915 I cannot reproduce
> that abort you're seeing. Other kms tests run on your setup?

I think the abortion related to VKMS driver only, but I didn't try to
run it on i915.
yes, I ran other kms test but with VKMS driver.

> 
> Anyway, that revert you're suggesting would remove support for msm
> driver on this test. Let's first summon those who made these changes
> to comment. (cc'ing Modem and Swati)

I see, so I can check that after Modem and Swati reply.

> 
> /Juha-Pekka

BR,
Alaa
> 
> On 9.10.2022 18.18, Alaa Emad wrote:
>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>
>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>> Stack trace:
>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>> Received signal SIGABRT.
>>
>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>
>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>> only dynamic subsubtests themselves will produce test results.
>>
>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>> by running all tests for one cursor size one by one, and check if cursor size is
>> supported or not before running the test.
>>
>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>
>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>> ---
>>   tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>   1 file changed, 69 insertions(+), 67 deletions(-)
>>
>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>> index 8d3426dd..9b620389 100644
>> --- a/tests/kms_cursor_crc.c
>> +++ b/tests/kms_cursor_crc.c
>> @@ -72,7 +72,6 @@ typedef struct {
>>   	cairo_surface_t *surface;
>>   	uint32_t devid;
>>   	double alpha;
>> -	int vblank_wait_count; /* because of msm */
>>   } data_t;
>>     #define TEST_DPMS (1<<0)
>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>   {
>>   	igt_plane_set_fb(data->cursor, NULL);
>>   	igt_plane_set_position(data->cursor, 0, 0);
>> -	igt_display_commit(&data->display);
>> -
>> -	/* do this wait here so it will not need to be added everywhere */
>> -	igt_wait_for_vblank_count(data->drm_fd,
>> -				  data->display.pipes[data->pipe].crtc_offset,
>> -				  data->vblank_wait_count);
>>   }
>>     static bool chv_cursor_broken(data_t *data, int x)
>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>   		igt_display_commit(display);
>>     		/* Extra vblank wait is because nonblocking cursor ioctl */
>> -		igt_wait_for_vblank_count(data->drm_fd,
>> -					  display->pipes[data->pipe].crtc_offset,
>> -					  data->vblank_wait_count);
>> +		igt_wait_for_vblank(data->drm_fd,
>> +				display->pipes[data->pipe].crtc_offset);
>>     		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>   @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>     		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>   		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>> +
>>   		igt_display_commit(display);
>> +		igt_wait_for_vblank(data->drm_fd,
>> +				display->pipes[data->pipe].crtc_offset);
>> +
>>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>   		igt_assert_crc_equal(&crc, hwcrc);
>>   	}
>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>   	igt_plane_set_position(data->cursor, x, y);
>>   	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>   +	igt_plane_set_position(data->cursor, 0, 0);
>>   	cursor_disable(data);
>> +	igt_display_commit(display);
>>     	igt_assert_eq(ret, expect);
>>   }
>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>   	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>   }
>>   -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>> -			   int w, int h)
>> +static void run_size_tests(data_t *data, int w, int h)
>>   {
>>   	enum pipe pipe;
>> +	int i;
>> +
>> +	struct
>> +	{
>> +		const char *name;
>> +		void (*testfunc)(data_t *);
>> +		const char *desc;
>> +	} size_tests[] = {
>> +		{"cursor-onscreen", test_crc_onscreen,
>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>> +		{"cursor-offscreen", test_crc_offscreen,
>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>> +		{"cursor-sliding", test_crc_sliding,
>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>> +		{"cursor-random", test_crc_random,
>> +		 "Check random placement of a cursor with given size."},
>> +		{"cursor-rapid-movement", test_rapid_movement,
>> +		 "Check the rapid update of given-size cursor movements."},
>> +	};
>>     	if (w == 0 && h == 0) {
>>   		w = data->cursor_max_w;
>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>   		}
>>   	}
>>   -	create_cursor_fb(data, w, h);
>> -	if (require_cursor_size(data, w, h)) {
>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>> -
>> -		igt_remove_fb(data->drm_fd, &data->fb);
>> -		return;
>> -	}
>> +	igt_fixture
>> +		create_cursor_fb(data, w, h);
>>   -	for_each_pipe(&data->display, pipe) {
>> -		data->pipe = pipe;
>> -		igt_dynamic_f("pipe-%s-%s",
>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>> -			run_test(data, testfunc, w, h);
>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>> +	{
>> +		igt_describe(size_tests[i].desc);
>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> +		{
>> +			for_each_pipe(&data->display, pipe)
>> +			{
>> +				data->pipe = pipe;
>> +				if (require_cursor_size(data, w, h))
>> +				{
>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>> +					continue;
>> +				}
>> +
>> +				igt_dynamic_f("pipe-%s-%s",
>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>> +					run_test(data, size_tests[i].testfunc, w, h);
>> +			}
>> +		}
>>   	}
>>   -	igt_remove_fb(data->drm_fd, &data->fb);
>> +	igt_fixture
>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>   }
>>     static void run_tests_on_pipe(data_t *data)
>>   {
>>   	enum pipe pipe;
>>   	int cursor_size;
>> -	int i;
>> -	struct {
>> -		const char *name;
>> -		void (*testfunc)(data_t *);
>> -		const char *desc;
>> -	} size_tests[] = {
>> -		{ "cursor-onscreen", test_crc_onscreen,
>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>> -		{ "cursor-offscreen", test_crc_offscreen,
>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>> -		{ "cursor-sliding", test_crc_sliding,
>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>> -		{ "cursor-random", test_crc_random,
>> -			"Check random placement of a cursor with given size." },
>> -		{ "cursor-rapid-movement", test_rapid_movement,
>> -			"Check the rapid update of given-size cursor movements." },
>> -	};
>>     	igt_fixture {
>>   		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>   	igt_fixture
>>   		igt_remove_fb(data->drm_fd, &data->fb);
>>   -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>> -		igt_describe(size_tests[i].desc);
>> -		igt_subtest_group {
>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>> -				int w = cursor_size;
>> -				int h = cursor_size;
>> -
>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>> -
>> -				/*
>> -				 * Test non-square cursors a bit on the platforms
>> -				 * that support such things. And make it a bit more
>> -				 * interesting by using a non-pot height.
>> -				 */
>> -				h /= 3;
>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>> -			}
>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>> +	{
>> +		int w = cursor_size;
>> +		int h = cursor_size;
>>   -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>> -		}
>> +		igt_subtest_group
>> +			run_size_tests(data, w, h);
>> +
>> +		/*
>> +		 * Test non-square cursors a bit on the platforms
>> +		 * that support such things. And make it a bit more
>> +		 * interesting by using a non-pot height.
>> +		 */
>> +		h /= 3;
>> +
>> +		igt_subtest_group
>> +			run_size_tests(data, w, h);
>>   	}
>> +
>> +	run_size_tests(data, 0, 0);
>>   }
>>     static data_t data;
>> @@ -896,8 +901,6 @@ igt_main
>>   		kmstest_set_vt_graphics_mode();
>>     		igt_require_pipe_crc(data.drm_fd);
>> -
>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>   	}
>>     	data.cursor_max_w = cursor_width;
>> @@ -913,6 +916,5 @@ igt_main
>>   		}
>>     		igt_display_fini(&data.display);
>> -		close(data.drm_fd);
>>   	}
>>   }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-10 14:26   ` aemad
@ 2022-10-10 18:52     ` Juha-Pekka Heikkila
  2022-10-11 17:08       ` aemad
  0 siblings, 1 reply; 25+ messages in thread
From: Juha-Pekka Heikkila @ 2022-10-10 18:52 UTC (permalink / raw)
  To: aemad; +Cc: igt-dev, petri.latvala

On 10.10.2022 17.26, aemad wrote:
> Hi Juha,
> 
> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>> Hi Alaa,
>>
>> what's that invalid argument you're getting on addfb? I never tried
> 
> I am not sure what is the invalid argument, but the failure of this test
> with a cursor size 32x10 is that VKMS does not support this size yet so
> the test unable to create a cursor FB.

At that moment when addfb gives failure it doesn't yet relate to cursor 
testing, it is like any other framebuffer. As other kms tests work for 
you there maybe limitation on vkms not supporting so small framebuffer 
or it could be on libigt there's something missing for handling vkms 
framebuffers.

I'm looking at kernel sources and I suspect you'd see in dmesg message 
saying  "GEM object size (%zu) smaller than minimum size (%u) for plane 
%d\n" when that addfb failed? If it is that message then probably into 
libigt for vkms there would be needed some minimum size alignment with 
framebuffers.

> 
> 
>> this with vkms, normally just on i915. With i915 I cannot reproduce
>> that abort you're seeing. Other kms tests run on your setup?
> 
> I think the abortion related to VKMS driver only, but I didn't try to
> run it on i915.
> yes, I ran other kms test but with VKMS driver.
> 
>>
>> Anyway, that revert you're suggesting would remove support for msm
>> driver on this test. Let's first summon those who made these changes
>> to comment. (cc'ing Modem and Swati)
> 
> I see, so I can check that after Modem and Swati reply.
> 
>>
>> /Juha-Pekka
> 
> BR,
> Alaa
>>
>> On 9.10.2022 18.18, Alaa Emad wrote:
>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>
>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>> Stack trace:
>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>> Received signal SIGABRT.
>>>
>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>
>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>> only dynamic subsubtests themselves will produce test results.
>>>
>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>> by running all tests for one cursor size one by one, and check if cursor size is
>>> supported or not before running the test.
>>>
>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>
>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>> ---
>>>    tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>
>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>> index 8d3426dd..9b620389 100644
>>> --- a/tests/kms_cursor_crc.c
>>> +++ b/tests/kms_cursor_crc.c
>>> @@ -72,7 +72,6 @@ typedef struct {
>>>    	cairo_surface_t *surface;
>>>    	uint32_t devid;
>>>    	double alpha;
>>> -	int vblank_wait_count; /* because of msm */
>>>    } data_t;
>>>      #define TEST_DPMS (1<<0)
>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>    {
>>>    	igt_plane_set_fb(data->cursor, NULL);
>>>    	igt_plane_set_position(data->cursor, 0, 0);
>>> -	igt_display_commit(&data->display);
>>> -
>>> -	/* do this wait here so it will not need to be added everywhere */
>>> -	igt_wait_for_vblank_count(data->drm_fd,
>>> -				  data->display.pipes[data->pipe].crtc_offset,
>>> -				  data->vblank_wait_count);
>>>    }
>>>      static bool chv_cursor_broken(data_t *data, int x)
>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>    		igt_display_commit(display);
>>>      		/* Extra vblank wait is because nonblocking cursor ioctl */
>>> -		igt_wait_for_vblank_count(data->drm_fd,
>>> -					  display->pipes[data->pipe].crtc_offset,
>>> -					  data->vblank_wait_count);
>>> +		igt_wait_for_vblank(data->drm_fd,
>>> +				display->pipes[data->pipe].crtc_offset);
>>>      		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>      		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>    		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>> +
>>>    		igt_display_commit(display);
>>> +		igt_wait_for_vblank(data->drm_fd,
>>> +				display->pipes[data->pipe].crtc_offset);
>>> +
>>>    		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>    		igt_assert_crc_equal(&crc, hwcrc);
>>>    	}
>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>    	igt_plane_set_position(data->cursor, x, y);
>>>    	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>    +	igt_plane_set_position(data->cursor, 0, 0);
>>>    	cursor_disable(data);
>>> +	igt_display_commit(display);
>>>      	igt_assert_eq(ret, expect);
>>>    }
>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>    	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>    }
>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>> -			   int w, int h)
>>> +static void run_size_tests(data_t *data, int w, int h)
>>>    {
>>>    	enum pipe pipe;
>>> +	int i;
>>> +
>>> +	struct
>>> +	{
>>> +		const char *name;
>>> +		void (*testfunc)(data_t *);
>>> +		const char *desc;
>>> +	} size_tests[] = {
>>> +		{"cursor-onscreen", test_crc_onscreen,
>>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>>> +		{"cursor-offscreen", test_crc_offscreen,
>>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>>> +		{"cursor-sliding", test_crc_sliding,
>>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>> +		{"cursor-random", test_crc_random,
>>> +		 "Check random placement of a cursor with given size."},
>>> +		{"cursor-rapid-movement", test_rapid_movement,
>>> +		 "Check the rapid update of given-size cursor movements."},
>>> +	};
>>>      	if (w == 0 && h == 0) {
>>>    		w = data->cursor_max_w;
>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>    		}
>>>    	}
>>>    -	create_cursor_fb(data, w, h);
>>> -	if (require_cursor_size(data, w, h)) {
>>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>> -
>>> -		igt_remove_fb(data->drm_fd, &data->fb);
>>> -		return;
>>> -	}
>>> +	igt_fixture
>>> +		create_cursor_fb(data, w, h);
>>>    -	for_each_pipe(&data->display, pipe) {
>>> -		data->pipe = pipe;
>>> -		igt_dynamic_f("pipe-%s-%s",
>>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>>> -			run_test(data, testfunc, w, h);
>>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>> +	{
>>> +		igt_describe(size_tests[i].desc);
>>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>> +		{
>>> +			for_each_pipe(&data->display, pipe)
>>> +			{
>>> +				data->pipe = pipe;
>>> +				if (require_cursor_size(data, w, h))
>>> +				{
>>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>> +					continue;
>>> +				}
>>> +
>>> +				igt_dynamic_f("pipe-%s-%s",
>>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>> +					run_test(data, size_tests[i].testfunc, w, h);
>>> +			}
>>> +		}
>>>    	}
>>>    -	igt_remove_fb(data->drm_fd, &data->fb);
>>> +	igt_fixture
>>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>>    }
>>>      static void run_tests_on_pipe(data_t *data)
>>>    {
>>>    	enum pipe pipe;
>>>    	int cursor_size;
>>> -	int i;
>>> -	struct {
>>> -		const char *name;
>>> -		void (*testfunc)(data_t *);
>>> -		const char *desc;
>>> -	} size_tests[] = {
>>> -		{ "cursor-onscreen", test_crc_onscreen,
>>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>>> -		{ "cursor-offscreen", test_crc_offscreen,
>>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>>> -		{ "cursor-sliding", test_crc_sliding,
>>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>> -		{ "cursor-random", test_crc_random,
>>> -			"Check random placement of a cursor with given size." },
>>> -		{ "cursor-rapid-movement", test_rapid_movement,
>>> -			"Check the rapid update of given-size cursor movements." },
>>> -	};
>>>      	igt_fixture {
>>>    		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>    	igt_fixture
>>>    		igt_remove_fb(data->drm_fd, &data->fb);
>>>    -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>> -		igt_describe(size_tests[i].desc);
>>> -		igt_subtest_group {
>>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>> -				int w = cursor_size;
>>> -				int h = cursor_size;
>>> -
>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>> -
>>> -				/*
>>> -				 * Test non-square cursors a bit on the platforms
>>> -				 * that support such things. And make it a bit more
>>> -				 * interesting by using a non-pot height.
>>> -				 */
>>> -				h /= 3;
>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>> -			}
>>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>> +	{
>>> +		int w = cursor_size;
>>> +		int h = cursor_size;
>>>    -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>> -		}
>>> +		igt_subtest_group
>>> +			run_size_tests(data, w, h);
>>> +
>>> +		/*
>>> +		 * Test non-square cursors a bit on the platforms
>>> +		 * that support such things. And make it a bit more
>>> +		 * interesting by using a non-pot height.
>>> +		 */
>>> +		h /= 3;
>>> +
>>> +		igt_subtest_group
>>> +			run_size_tests(data, w, h);
>>>    	}
>>> +
>>> +	run_size_tests(data, 0, 0);
>>>    }
>>>      static data_t data;
>>> @@ -896,8 +901,6 @@ igt_main
>>>    		kmstest_set_vt_graphics_mode();
>>>      		igt_require_pipe_crc(data.drm_fd);
>>> -
>>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>    	}
>>>      	data.cursor_max_w = cursor_width;
>>> @@ -913,6 +916,5 @@ igt_main
>>>    		}
>>>      		igt_display_fini(&data.display);
>>> -		close(data.drm_fd);
>>>    	}
>>>    }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-09 15:18 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails Alaa Emad
                   ` (2 preceding siblings ...)
  2022-10-10 11:16 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
@ 2022-10-11 12:56 ` Modem, Bhanuprakash
  2022-10-11 17:25   ` aemad
  3 siblings, 1 reply; 25+ messages in thread
From: Modem, Bhanuprakash @ 2022-10-11 12:56 UTC (permalink / raw)
  To: Alaa Emad, igt-dev; +Cc: petri.latvala

On Sun-09-10-2022 08:48 pm, Alaa Emad wrote:
> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
> the execution is aborted instead of SKIP/FAIL, as in the following output:
> 
> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
> Stack trace:
> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
> Received signal SIGABRT.
> 
> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.

I think you just need to put this fb creation part to igt_fixture

igt_fixture {
	create_cursor_fb(data, w, h);
}

> 
> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
> only dynamic subsubtests themselves will produce test results.
> 
> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
> by running all tests for one cursor size one by one, and check if cursor size is
> supported or not before running the test.

With this change, maximum cursor size test will not show up in list of 
tests. Ie. max size test and what happened with them are not seen here:

https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shards-all.html?testfilter=kms_cursor_crc

 From previous conversations [1]:
And I think it is needed here to know what happen with maximum cursor 
size tests. Maximum cursor size is special case that is wanted to be 
known what happen with it, will driver reported largest possible cursor 
work.

[1]: https://patchwork.freedesktop.org/patch/496899/

- Bhanu

> 
> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
> 
> Signed-off-by: Alaa Emad <aemad@igalia.com>
> ---
>   tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>   1 file changed, 69 insertions(+), 67 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 8d3426dd..9b620389 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -72,7 +72,6 @@ typedef struct {
>   	cairo_surface_t *surface;
>   	uint32_t devid;
>   	double alpha;
> -	int vblank_wait_count; /* because of msm */
>   } data_t;
>   
>   #define TEST_DPMS (1<<0)
> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>   {
>   	igt_plane_set_fb(data->cursor, NULL);
>   	igt_plane_set_position(data->cursor, 0, 0);
> -	igt_display_commit(&data->display);
> -
> -	/* do this wait here so it will not need to be added everywhere */
> -	igt_wait_for_vblank_count(data->drm_fd,
> -				  data->display.pipes[data->pipe].crtc_offset,
> -				  data->vblank_wait_count);
>   }
>   
>   static bool chv_cursor_broken(data_t *data, int x)
> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>   		igt_display_commit(display);
>   
>   		/* Extra vblank wait is because nonblocking cursor ioctl */
> -		igt_wait_for_vblank_count(data->drm_fd,
> -					  display->pipes[data->pipe].crtc_offset,
> -					  data->vblank_wait_count);
> +		igt_wait_for_vblank(data->drm_fd,
> +				display->pipes[data->pipe].crtc_offset);
>   
>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>   
> @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>   
>   		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>   		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
> +
>   		igt_display_commit(display);
> +		igt_wait_for_vblank(data->drm_fd,
> +				display->pipes[data->pipe].crtc_offset);
> +
>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>   		igt_assert_crc_equal(&crc, hwcrc);
>   	}
> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>   	igt_plane_set_position(data->cursor, x, y);
>   	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>   
> +	igt_plane_set_position(data->cursor, 0, 0);
>   	cursor_disable(data);
> +	igt_display_commit(display);
>   
>   	igt_assert_eq(ret, expect);
>   }
> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>   	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>   }
>   
> -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
> -			   int w, int h)
> +static void run_size_tests(data_t *data, int w, int h)
>   {
>   	enum pipe pipe;
> +	int i;
> +
> +	struct
> +	{
> +		const char *name;
> +		void (*testfunc)(data_t *);
> +		const char *desc;
> +	} size_tests[] = {
> +		{"cursor-onscreen", test_crc_onscreen,
> +		 "Check if a given-size cursor is well-positioned inside the screen."},
> +		{"cursor-offscreen", test_crc_offscreen,
> +		 "Check if a given-size cursor is well-positioned outside the screen."},
> +		{"cursor-sliding", test_crc_sliding,
> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
> +		{"cursor-random", test_crc_random,
> +		 "Check random placement of a cursor with given size."},
> +		{"cursor-rapid-movement", test_rapid_movement,
> +		 "Check the rapid update of given-size cursor movements."},
> +	};
>   
>   	if (w == 0 && h == 0) {
>   		w = data->cursor_max_w;
> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>   		}
>   	}
>   
> -	create_cursor_fb(data, w, h);
> -	if (require_cursor_size(data, w, h)) {
> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
> -
> -		igt_remove_fb(data->drm_fd, &data->fb);
> -		return;
> -	}
> +	igt_fixture
> +		create_cursor_fb(data, w, h);
>   
> -	for_each_pipe(&data->display, pipe) {
> -		data->pipe = pipe;
> -		igt_dynamic_f("pipe-%s-%s",
> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
> -			run_test(data, testfunc, w, h);
> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
> +	{
> +		igt_describe(size_tests[i].desc);
> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
> +		{
> +			for_each_pipe(&data->display, pipe)
> +			{
> +				data->pipe = pipe;
> +				if (require_cursor_size(data, w, h))
> +				{
> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
> +					continue;
> +				}
> +
> +				igt_dynamic_f("pipe-%s-%s",
> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
> +					run_test(data, size_tests[i].testfunc, w, h);
> +			}
> +		}
>   	}
>   
> -	igt_remove_fb(data->drm_fd, &data->fb);
> +	igt_fixture
> +		igt_remove_fb(data->drm_fd, &data->fb);
>   }
>   
>   static void run_tests_on_pipe(data_t *data)
>   {
>   	enum pipe pipe;
>   	int cursor_size;
> -	int i;
> -	struct {
> -		const char *name;
> -		void (*testfunc)(data_t *);
> -		const char *desc;
> -	} size_tests[] = {
> -		{ "cursor-onscreen", test_crc_onscreen,
> -			"Check if a given-size cursor is well-positioned inside the screen." },
> -		{ "cursor-offscreen", test_crc_offscreen,
> -			"Check if a given-size cursor is well-positioned outside the screen." },
> -		{ "cursor-sliding", test_crc_sliding,
> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
> -		{ "cursor-random", test_crc_random,
> -			"Check random placement of a cursor with given size." },
> -		{ "cursor-rapid-movement", test_rapid_movement,
> -			"Check the rapid update of given-size cursor movements." },
> -	};
>   
>   	igt_fixture {
>   		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>   	igt_fixture
>   		igt_remove_fb(data->drm_fd, &data->fb);
>   
> -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
> -		igt_describe(size_tests[i].desc);
> -		igt_subtest_group {
> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
> -				int w = cursor_size;
> -				int h = cursor_size;
> -
> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
> -					run_size_tests(data, size_tests[i].testfunc, w, h);
> -
> -				/*
> -				 * Test non-square cursors a bit on the platforms
> -				 * that support such things. And make it a bit more
> -				 * interesting by using a non-pot height.
> -				 */
> -				h /= 3;
> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
> -					run_size_tests(data, size_tests[i].testfunc, w, h);
> -			}
> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
> +	{
> +		int w = cursor_size;
> +		int h = cursor_size;
>   
> -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
> -		}
> +		igt_subtest_group
> +			run_size_tests(data, w, h);
> +
> +		/*
> +		 * Test non-square cursors a bit on the platforms
> +		 * that support such things. And make it a bit more
> +		 * interesting by using a non-pot height.
> +		 */
> +		h /= 3;
> +
> +		igt_subtest_group
> +			run_size_tests(data, w, h);
>   	}
> +	
> +	run_size_tests(data, 0, 0);
>   }
>   
>   static data_t data;
> @@ -896,8 +901,6 @@ igt_main
>   		kmstest_set_vt_graphics_mode();
>   
>   		igt_require_pipe_crc(data.drm_fd);
> -
> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>   	}
>   
>   	data.cursor_max_w = cursor_width;
> @@ -913,6 +916,5 @@ igt_main
>   		}
>   
>   		igt_display_fini(&data.display);
> -		close(data.drm_fd);
>   	}
>   }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-10 18:52     ` Juha-Pekka Heikkila
@ 2022-10-11 17:08       ` aemad
  2022-10-11 17:35         ` Juha-Pekka Heikkila
  0 siblings, 1 reply; 25+ messages in thread
From: aemad @ 2022-10-11 17:08 UTC (permalink / raw)
  To: juhapekka.heikkila; +Cc: igt-dev, petri.latvala

On 2022-10-10 20:52, Juha-Pekka Heikkila wrote:
> On 10.10.2022 17.26, aemad wrote:
>> Hi Juha,
>>
>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>> Hi Alaa,
>>>
>>> what's that invalid argument you're getting on addfb? I never tried
>>
>> I am not sure what is the invalid argument, but the failure of this test
>> with a cursor size 32x10 is that VKMS does not support this size yet so
>> the test unable to create a cursor FB.
> 
> At that moment when addfb gives failure it doesn't yet relate to
> cursor testing, it is like any other framebuffer. As other kms tests
> work for you there maybe limitation on vkms not supporting so small
> framebuffer or it could be on libigt there's something missing for
> handling vkms framebuffers.

yes, understood.
> 
> I'm looking at kernel sources and I suspect you'd see in dmesg message
> saying  "GEM object size (%zu) smaller than minimum size (%u) for
> plane %d\n" when that addfb failed? If it is that message then
> probably into libigt for vkms there would be needed some minimum size
> alignment with framebuffers.

I didn't check dmesg message, but I will check it. I got your point,
Thank you.
> 
>>
>>
>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>> that abort you're seeing. Other kms tests run on your setup?
>>
>> I think the abortion related to VKMS driver only, but I didn't try to
>> run it on i915.
>> yes, I ran other kms test but with VKMS driver.
>>
>>>
>>> Anyway, that revert you're suggesting would remove support for msm
>>> driver on this test. Let's first summon those who made these changes
>>> to comment. (cc'ing Modem and Swati)
>>
>> I see, so I can check that after Modem and Swati reply.
>>
>>>
>>> /Juha-Pekka
>>
>> BR,
>> Alaa
>>>
>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>
>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>> Stack trace:
>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>> Received signal SIGABRT.
>>>>
>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>
>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>> only dynamic subsubtests themselves will produce test results.
>>>>
>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>> supported or not before running the test.
>>>>
>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>
>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>> ---
>>>>    tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>>
>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>> index 8d3426dd..9b620389 100644
>>>> --- a/tests/kms_cursor_crc.c
>>>> +++ b/tests/kms_cursor_crc.c
>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>    	cairo_surface_t *surface;
>>>>    	uint32_t devid;
>>>>    	double alpha;
>>>> -	int vblank_wait_count; /* because of msm */
>>>>    } data_t;
>>>>      #define TEST_DPMS (1<<0)
>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>    {
>>>>    	igt_plane_set_fb(data->cursor, NULL);
>>>>    	igt_plane_set_position(data->cursor, 0, 0);
>>>> -	igt_display_commit(&data->display);
>>>> -
>>>> -	/* do this wait here so it will not need to be added everywhere */
>>>> -	igt_wait_for_vblank_count(data->drm_fd,
>>>> -				  data->display.pipes[data->pipe].crtc_offset,
>>>> -				  data->vblank_wait_count);
>>>>    }
>>>>      static bool chv_cursor_broken(data_t *data, int x)
>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>    		igt_display_commit(display);
>>>>      		/* Extra vblank wait is because nonblocking cursor ioctl */
>>>> -		igt_wait_for_vblank_count(data->drm_fd,
>>>> -					  display->pipes[data->pipe].crtc_offset,
>>>> -					  data->vblank_wait_count);
>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>> +				display->pipes[data->pipe].crtc_offset);
>>>>      		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>      		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>    		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>> +
>>>>    		igt_display_commit(display);
>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>> +				display->pipes[data->pipe].crtc_offset);
>>>> +
>>>>    		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>    		igt_assert_crc_equal(&crc, hwcrc);
>>>>    	}
>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>    	igt_plane_set_position(data->cursor, x, y);
>>>>    	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>    +	igt_plane_set_position(data->cursor, 0, 0);
>>>>    	cursor_disable(data);
>>>> +	igt_display_commit(display);
>>>>      	igt_assert_eq(ret, expect);
>>>>    }
>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>    	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>    }
>>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>> -			   int w, int h)
>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>    {
>>>>    	enum pipe pipe;
>>>> +	int i;
>>>> +
>>>> +	struct
>>>> +	{
>>>> +		const char *name;
>>>> +		void (*testfunc)(data_t *);
>>>> +		const char *desc;
>>>> +	} size_tests[] = {
>>>> +		{"cursor-onscreen", test_crc_onscreen,
>>>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>>>> +		{"cursor-offscreen", test_crc_offscreen,
>>>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>>>> +		{"cursor-sliding", test_crc_sliding,
>>>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>> +		{"cursor-random", test_crc_random,
>>>> +		 "Check random placement of a cursor with given size."},
>>>> +		{"cursor-rapid-movement", test_rapid_movement,
>>>> +		 "Check the rapid update of given-size cursor movements."},
>>>> +	};
>>>>      	if (w == 0 && h == 0) {
>>>>    		w = data->cursor_max_w;
>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>    		}
>>>>    	}
>>>>    -	create_cursor_fb(data, w, h);
>>>> -	if (require_cursor_size(data, w, h)) {
>>>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>> -
>>>> -		igt_remove_fb(data->drm_fd, &data->fb);
>>>> -		return;
>>>> -	}
>>>> +	igt_fixture
>>>> +		create_cursor_fb(data, w, h);
>>>>    -	for_each_pipe(&data->display, pipe) {
>>>> -		data->pipe = pipe;
>>>> -		igt_dynamic_f("pipe-%s-%s",
>>>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>> -			run_test(data, testfunc, w, h);
>>>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>> +	{
>>>> +		igt_describe(size_tests[i].desc);
>>>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>> +		{
>>>> +			for_each_pipe(&data->display, pipe)
>>>> +			{
>>>> +				data->pipe = pipe;
>>>> +				if (require_cursor_size(data, w, h))
>>>> +				{
>>>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>> +					continue;
>>>> +				}
>>>> +
>>>> +				igt_dynamic_f("pipe-%s-%s",
>>>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>> +					run_test(data, size_tests[i].testfunc, w, h);
>>>> +			}
>>>> +		}
>>>>    	}
>>>>    -	igt_remove_fb(data->drm_fd, &data->fb);
>>>> +	igt_fixture
>>>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>>>    }
>>>>      static void run_tests_on_pipe(data_t *data)
>>>>    {
>>>>    	enum pipe pipe;
>>>>    	int cursor_size;
>>>> -	int i;
>>>> -	struct {
>>>> -		const char *name;
>>>> -		void (*testfunc)(data_t *);
>>>> -		const char *desc;
>>>> -	} size_tests[] = {
>>>> -		{ "cursor-onscreen", test_crc_onscreen,
>>>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>>>> -		{ "cursor-offscreen", test_crc_offscreen,
>>>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>>>> -		{ "cursor-sliding", test_crc_sliding,
>>>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>> -		{ "cursor-random", test_crc_random,
>>>> -			"Check random placement of a cursor with given size." },
>>>> -		{ "cursor-rapid-movement", test_rapid_movement,
>>>> -			"Check the rapid update of given-size cursor movements." },
>>>> -	};
>>>>      	igt_fixture {
>>>>    		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>    	igt_fixture
>>>>    		igt_remove_fb(data->drm_fd, &data->fb);
>>>>    -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>> -		igt_describe(size_tests[i].desc);
>>>> -		igt_subtest_group {
>>>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>> -				int w = cursor_size;
>>>> -				int h = cursor_size;
>>>> -
>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>> -
>>>> -				/*
>>>> -				 * Test non-square cursors a bit on the platforms
>>>> -				 * that support such things. And make it a bit more
>>>> -				 * interesting by using a non-pot height.
>>>> -				 */
>>>> -				h /= 3;
>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>> -			}
>>>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>> +	{
>>>> +		int w = cursor_size;
>>>> +		int h = cursor_size;
>>>>    -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>> -		}
>>>> +		igt_subtest_group
>>>> +			run_size_tests(data, w, h);
>>>> +
>>>> +		/*
>>>> +		 * Test non-square cursors a bit on the platforms
>>>> +		 * that support such things. And make it a bit more
>>>> +		 * interesting by using a non-pot height.
>>>> +		 */
>>>> +		h /= 3;
>>>> +
>>>> +		igt_subtest_group
>>>> +			run_size_tests(data, w, h);
>>>>    	}
>>>> +
>>>> +	run_size_tests(data, 0, 0);
>>>>    }
>>>>      static data_t data;
>>>> @@ -896,8 +901,6 @@ igt_main
>>>>    		kmstest_set_vt_graphics_mode();
>>>>      		igt_require_pipe_crc(data.drm_fd);
>>>> -
>>>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>    	}
>>>>      	data.cursor_max_w = cursor_width;
>>>> @@ -913,6 +916,5 @@ igt_main
>>>>    		}
>>>>      		igt_display_fini(&data.display);
>>>> -		close(data.drm_fd);
>>>>    	}
>>>>    }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-11 12:56 ` Modem, Bhanuprakash
@ 2022-10-11 17:25   ` aemad
  0 siblings, 0 replies; 25+ messages in thread
From: aemad @ 2022-10-11 17:25 UTC (permalink / raw)
  To: Modem, Bhanuprakash; +Cc: petri.latvala, igt-dev

Hi Bhanu,

On 2022-10-11 14:56, Modem, Bhanuprakash wrote:
> On Sun-09-10-2022 08:48 pm, Alaa Emad wrote:
>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>
>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>> Stack trace:
>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>> Received signal SIGABRT.
>>
>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
> 
> I think you just need to put this fb creation part to igt_fixture
> 
> igt_fixture {
> 	create_cursor_fb(data, w, h);
> }

I have already tried this and the test was aborted.

> 
>>
>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>> only dynamic subsubtests themselves will produce test results.
>>
>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>> by running all tests for one cursor size one by one, and check if cursor size is
>> supported or not before running the test.
> 
> With this change, maximum cursor size test will not show up in list of
> tests. Ie. max size test and what happened with them are not seen
> here:
> 
> https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7933/shards-all.html?testfilter=kms_cursor_crc
> 
> From previous conversations [1]:
> And I think it is needed here to know what happen with maximum cursor
> size tests. Maximum cursor size is special case that is wanted to be
> known what happen with it, will driver reported largest possible
> cursor work.

yes, I see. I will rework again on it.
> 
> [1]: https://patchwork.freedesktop.org/patch/496899/
> 
> - Bhanu
> 

Thanks,
Alaa

>>
>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>
>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>> ---
>>   tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>   1 file changed, 69 insertions(+), 67 deletions(-)
>>
>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>> index 8d3426dd..9b620389 100644
>> --- a/tests/kms_cursor_crc.c
>> +++ b/tests/kms_cursor_crc.c
>> @@ -72,7 +72,6 @@ typedef struct {
>>   	cairo_surface_t *surface;
>>   	uint32_t devid;
>>   	double alpha;
>> -	int vblank_wait_count; /* because of msm */
>>   } data_t;
>>     #define TEST_DPMS (1<<0)
>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>   {
>>   	igt_plane_set_fb(data->cursor, NULL);
>>   	igt_plane_set_position(data->cursor, 0, 0);
>> -	igt_display_commit(&data->display);
>> -
>> -	/* do this wait here so it will not need to be added everywhere */
>> -	igt_wait_for_vblank_count(data->drm_fd,
>> -				  data->display.pipes[data->pipe].crtc_offset,
>> -				  data->vblank_wait_count);
>>   }
>>     static bool chv_cursor_broken(data_t *data, int x)
>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>   		igt_display_commit(display);
>>     		/* Extra vblank wait is because nonblocking cursor ioctl */
>> -		igt_wait_for_vblank_count(data->drm_fd,
>> -					  display->pipes[data->pipe].crtc_offset,
>> -					  data->vblank_wait_count);
>> +		igt_wait_for_vblank(data->drm_fd,
>> +				display->pipes[data->pipe].crtc_offset);
>>     		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>   @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>     		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>   		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>> +
>>   		igt_display_commit(display);
>> +		igt_wait_for_vblank(data->drm_fd,
>> +				display->pipes[data->pipe].crtc_offset);
>> +
>>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>   		igt_assert_crc_equal(&crc, hwcrc);
>>   	}
>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>   	igt_plane_set_position(data->cursor, x, y);
>>   	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>   +	igt_plane_set_position(data->cursor, 0, 0);
>>   	cursor_disable(data);
>> +	igt_display_commit(display);
>>     	igt_assert_eq(ret, expect);
>>   }
>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>   	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>   }
>>   -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>> -			   int w, int h)
>> +static void run_size_tests(data_t *data, int w, int h)
>>   {
>>   	enum pipe pipe;
>> +	int i;
>> +
>> +	struct
>> +	{
>> +		const char *name;
>> +		void (*testfunc)(data_t *);
>> +		const char *desc;
>> +	} size_tests[] = {
>> +		{"cursor-onscreen", test_crc_onscreen,
>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>> +		{"cursor-offscreen", test_crc_offscreen,
>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>> +		{"cursor-sliding", test_crc_sliding,
>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>> +		{"cursor-random", test_crc_random,
>> +		 "Check random placement of a cursor with given size."},
>> +		{"cursor-rapid-movement", test_rapid_movement,
>> +		 "Check the rapid update of given-size cursor movements."},
>> +	};
>>     	if (w == 0 && h == 0) {
>>   		w = data->cursor_max_w;
>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>   		}
>>   	}
>>   -	create_cursor_fb(data, w, h);
>> -	if (require_cursor_size(data, w, h)) {
>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>> -
>> -		igt_remove_fb(data->drm_fd, &data->fb);
>> -		return;
>> -	}
>> +	igt_fixture
>> +		create_cursor_fb(data, w, h);
>>   -	for_each_pipe(&data->display, pipe) {
>> -		data->pipe = pipe;
>> -		igt_dynamic_f("pipe-%s-%s",
>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>> -			run_test(data, testfunc, w, h);
>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>> +	{
>> +		igt_describe(size_tests[i].desc);
>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> +		{
>> +			for_each_pipe(&data->display, pipe)
>> +			{
>> +				data->pipe = pipe;
>> +				if (require_cursor_size(data, w, h))
>> +				{
>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>> +					continue;
>> +				}
>> +
>> +				igt_dynamic_f("pipe-%s-%s",
>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>> +					run_test(data, size_tests[i].testfunc, w, h);
>> +			}
>> +		}
>>   	}
>>   -	igt_remove_fb(data->drm_fd, &data->fb);
>> +	igt_fixture
>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>   }
>>     static void run_tests_on_pipe(data_t *data)
>>   {
>>   	enum pipe pipe;
>>   	int cursor_size;
>> -	int i;
>> -	struct {
>> -		const char *name;
>> -		void (*testfunc)(data_t *);
>> -		const char *desc;
>> -	} size_tests[] = {
>> -		{ "cursor-onscreen", test_crc_onscreen,
>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>> -		{ "cursor-offscreen", test_crc_offscreen,
>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>> -		{ "cursor-sliding", test_crc_sliding,
>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>> -		{ "cursor-random", test_crc_random,
>> -			"Check random placement of a cursor with given size." },
>> -		{ "cursor-rapid-movement", test_rapid_movement,
>> -			"Check the rapid update of given-size cursor movements." },
>> -	};
>>     	igt_fixture {
>>   		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>   	igt_fixture
>>   		igt_remove_fb(data->drm_fd, &data->fb);
>>   -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>> -		igt_describe(size_tests[i].desc);
>> -		igt_subtest_group {
>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>> -				int w = cursor_size;
>> -				int h = cursor_size;
>> -
>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>> -
>> -				/*
>> -				 * Test non-square cursors a bit on the platforms
>> -				 * that support such things. And make it a bit more
>> -				 * interesting by using a non-pot height.
>> -				 */
>> -				h /= 3;
>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>> -			}
>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>> +	{
>> +		int w = cursor_size;
>> +		int h = cursor_size;
>>   -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>> -		}
>> +		igt_subtest_group
>> +			run_size_tests(data, w, h);
>> +
>> +		/*
>> +		 * Test non-square cursors a bit on the platforms
>> +		 * that support such things. And make it a bit more
>> +		 * interesting by using a non-pot height.
>> +		 */
>> +		h /= 3;
>> +
>> +		igt_subtest_group
>> +			run_size_tests(data, w, h);
>>   	}
>> +
>> +	run_size_tests(data, 0, 0);
>>   }
>>     static data_t data;
>> @@ -896,8 +901,6 @@ igt_main
>>   		kmstest_set_vt_graphics_mode();
>>     		igt_require_pipe_crc(data.drm_fd);
>> -
>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>   	}
>>     	data.cursor_max_w = cursor_width;
>> @@ -913,6 +916,5 @@ igt_main
>>   		}
>>     		igt_display_fini(&data.display);
>> -		close(data.drm_fd);
>>   	}
>>   }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-11 17:08       ` aemad
@ 2022-10-11 17:35         ` Juha-Pekka Heikkila
  2022-10-11 17:53           ` aemad
  2022-11-01 16:43           ` Modem, Bhanuprakash
  0 siblings, 2 replies; 25+ messages in thread
From: Juha-Pekka Heikkila @ 2022-10-11 17:35 UTC (permalink / raw)
  To: aemad; +Cc: igt-dev, petri.latvala

On 11.10.2022 20.08, aemad wrote:
> On 2022-10-10 20:52, Juha-Pekka Heikkila wrote:
>> On 10.10.2022 17.26, aemad wrote:
>>> Hi Juha,
>>>
>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>> Hi Alaa,
>>>>
>>>> what's that invalid argument you're getting on addfb? I never tried
>>>
>>> I am not sure what is the invalid argument, but the failure of this test
>>> with a cursor size 32x10 is that VKMS does not support this size yet so
>>> the test unable to create a cursor FB.
>>
>> At that moment when addfb gives failure it doesn't yet relate to
>> cursor testing, it is like any other framebuffer. As other kms tests
>> work for you there maybe limitation on vkms not supporting so small
>> framebuffer or it could be on libigt there's something missing for
>> handling vkms framebuffers.
> 
> yes, understood.
>>
>> I'm looking at kernel sources and I suspect you'd see in dmesg message
>> saying  "GEM object size (%zu) smaller than minimum size (%u) for
>> plane %d\n" when that addfb failed? If it is that message then
>> probably into libigt for vkms there would be needed some minimum size
>> alignment with framebuffers.
> 
> I didn't check dmesg message, but I will check it. I got your point,
> Thank you.

After sending that mail I did notice minimum framebuffer height for vkms 
is 20 pixels, that's where that addfb failure likely is coming from. It 
mean is this 32x10 subtest would never work on vkms and this test will 
need to be fixed to skip correctly again.

/Juha-Pekka

>>
>>>
>>>
>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>> that abort you're seeing. Other kms tests run on your setup?
>>>
>>> I think the abortion related to VKMS driver only, but I didn't try to
>>> run it on i915.
>>> yes, I ran other kms test but with VKMS driver.
>>>
>>>>
>>>> Anyway, that revert you're suggesting would remove support for msm
>>>> driver on this test. Let's first summon those who made these changes
>>>> to comment. (cc'ing Modem and Swati)
>>>
>>> I see, so I can check that after Modem and Swati reply.
>>>
>>>>
>>>> /Juha-Pekka
>>>
>>> BR,
>>> Alaa
>>>>
>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>
>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>> Stack trace:
>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>> Received signal SIGABRT.
>>>>>
>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>
>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>
>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>> supported or not before running the test.
>>>>>
>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>
>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>> ---
>>>>>     tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>     1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>
>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>> index 8d3426dd..9b620389 100644
>>>>> --- a/tests/kms_cursor_crc.c
>>>>> +++ b/tests/kms_cursor_crc.c
>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>     	cairo_surface_t *surface;
>>>>>     	uint32_t devid;
>>>>>     	double alpha;
>>>>> -	int vblank_wait_count; /* because of msm */
>>>>>     } data_t;
>>>>>       #define TEST_DPMS (1<<0)
>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>     {
>>>>>     	igt_plane_set_fb(data->cursor, NULL);
>>>>>     	igt_plane_set_position(data->cursor, 0, 0);
>>>>> -	igt_display_commit(&data->display);
>>>>> -
>>>>> -	/* do this wait here so it will not need to be added everywhere */
>>>>> -	igt_wait_for_vblank_count(data->drm_fd,
>>>>> -				  data->display.pipes[data->pipe].crtc_offset,
>>>>> -				  data->vblank_wait_count);
>>>>>     }
>>>>>       static bool chv_cursor_broken(data_t *data, int x)
>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>     		igt_display_commit(display);
>>>>>       		/* Extra vblank wait is because nonblocking cursor ioctl */
>>>>> -		igt_wait_for_vblank_count(data->drm_fd,
>>>>> -					  display->pipes[data->pipe].crtc_offset,
>>>>> -					  data->vblank_wait_count);
>>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>>> +				display->pipes[data->pipe].crtc_offset);
>>>>>       		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>     @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>       		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>     		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>> +
>>>>>     		igt_display_commit(display);
>>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>>> +				display->pipes[data->pipe].crtc_offset);
>>>>> +
>>>>>     		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>     		igt_assert_crc_equal(&crc, hwcrc);
>>>>>     	}
>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>     	igt_plane_set_position(data->cursor, x, y);
>>>>>     	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>     +	igt_plane_set_position(data->cursor, 0, 0);
>>>>>     	cursor_disable(data);
>>>>> +	igt_display_commit(display);
>>>>>       	igt_assert_eq(ret, expect);
>>>>>     }
>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>     	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>     }
>>>>>     -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>> -			   int w, int h)
>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>     {
>>>>>     	enum pipe pipe;
>>>>> +	int i;
>>>>> +
>>>>> +	struct
>>>>> +	{
>>>>> +		const char *name;
>>>>> +		void (*testfunc)(data_t *);
>>>>> +		const char *desc;
>>>>> +	} size_tests[] = {
>>>>> +		{"cursor-onscreen", test_crc_onscreen,
>>>>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>>>>> +		{"cursor-offscreen", test_crc_offscreen,
>>>>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>>>>> +		{"cursor-sliding", test_crc_sliding,
>>>>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>> +		{"cursor-random", test_crc_random,
>>>>> +		 "Check random placement of a cursor with given size."},
>>>>> +		{"cursor-rapid-movement", test_rapid_movement,
>>>>> +		 "Check the rapid update of given-size cursor movements."},
>>>>> +	};
>>>>>       	if (w == 0 && h == 0) {
>>>>>     		w = data->cursor_max_w;
>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>     		}
>>>>>     	}
>>>>>     -	create_cursor_fb(data, w, h);
>>>>> -	if (require_cursor_size(data, w, h)) {
>>>>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>> -
>>>>> -		igt_remove_fb(data->drm_fd, &data->fb);
>>>>> -		return;
>>>>> -	}
>>>>> +	igt_fixture
>>>>> +		create_cursor_fb(data, w, h);
>>>>>     -	for_each_pipe(&data->display, pipe) {
>>>>> -		data->pipe = pipe;
>>>>> -		igt_dynamic_f("pipe-%s-%s",
>>>>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>> -			run_test(data, testfunc, w, h);
>>>>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>> +	{
>>>>> +		igt_describe(size_tests[i].desc);
>>>>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>> +		{
>>>>> +			for_each_pipe(&data->display, pipe)
>>>>> +			{
>>>>> +				data->pipe = pipe;
>>>>> +				if (require_cursor_size(data, w, h))
>>>>> +				{
>>>>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>> +					continue;
>>>>> +				}
>>>>> +
>>>>> +				igt_dynamic_f("pipe-%s-%s",
>>>>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>> +					run_test(data, size_tests[i].testfunc, w, h);
>>>>> +			}
>>>>> +		}
>>>>>     	}
>>>>>     -	igt_remove_fb(data->drm_fd, &data->fb);
>>>>> +	igt_fixture
>>>>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>>>>     }
>>>>>       static void run_tests_on_pipe(data_t *data)
>>>>>     {
>>>>>     	enum pipe pipe;
>>>>>     	int cursor_size;
>>>>> -	int i;
>>>>> -	struct {
>>>>> -		const char *name;
>>>>> -		void (*testfunc)(data_t *);
>>>>> -		const char *desc;
>>>>> -	} size_tests[] = {
>>>>> -		{ "cursor-onscreen", test_crc_onscreen,
>>>>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>>>>> -		{ "cursor-offscreen", test_crc_offscreen,
>>>>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>>>>> -		{ "cursor-sliding", test_crc_sliding,
>>>>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>> -		{ "cursor-random", test_crc_random,
>>>>> -			"Check random placement of a cursor with given size." },
>>>>> -		{ "cursor-rapid-movement", test_rapid_movement,
>>>>> -			"Check the rapid update of given-size cursor movements." },
>>>>> -	};
>>>>>       	igt_fixture {
>>>>>     		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>     	igt_fixture
>>>>>     		igt_remove_fb(data->drm_fd, &data->fb);
>>>>>     -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>> -		igt_describe(size_tests[i].desc);
>>>>> -		igt_subtest_group {
>>>>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>> -				int w = cursor_size;
>>>>> -				int h = cursor_size;
>>>>> -
>>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>> -
>>>>> -				/*
>>>>> -				 * Test non-square cursors a bit on the platforms
>>>>> -				 * that support such things. And make it a bit more
>>>>> -				 * interesting by using a non-pot height.
>>>>> -				 */
>>>>> -				h /= 3;
>>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>> -			}
>>>>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>> +	{
>>>>> +		int w = cursor_size;
>>>>> +		int h = cursor_size;
>>>>>     -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>> -		}
>>>>> +		igt_subtest_group
>>>>> +			run_size_tests(data, w, h);
>>>>> +
>>>>> +		/*
>>>>> +		 * Test non-square cursors a bit on the platforms
>>>>> +		 * that support such things. And make it a bit more
>>>>> +		 * interesting by using a non-pot height.
>>>>> +		 */
>>>>> +		h /= 3;
>>>>> +
>>>>> +		igt_subtest_group
>>>>> +			run_size_tests(data, w, h);
>>>>>     	}
>>>>> +
>>>>> +	run_size_tests(data, 0, 0);
>>>>>     }
>>>>>       static data_t data;
>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>     		kmstest_set_vt_graphics_mode();
>>>>>       		igt_require_pipe_crc(data.drm_fd);
>>>>> -
>>>>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>     	}
>>>>>       	data.cursor_max_w = cursor_width;
>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>     		}
>>>>>       		igt_display_fini(&data.display);
>>>>> -		close(data.drm_fd);
>>>>>     	}
>>>>>     }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-11 17:35         ` Juha-Pekka Heikkila
@ 2022-10-11 17:53           ` aemad
  2022-11-01 16:43           ` Modem, Bhanuprakash
  1 sibling, 0 replies; 25+ messages in thread
From: aemad @ 2022-10-11 17:53 UTC (permalink / raw)
  To: juhapekka.heikkila; +Cc: igt-dev, petri.latvala

On 2022-10-11 19:35, Juha-Pekka Heikkila wrote:
> On 11.10.2022 20.08, aemad wrote:
>> On 2022-10-10 20:52, Juha-Pekka Heikkila wrote:
>>> On 10.10.2022 17.26, aemad wrote:
>>>> Hi Juha,
>>>>
>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>> Hi Alaa,
>>>>>
>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>
>>>> I am not sure what is the invalid argument, but the failure of this test
>>>> with a cursor size 32x10 is that VKMS does not support this size yet so
>>>> the test unable to create a cursor FB.
>>>
>>> At that moment when addfb gives failure it doesn't yet relate to
>>> cursor testing, it is like any other framebuffer. As other kms tests
>>> work for you there maybe limitation on vkms not supporting so small
>>> framebuffer or it could be on libigt there's something missing for
>>> handling vkms framebuffers.
>>
>> yes, understood.
>>>
>>> I'm looking at kernel sources and I suspect you'd see in dmesg message
>>> saying  "GEM object size (%zu) smaller than minimum size (%u) for
>>> plane %d\n" when that addfb failed? If it is that message then
>>> probably into libigt for vkms there would be needed some minimum size
>>> alignment with framebuffers.
>>
>> I didn't check dmesg message, but I will check it. I got your point,
>> Thank you.
> 
> After sending that mail I did notice minimum framebuffer height for
> vkms is 20 pixels, that's where that addfb failure likely is coming
> from. It mean is this 32x10 subtest would never work on vkms and this
> test will need to be fixed to skip correctly again.
> 
> /Juha-Pekka
> 
yes, so this cursor size failed.
>>>
>>>>
>>>>
>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>
>>>> I think the abortion related to VKMS driver only, but I didn't try to
>>>> run it on i915.
>>>> yes, I ran other kms test but with VKMS driver.
>>>>
>>>>>
>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>> driver on this test. Let's first summon those who made these changes
>>>>> to comment. (cc'ing Modem and Swati)
>>>>
>>>> I see, so I can check that after Modem and Swati reply.
>>>>
>>>>>
>>>>> /Juha-Pekka
>>>>
>>>> BR,
>>>> Alaa
>>>>>
>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>
>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>> Stack trace:
>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>> Received signal SIGABRT.
>>>>>>
>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>
>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>
>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>> supported or not before running the test.
>>>>>>
>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>
>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>> ---
>>>>>>     tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>     1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>
>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>> index 8d3426dd..9b620389 100644
>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>     	cairo_surface_t *surface;
>>>>>>     	uint32_t devid;
>>>>>>     	double alpha;
>>>>>> -	int vblank_wait_count; /* because of msm */
>>>>>>     } data_t;
>>>>>>       #define TEST_DPMS (1<<0)
>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>     {
>>>>>>     	igt_plane_set_fb(data->cursor, NULL);
>>>>>>     	igt_plane_set_position(data->cursor, 0, 0);
>>>>>> -	igt_display_commit(&data->display);
>>>>>> -
>>>>>> -	/* do this wait here so it will not need to be added everywhere */
>>>>>> -	igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -				  data->display.pipes[data->pipe].crtc_offset,
>>>>>> -				  data->vblank_wait_count);
>>>>>>     }
>>>>>>       static bool chv_cursor_broken(data_t *data, int x)
>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>     		igt_display_commit(display);
>>>>>>       		/* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>> -		igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -					  display->pipes[data->pipe].crtc_offset,
>>>>>> -					  data->vblank_wait_count);
>>>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>>>> +				display->pipes[data->pipe].crtc_offset);
>>>>>>       		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>     @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>       		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>     		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>> +
>>>>>>     		igt_display_commit(display);
>>>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>>>> +				display->pipes[data->pipe].crtc_offset);
>>>>>> +
>>>>>>     		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>     		igt_assert_crc_equal(&crc, hwcrc);
>>>>>>     	}
>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>     	igt_plane_set_position(data->cursor, x, y);
>>>>>>     	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>     +	igt_plane_set_position(data->cursor, 0, 0);
>>>>>>     	cursor_disable(data);
>>>>>> +	igt_display_commit(display);
>>>>>>       	igt_assert_eq(ret, expect);
>>>>>>     }
>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>     	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>     }
>>>>>>     -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>> -			   int w, int h)
>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>     {
>>>>>>     	enum pipe pipe;
>>>>>> +	int i;
>>>>>> +
>>>>>> +	struct
>>>>>> +	{
>>>>>> +		const char *name;
>>>>>> +		void (*testfunc)(data_t *);
>>>>>> +		const char *desc;
>>>>>> +	} size_tests[] = {
>>>>>> +		{"cursor-onscreen", test_crc_onscreen,
>>>>>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>> +		{"cursor-offscreen", test_crc_offscreen,
>>>>>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>> +		{"cursor-sliding", test_crc_sliding,
>>>>>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>> +		{"cursor-random", test_crc_random,
>>>>>> +		 "Check random placement of a cursor with given size."},
>>>>>> +		{"cursor-rapid-movement", test_rapid_movement,
>>>>>> +		 "Check the rapid update of given-size cursor movements."},
>>>>>> +	};
>>>>>>       	if (w == 0 && h == 0) {
>>>>>>     		w = data->cursor_max_w;
>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>     		}
>>>>>>     	}
>>>>>>     -	create_cursor_fb(data, w, h);
>>>>>> -	if (require_cursor_size(data, w, h)) {
>>>>>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>> -
>>>>>> -		igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> -		return;
>>>>>> -	}
>>>>>> +	igt_fixture
>>>>>> +		create_cursor_fb(data, w, h);
>>>>>>     -	for_each_pipe(&data->display, pipe) {
>>>>>> -		data->pipe = pipe;
>>>>>> -		igt_dynamic_f("pipe-%s-%s",
>>>>>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>> -			run_test(data, testfunc, w, h);
>>>>>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>> +	{
>>>>>> +		igt_describe(size_tests[i].desc);
>>>>>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> +		{
>>>>>> +			for_each_pipe(&data->display, pipe)
>>>>>> +			{
>>>>>> +				data->pipe = pipe;
>>>>>> +				if (require_cursor_size(data, w, h))
>>>>>> +				{
>>>>>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>> +					continue;
>>>>>> +				}
>>>>>> +
>>>>>> +				igt_dynamic_f("pipe-%s-%s",
>>>>>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>> +					run_test(data, size_tests[i].testfunc, w, h);
>>>>>> +			}
>>>>>> +		}
>>>>>>     	}
>>>>>>     -	igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> +	igt_fixture
>>>>>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>     }
>>>>>>       static void run_tests_on_pipe(data_t *data)
>>>>>>     {
>>>>>>     	enum pipe pipe;
>>>>>>     	int cursor_size;
>>>>>> -	int i;
>>>>>> -	struct {
>>>>>> -		const char *name;
>>>>>> -		void (*testfunc)(data_t *);
>>>>>> -		const char *desc;
>>>>>> -	} size_tests[] = {
>>>>>> -		{ "cursor-onscreen", test_crc_onscreen,
>>>>>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>>>>>> -		{ "cursor-offscreen", test_crc_offscreen,
>>>>>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>>>>>> -		{ "cursor-sliding", test_crc_sliding,
>>>>>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>> -		{ "cursor-random", test_crc_random,
>>>>>> -			"Check random placement of a cursor with given size." },
>>>>>> -		{ "cursor-rapid-movement", test_rapid_movement,
>>>>>> -			"Check the rapid update of given-size cursor movements." },
>>>>>> -	};
>>>>>>       	igt_fixture {
>>>>>>     		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>     	igt_fixture
>>>>>>     		igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>     -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>> -		igt_describe(size_tests[i].desc);
>>>>>> -		igt_subtest_group {
>>>>>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>> -				int w = cursor_size;
>>>>>> -				int h = cursor_size;
>>>>>> -
>>>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>> -
>>>>>> -				/*
>>>>>> -				 * Test non-square cursors a bit on the platforms
>>>>>> -				 * that support such things. And make it a bit more
>>>>>> -				 * interesting by using a non-pot height.
>>>>>> -				 */
>>>>>> -				h /= 3;
>>>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>> -			}
>>>>>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>> +	{
>>>>>> +		int w = cursor_size;
>>>>>> +		int h = cursor_size;
>>>>>>     -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>> -		}
>>>>>> +		igt_subtest_group
>>>>>> +			run_size_tests(data, w, h);
>>>>>> +
>>>>>> +		/*
>>>>>> +		 * Test non-square cursors a bit on the platforms
>>>>>> +		 * that support such things. And make it a bit more
>>>>>> +		 * interesting by using a non-pot height.
>>>>>> +		 */
>>>>>> +		h /= 3;
>>>>>> +
>>>>>> +		igt_subtest_group
>>>>>> +			run_size_tests(data, w, h);
>>>>>>     	}
>>>>>> +
>>>>>> +	run_size_tests(data, 0, 0);
>>>>>>     }
>>>>>>       static data_t data;
>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>     		kmstest_set_vt_graphics_mode();
>>>>>>       		igt_require_pipe_crc(data.drm_fd);
>>>>>> -
>>>>>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>     	}
>>>>>>       	data.cursor_max_w = cursor_width;
>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>     		}
>>>>>>       		igt_display_fini(&data.display);
>>>>>> -		close(data.drm_fd);
>>>>>>     	}
>>>>>>     }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-10 11:16 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
  2022-10-10 14:26   ` aemad
@ 2022-11-01 11:25   ` aemad
  2022-11-01 15:11     ` Juha-Pekka Heikkila
  1 sibling, 1 reply; 25+ messages in thread
From: aemad @ 2022-11-01 11:25 UTC (permalink / raw)
  To: juhapekka.heikkila; +Cc: igt-dev, petri.latvala

On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
> Hi Alaa,
> 
> what's that invalid argument you're getting on addfb? I never tried
> this with vkms, normally just on i915. With i915 I cannot reproduce
> that abort you're seeing. Other kms tests run on your setup?
> 

Hi Juha-Pekka,

> Anyway, that revert you're suggesting would remove support for msm
> driver on this test. Let's first summon those who made these changes
> to comment. (cc'ing Modem and Swati)

Could you please explain why this patch will remove MSM driver support?


BR,
Alaa


> 
> /Juha-Pekka
> 
> On 9.10.2022 18.18, Alaa Emad wrote:
>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>
>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>> Stack trace:
>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>> Received signal SIGABRT.
>>
>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>
>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>> only dynamic subsubtests themselves will produce test results.
>>
>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>> by running all tests for one cursor size one by one, and check if cursor size is
>> supported or not before running the test.
>>
>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>
>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>> ---
>>   tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>   1 file changed, 69 insertions(+), 67 deletions(-)
>>
>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>> index 8d3426dd..9b620389 100644
>> --- a/tests/kms_cursor_crc.c
>> +++ b/tests/kms_cursor_crc.c
>> @@ -72,7 +72,6 @@ typedef struct {
>>   	cairo_surface_t *surface;
>>   	uint32_t devid;
>>   	double alpha;
>> -	int vblank_wait_count; /* because of msm */
>>   } data_t;
>>     #define TEST_DPMS (1<<0)
>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>   {
>>   	igt_plane_set_fb(data->cursor, NULL);
>>   	igt_plane_set_position(data->cursor, 0, 0);
>> -	igt_display_commit(&data->display);
>> -
>> -	/* do this wait here so it will not need to be added everywhere */
>> -	igt_wait_for_vblank_count(data->drm_fd,
>> -				  data->display.pipes[data->pipe].crtc_offset,
>> -				  data->vblank_wait_count);
>>   }
>>     static bool chv_cursor_broken(data_t *data, int x)
>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>   		igt_display_commit(display);
>>     		/* Extra vblank wait is because nonblocking cursor ioctl */
>> -		igt_wait_for_vblank_count(data->drm_fd,
>> -					  display->pipes[data->pipe].crtc_offset,
>> -					  data->vblank_wait_count);
>> +		igt_wait_for_vblank(data->drm_fd,
>> +				display->pipes[data->pipe].crtc_offset);
>>     		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>   @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>     		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>   		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>> +
>>   		igt_display_commit(display);
>> +		igt_wait_for_vblank(data->drm_fd,
>> +				display->pipes[data->pipe].crtc_offset);
>> +
>>   		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>   		igt_assert_crc_equal(&crc, hwcrc);
>>   	}
>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>   	igt_plane_set_position(data->cursor, x, y);
>>   	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>   +	igt_plane_set_position(data->cursor, 0, 0);
>>   	cursor_disable(data);
>> +	igt_display_commit(display);
>>     	igt_assert_eq(ret, expect);
>>   }
>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>   	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>   }
>>   -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>> -			   int w, int h)
>> +static void run_size_tests(data_t *data, int w, int h)
>>   {
>>   	enum pipe pipe;
>> +	int i;
>> +
>> +	struct
>> +	{
>> +		const char *name;
>> +		void (*testfunc)(data_t *);
>> +		const char *desc;
>> +	} size_tests[] = {
>> +		{"cursor-onscreen", test_crc_onscreen,
>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>> +		{"cursor-offscreen", test_crc_offscreen,
>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>> +		{"cursor-sliding", test_crc_sliding,
>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>> +		{"cursor-random", test_crc_random,
>> +		 "Check random placement of a cursor with given size."},
>> +		{"cursor-rapid-movement", test_rapid_movement,
>> +		 "Check the rapid update of given-size cursor movements."},
>> +	};
>>     	if (w == 0 && h == 0) {
>>   		w = data->cursor_max_w;
>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>   		}
>>   	}
>>   -	create_cursor_fb(data, w, h);
>> -	if (require_cursor_size(data, w, h)) {
>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>> -
>> -		igt_remove_fb(data->drm_fd, &data->fb);
>> -		return;
>> -	}
>> +	igt_fixture
>> +		create_cursor_fb(data, w, h);
>>   -	for_each_pipe(&data->display, pipe) {
>> -		data->pipe = pipe;
>> -		igt_dynamic_f("pipe-%s-%s",
>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>> -			run_test(data, testfunc, w, h);
>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>> +	{
>> +		igt_describe(size_tests[i].desc);
>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> +		{
>> +			for_each_pipe(&data->display, pipe)
>> +			{
>> +				data->pipe = pipe;
>> +				if (require_cursor_size(data, w, h))
>> +				{
>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>> +					continue;
>> +				}
>> +
>> +				igt_dynamic_f("pipe-%s-%s",
>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>> +					run_test(data, size_tests[i].testfunc, w, h);
>> +			}
>> +		}
>>   	}
>>   -	igt_remove_fb(data->drm_fd, &data->fb);
>> +	igt_fixture
>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>   }
>>     static void run_tests_on_pipe(data_t *data)
>>   {
>>   	enum pipe pipe;
>>   	int cursor_size;
>> -	int i;
>> -	struct {
>> -		const char *name;
>> -		void (*testfunc)(data_t *);
>> -		const char *desc;
>> -	} size_tests[] = {
>> -		{ "cursor-onscreen", test_crc_onscreen,
>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>> -		{ "cursor-offscreen", test_crc_offscreen,
>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>> -		{ "cursor-sliding", test_crc_sliding,
>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>> -		{ "cursor-random", test_crc_random,
>> -			"Check random placement of a cursor with given size." },
>> -		{ "cursor-rapid-movement", test_rapid_movement,
>> -			"Check the rapid update of given-size cursor movements." },
>> -	};
>>     	igt_fixture {
>>   		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>   	igt_fixture
>>   		igt_remove_fb(data->drm_fd, &data->fb);
>>   -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>> -		igt_describe(size_tests[i].desc);
>> -		igt_subtest_group {
>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>> -				int w = cursor_size;
>> -				int h = cursor_size;
>> -
>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>> -
>> -				/*
>> -				 * Test non-square cursors a bit on the platforms
>> -				 * that support such things. And make it a bit more
>> -				 * interesting by using a non-pot height.
>> -				 */
>> -				h /= 3;
>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>> -			}
>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>> +	{
>> +		int w = cursor_size;
>> +		int h = cursor_size;
>>   -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>> -		}
>> +		igt_subtest_group
>> +			run_size_tests(data, w, h);
>> +
>> +		/*
>> +		 * Test non-square cursors a bit on the platforms
>> +		 * that support such things. And make it a bit more
>> +		 * interesting by using a non-pot height.
>> +		 */
>> +		h /= 3;
>> +
>> +		igt_subtest_group
>> +			run_size_tests(data, w, h);
>>   	}
>> +
>> +	run_size_tests(data, 0, 0);
>>   }
>>     static data_t data;
>> @@ -896,8 +901,6 @@ igt_main
>>   		kmstest_set_vt_graphics_mode();
>>     		igt_require_pipe_crc(data.drm_fd);
>> -
>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>   	}
>>     	data.cursor_max_w = cursor_width;
>> @@ -913,6 +916,5 @@ igt_main
>>   		}
>>     		igt_display_fini(&data.display);
>> -		close(data.drm_fd);
>>   	}
>>   }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 11:25   ` aemad
@ 2022-11-01 15:11     ` Juha-Pekka Heikkila
  2022-11-01 16:50       ` Modem, Bhanuprakash
  2022-11-01 18:46       ` aemad
  0 siblings, 2 replies; 25+ messages in thread
From: Juha-Pekka Heikkila @ 2022-11-01 15:11 UTC (permalink / raw)
  To: aemad; +Cc: igt-dev, petri.latvala

On 1.11.2022 13.25, aemad wrote:
> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>> Hi Alaa,
>>
>> what's that invalid argument you're getting on addfb? I never tried
>> this with vkms, normally just on i915. With i915 I cannot reproduce
>> that abort you're seeing. Other kms tests run on your setup?
>>
> 
> Hi Juha-Pekka,
> 
>> Anyway, that revert you're suggesting would remove support for msm
>> driver on this test. Let's first summon those who made these changes
>> to comment. (cc'ing Modem and Swati)
> 
> Could you please explain why this patch will remove MSM driver support?
> 

See in test what's done with data.vblank_wait_count variable. That is 
there because on msm legacy cursor is not updated asynchronously and msm 
cursor likely will miss even second frame. Taking that out will cause 
these tests reliably fail on msm.

I was just today because of unrelated cursor issues looking into this, I 
still don't have patch though. As Swati/Modem didn't come back with a 
fix I was looking to take out all dynamic stuff, it should solve this issue.

/Juha-Pekka

> 
>>
>> /Juha-Pekka
>>
>> On 9.10.2022 18.18, Alaa Emad wrote:
>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>
>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>> Stack trace:
>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>> Received signal SIGABRT.
>>>
>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>
>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>> only dynamic subsubtests themselves will produce test results.
>>>
>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>> by running all tests for one cursor size one by one, and check if cursor size is
>>> supported or not before running the test.
>>>
>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>
>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>> ---
>>>    tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>
>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>> index 8d3426dd..9b620389 100644
>>> --- a/tests/kms_cursor_crc.c
>>> +++ b/tests/kms_cursor_crc.c
>>> @@ -72,7 +72,6 @@ typedef struct {
>>>    	cairo_surface_t *surface;
>>>    	uint32_t devid;
>>>    	double alpha;
>>> -	int vblank_wait_count; /* because of msm */
>>>    } data_t;
>>>      #define TEST_DPMS (1<<0)
>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>    {
>>>    	igt_plane_set_fb(data->cursor, NULL);
>>>    	igt_plane_set_position(data->cursor, 0, 0);
>>> -	igt_display_commit(&data->display);
>>> -
>>> -	/* do this wait here so it will not need to be added everywhere */
>>> -	igt_wait_for_vblank_count(data->drm_fd,
>>> -				  data->display.pipes[data->pipe].crtc_offset,
>>> -				  data->vblank_wait_count);
>>>    }
>>>      static bool chv_cursor_broken(data_t *data, int x)
>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>    		igt_display_commit(display);
>>>      		/* Extra vblank wait is because nonblocking cursor ioctl */
>>> -		igt_wait_for_vblank_count(data->drm_fd,
>>> -					  display->pipes[data->pipe].crtc_offset,
>>> -					  data->vblank_wait_count);
>>> +		igt_wait_for_vblank(data->drm_fd,
>>> +				display->pipes[data->pipe].crtc_offset);
>>>      		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>      		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>    		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>> +
>>>    		igt_display_commit(display);
>>> +		igt_wait_for_vblank(data->drm_fd,
>>> +				display->pipes[data->pipe].crtc_offset);
>>> +
>>>    		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>    		igt_assert_crc_equal(&crc, hwcrc);
>>>    	}
>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>    	igt_plane_set_position(data->cursor, x, y);
>>>    	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>    +	igt_plane_set_position(data->cursor, 0, 0);
>>>    	cursor_disable(data);
>>> +	igt_display_commit(display);
>>>      	igt_assert_eq(ret, expect);
>>>    }
>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>    	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>    }
>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>> -			   int w, int h)
>>> +static void run_size_tests(data_t *data, int w, int h)
>>>    {
>>>    	enum pipe pipe;
>>> +	int i;
>>> +
>>> +	struct
>>> +	{
>>> +		const char *name;
>>> +		void (*testfunc)(data_t *);
>>> +		const char *desc;
>>> +	} size_tests[] = {
>>> +		{"cursor-onscreen", test_crc_onscreen,
>>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>>> +		{"cursor-offscreen", test_crc_offscreen,
>>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>>> +		{"cursor-sliding", test_crc_sliding,
>>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>> +		{"cursor-random", test_crc_random,
>>> +		 "Check random placement of a cursor with given size."},
>>> +		{"cursor-rapid-movement", test_rapid_movement,
>>> +		 "Check the rapid update of given-size cursor movements."},
>>> +	};
>>>      	if (w == 0 && h == 0) {
>>>    		w = data->cursor_max_w;
>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>    		}
>>>    	}
>>>    -	create_cursor_fb(data, w, h);
>>> -	if (require_cursor_size(data, w, h)) {
>>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>> -
>>> -		igt_remove_fb(data->drm_fd, &data->fb);
>>> -		return;
>>> -	}
>>> +	igt_fixture
>>> +		create_cursor_fb(data, w, h);
>>>    -	for_each_pipe(&data->display, pipe) {
>>> -		data->pipe = pipe;
>>> -		igt_dynamic_f("pipe-%s-%s",
>>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>>> -			run_test(data, testfunc, w, h);
>>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>> +	{
>>> +		igt_describe(size_tests[i].desc);
>>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>> +		{
>>> +			for_each_pipe(&data->display, pipe)
>>> +			{
>>> +				data->pipe = pipe;
>>> +				if (require_cursor_size(data, w, h))
>>> +				{
>>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>> +					continue;
>>> +				}
>>> +
>>> +				igt_dynamic_f("pipe-%s-%s",
>>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>> +					run_test(data, size_tests[i].testfunc, w, h);
>>> +			}
>>> +		}
>>>    	}
>>>    -	igt_remove_fb(data->drm_fd, &data->fb);
>>> +	igt_fixture
>>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>>    }
>>>      static void run_tests_on_pipe(data_t *data)
>>>    {
>>>    	enum pipe pipe;
>>>    	int cursor_size;
>>> -	int i;
>>> -	struct {
>>> -		const char *name;
>>> -		void (*testfunc)(data_t *);
>>> -		const char *desc;
>>> -	} size_tests[] = {
>>> -		{ "cursor-onscreen", test_crc_onscreen,
>>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>>> -		{ "cursor-offscreen", test_crc_offscreen,
>>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>>> -		{ "cursor-sliding", test_crc_sliding,
>>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>> -		{ "cursor-random", test_crc_random,
>>> -			"Check random placement of a cursor with given size." },
>>> -		{ "cursor-rapid-movement", test_rapid_movement,
>>> -			"Check the rapid update of given-size cursor movements." },
>>> -	};
>>>      	igt_fixture {
>>>    		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>    	igt_fixture
>>>    		igt_remove_fb(data->drm_fd, &data->fb);
>>>    -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>> -		igt_describe(size_tests[i].desc);
>>> -		igt_subtest_group {
>>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>> -				int w = cursor_size;
>>> -				int h = cursor_size;
>>> -
>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>> -
>>> -				/*
>>> -				 * Test non-square cursors a bit on the platforms
>>> -				 * that support such things. And make it a bit more
>>> -				 * interesting by using a non-pot height.
>>> -				 */
>>> -				h /= 3;
>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>> -			}
>>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>> +	{
>>> +		int w = cursor_size;
>>> +		int h = cursor_size;
>>>    -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>> -		}
>>> +		igt_subtest_group
>>> +			run_size_tests(data, w, h);
>>> +
>>> +		/*
>>> +		 * Test non-square cursors a bit on the platforms
>>> +		 * that support such things. And make it a bit more
>>> +		 * interesting by using a non-pot height.
>>> +		 */
>>> +		h /= 3;
>>> +
>>> +		igt_subtest_group
>>> +			run_size_tests(data, w, h);
>>>    	}
>>> +
>>> +	run_size_tests(data, 0, 0);
>>>    }
>>>      static data_t data;
>>> @@ -896,8 +901,6 @@ igt_main
>>>    		kmstest_set_vt_graphics_mode();
>>>      		igt_require_pipe_crc(data.drm_fd);
>>> -
>>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>    	}
>>>      	data.cursor_max_w = cursor_width;
>>> @@ -913,6 +916,5 @@ igt_main
>>>    		}
>>>      		igt_display_fini(&data.display);
>>> -		close(data.drm_fd);
>>>    	}
>>>    }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-10-11 17:35         ` Juha-Pekka Heikkila
  2022-10-11 17:53           ` aemad
@ 2022-11-01 16:43           ` Modem, Bhanuprakash
  1 sibling, 0 replies; 25+ messages in thread
From: Modem, Bhanuprakash @ 2022-11-01 16:43 UTC (permalink / raw)
  To: juhapekka.heikkila, aemad; +Cc: igt-dev, petri.latvala

Hi JP,

On Tue-11-10-2022 11:05 pm, Juha-Pekka Heikkila wrote:
> On 11.10.2022 20.08, aemad wrote:
>> On 2022-10-10 20:52, Juha-Pekka Heikkila wrote:
>>> On 10.10.2022 17.26, aemad wrote:
>>>> Hi Juha,
>>>>
>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>> Hi Alaa,
>>>>>
>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>
>>>> I am not sure what is the invalid argument, but the failure of this 
>>>> test
>>>> with a cursor size 32x10 is that VKMS does not support this size yet so
>>>> the test unable to create a cursor FB.
>>>
>>> At that moment when addfb gives failure it doesn't yet relate to
>>> cursor testing, it is like any other framebuffer. As other kms tests
>>> work for you there maybe limitation on vkms not supporting so small
>>> framebuffer or it could be on libigt there's something missing for
>>> handling vkms framebuffers.
>>
>> yes, understood.
>>>
>>> I'm looking at kernel sources and I suspect you'd see in dmesg message
>>> saying  "GEM object size (%zu) smaller than minimum size (%u) for
>>> plane %d\n" when that addfb failed? If it is that message then
>>> probably into libigt for vkms there would be needed some minimum size
>>> alignment with framebuffers.
>>
>> I didn't check dmesg message, but I will check it. I got your point,
>> Thank you.
> 
> After sending that mail I did notice minimum framebuffer height for vkms 
> is 20 pixels, that's where that addfb failure likely is coming from. It 
> mean is this 32x10 subtest would never work on vkms and this test will 
> need to be fixed to skip correctly again.

So, we need to skip if the device is vkms & cursor height/width < 20 px.

 From IGT, is there any way to identify the device is VKMS or not?

- Bhanu

> 
> /Juha-Pekka
> 
>>>
>>>>
>>>>
>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>
>>>> I think the abortion related to VKMS driver only, but I didn't try to
>>>> run it on i915.
>>>> yes, I ran other kms test but with VKMS driver.
>>>>
>>>>>
>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>> driver on this test. Let's first summon those who made these changes
>>>>> to comment. (cc'ing Modem and Swati)
>>>>
>>>> I see, so I can check that after Modem and Swati reply.
>>>>
>>>>>
>>>>> /Juha-Pekka
>>>>
>>>> BR,
>>>> Alaa
>>>>>
>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>> Any test failure prevents the other tests to be run, aborting the 
>>>>>> entire test loop. This behavior was introduced by commit
>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>> For instance, when running the cursor-offscreen-32x10 subtest 
>>>>>> using VKMS,
>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following 
>>>>>> output:
>>>>>>
>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure 
>>>>>> function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: 
>>>>>> (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, 
>>>>>> fb->drm_format, fb->modifier, fb->strides, fb->offsets, 
>>>>>> fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid 
>>>>>> argument
>>>>>> Stack trace:
>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion 
>>>>>> `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>> Received signal SIGABRT.
>>>>>>
>>>>>> The test was aborted after convertig tests to dynamic with cursor 
>>>>>> size 32*10 that because of the assertion in the 
>>>>>> `igt_create_fb_with_bo_size` when creating cursor in 
>>>>>> `create_cursor_fb`.
>>>>>>
>>>>>> This happened because Within a igt_subtest_with_dynamic block, 
>>>>>> explicit failure (e.g. igt_assert) is not allowed,
>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>
>>>>>> The previous approach was running each test for all cursor sizes 
>>>>>> then move to the next test  so fix this issue
>>>>>> by running all tests for one cursor size one by one, and check if 
>>>>>> cursor size is
>>>>>> supported or not before running the test.
>>>>>>
>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>
>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>> ---
>>>>>>     tests/kms_cursor_crc.c | 136 
>>>>>> +++++++++++++++++++++--------------------
>>>>>>     1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>
>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>> index 8d3426dd..9b620389 100644
>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>         cairo_surface_t *surface;
>>>>>>         uint32_t devid;
>>>>>>         double alpha;
>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>     } data_t;
>>>>>>       #define TEST_DPMS (1<<0)
>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>     {
>>>>>>         igt_plane_set_fb(data->cursor, NULL);
>>>>>>         igt_plane_set_position(data->cursor, 0, 0);
>>>>>> -    igt_display_commit(&data->display);
>>>>>> -
>>>>>> -    /* do this wait here so it will not need to be added 
>>>>>> everywhere */
>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>> -                  data->vblank_wait_count);
>>>>>>     }
>>>>>>       static bool chv_cursor_broken(data_t *data, int x)
>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int 
>>>>>> x, int y, bool hw_test,
>>>>>>             igt_display_commit(display);
>>>>>>               /* Extra vblank wait is because nonblocking cursor 
>>>>>> ioctl */
>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>> -                      data->vblank_wait_count);
>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>               igt_pipe_crc_get_current(data->drm_fd, pipe_crc, 
>>>>>> hwcrc);
>>>>>>     @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, 
>>>>>> int x, int y, bool hw_test,
>>>>>>               restore_image(data, swbufidx, &((cursorarea){x, y, 
>>>>>> data->curw, data->curh}));
>>>>>>             igt_plane_set_fb(data->primary, 
>>>>>> &data->primary_fb[swbufidx]);
>>>>>> +
>>>>>>             igt_display_commit(display);
>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>> +
>>>>>>             igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>             igt_assert_crc_equal(&crc, hwcrc);
>>>>>>         }
>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, 
>>>>>> int y, int expect)
>>>>>>         igt_plane_set_position(data->cursor, x, y);
>>>>>>         ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>     +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>         cursor_disable(data);
>>>>>> +    igt_display_commit(display);
>>>>>>           igt_assert_eq(ret, expect);
>>>>>>     }
>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>         igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>     }
>>>>>>     -static void run_size_tests(data_t *data, void 
>>>>>> (*testfunc)(data_t *),
>>>>>> -               int w, int h)
>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>     {
>>>>>>         enum pipe pipe;
>>>>>> +    int i;
>>>>>> +
>>>>>> +    struct
>>>>>> +    {
>>>>>> +        const char *name;
>>>>>> +        void (*testfunc)(data_t *);
>>>>>> +        const char *desc;
>>>>>> +    } size_tests[] = {
>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>> +         "Check if a given-size cursor is well-positioned inside 
>>>>>> the screen."},
>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>> +         "Check if a given-size cursor is well-positioned outside 
>>>>>> the screen."},
>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor 
>>>>>> movements on horizontal, vertical and diagonal."},
>>>>>> +        {"cursor-random", test_crc_random,
>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>> +    };
>>>>>>           if (w == 0 && h == 0) {
>>>>>>             w = data->cursor_max_w;
>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, 
>>>>>> void (*testfunc)(data_t *),
>>>>>>             }
>>>>>>         }
>>>>>>     -    create_cursor_fb(data, w, h);
>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", 
>>>>>> w, h);
>>>>>> -
>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> -        return;
>>>>>> -    }
>>>>>> +    igt_fixture
>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>     -    for_each_pipe(&data->display, pipe) {
>>>>>> -        data->pipe = pipe;
>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>> -                  kmstest_pipe_name(pipe), 
>>>>>> igt_output_name(data->output))
>>>>>> -            run_test(data, testfunc, w, h);
>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>> +    {
>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>>>> size_tests[i].name, w, h)
>>>>>> +        {
>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>> +            {
>>>>>> +                data->pipe = pipe;
>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>> +                {
>>>>>> +                    igt_info("Cursor size %dx%d not supported by 
>>>>>> driver\n", w, h);
>>>>>> +                    continue;
>>>>>> +                }
>>>>>> +
>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>> +                              kmstest_pipe_name(pipe), 
>>>>>> igt_output_name(data->output))
>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>> +            }
>>>>>> +        }
>>>>>>         }
>>>>>>     -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> +    igt_fixture
>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>     }
>>>>>>       static void run_tests_on_pipe(data_t *data)
>>>>>>     {
>>>>>>         enum pipe pipe;
>>>>>>         int cursor_size;
>>>>>> -    int i;
>>>>>> -    struct {
>>>>>> -        const char *name;
>>>>>> -        void (*testfunc)(data_t *);
>>>>>> -        const char *desc;
>>>>>> -    } size_tests[] = {
>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>> -            "Check if a given-size cursor is well-positioned 
>>>>>> inside the screen." },
>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>> -            "Check if a given-size cursor is well-positioned 
>>>>>> outside the screen." },
>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>> -            "Check the smooth and pixel-by-pixel given-size 
>>>>>> cursor movements on horizontal, vertical and diagonal." },
>>>>>> -        { "cursor-random", test_crc_random,
>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>> -            "Check the rapid update of given-size cursor 
>>>>>> movements." },
>>>>>> -    };
>>>>>>           igt_fixture {
>>>>>>             data->output = 
>>>>>> igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>         igt_fixture
>>>>>>             igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>     -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>> -        igt_subtest_group {
>>>>>> -            for (cursor_size = 32; cursor_size <= 512; 
>>>>>> cursor_size *= 2) {
>>>>>> -                int w = cursor_size;
>>>>>> -                int h = cursor_size;
>>>>>> -
>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>>>> size_tests[i].name, w, h)
>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, 
>>>>>> w, h);
>>>>>> -
>>>>>> -                /*
>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>> -                 * that support such things. And make it a bit more
>>>>>> -                 * interesting by using a non-pot height.
>>>>>> -                 */
>>>>>> -                h /= 3;
>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>>>> size_tests[i].name, w, h)
>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, 
>>>>>> w, h);
>>>>>> -            }
>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>> +    {
>>>>>> +        int w = cursor_size;
>>>>>> +        int h = cursor_size;
>>>>>>     -            igt_subtest_with_dynamic_f("%s-max-size", 
>>>>>> size_tests[i].name)
>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>> -        }
>>>>>> +        igt_subtest_group
>>>>>> +            run_size_tests(data, w, h);
>>>>>> +
>>>>>> +        /*
>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>> +         * that support such things. And make it a bit more
>>>>>> +         * interesting by using a non-pot height.
>>>>>> +         */
>>>>>> +        h /= 3;
>>>>>> +
>>>>>> +        igt_subtest_group
>>>>>> +            run_size_tests(data, w, h);
>>>>>>         }
>>>>>> +
>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>     }
>>>>>>       static data_t data;
>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>             kmstest_set_vt_graphics_mode();
>>>>>>               igt_require_pipe_crc(data.drm_fd);
>>>>>> -
>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>         }
>>>>>>           data.cursor_max_w = cursor_width;
>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>             }
>>>>>>               igt_display_fini(&data.display);
>>>>>> -        close(data.drm_fd);
>>>>>>         }
>>>>>>     }
> 

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 15:11     ` Juha-Pekka Heikkila
@ 2022-11-01 16:50       ` Modem, Bhanuprakash
  2022-11-01 17:31         ` Juha-Pekka Heikkila
  2022-11-01 18:49         ` aemad
  2022-11-01 18:46       ` aemad
  1 sibling, 2 replies; 25+ messages in thread
From: Modem, Bhanuprakash @ 2022-11-01 16:50 UTC (permalink / raw)
  To: juhapekka.heikkila, aemad; +Cc: igt-dev, petri.latvala

Hi JP,

On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
> On 1.11.2022 13.25, aemad wrote:
>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>> Hi Alaa,
>>>
>>> what's that invalid argument you're getting on addfb? I never tried
>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>> that abort you're seeing. Other kms tests run on your setup?
>>>
>>
>> Hi Juha-Pekka,
>>
>>> Anyway, that revert you're suggesting would remove support for msm
>>> driver on this test. Let's first summon those who made these changes
>>> to comment. (cc'ing Modem and Swati)
>>
>> Could you please explain why this patch will remove MSM driver support?
>>
> 
> See in test what's done with data.vblank_wait_count variable. That is 
> there because on msm legacy cursor is not updated asynchronously and msm 
> cursor likely will miss even second frame. Taking that out will cause 
> these tests reliably fail on msm.
> 
> I was just today because of unrelated cursor issues looking into this, I 
> still don't have patch though. As Swati/Modem didn't come back with a 
> fix I was looking to take out all dynamic stuff, it should solve this 
> issue.

I am not sure, how this issue is related to dynamic subtests.

Expecting that we need to skip the test if the device is vkms & cursor 
height/width < 20 px. From IGT, is there any way to identify the device 
is VKMS or not?

Apart from this, I have floated patch with some minor cleanup [1].
@ Alaa, can you please help to check if it helps?

[1]: https://patchwork.freedesktop.org/series/110381/

- Bhanu

> 
> /Juha-Pekka
> 
>>
>>>
>>> /Juha-Pekka
>>>
>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>> Any test failure prevents the other tests to be run, aborting the 
>>>> entire test loop. This behavior was introduced by commit
>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>> For instance, when running the cursor-offscreen-32x10 subtest using 
>>>> VKMS,
>>>> the execution is aborted instead of SKIP/FAIL, as in the following 
>>>> output:
>>>>
>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure 
>>>> function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: 
>>>> (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, 
>>>> fb->drm_format, fb->modifier, fb->strides, fb->offsets, 
>>>> fb->num_planes, flags, &fb->fb_id)) == 0
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>> Stack trace:
>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion 
>>>> `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>> Received signal SIGABRT.
>>>>
>>>> The test was aborted after convertig tests to dynamic with cursor 
>>>> size 32*10 that because of the assertion in the 
>>>> `igt_create_fb_with_bo_size` when creating cursor in 
>>>> `create_cursor_fb`.
>>>>
>>>> This happened because Within a igt_subtest_with_dynamic block, 
>>>> explicit failure (e.g. igt_assert) is not allowed,
>>>> only dynamic subsubtests themselves will produce test results.
>>>>
>>>> The previous approach was running each test for all cursor sizes 
>>>> then move to the next test  so fix this issue
>>>> by running all tests for one cursor size one by one, and check if 
>>>> cursor size is
>>>> supported or not before running the test.
>>>>
>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>
>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>> ---
>>>>    tests/kms_cursor_crc.c | 136 
>>>> +++++++++++++++++++++--------------------
>>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>>
>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>> index 8d3426dd..9b620389 100644
>>>> --- a/tests/kms_cursor_crc.c
>>>> +++ b/tests/kms_cursor_crc.c
>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>        cairo_surface_t *surface;
>>>>        uint32_t devid;
>>>>        double alpha;
>>>> -    int vblank_wait_count; /* because of msm */
>>>>    } data_t;
>>>>      #define TEST_DPMS (1<<0)
>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>    {
>>>>        igt_plane_set_fb(data->cursor, NULL);
>>>>        igt_plane_set_position(data->cursor, 0, 0);
>>>> -    igt_display_commit(&data->display);
>>>> -
>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>> -                  data->vblank_wait_count);
>>>>    }
>>>>      static bool chv_cursor_broken(data_t *data, int x)
>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, 
>>>> int y, bool hw_test,
>>>>            igt_display_commit(display);
>>>>              /* Extra vblank wait is because nonblocking cursor 
>>>> ioctl */
>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>> -                      data->vblank_wait_count);
>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int 
>>>> x, int y, bool hw_test,
>>>>              restore_image(data, swbufidx, &((cursorarea){x, y, 
>>>> data->curw, data->curh}));
>>>>            igt_plane_set_fb(data->primary, 
>>>> &data->primary_fb[swbufidx]);
>>>> +
>>>>            igt_display_commit(display);
>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>> +                display->pipes[data->pipe].crtc_offset);
>>>> +
>>>>            igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>            igt_assert_crc_equal(&crc, hwcrc);
>>>>        }
>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, 
>>>> int y, int expect)
>>>>        igt_plane_set_position(data->cursor, x, y);
>>>>        ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>    +    igt_plane_set_position(data->cursor, 0, 0);
>>>>        cursor_disable(data);
>>>> +    igt_display_commit(display);
>>>>          igt_assert_eq(ret, expect);
>>>>    }
>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>        igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>    }
>>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t 
>>>> *),
>>>> -               int w, int h)
>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>    {
>>>>        enum pipe pipe;
>>>> +    int i;
>>>> +
>>>> +    struct
>>>> +    {
>>>> +        const char *name;
>>>> +        void (*testfunc)(data_t *);
>>>> +        const char *desc;
>>>> +    } size_tests[] = {
>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>> +         "Check if a given-size cursor is well-positioned inside 
>>>> the screen."},
>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>> +         "Check if a given-size cursor is well-positioned outside 
>>>> the screen."},
>>>> +        {"cursor-sliding", test_crc_sliding,
>>>> +         "Check the smooth and pixel-by-pixel given-size cursor 
>>>> movements on horizontal, vertical and diagonal."},
>>>> +        {"cursor-random", test_crc_random,
>>>> +         "Check random placement of a cursor with given size."},
>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>> +         "Check the rapid update of given-size cursor movements."},
>>>> +    };
>>>>          if (w == 0 && h == 0) {
>>>>            w = data->cursor_max_w;
>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void 
>>>> (*testfunc)(data_t *),
>>>>            }
>>>>        }
>>>>    -    create_cursor_fb(data, w, h);
>>>> -    if (require_cursor_size(data, w, h)) {
>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>> -
>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>> -        return;
>>>> -    }
>>>> +    igt_fixture
>>>> +        create_cursor_fb(data, w, h);
>>>>    -    for_each_pipe(&data->display, pipe) {
>>>> -        data->pipe = pipe;
>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>> -                  kmstest_pipe_name(pipe), 
>>>> igt_output_name(data->output))
>>>> -            run_test(data, testfunc, w, h);
>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>> +    {
>>>> +        igt_describe(size_tests[i].desc);
>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, 
>>>> w, h)
>>>> +        {
>>>> +            for_each_pipe(&data->display, pipe)
>>>> +            {
>>>> +                data->pipe = pipe;
>>>> +                if (require_cursor_size(data, w, h))
>>>> +                {
>>>> +                    igt_info("Cursor size %dx%d not supported by 
>>>> driver\n", w, h);
>>>> +                    continue;
>>>> +                }
>>>> +
>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>> +                              kmstest_pipe_name(pipe), 
>>>> igt_output_name(data->output))
>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>> +            }
>>>> +        }
>>>>        }
>>>>    -    igt_remove_fb(data->drm_fd, &data->fb);
>>>> +    igt_fixture
>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>    }
>>>>      static void run_tests_on_pipe(data_t *data)
>>>>    {
>>>>        enum pipe pipe;
>>>>        int cursor_size;
>>>> -    int i;
>>>> -    struct {
>>>> -        const char *name;
>>>> -        void (*testfunc)(data_t *);
>>>> -        const char *desc;
>>>> -    } size_tests[] = {
>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>> -            "Check if a given-size cursor is well-positioned inside 
>>>> the screen." },
>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>> -            "Check if a given-size cursor is well-positioned 
>>>> outside the screen." },
>>>> -        { "cursor-sliding", test_crc_sliding,
>>>> -            "Check the smooth and pixel-by-pixel given-size cursor 
>>>> movements on horizontal, vertical and diagonal." },
>>>> -        { "cursor-random", test_crc_random,
>>>> -            "Check random placement of a cursor with given size." },
>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>> -            "Check the rapid update of given-size cursor 
>>>> movements." },
>>>> -    };
>>>>          igt_fixture {
>>>>            data->output = 
>>>> igt_get_single_output_for_pipe(&data->display, pipe);
>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>        igt_fixture
>>>>            igt_remove_fb(data->drm_fd, &data->fb);
>>>>    -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>> -        igt_describe(size_tests[i].desc);
>>>> -        igt_subtest_group {
>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size 
>>>> *= 2) {
>>>> -                int w = cursor_size;
>>>> -                int h = cursor_size;
>>>> -
>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>> size_tests[i].name, w, h)
>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, 
>>>> h);
>>>> -
>>>> -                /*
>>>> -                 * Test non-square cursors a bit on the platforms
>>>> -                 * that support such things. And make it a bit more
>>>> -                 * interesting by using a non-pot height.
>>>> -                 */
>>>> -                h /= 3;
>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>> size_tests[i].name, w, h)
>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, 
>>>> h);
>>>> -            }
>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>> +    {
>>>> +        int w = cursor_size;
>>>> +        int h = cursor_size;
>>>>    -            igt_subtest_with_dynamic_f("%s-max-size", 
>>>> size_tests[i].name)
>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>> -        }
>>>> +        igt_subtest_group
>>>> +            run_size_tests(data, w, h);
>>>> +
>>>> +        /*
>>>> +         * Test non-square cursors a bit on the platforms
>>>> +         * that support such things. And make it a bit more
>>>> +         * interesting by using a non-pot height.
>>>> +         */
>>>> +        h /= 3;
>>>> +
>>>> +        igt_subtest_group
>>>> +            run_size_tests(data, w, h);
>>>>        }
>>>> +
>>>> +    run_size_tests(data, 0, 0);
>>>>    }
>>>>      static data_t data;
>>>> @@ -896,8 +901,6 @@ igt_main
>>>>            kmstest_set_vt_graphics_mode();
>>>>              igt_require_pipe_crc(data.drm_fd);
>>>> -
>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>        }
>>>>          data.cursor_max_w = cursor_width;
>>>> @@ -913,6 +916,5 @@ igt_main
>>>>            }
>>>>              igt_display_fini(&data.display);
>>>> -        close(data.drm_fd);
>>>>        }
>>>>    }
> 

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 16:50       ` Modem, Bhanuprakash
@ 2022-11-01 17:31         ` Juha-Pekka Heikkila
  2022-11-01 18:52           ` aemad
  2022-11-01 18:49         ` aemad
  1 sibling, 1 reply; 25+ messages in thread
From: Juha-Pekka Heikkila @ 2022-11-01 17:31 UTC (permalink / raw)
  To: Modem, Bhanuprakash, aemad; +Cc: igt-dev, petri.latvala

On 1.11.2022 18.50, Modem, Bhanuprakash wrote:
> Hi JP,
> 
> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>> On 1.11.2022 13.25, aemad wrote:
>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>> Hi Alaa,
>>>>
>>>> what's that invalid argument you're getting on addfb? I never tried
>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>
>>>
>>> Hi Juha-Pekka,
>>>
>>>> Anyway, that revert you're suggesting would remove support for msm
>>>> driver on this test. Let's first summon those who made these changes
>>>> to comment. (cc'ing Modem and Swati)
>>>
>>> Could you please explain why this patch will remove MSM driver support?
>>>
>>
>> See in test what's done with data.vblank_wait_count variable. That is 
>> there because on msm legacy cursor is not updated asynchronously and 
>> msm cursor likely will miss even second frame. Taking that out will 
>> cause these tests reliably fail on msm.
>>
>> I was just today because of unrelated cursor issues looking into this, 
>> I still don't have patch though. As Swati/Modem didn't come back with 
>> a fix I was looking to take out all dynamic stuff, it should solve 
>> this issue.
> 
> I am not sure, how this issue is related to dynamic subtests.

Well, the structure is definitely incorrect if failure in cursor 
framebuffer creation will cause SIGABRT. I didn't go figuring out where 
it goes wrong, I just was interested in getting tests running correctly.

In the mean time I created revert patch which probably doesn't lose 
anything written on top of dynamic tests. Does this cause test runs go 
correct Alaa? https://patchwork.freedesktop.org/series/110386/

/Juha-Pekka

> 
> Expecting that we need to skip the test if the device is vkms & cursor 
> height/width < 20 px. From IGT, is there any way to identify the device 
> is VKMS or not?
> 
> Apart from this, I have floated patch with some minor cleanup [1].
> @ Alaa, can you please help to check if it helps?
> 
> [1]: https://patchwork.freedesktop.org/series/110381/
> 
> - Bhanu
> 
>>
>> /Juha-Pekka
>>
>>>
>>>>
>>>> /Juha-Pekka
>>>>
>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>> Any test failure prevents the other tests to be run, aborting the 
>>>>> entire test loop. This behavior was introduced by commit
>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>> For instance, when running the cursor-offscreen-32x10 subtest using 
>>>>> VKMS,
>>>>> the execution is aborted instead of SKIP/FAIL, as in the following 
>>>>> output:
>>>>>
>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure 
>>>>> function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: 
>>>>> (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, 
>>>>> fb->drm_format, fb->modifier, fb->strides, fb->offsets, 
>>>>> fb->num_planes, flags, &fb->fb_id)) == 0
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid 
>>>>> argument
>>>>> Stack trace:
>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion 
>>>>> `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>> Received signal SIGABRT.
>>>>>
>>>>> The test was aborted after convertig tests to dynamic with cursor 
>>>>> size 32*10 that because of the assertion in the 
>>>>> `igt_create_fb_with_bo_size` when creating cursor in 
>>>>> `create_cursor_fb`.
>>>>>
>>>>> This happened because Within a igt_subtest_with_dynamic block, 
>>>>> explicit failure (e.g. igt_assert) is not allowed,
>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>
>>>>> The previous approach was running each test for all cursor sizes 
>>>>> then move to the next test  so fix this issue
>>>>> by running all tests for one cursor size one by one, and check if 
>>>>> cursor size is
>>>>> supported or not before running the test.
>>>>>
>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>
>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>> ---
>>>>>    tests/kms_cursor_crc.c | 136 
>>>>> +++++++++++++++++++++--------------------
>>>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>
>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>> index 8d3426dd..9b620389 100644
>>>>> --- a/tests/kms_cursor_crc.c
>>>>> +++ b/tests/kms_cursor_crc.c
>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>        cairo_surface_t *surface;
>>>>>        uint32_t devid;
>>>>>        double alpha;
>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>    } data_t;
>>>>>      #define TEST_DPMS (1<<0)
>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>    {
>>>>>        igt_plane_set_fb(data->cursor, NULL);
>>>>>        igt_plane_set_position(data->cursor, 0, 0);
>>>>> -    igt_display_commit(&data->display);
>>>>> -
>>>>> -    /* do this wait here so it will not need to be added 
>>>>> everywhere */
>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>> -                  data->vblank_wait_count);
>>>>>    }
>>>>>      static bool chv_cursor_broken(data_t *data, int x)
>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, 
>>>>> int y, bool hw_test,
>>>>>            igt_display_commit(display);
>>>>>              /* Extra vblank wait is because nonblocking cursor 
>>>>> ioctl */
>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>> -                      data->vblank_wait_count);
>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, 
>>>>> int x, int y, bool hw_test,
>>>>>              restore_image(data, swbufidx, &((cursorarea){x, y, 
>>>>> data->curw, data->curh}));
>>>>>            igt_plane_set_fb(data->primary, 
>>>>> &data->primary_fb[swbufidx]);
>>>>> +
>>>>>            igt_display_commit(display);
>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>> +
>>>>>            igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>            igt_assert_crc_equal(&crc, hwcrc);
>>>>>        }
>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, 
>>>>> int y, int expect)
>>>>>        igt_plane_set_position(data->cursor, x, y);
>>>>>        ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>    +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>        cursor_disable(data);
>>>>> +    igt_display_commit(display);
>>>>>          igt_assert_eq(ret, expect);
>>>>>    }
>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>        igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>    }
>>>>>    -static void run_size_tests(data_t *data, void 
>>>>> (*testfunc)(data_t *),
>>>>> -               int w, int h)
>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>    {
>>>>>        enum pipe pipe;
>>>>> +    int i;
>>>>> +
>>>>> +    struct
>>>>> +    {
>>>>> +        const char *name;
>>>>> +        void (*testfunc)(data_t *);
>>>>> +        const char *desc;
>>>>> +    } size_tests[] = {
>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>> +         "Check if a given-size cursor is well-positioned inside 
>>>>> the screen."},
>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>> +         "Check if a given-size cursor is well-positioned outside 
>>>>> the screen."},
>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor 
>>>>> movements on horizontal, vertical and diagonal."},
>>>>> +        {"cursor-random", test_crc_random,
>>>>> +         "Check random placement of a cursor with given size."},
>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>> +    };
>>>>>          if (w == 0 && h == 0) {
>>>>>            w = data->cursor_max_w;
>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void 
>>>>> (*testfunc)(data_t *),
>>>>>            }
>>>>>        }
>>>>>    -    create_cursor_fb(data, w, h);
>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, 
>>>>> h);
>>>>> -
>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>> -        return;
>>>>> -    }
>>>>> +    igt_fixture
>>>>> +        create_cursor_fb(data, w, h);
>>>>>    -    for_each_pipe(&data->display, pipe) {
>>>>> -        data->pipe = pipe;
>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>> -                  kmstest_pipe_name(pipe), 
>>>>> igt_output_name(data->output))
>>>>> -            run_test(data, testfunc, w, h);
>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>> +    {
>>>>> +        igt_describe(size_tests[i].desc);
>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, 
>>>>> w, h)
>>>>> +        {
>>>>> +            for_each_pipe(&data->display, pipe)
>>>>> +            {
>>>>> +                data->pipe = pipe;
>>>>> +                if (require_cursor_size(data, w, h))
>>>>> +                {
>>>>> +                    igt_info("Cursor size %dx%d not supported by 
>>>>> driver\n", w, h);
>>>>> +                    continue;
>>>>> +                }
>>>>> +
>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>> +                              kmstest_pipe_name(pipe), 
>>>>> igt_output_name(data->output))
>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>> +            }
>>>>> +        }
>>>>>        }
>>>>>    -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>> +    igt_fixture
>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>    }
>>>>>      static void run_tests_on_pipe(data_t *data)
>>>>>    {
>>>>>        enum pipe pipe;
>>>>>        int cursor_size;
>>>>> -    int i;
>>>>> -    struct {
>>>>> -        const char *name;
>>>>> -        void (*testfunc)(data_t *);
>>>>> -        const char *desc;
>>>>> -    } size_tests[] = {
>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>> -            "Check if a given-size cursor is well-positioned 
>>>>> inside the screen." },
>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>> -            "Check if a given-size cursor is well-positioned 
>>>>> outside the screen." },
>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor 
>>>>> movements on horizontal, vertical and diagonal." },
>>>>> -        { "cursor-random", test_crc_random,
>>>>> -            "Check random placement of a cursor with given size." },
>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>> -            "Check the rapid update of given-size cursor 
>>>>> movements." },
>>>>> -    };
>>>>>          igt_fixture {
>>>>>            data->output = 
>>>>> igt_get_single_output_for_pipe(&data->display, pipe);
>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>        igt_fixture
>>>>>            igt_remove_fb(data->drm_fd, &data->fb);
>>>>>    -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>> -        igt_describe(size_tests[i].desc);
>>>>> -        igt_subtest_group {
>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size 
>>>>> *= 2) {
>>>>> -                int w = cursor_size;
>>>>> -                int h = cursor_size;
>>>>> -
>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>>> size_tests[i].name, w, h)
>>>>> -                    run_size_tests(data, size_tests[i].testfunc, 
>>>>> w, h);
>>>>> -
>>>>> -                /*
>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>> -                 * that support such things. And make it a bit more
>>>>> -                 * interesting by using a non-pot height.
>>>>> -                 */
>>>>> -                h /= 3;
>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", 
>>>>> size_tests[i].name, w, h)
>>>>> -                    run_size_tests(data, size_tests[i].testfunc, 
>>>>> w, h);
>>>>> -            }
>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>> +    {
>>>>> +        int w = cursor_size;
>>>>> +        int h = cursor_size;
>>>>>    -            igt_subtest_with_dynamic_f("%s-max-size", 
>>>>> size_tests[i].name)
>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>> -        }
>>>>> +        igt_subtest_group
>>>>> +            run_size_tests(data, w, h);
>>>>> +
>>>>> +        /*
>>>>> +         * Test non-square cursors a bit on the platforms
>>>>> +         * that support such things. And make it a bit more
>>>>> +         * interesting by using a non-pot height.
>>>>> +         */
>>>>> +        h /= 3;
>>>>> +
>>>>> +        igt_subtest_group
>>>>> +            run_size_tests(data, w, h);
>>>>>        }
>>>>> +
>>>>> +    run_size_tests(data, 0, 0);
>>>>>    }
>>>>>      static data_t data;
>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>            kmstest_set_vt_graphics_mode();
>>>>>              igt_require_pipe_crc(data.drm_fd);
>>>>> -
>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>        }
>>>>>          data.cursor_max_w = cursor_width;
>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>            }
>>>>>              igt_display_fini(&data.display);
>>>>> -        close(data.drm_fd);
>>>>>        }
>>>>>    }
>>
> 

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 15:11     ` Juha-Pekka Heikkila
  2022-11-01 16:50       ` Modem, Bhanuprakash
@ 2022-11-01 18:46       ` aemad
  1 sibling, 0 replies; 25+ messages in thread
From: aemad @ 2022-11-01 18:46 UTC (permalink / raw)
  To: juhapekka.heikkila; +Cc: igt-dev, petri.latvala

On 2022-11-01 16:11, Juha-Pekka Heikkila wrote:
> On 1.11.2022 13.25, aemad wrote:
>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>> Hi Alaa,
>>>
>>> what's that invalid argument you're getting on addfb? I never tried
>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>> that abort you're seeing. Other kms tests run on your setup?
>>>
>>
>> Hi Juha-Pekka,
>>
>>> Anyway, that revert you're suggesting would remove support for msm
>>> driver on this test. Let's first summon those who made these changes
>>> to comment. (cc'ing Modem and Swati)
>>
>> Could you please explain why this patch will remove MSM driver support?
>>
> 
> See in test what's done with data.vblank_wait_count variable. That is
> there because on msm legacy cursor is not updated asynchronously and
> msm cursor likely will miss even second frame. Taking that out will
> cause these tests reliably fail on msm.
> 
> I was just today because of unrelated cursor issues looking into this,
> I still don't have patch though. As Swati/Modem didn't come back with
> a fix I was looking to take out all dynamic stuff, it should solve
> this issue.
> 
> /Juha-Pekka

Got it, thanks Juha.
> 
>>
>>>
>>> /Juha-Pekka
>>>
>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>
>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>> Stack trace:
>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>> Received signal SIGABRT.
>>>>
>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>
>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>> only dynamic subsubtests themselves will produce test results.
>>>>
>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>> supported or not before running the test.
>>>>
>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>
>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>> ---
>>>>    tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>>
>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>> index 8d3426dd..9b620389 100644
>>>> --- a/tests/kms_cursor_crc.c
>>>> +++ b/tests/kms_cursor_crc.c
>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>    	cairo_surface_t *surface;
>>>>    	uint32_t devid;
>>>>    	double alpha;
>>>> -	int vblank_wait_count; /* because of msm */
>>>>    } data_t;
>>>>      #define TEST_DPMS (1<<0)
>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>    {
>>>>    	igt_plane_set_fb(data->cursor, NULL);
>>>>    	igt_plane_set_position(data->cursor, 0, 0);
>>>> -	igt_display_commit(&data->display);
>>>> -
>>>> -	/* do this wait here so it will not need to be added everywhere */
>>>> -	igt_wait_for_vblank_count(data->drm_fd,
>>>> -				  data->display.pipes[data->pipe].crtc_offset,
>>>> -				  data->vblank_wait_count);
>>>>    }
>>>>      static bool chv_cursor_broken(data_t *data, int x)
>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>    		igt_display_commit(display);
>>>>      		/* Extra vblank wait is because nonblocking cursor ioctl */
>>>> -		igt_wait_for_vblank_count(data->drm_fd,
>>>> -					  display->pipes[data->pipe].crtc_offset,
>>>> -					  data->vblank_wait_count);
>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>> +				display->pipes[data->pipe].crtc_offset);
>>>>      		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>      		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>    		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>> +
>>>>    		igt_display_commit(display);
>>>> +		igt_wait_for_vblank(data->drm_fd,
>>>> +				display->pipes[data->pipe].crtc_offset);
>>>> +
>>>>    		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>    		igt_assert_crc_equal(&crc, hwcrc);
>>>>    	}
>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>    	igt_plane_set_position(data->cursor, x, y);
>>>>    	ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>    +	igt_plane_set_position(data->cursor, 0, 0);
>>>>    	cursor_disable(data);
>>>> +	igt_display_commit(display);
>>>>      	igt_assert_eq(ret, expect);
>>>>    }
>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>    	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>    }
>>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>> -			   int w, int h)
>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>    {
>>>>    	enum pipe pipe;
>>>> +	int i;
>>>> +
>>>> +	struct
>>>> +	{
>>>> +		const char *name;
>>>> +		void (*testfunc)(data_t *);
>>>> +		const char *desc;
>>>> +	} size_tests[] = {
>>>> +		{"cursor-onscreen", test_crc_onscreen,
>>>> +		 "Check if a given-size cursor is well-positioned inside the screen."},
>>>> +		{"cursor-offscreen", test_crc_offscreen,
>>>> +		 "Check if a given-size cursor is well-positioned outside the screen."},
>>>> +		{"cursor-sliding", test_crc_sliding,
>>>> +		 "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>> +		{"cursor-random", test_crc_random,
>>>> +		 "Check random placement of a cursor with given size."},
>>>> +		{"cursor-rapid-movement", test_rapid_movement,
>>>> +		 "Check the rapid update of given-size cursor movements."},
>>>> +	};
>>>>      	if (w == 0 && h == 0) {
>>>>    		w = data->cursor_max_w;
>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>    		}
>>>>    	}
>>>>    -	create_cursor_fb(data, w, h);
>>>> -	if (require_cursor_size(data, w, h)) {
>>>> -		igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>> -
>>>> -		igt_remove_fb(data->drm_fd, &data->fb);
>>>> -		return;
>>>> -	}
>>>> +	igt_fixture
>>>> +		create_cursor_fb(data, w, h);
>>>>    -	for_each_pipe(&data->display, pipe) {
>>>> -		data->pipe = pipe;
>>>> -		igt_dynamic_f("pipe-%s-%s",
>>>> -			      kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>> -			run_test(data, testfunc, w, h);
>>>> +	for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>> +	{
>>>> +		igt_describe(size_tests[i].desc);
>>>> +		igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>> +		{
>>>> +			for_each_pipe(&data->display, pipe)
>>>> +			{
>>>> +				data->pipe = pipe;
>>>> +				if (require_cursor_size(data, w, h))
>>>> +				{
>>>> +					igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>> +					continue;
>>>> +				}
>>>> +
>>>> +				igt_dynamic_f("pipe-%s-%s",
>>>> +							  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>> +					run_test(data, size_tests[i].testfunc, w, h);
>>>> +			}
>>>> +		}
>>>>    	}
>>>>    -	igt_remove_fb(data->drm_fd, &data->fb);
>>>> +	igt_fixture
>>>> +		igt_remove_fb(data->drm_fd, &data->fb);
>>>>    }
>>>>      static void run_tests_on_pipe(data_t *data)
>>>>    {
>>>>    	enum pipe pipe;
>>>>    	int cursor_size;
>>>> -	int i;
>>>> -	struct {
>>>> -		const char *name;
>>>> -		void (*testfunc)(data_t *);
>>>> -		const char *desc;
>>>> -	} size_tests[] = {
>>>> -		{ "cursor-onscreen", test_crc_onscreen,
>>>> -			"Check if a given-size cursor is well-positioned inside the screen." },
>>>> -		{ "cursor-offscreen", test_crc_offscreen,
>>>> -			"Check if a given-size cursor is well-positioned outside the screen." },
>>>> -		{ "cursor-sliding", test_crc_sliding,
>>>> -			"Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>> -		{ "cursor-random", test_crc_random,
>>>> -			"Check random placement of a cursor with given size." },
>>>> -		{ "cursor-rapid-movement", test_rapid_movement,
>>>> -			"Check the rapid update of given-size cursor movements." },
>>>> -	};
>>>>      	igt_fixture {
>>>>    		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>    	igt_fixture
>>>>    		igt_remove_fb(data->drm_fd, &data->fb);
>>>>    -	for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>> -		igt_describe(size_tests[i].desc);
>>>> -		igt_subtest_group {
>>>> -			for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>> -				int w = cursor_size;
>>>> -				int h = cursor_size;
>>>> -
>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>> -
>>>> -				/*
>>>> -				 * Test non-square cursors a bit on the platforms
>>>> -				 * that support such things. And make it a bit more
>>>> -				 * interesting by using a non-pot height.
>>>> -				 */
>>>> -				h /= 3;
>>>> -				igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>> -					run_size_tests(data, size_tests[i].testfunc, w, h);
>>>> -			}
>>>> +	for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>> +	{
>>>> +		int w = cursor_size;
>>>> +		int h = cursor_size;
>>>>    -			igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>> -				run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>> -		}
>>>> +		igt_subtest_group
>>>> +			run_size_tests(data, w, h);
>>>> +
>>>> +		/*
>>>> +		 * Test non-square cursors a bit on the platforms
>>>> +		 * that support such things. And make it a bit more
>>>> +		 * interesting by using a non-pot height.
>>>> +		 */
>>>> +		h /= 3;
>>>> +
>>>> +		igt_subtest_group
>>>> +			run_size_tests(data, w, h);
>>>>    	}
>>>> +
>>>> +	run_size_tests(data, 0, 0);
>>>>    }
>>>>      static data_t data;
>>>> @@ -896,8 +901,6 @@ igt_main
>>>>    		kmstest_set_vt_graphics_mode();
>>>>      		igt_require_pipe_crc(data.drm_fd);
>>>> -
>>>> -		data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>    	}
>>>>      	data.cursor_max_w = cursor_width;
>>>> @@ -913,6 +916,5 @@ igt_main
>>>>    		}
>>>>      		igt_display_fini(&data.display);
>>>> -		close(data.drm_fd);
>>>>    	}
>>>>    }

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 16:50       ` Modem, Bhanuprakash
  2022-11-01 17:31         ` Juha-Pekka Heikkila
@ 2022-11-01 18:49         ` aemad
  2022-11-02 11:25           ` Modem, Bhanuprakash
  1 sibling, 1 reply; 25+ messages in thread
From: aemad @ 2022-11-01 18:49 UTC (permalink / raw)
  To: Modem, Bhanuprakash; +Cc: igt-dev, petri.latvala

On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
> Hi JP,
> 
> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>> On 1.11.2022 13.25, aemad wrote:
>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>> Hi Alaa,
>>>>
>>>> what's that invalid argument you're getting on addfb? I never tried
>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>
>>>
>>> Hi Juha-Pekka,
>>>
>>>> Anyway, that revert you're suggesting would remove support for msm
>>>> driver on this test. Let's first summon those who made these changes
>>>> to comment. (cc'ing Modem and Swati)
>>>
>>> Could you please explain why this patch will remove MSM driver support?
>>>
>>
>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>
>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
> 
> I am not sure, how this issue is related to dynamic subtests.
> 
> Expecting that we need to skip the test if the device is vkms & cursor
> height/width < 20 px. From IGT, is there any way to identify the
> device is VKMS or not?
> 
> Apart from this, I have floated patch with some minor cleanup [1].
> @ Alaa, can you please help to check if it helps?

yes, sure I can check it.

> 
> [1]: https://patchwork.freedesktop.org/series/110381/
> 
> - Bhanu
> 
>>
>> /Juha-Pekka
>>
>>>
>>>>
>>>> /Juha-Pekka
>>>>
>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>
>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>> Stack trace:
>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>> Received signal SIGABRT.
>>>>>
>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>
>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>
>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>> supported or not before running the test.
>>>>>
>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>
>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>> ---
>>>>>    tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>
>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>> index 8d3426dd..9b620389 100644
>>>>> --- a/tests/kms_cursor_crc.c
>>>>> +++ b/tests/kms_cursor_crc.c
>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>        cairo_surface_t *surface;
>>>>>        uint32_t devid;
>>>>>        double alpha;
>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>    } data_t;
>>>>>      #define TEST_DPMS (1<<0)
>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>    {
>>>>>        igt_plane_set_fb(data->cursor, NULL);
>>>>>        igt_plane_set_position(data->cursor, 0, 0);
>>>>> -    igt_display_commit(&data->display);
>>>>> -
>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>> -                  data->vblank_wait_count);
>>>>>    }
>>>>>      static bool chv_cursor_broken(data_t *data, int x)
>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>            igt_display_commit(display);
>>>>>              /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>> -                      data->vblank_wait_count);
>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>              restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>            igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>> +
>>>>>            igt_display_commit(display);
>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>> +
>>>>>            igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>            igt_assert_crc_equal(&crc, hwcrc);
>>>>>        }
>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>        igt_plane_set_position(data->cursor, x, y);
>>>>>        ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>    +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>        cursor_disable(data);
>>>>> +    igt_display_commit(display);
>>>>>          igt_assert_eq(ret, expect);
>>>>>    }
>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>        igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>    }
>>>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>> -               int w, int h)
>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>    {
>>>>>        enum pipe pipe;
>>>>> +    int i;
>>>>> +
>>>>> +    struct
>>>>> +    {
>>>>> +        const char *name;
>>>>> +        void (*testfunc)(data_t *);
>>>>> +        const char *desc;
>>>>> +    } size_tests[] = {
>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>> +        {"cursor-random", test_crc_random,
>>>>> +         "Check random placement of a cursor with given size."},
>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>> +    };
>>>>>          if (w == 0 && h == 0) {
>>>>>            w = data->cursor_max_w;
>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>            }
>>>>>        }
>>>>>    -    create_cursor_fb(data, w, h);
>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>> -
>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>> -        return;
>>>>> -    }
>>>>> +    igt_fixture
>>>>> +        create_cursor_fb(data, w, h);
>>>>>    -    for_each_pipe(&data->display, pipe) {
>>>>> -        data->pipe = pipe;
>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>> -            run_test(data, testfunc, w, h);
>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>> +    {
>>>>> +        igt_describe(size_tests[i].desc);
>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>> +        {
>>>>> +            for_each_pipe(&data->display, pipe)
>>>>> +            {
>>>>> +                data->pipe = pipe;
>>>>> +                if (require_cursor_size(data, w, h))
>>>>> +                {
>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>> +                    continue;
>>>>> +                }
>>>>> +
>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>> +            }
>>>>> +        }
>>>>>        }
>>>>>    -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>> +    igt_fixture
>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>    }
>>>>>      static void run_tests_on_pipe(data_t *data)
>>>>>    {
>>>>>        enum pipe pipe;
>>>>>        int cursor_size;
>>>>> -    int i;
>>>>> -    struct {
>>>>> -        const char *name;
>>>>> -        void (*testfunc)(data_t *);
>>>>> -        const char *desc;
>>>>> -    } size_tests[] = {
>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>> -        { "cursor-random", test_crc_random,
>>>>> -            "Check random placement of a cursor with given size." },
>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>> -    };
>>>>>          igt_fixture {
>>>>>            data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>        igt_fixture
>>>>>            igt_remove_fb(data->drm_fd, &data->fb);
>>>>>    -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>> -        igt_describe(size_tests[i].desc);
>>>>> -        igt_subtest_group {
>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>> -                int w = cursor_size;
>>>>> -                int h = cursor_size;
>>>>> -
>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>> -
>>>>> -                /*
>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>> -                 * that support such things. And make it a bit more
>>>>> -                 * interesting by using a non-pot height.
>>>>> -                 */
>>>>> -                h /= 3;
>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>> -            }
>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>> +    {
>>>>> +        int w = cursor_size;
>>>>> +        int h = cursor_size;
>>>>>    -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>> -        }
>>>>> +        igt_subtest_group
>>>>> +            run_size_tests(data, w, h);
>>>>> +
>>>>> +        /*
>>>>> +         * Test non-square cursors a bit on the platforms
>>>>> +         * that support such things. And make it a bit more
>>>>> +         * interesting by using a non-pot height.
>>>>> +         */
>>>>> +        h /= 3;
>>>>> +
>>>>> +        igt_subtest_group
>>>>> +            run_size_tests(data, w, h);
>>>>>        }
>>>>> +
>>>>> +    run_size_tests(data, 0, 0);
>>>>>    }
>>>>>      static data_t data;
>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>            kmstest_set_vt_graphics_mode();
>>>>>              igt_require_pipe_crc(data.drm_fd);
>>>>> -
>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>        }
>>>>>          data.cursor_max_w = cursor_width;
>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>            }
>>>>>              igt_display_fini(&data.display);
>>>>> -        close(data.drm_fd);
>>>>>        }
>>>>>    }
>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 17:31         ` Juha-Pekka Heikkila
@ 2022-11-01 18:52           ` aemad
  0 siblings, 0 replies; 25+ messages in thread
From: aemad @ 2022-11-01 18:52 UTC (permalink / raw)
  To: juhapekka.heikkila; +Cc: igt-dev, petri.latvala

On 2022-11-01 18:31, Juha-Pekka Heikkila wrote:
> On 1.11.2022 18.50, Modem, Bhanuprakash wrote:
>> Hi JP,
>>
>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>> On 1.11.2022 13.25, aemad wrote:
>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>> Hi Alaa,
>>>>>
>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>
>>>>
>>>> Hi Juha-Pekka,
>>>>
>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>> driver on this test. Let's first summon those who made these changes
>>>>> to comment. (cc'ing Modem and Swati)
>>>>
>>>> Could you please explain why this patch will remove MSM driver support?
>>>>
>>>
>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>
>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>
>> I am not sure, how this issue is related to dynamic subtests.
> 
> Well, the structure is definitely incorrect if failure in cursor
> framebuffer creation will cause SIGABRT. I didn't go figuring out
> where it goes wrong, I just was interested in getting tests running
> correctly.
> 
> In the mean time I created revert patch which probably doesn't lose
> anything written on top of dynamic tests. Does this cause test runs go
> correct Alaa? 

Yes, it does
/Alaa

https://patchwork.freedesktop.org/series/110386/
> 
> /Juha-Pekka
> 
>>
>> Expecting that we need to skip the test if the device is vkms & cursor height/width < 20 px. From IGT, is there any way to identify the device is VKMS or not?
>>
>> Apart from this, I have floated patch with some minor cleanup [1].
>> @ Alaa, can you please help to check if it helps?
>>
>> [1]: https://patchwork.freedesktop.org/series/110381/
>>
>> - Bhanu
>>
>>>
>>> /Juha-Pekka
>>>
>>>>
>>>>>
>>>>> /Juha-Pekka
>>>>>
>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>
>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>> Stack trace:
>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>> Received signal SIGABRT.
>>>>>>
>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>
>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>
>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>> supported or not before running the test.
>>>>>>
>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>
>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>> ---
>>>>>>    tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>    1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>
>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>> index 8d3426dd..9b620389 100644
>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>        cairo_surface_t *surface;
>>>>>>        uint32_t devid;
>>>>>>        double alpha;
>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>    } data_t;
>>>>>>      #define TEST_DPMS (1<<0)
>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>    {
>>>>>>        igt_plane_set_fb(data->cursor, NULL);
>>>>>>        igt_plane_set_position(data->cursor, 0, 0);
>>>>>> -    igt_display_commit(&data->display);
>>>>>> -
>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>> -                  data->vblank_wait_count);
>>>>>>    }
>>>>>>      static bool chv_cursor_broken(data_t *data, int x)
>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>            igt_display_commit(display);
>>>>>>              /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>> -                      data->vblank_wait_count);
>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>    @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>              restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>            igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>> +
>>>>>>            igt_display_commit(display);
>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>> +
>>>>>>            igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>            igt_assert_crc_equal(&crc, hwcrc);
>>>>>>        }
>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>        igt_plane_set_position(data->cursor, x, y);
>>>>>>        ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>    +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>        cursor_disable(data);
>>>>>> +    igt_display_commit(display);
>>>>>>          igt_assert_eq(ret, expect);
>>>>>>    }
>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>        igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>    }
>>>>>>    -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>> -               int w, int h)
>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>    {
>>>>>>        enum pipe pipe;
>>>>>> +    int i;
>>>>>> +
>>>>>> +    struct
>>>>>> +    {
>>>>>> +        const char *name;
>>>>>> +        void (*testfunc)(data_t *);
>>>>>> +        const char *desc;
>>>>>> +    } size_tests[] = {
>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>> +        {"cursor-random", test_crc_random,
>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>> +    };
>>>>>>          if (w == 0 && h == 0) {
>>>>>>            w = data->cursor_max_w;
>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>            }
>>>>>>        }
>>>>>>    -    create_cursor_fb(data, w, h);
>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>> -
>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> -        return;
>>>>>> -    }
>>>>>> +    igt_fixture
>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>    -    for_each_pipe(&data->display, pipe) {
>>>>>> -        data->pipe = pipe;
>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>> -            run_test(data, testfunc, w, h);
>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>> +    {
>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> +        {
>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>> +            {
>>>>>> +                data->pipe = pipe;
>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>> +                {
>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>> +                    continue;
>>>>>> +                }
>>>>>> +
>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>> +            }
>>>>>> +        }
>>>>>>        }
>>>>>>    -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> +    igt_fixture
>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>    }
>>>>>>      static void run_tests_on_pipe(data_t *data)
>>>>>>    {
>>>>>>        enum pipe pipe;
>>>>>>        int cursor_size;
>>>>>> -    int i;
>>>>>> -    struct {
>>>>>> -        const char *name;
>>>>>> -        void (*testfunc)(data_t *);
>>>>>> -        const char *desc;
>>>>>> -    } size_tests[] = {
>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>> -        { "cursor-random", test_crc_random,
>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>> -    };
>>>>>>          igt_fixture {
>>>>>>            data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>        igt_fixture
>>>>>>            igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>    -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>> -        igt_subtest_group {
>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>> -                int w = cursor_size;
>>>>>> -                int h = cursor_size;
>>>>>> -
>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>> -
>>>>>> -                /*
>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>> -                 * that support such things. And make it a bit more
>>>>>> -                 * interesting by using a non-pot height.
>>>>>> -                 */
>>>>>> -                h /= 3;
>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>> -            }
>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>> +    {
>>>>>> +        int w = cursor_size;
>>>>>> +        int h = cursor_size;
>>>>>>    -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>> -        }
>>>>>> +        igt_subtest_group
>>>>>> +            run_size_tests(data, w, h);
>>>>>> +
>>>>>> +        /*
>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>> +         * that support such things. And make it a bit more
>>>>>> +         * interesting by using a non-pot height.
>>>>>> +         */
>>>>>> +        h /= 3;
>>>>>> +
>>>>>> +        igt_subtest_group
>>>>>> +            run_size_tests(data, w, h);
>>>>>>        }
>>>>>> +
>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>    }
>>>>>>      static data_t data;
>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>            kmstest_set_vt_graphics_mode();
>>>>>>              igt_require_pipe_crc(data.drm_fd);
>>>>>> -
>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>        }
>>>>>>          data.cursor_max_w = cursor_width;
>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>            }
>>>>>>              igt_display_fini(&data.display);
>>>>>> -        close(data.drm_fd);
>>>>>>        }
>>>>>>    }
>>>
>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-01 18:49         ` aemad
@ 2022-11-02 11:25           ` Modem, Bhanuprakash
  2022-11-03 16:07             ` aemad
  0 siblings, 1 reply; 25+ messages in thread
From: Modem, Bhanuprakash @ 2022-11-02 11:25 UTC (permalink / raw)
  To: aemad; +Cc: igt-dev, petri.latvala

On Wed-02-11-2022 12:19 am, aemad wrote:
> On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
>> Hi JP,
>>
>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>> On 1.11.2022 13.25, aemad wrote:
>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>> Hi Alaa,
>>>>>
>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>
>>>>
>>>> Hi Juha-Pekka,
>>>>
>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>> driver on this test. Let's first summon those who made these changes
>>>>> to comment. (cc'ing Modem and Swati)
>>>>
>>>> Could you please explain why this patch will remove MSM driver support?
>>>>
>>>
>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>
>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>
>> I am not sure, how this issue is related to dynamic subtests.
>>
>> Expecting that we need to skip the test if the device is vkms & cursor
>> height/width < 20 px. From IGT, is there any way to identify the
>> device is VKMS or not?
>>
>> Apart from this, I have floated patch with some minor cleanup [1].
>> @ Alaa, can you please help to check if it helps?
> 
> yes, sure I can check it.

Floated a fix: https://patchwork.freedesktop.org/series/110407/

I have adopted the approach from your patch (also kept your Sob) & fixed 
the usage of *-max-size tests.

Please check if it works.

- Bhanu

> 
>>
>> [1]: https://patchwork.freedesktop.org/series/110381/
>>
>> - Bhanu
>>
>>>
>>> /Juha-Pekka
>>>
>>>>
>>>>>
>>>>> /Juha-Pekka
>>>>>
>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>
>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>> Stack trace:
>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>> Received signal SIGABRT.
>>>>>>
>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>
>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>
>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>> supported or not before running the test.
>>>>>>
>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>
>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>> ---
>>>>>>     tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>     1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>
>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>> index 8d3426dd..9b620389 100644
>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>         cairo_surface_t *surface;
>>>>>>         uint32_t devid;
>>>>>>         double alpha;
>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>     } data_t;
>>>>>>       #define TEST_DPMS (1<<0)
>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>     {
>>>>>>         igt_plane_set_fb(data->cursor, NULL);
>>>>>>         igt_plane_set_position(data->cursor, 0, 0);
>>>>>> -    igt_display_commit(&data->display);
>>>>>> -
>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>> -                  data->vblank_wait_count);
>>>>>>     }
>>>>>>       static bool chv_cursor_broken(data_t *data, int x)
>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>             igt_display_commit(display);
>>>>>>               /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>> -                      data->vblank_wait_count);
>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>               igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>     @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>               restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>             igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>> +
>>>>>>             igt_display_commit(display);
>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>> +
>>>>>>             igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>             igt_assert_crc_equal(&crc, hwcrc);
>>>>>>         }
>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>         igt_plane_set_position(data->cursor, x, y);
>>>>>>         ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>     +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>         cursor_disable(data);
>>>>>> +    igt_display_commit(display);
>>>>>>           igt_assert_eq(ret, expect);
>>>>>>     }
>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>         igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>     }
>>>>>>     -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>> -               int w, int h)
>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>     {
>>>>>>         enum pipe pipe;
>>>>>> +    int i;
>>>>>> +
>>>>>> +    struct
>>>>>> +    {
>>>>>> +        const char *name;
>>>>>> +        void (*testfunc)(data_t *);
>>>>>> +        const char *desc;
>>>>>> +    } size_tests[] = {
>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>> +        {"cursor-random", test_crc_random,
>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>> +    };
>>>>>>           if (w == 0 && h == 0) {
>>>>>>             w = data->cursor_max_w;
>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>             }
>>>>>>         }
>>>>>>     -    create_cursor_fb(data, w, h);
>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>> -
>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> -        return;
>>>>>> -    }
>>>>>> +    igt_fixture
>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>     -    for_each_pipe(&data->display, pipe) {
>>>>>> -        data->pipe = pipe;
>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>> -            run_test(data, testfunc, w, h);
>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>> +    {
>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> +        {
>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>> +            {
>>>>>> +                data->pipe = pipe;
>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>> +                {
>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>> +                    continue;
>>>>>> +                }
>>>>>> +
>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>> +            }
>>>>>> +        }
>>>>>>         }
>>>>>>     -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>> +    igt_fixture
>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>     }
>>>>>>       static void run_tests_on_pipe(data_t *data)
>>>>>>     {
>>>>>>         enum pipe pipe;
>>>>>>         int cursor_size;
>>>>>> -    int i;
>>>>>> -    struct {
>>>>>> -        const char *name;
>>>>>> -        void (*testfunc)(data_t *);
>>>>>> -        const char *desc;
>>>>>> -    } size_tests[] = {
>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>> -        { "cursor-random", test_crc_random,
>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>> -    };
>>>>>>           igt_fixture {
>>>>>>             data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>         igt_fixture
>>>>>>             igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>     -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>> -        igt_subtest_group {
>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>> -                int w = cursor_size;
>>>>>> -                int h = cursor_size;
>>>>>> -
>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>> -
>>>>>> -                /*
>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>> -                 * that support such things. And make it a bit more
>>>>>> -                 * interesting by using a non-pot height.
>>>>>> -                 */
>>>>>> -                h /= 3;
>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>> -            }
>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>> +    {
>>>>>> +        int w = cursor_size;
>>>>>> +        int h = cursor_size;
>>>>>>     -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>> -        }
>>>>>> +        igt_subtest_group
>>>>>> +            run_size_tests(data, w, h);
>>>>>> +
>>>>>> +        /*
>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>> +         * that support such things. And make it a bit more
>>>>>> +         * interesting by using a non-pot height.
>>>>>> +         */
>>>>>> +        h /= 3;
>>>>>> +
>>>>>> +        igt_subtest_group
>>>>>> +            run_size_tests(data, w, h);
>>>>>>         }
>>>>>> +
>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>     }
>>>>>>       static data_t data;
>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>             kmstest_set_vt_graphics_mode();
>>>>>>               igt_require_pipe_crc(data.drm_fd);
>>>>>> -
>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>         }
>>>>>>           data.cursor_max_w = cursor_width;
>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>             }
>>>>>>               igt_display_fini(&data.display);
>>>>>> -        close(data.drm_fd);
>>>>>>         }
>>>>>>     }
>>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-02 11:25           ` Modem, Bhanuprakash
@ 2022-11-03 16:07             ` aemad
  2022-11-03 19:36               ` aemad
  0 siblings, 1 reply; 25+ messages in thread
From: aemad @ 2022-11-03 16:07 UTC (permalink / raw)
  To: Modem, Bhanuprakash; +Cc: igt-dev, petri.latvala

On 2022-11-02 12:25, Modem, Bhanuprakash wrote:
> On Wed-02-11-2022 12:19 am, aemad wrote:
>> On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
>>> Hi JP,
>>>
>>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>>> On 1.11.2022 13.25, aemad wrote:
>>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>>> Hi Alaa,
>>>>>>
>>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>>
>>>>>
>>>>> Hi Juha-Pekka,
>>>>>
>>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>>> driver on this test. Let's first summon those who made these changes
>>>>>> to comment. (cc'ing Modem and Swati)
>>>>>
>>>>> Could you please explain why this patch will remove MSM driver support?
>>>>>
>>>>
>>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>>
>>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>>
>>> I am not sure, how this issue is related to dynamic subtests.
>>>
>>> Expecting that we need to skip the test if the device is vkms & cursor
>>> height/width < 20 px. From IGT, is there any way to identify the
>>> device is VKMS or not?
>>>
>>> Apart from this, I have floated patch with some minor cleanup [1].
>>> @ Alaa, can you please help to check if it helps?
>>
>> yes, sure I can check it.
> 
> Floated a fix: https://patchwork.freedesktop.org/series/110407/
> 
> I have adopted the approach from your patch (also kept your Sob) &
> fixed the usage of *-max-size tests.
> 
> Please check if it works.

Sure, I will.

- Alaa
> 
> - Bhanu
> 
>>
>>>
>>> [1]: https://patchwork.freedesktop.org/series/110381/
>>>
>>> - Bhanu
>>>
>>>>
>>>> /Juha-Pekka
>>>>
>>>>>
>>>>>>
>>>>>> /Juha-Pekka
>>>>>>
>>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>>
>>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>>> Stack trace:
>>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>>> Received signal SIGABRT.
>>>>>>>
>>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>>
>>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>>
>>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>>> supported or not before running the test.
>>>>>>>
>>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>>
>>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>>> ---
>>>>>>>     tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>>     1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>>
>>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>>> index 8d3426dd..9b620389 100644
>>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>>         cairo_surface_t *surface;
>>>>>>>         uint32_t devid;
>>>>>>>         double alpha;
>>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>>     } data_t;
>>>>>>>       #define TEST_DPMS (1<<0)
>>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>>     {
>>>>>>>         igt_plane_set_fb(data->cursor, NULL);
>>>>>>>         igt_plane_set_position(data->cursor, 0, 0);
>>>>>>> -    igt_display_commit(&data->display);
>>>>>>> -
>>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>>> -                  data->vblank_wait_count);
>>>>>>>     }
>>>>>>>       static bool chv_cursor_broken(data_t *data, int x)
>>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>             igt_display_commit(display);
>>>>>>>               /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>>> -                      data->vblank_wait_count);
>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>               igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>>     @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>               restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>>             igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>>> +
>>>>>>>             igt_display_commit(display);
>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>> +
>>>>>>>             igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>>             igt_assert_crc_equal(&crc, hwcrc);
>>>>>>>         }
>>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>>         igt_plane_set_position(data->cursor, x, y);
>>>>>>>         ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>>     +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>         cursor_disable(data);
>>>>>>> +    igt_display_commit(display);
>>>>>>>           igt_assert_eq(ret, expect);
>>>>>>>     }
>>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>>         igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>>     }
>>>>>>>     -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>> -               int w, int h)
>>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>>     {
>>>>>>>         enum pipe pipe;
>>>>>>> +    int i;
>>>>>>> +
>>>>>>> +    struct
>>>>>>> +    {
>>>>>>> +        const char *name;
>>>>>>> +        void (*testfunc)(data_t *);
>>>>>>> +        const char *desc;
>>>>>>> +    } size_tests[] = {
>>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>>> +        {"cursor-random", test_crc_random,
>>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>>> +    };
>>>>>>>           if (w == 0 && h == 0) {
>>>>>>>             w = data->cursor_max_w;
>>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>             }
>>>>>>>         }
>>>>>>>     -    create_cursor_fb(data, w, h);
>>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>> -
>>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>> -        return;
>>>>>>> -    }
>>>>>>> +    igt_fixture
>>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>>     -    for_each_pipe(&data->display, pipe) {
>>>>>>> -        data->pipe = pipe;
>>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>> -            run_test(data, testfunc, w, h);
>>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>>> +    {
>>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>> +        {
>>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>>> +            {
>>>>>>> +                data->pipe = pipe;
>>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>>> +                {
>>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>> +                    continue;
>>>>>>> +                }
>>>>>>> +
>>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>>> +            }
>>>>>>> +        }
>>>>>>>         }
>>>>>>>     -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>> +    igt_fixture
>>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>     }
>>>>>>>       static void run_tests_on_pipe(data_t *data)
>>>>>>>     {
>>>>>>>         enum pipe pipe;
>>>>>>>         int cursor_size;
>>>>>>> -    int i;
>>>>>>> -    struct {
>>>>>>> -        const char *name;
>>>>>>> -        void (*testfunc)(data_t *);
>>>>>>> -        const char *desc;
>>>>>>> -    } size_tests[] = {
>>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>>> -        { "cursor-random", test_crc_random,
>>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>>> -    };
>>>>>>>           igt_fixture {
>>>>>>>             data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>>         igt_fixture
>>>>>>>             igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>     -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>>> -        igt_subtest_group {
>>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>>> -                int w = cursor_size;
>>>>>>> -                int h = cursor_size;
>>>>>>> -
>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>> -
>>>>>>> -                /*
>>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>>> -                 * that support such things. And make it a bit more
>>>>>>> -                 * interesting by using a non-pot height.
>>>>>>> -                 */
>>>>>>> -                h /= 3;
>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>> -            }
>>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>>> +    {
>>>>>>> +        int w = cursor_size;
>>>>>>> +        int h = cursor_size;
>>>>>>>     -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>>> -        }
>>>>>>> +        igt_subtest_group
>>>>>>> +            run_size_tests(data, w, h);
>>>>>>> +
>>>>>>> +        /*
>>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>>> +         * that support such things. And make it a bit more
>>>>>>> +         * interesting by using a non-pot height.
>>>>>>> +         */
>>>>>>> +        h /= 3;
>>>>>>> +
>>>>>>> +        igt_subtest_group
>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>         }
>>>>>>> +
>>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>>     }
>>>>>>>       static data_t data;
>>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>>             kmstest_set_vt_graphics_mode();
>>>>>>>               igt_require_pipe_crc(data.drm_fd);
>>>>>>> -
>>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>>         }
>>>>>>>           data.cursor_max_w = cursor_width;
>>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>>             }
>>>>>>>               igt_display_fini(&data.display);
>>>>>>> -        close(data.drm_fd);
>>>>>>>         }
>>>>>>>     }
>>>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-03 16:07             ` aemad
@ 2022-11-03 19:36               ` aemad
  2022-11-04  2:07                 ` Modem, Bhanuprakash
  0 siblings, 1 reply; 25+ messages in thread
From: aemad @ 2022-11-03 19:36 UTC (permalink / raw)
  To: Modem, Bhanuprakash; +Cc: igt-dev, petri.latvala

Hi Bhanuprakash,

On 2022-11-03 18:07, aemad wrote:
> On 2022-11-02 12:25, Modem, Bhanuprakash wrote:
>> On Wed-02-11-2022 12:19 am, aemad wrote:
>>> On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
>>>> Hi JP,
>>>>
>>>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>>>> On 1.11.2022 13.25, aemad wrote:
>>>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>>>> Hi Alaa,
>>>>>>>
>>>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>>>
>>>>>>
>>>>>> Hi Juha-Pekka,
>>>>>>
>>>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>>>> driver on this test. Let's first summon those who made these changes
>>>>>>> to comment. (cc'ing Modem and Swati)
>>>>>>
>>>>>> Could you please explain why this patch will remove MSM driver support?
>>>>>>
>>>>>
>>>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>>>
>>>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>>>
>>>> I am not sure, how this issue is related to dynamic subtests.
>>>>
>>>> Expecting that we need to skip the test if the device is vkms & cursor
>>>> height/width < 20 px. From IGT, is there any way to identify the
>>>> device is VKMS or not?
>>>>
>>>> Apart from this, I have floated patch with some minor cleanup [1].
>>>> @ Alaa, can you please help to check if it helps?
>>>
>>> yes, sure I can check it.
>>
>> Floated a fix: https://patchwork.freedesktop.org/series/110407/
>>
>> I have adopted the approach from your patch (also kept your Sob) &
>> fixed the usage of *-max-size tests.
>>
>> Please check if it works.
> 
> Sure, I will.
> 
> - Alaa
>>
Still, the max-size test doesn't include.

- Alaa

>> - Bhanu
>>
>>>
>>>>
>>>> [1]: https://patchwork.freedesktop.org/series/110381/
>>>>
>>>> - Bhanu
>>>>
>>>>>
>>>>> /Juha-Pekka
>>>>>
>>>>>>
>>>>>>>
>>>>>>> /Juha-Pekka
>>>>>>>
>>>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>>>
>>>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>>>> Stack trace:
>>>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>>>> Received signal SIGABRT.
>>>>>>>>
>>>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>>>
>>>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>>>
>>>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>>>> supported or not before running the test.
>>>>>>>>
>>>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>>>
>>>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>>>> ---
>>>>>>>>     tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>>>     1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>>>> index 8d3426dd..9b620389 100644
>>>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>>>         cairo_surface_t *surface;
>>>>>>>>         uint32_t devid;
>>>>>>>>         double alpha;
>>>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>>>     } data_t;
>>>>>>>>       #define TEST_DPMS (1<<0)
>>>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>>>     {
>>>>>>>>         igt_plane_set_fb(data->cursor, NULL);
>>>>>>>>         igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>> -    igt_display_commit(&data->display);
>>>>>>>> -
>>>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>>>> -                  data->vblank_wait_count);
>>>>>>>>     }
>>>>>>>>       static bool chv_cursor_broken(data_t *data, int x)
>>>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>             igt_display_commit(display);
>>>>>>>>               /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>>>> -                      data->vblank_wait_count);
>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>               igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>>>     @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>               restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>>>             igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>>>> +
>>>>>>>>             igt_display_commit(display);
>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>> +
>>>>>>>>             igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>>>             igt_assert_crc_equal(&crc, hwcrc);
>>>>>>>>         }
>>>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>>>         igt_plane_set_position(data->cursor, x, y);
>>>>>>>>         ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>>>     +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>         cursor_disable(data);
>>>>>>>> +    igt_display_commit(display);
>>>>>>>>           igt_assert_eq(ret, expect);
>>>>>>>>     }
>>>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>>>         igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>>>     }
>>>>>>>>     -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>> -               int w, int h)
>>>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>>>     {
>>>>>>>>         enum pipe pipe;
>>>>>>>> +    int i;
>>>>>>>> +
>>>>>>>> +    struct
>>>>>>>> +    {
>>>>>>>> +        const char *name;
>>>>>>>> +        void (*testfunc)(data_t *);
>>>>>>>> +        const char *desc;
>>>>>>>> +    } size_tests[] = {
>>>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>>>> +        {"cursor-random", test_crc_random,
>>>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>>>> +    };
>>>>>>>>           if (w == 0 && h == 0) {
>>>>>>>>             w = data->cursor_max_w;
>>>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>             }
>>>>>>>>         }
>>>>>>>>     -    create_cursor_fb(data, w, h);
>>>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>> -
>>>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>> -        return;
>>>>>>>> -    }
>>>>>>>> +    igt_fixture
>>>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>>>     -    for_each_pipe(&data->display, pipe) {
>>>>>>>> -        data->pipe = pipe;
>>>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>> -            run_test(data, testfunc, w, h);
>>>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>>>> +    {
>>>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>> +        {
>>>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>>>> +            {
>>>>>>>> +                data->pipe = pipe;
>>>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>>>> +                {
>>>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>> +                    continue;
>>>>>>>> +                }
>>>>>>>> +
>>>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>>>> +            }
>>>>>>>> +        }
>>>>>>>>         }
>>>>>>>>     -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>> +    igt_fixture
>>>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>     }
>>>>>>>>       static void run_tests_on_pipe(data_t *data)
>>>>>>>>     {
>>>>>>>>         enum pipe pipe;
>>>>>>>>         int cursor_size;
>>>>>>>> -    int i;
>>>>>>>> -    struct {
>>>>>>>> -        const char *name;
>>>>>>>> -        void (*testfunc)(data_t *);
>>>>>>>> -        const char *desc;
>>>>>>>> -    } size_tests[] = {
>>>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>>>> -        { "cursor-random", test_crc_random,
>>>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>>>> -    };
>>>>>>>>           igt_fixture {
>>>>>>>>             data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>>>         igt_fixture
>>>>>>>>             igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>     -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>>>> -        igt_subtest_group {
>>>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>>>> -                int w = cursor_size;
>>>>>>>> -                int h = cursor_size;
>>>>>>>> -
>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>> -
>>>>>>>> -                /*
>>>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>>>> -                 * that support such things. And make it a bit more
>>>>>>>> -                 * interesting by using a non-pot height.
>>>>>>>> -                 */
>>>>>>>> -                h /= 3;
>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>> -            }
>>>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>>>> +    {
>>>>>>>> +        int w = cursor_size;
>>>>>>>> +        int h = cursor_size;
>>>>>>>>     -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>>>> -        }
>>>>>>>> +        igt_subtest_group
>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>> +
>>>>>>>> +        /*
>>>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>>>> +         * that support such things. And make it a bit more
>>>>>>>> +         * interesting by using a non-pot height.
>>>>>>>> +         */
>>>>>>>> +        h /= 3;
>>>>>>>> +
>>>>>>>> +        igt_subtest_group
>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>         }
>>>>>>>> +
>>>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>>>     }
>>>>>>>>       static data_t data;
>>>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>>>             kmstest_set_vt_graphics_mode();
>>>>>>>>               igt_require_pipe_crc(data.drm_fd);
>>>>>>>> -
>>>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>>>         }
>>>>>>>>           data.cursor_max_w = cursor_width;
>>>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>>>             }
>>>>>>>>               igt_display_fini(&data.display);
>>>>>>>> -        close(data.drm_fd);
>>>>>>>>         }
>>>>>>>>     }
>>>>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-03 19:36               ` aemad
@ 2022-11-04  2:07                 ` Modem, Bhanuprakash
  2022-11-05 19:17                   ` aemad
  0 siblings, 1 reply; 25+ messages in thread
From: Modem, Bhanuprakash @ 2022-11-04  2:07 UTC (permalink / raw)
  To: aemad; +Cc: igt-dev, petri.latvala

On Fri-04-11-2022 01:06 am, aemad wrote:
> Hi Bhanuprakash,
> 
> On 2022-11-03 18:07, aemad wrote:
>> On 2022-11-02 12:25, Modem, Bhanuprakash wrote:
>>> On Wed-02-11-2022 12:19 am, aemad wrote:
>>>> On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
>>>>> Hi JP,
>>>>>
>>>>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>>>>> On 1.11.2022 13.25, aemad wrote:
>>>>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>>>>> Hi Alaa,
>>>>>>>>
>>>>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>>>>
>>>>>>>
>>>>>>> Hi Juha-Pekka,
>>>>>>>
>>>>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>>>>> driver on this test. Let's first summon those who made these changes
>>>>>>>> to comment. (cc'ing Modem and Swati)
>>>>>>>
>>>>>>> Could you please explain why this patch will remove MSM driver support?
>>>>>>>
>>>>>>
>>>>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>>>>
>>>>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>>>>
>>>>> I am not sure, how this issue is related to dynamic subtests.
>>>>>
>>>>> Expecting that we need to skip the test if the device is vkms & cursor
>>>>> height/width < 20 px. From IGT, is there any way to identify the
>>>>> device is VKMS or not?
>>>>>
>>>>> Apart from this, I have floated patch with some minor cleanup [1].
>>>>> @ Alaa, can you please help to check if it helps?
>>>>
>>>> yes, sure I can check it.
>>>
>>> Floated a fix: https://patchwork.freedesktop.org/series/110407/
>>>
>>> I have adopted the approach from your patch (also kept your Sob) &
>>> fixed the usage of *-max-size tests.
>>>
>>> Please check if it works.
>>
>> Sure, I will.
>>
>> - Alaa
>>>
> Still, the max-size test doesn't include.

Sorry, somehow I have floated a old rev :-(

Here is the updated fix: https://patchwork.freedesktop.org/series/110407/

- Bhanu

> 
> - Alaa
> 
>>> - Bhanu
>>>
>>>>
>>>>>
>>>>> [1]: https://patchwork.freedesktop.org/series/110381/
>>>>>
>>>>> - Bhanu
>>>>>
>>>>>>
>>>>>> /Juha-Pekka
>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> /Juha-Pekka
>>>>>>>>
>>>>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>>>>
>>>>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>>>>> Stack trace:
>>>>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>>>>> Received signal SIGABRT.
>>>>>>>>>
>>>>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>>>>
>>>>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>>>>
>>>>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>>>>> supported or not before running the test.
>>>>>>>>>
>>>>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>>>>
>>>>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>>>>> ---
>>>>>>>>>      tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>>>>      1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>>>>> index 8d3426dd..9b620389 100644
>>>>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>>>>          cairo_surface_t *surface;
>>>>>>>>>          uint32_t devid;
>>>>>>>>>          double alpha;
>>>>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>>>>      } data_t;
>>>>>>>>>        #define TEST_DPMS (1<<0)
>>>>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>>>>      {
>>>>>>>>>          igt_plane_set_fb(data->cursor, NULL);
>>>>>>>>>          igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>> -    igt_display_commit(&data->display);
>>>>>>>>> -
>>>>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>>>>> -                  data->vblank_wait_count);
>>>>>>>>>      }
>>>>>>>>>        static bool chv_cursor_broken(data_t *data, int x)
>>>>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>>              igt_display_commit(display);
>>>>>>>>>                /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>>>>> -                      data->vblank_wait_count);
>>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>>                igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>>>>      @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>>                restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>>>>              igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>>>>> +
>>>>>>>>>              igt_display_commit(display);
>>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>> +
>>>>>>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>>>>              igt_assert_crc_equal(&crc, hwcrc);
>>>>>>>>>          }
>>>>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>>>>          igt_plane_set_position(data->cursor, x, y);
>>>>>>>>>          ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>>>>      +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>>          cursor_disable(data);
>>>>>>>>> +    igt_display_commit(display);
>>>>>>>>>            igt_assert_eq(ret, expect);
>>>>>>>>>      }
>>>>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>>>>          igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>>>>      }
>>>>>>>>>      -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>> -               int w, int h)
>>>>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>>>>      {
>>>>>>>>>          enum pipe pipe;
>>>>>>>>> +    int i;
>>>>>>>>> +
>>>>>>>>> +    struct
>>>>>>>>> +    {
>>>>>>>>> +        const char *name;
>>>>>>>>> +        void (*testfunc)(data_t *);
>>>>>>>>> +        const char *desc;
>>>>>>>>> +    } size_tests[] = {
>>>>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>>>>> +        {"cursor-random", test_crc_random,
>>>>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>>>>> +    };
>>>>>>>>>            if (w == 0 && h == 0) {
>>>>>>>>>              w = data->cursor_max_w;
>>>>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>>              }
>>>>>>>>>          }
>>>>>>>>>      -    create_cursor_fb(data, w, h);
>>>>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>>> -
>>>>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>> -        return;
>>>>>>>>> -    }
>>>>>>>>> +    igt_fixture
>>>>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>>>>      -    for_each_pipe(&data->display, pipe) {
>>>>>>>>> -        data->pipe = pipe;
>>>>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>>> -            run_test(data, testfunc, w, h);
>>>>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>>>>> +    {
>>>>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>> +        {
>>>>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>>>>> +            {
>>>>>>>>> +                data->pipe = pipe;
>>>>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>>>>> +                {
>>>>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>>> +                    continue;
>>>>>>>>> +                }
>>>>>>>>> +
>>>>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>>>>> +            }
>>>>>>>>> +        }
>>>>>>>>>          }
>>>>>>>>>      -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>> +    igt_fixture
>>>>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>      }
>>>>>>>>>        static void run_tests_on_pipe(data_t *data)
>>>>>>>>>      {
>>>>>>>>>          enum pipe pipe;
>>>>>>>>>          int cursor_size;
>>>>>>>>> -    int i;
>>>>>>>>> -    struct {
>>>>>>>>> -        const char *name;
>>>>>>>>> -        void (*testfunc)(data_t *);
>>>>>>>>> -        const char *desc;
>>>>>>>>> -    } size_tests[] = {
>>>>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>>>>> -        { "cursor-random", test_crc_random,
>>>>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>>>>> -    };
>>>>>>>>>            igt_fixture {
>>>>>>>>>              data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>>>>          igt_fixture
>>>>>>>>>              igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>      -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>>>>> -        igt_subtest_group {
>>>>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>>>>> -                int w = cursor_size;
>>>>>>>>> -                int h = cursor_size;
>>>>>>>>> -
>>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>>> -
>>>>>>>>> -                /*
>>>>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>>>>> -                 * that support such things. And make it a bit more
>>>>>>>>> -                 * interesting by using a non-pot height.
>>>>>>>>> -                 */
>>>>>>>>> -                h /= 3;
>>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>>> -            }
>>>>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>>>>> +    {
>>>>>>>>> +        int w = cursor_size;
>>>>>>>>> +        int h = cursor_size;
>>>>>>>>>      -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>>>>> -        }
>>>>>>>>> +        igt_subtest_group
>>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>> +
>>>>>>>>> +        /*
>>>>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>>>>> +         * that support such things. And make it a bit more
>>>>>>>>> +         * interesting by using a non-pot height.
>>>>>>>>> +         */
>>>>>>>>> +        h /= 3;
>>>>>>>>> +
>>>>>>>>> +        igt_subtest_group
>>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>>          }
>>>>>>>>> +
>>>>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>>>>      }
>>>>>>>>>        static data_t data;
>>>>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>>>>              kmstest_set_vt_graphics_mode();
>>>>>>>>>                igt_require_pipe_crc(data.drm_fd);
>>>>>>>>> -
>>>>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>>>>          }
>>>>>>>>>            data.cursor_max_w = cursor_width;
>>>>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>>>>              }
>>>>>>>>>                igt_display_fini(&data.display);
>>>>>>>>> -        close(data.drm_fd);
>>>>>>>>>          }
>>>>>>>>>      }
>>>>>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-04  2:07                 ` Modem, Bhanuprakash
@ 2022-11-05 19:17                   ` aemad
  2022-11-05 20:05                     ` aemad
  0 siblings, 1 reply; 25+ messages in thread
From: aemad @ 2022-11-05 19:17 UTC (permalink / raw)
  To: Modem, Bhanuprakash; +Cc: igt-dev, petri.latvala

On 2022-11-04 03:07, Modem, Bhanuprakash wrote:
> On Fri-04-11-2022 01:06 am, aemad wrote:
>> Hi Bhanuprakash,
>>
>> On 2022-11-03 18:07, aemad wrote:
>>> On 2022-11-02 12:25, Modem, Bhanuprakash wrote:
>>>> On Wed-02-11-2022 12:19 am, aemad wrote:
>>>>> On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
>>>>>> Hi JP,
>>>>>>
>>>>>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>>>>>> On 1.11.2022 13.25, aemad wrote:
>>>>>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>>>>>> Hi Alaa,
>>>>>>>>>
>>>>>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>>>>>
>>>>>>>>
>>>>>>>> Hi Juha-Pekka,
>>>>>>>>
>>>>>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>>>>>> driver on this test. Let's first summon those who made these changes
>>>>>>>>> to comment. (cc'ing Modem and Swati)
>>>>>>>>
>>>>>>>> Could you please explain why this patch will remove MSM driver support?
>>>>>>>>
>>>>>>>
>>>>>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>>>>>
>>>>>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>>>>>
>>>>>> I am not sure, how this issue is related to dynamic subtests.
>>>>>>
>>>>>> Expecting that we need to skip the test if the device is vkms & cursor
>>>>>> height/width < 20 px. From IGT, is there any way to identify the
>>>>>> device is VKMS or not?
>>>>>>
>>>>>> Apart from this, I have floated patch with some minor cleanup [1].
>>>>>> @ Alaa, can you please help to check if it helps?
>>>>>
>>>>> yes, sure I can check it.
>>>>
>>>> Floated a fix: https://patchwork.freedesktop.org/series/110407/
>>>>
>>>> I have adopted the approach from your patch (also kept your Sob) &
>>>> fixed the usage of *-max-size tests.
>>>>
>>>> Please check if it works.
>>>
>>> Sure, I will.
>>>
>>> - Alaa
>>>>
>> Still, the max-size test doesn't include.
> 
> Sorry, somehow I have floated a old rev :-(

Never mind, I will recheck

- Alaa
> 
> Here is the updated fix: https://patchwork.freedesktop.org/series/110407/
> 
> - Bhanu
> 
>>
>> - Alaa
>>
>>>> - Bhanu
>>>>
>>>>>
>>>>>>
>>>>>> [1]: https://patchwork.freedesktop.org/series/110381/
>>>>>>
>>>>>> - Bhanu
>>>>>>
>>>>>>>
>>>>>>> /Juha-Pekka
>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> /Juha-Pekka
>>>>>>>>>
>>>>>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>>>>>
>>>>>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>>>>>> Stack trace:
>>>>>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>>>>>> Received signal SIGABRT.
>>>>>>>>>>
>>>>>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>>>>>
>>>>>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>>>>>
>>>>>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>>>>>> supported or not before running the test.
>>>>>>>>>>
>>>>>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>>>>>> ---
>>>>>>>>>>      tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>>>>>      1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>>>>>
>>>>>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>>>>>> index 8d3426dd..9b620389 100644
>>>>>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>>>>>          cairo_surface_t *surface;
>>>>>>>>>>          uint32_t devid;
>>>>>>>>>>          double alpha;
>>>>>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>>>>>      } data_t;
>>>>>>>>>>        #define TEST_DPMS (1<<0)
>>>>>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>>>>>      {
>>>>>>>>>>          igt_plane_set_fb(data->cursor, NULL);
>>>>>>>>>>          igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>>> -    igt_display_commit(&data->display);
>>>>>>>>>> -
>>>>>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>>>>>> -                  data->vblank_wait_count);
>>>>>>>>>>      }
>>>>>>>>>>        static bool chv_cursor_broken(data_t *data, int x)
>>>>>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>>>              igt_display_commit(display);
>>>>>>>>>>                /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>>>>>> -                      data->vblank_wait_count);
>>>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>>>                igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>>>>>      @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>>>                restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>>>>>              igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>>>>>> +
>>>>>>>>>>              igt_display_commit(display);
>>>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>>> +
>>>>>>>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>>>>>              igt_assert_crc_equal(&crc, hwcrc);
>>>>>>>>>>          }
>>>>>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>>>>>          igt_plane_set_position(data->cursor, x, y);
>>>>>>>>>>          ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>>>>>      +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>>>          cursor_disable(data);
>>>>>>>>>> +    igt_display_commit(display);
>>>>>>>>>>            igt_assert_eq(ret, expect);
>>>>>>>>>>      }
>>>>>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>>>>>          igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>>>>>      }
>>>>>>>>>>      -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>>> -               int w, int h)
>>>>>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>>>>>      {
>>>>>>>>>>          enum pipe pipe;
>>>>>>>>>> +    int i;
>>>>>>>>>> +
>>>>>>>>>> +    struct
>>>>>>>>>> +    {
>>>>>>>>>> +        const char *name;
>>>>>>>>>> +        void (*testfunc)(data_t *);
>>>>>>>>>> +        const char *desc;
>>>>>>>>>> +    } size_tests[] = {
>>>>>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>>>>>> +        {"cursor-random", test_crc_random,
>>>>>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>>>>>> +    };
>>>>>>>>>>            if (w == 0 && h == 0) {
>>>>>>>>>>              w = data->cursor_max_w;
>>>>>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>>>              }
>>>>>>>>>>          }
>>>>>>>>>>      -    create_cursor_fb(data, w, h);
>>>>>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>>>> -
>>>>>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>> -        return;
>>>>>>>>>> -    }
>>>>>>>>>> +    igt_fixture
>>>>>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>>>>>      -    for_each_pipe(&data->display, pipe) {
>>>>>>>>>> -        data->pipe = pipe;
>>>>>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>>>> -            run_test(data, testfunc, w, h);
>>>>>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>>>>>> +    {
>>>>>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>>> +        {
>>>>>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>>>>>> +            {
>>>>>>>>>> +                data->pipe = pipe;
>>>>>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>>>>>> +                {
>>>>>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>>>> +                    continue;
>>>>>>>>>> +                }
>>>>>>>>>> +
>>>>>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>>>>>> +            }
>>>>>>>>>> +        }
>>>>>>>>>>          }
>>>>>>>>>>      -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>> +    igt_fixture
>>>>>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>>      }
>>>>>>>>>>        static void run_tests_on_pipe(data_t *data)
>>>>>>>>>>      {
>>>>>>>>>>          enum pipe pipe;
>>>>>>>>>>          int cursor_size;
>>>>>>>>>> -    int i;
>>>>>>>>>> -    struct {
>>>>>>>>>> -        const char *name;
>>>>>>>>>> -        void (*testfunc)(data_t *);
>>>>>>>>>> -        const char *desc;
>>>>>>>>>> -    } size_tests[] = {
>>>>>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>>>>>> -        { "cursor-random", test_crc_random,
>>>>>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>>>>>> -    };
>>>>>>>>>>            igt_fixture {
>>>>>>>>>>              data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>>>>>          igt_fixture
>>>>>>>>>>              igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>>      -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>>>>>> -        igt_subtest_group {
>>>>>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>>>>>> -                int w = cursor_size;
>>>>>>>>>> -                int h = cursor_size;
>>>>>>>>>> -
>>>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>>>> -
>>>>>>>>>> -                /*
>>>>>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>>>>>> -                 * that support such things. And make it a bit more
>>>>>>>>>> -                 * interesting by using a non-pot height.
>>>>>>>>>> -                 */
>>>>>>>>>> -                h /= 3;
>>>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>>>> -            }
>>>>>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>>>>>> +    {
>>>>>>>>>> +        int w = cursor_size;
>>>>>>>>>> +        int h = cursor_size;
>>>>>>>>>>      -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>>>>>> -        }
>>>>>>>>>> +        igt_subtest_group
>>>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>>> +
>>>>>>>>>> +        /*
>>>>>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>>>>>> +         * that support such things. And make it a bit more
>>>>>>>>>> +         * interesting by using a non-pot height.
>>>>>>>>>> +         */
>>>>>>>>>> +        h /= 3;
>>>>>>>>>> +
>>>>>>>>>> +        igt_subtest_group
>>>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>>>          }
>>>>>>>>>> +
>>>>>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>>>>>      }
>>>>>>>>>>        static data_t data;
>>>>>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>>>>>              kmstest_set_vt_graphics_mode();
>>>>>>>>>>                igt_require_pipe_crc(data.drm_fd);
>>>>>>>>>> -
>>>>>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>>>>>          }
>>>>>>>>>>            data.cursor_max_w = cursor_width;
>>>>>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>>>>>              }
>>>>>>>>>>                igt_display_fini(&data.display);
>>>>>>>>>> -        close(data.drm_fd);
>>>>>>>>>>          }
>>>>>>>>>>      }
>>>>>>>

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

* Re: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails
  2022-11-05 19:17                   ` aemad
@ 2022-11-05 20:05                     ` aemad
  0 siblings, 0 replies; 25+ messages in thread
From: aemad @ 2022-11-05 20:05 UTC (permalink / raw)
  To: Modem, Bhanuprakash; +Cc: igt-dev, petri.latvala

On 2022-11-05 21:17, aemad wrote:
> On 2022-11-04 03:07, Modem, Bhanuprakash wrote:
>> On Fri-04-11-2022 01:06 am, aemad wrote:
>>> Hi Bhanuprakash,
>>>
>>> On 2022-11-03 18:07, aemad wrote:
>>>> On 2022-11-02 12:25, Modem, Bhanuprakash wrote:
>>>>> On Wed-02-11-2022 12:19 am, aemad wrote:
>>>>>> On 2022-11-01 17:50, Modem, Bhanuprakash wrote:
>>>>>>> Hi JP,
>>>>>>>
>>>>>>> On Tue-01-11-2022 08:41 pm, Juha-Pekka Heikkila wrote:
>>>>>>>> On 1.11.2022 13.25, aemad wrote:
>>>>>>>>> On 2022-10-10 13:16, Juha-Pekka Heikkila wrote:
>>>>>>>>>> Hi Alaa,
>>>>>>>>>>
>>>>>>>>>> what's that invalid argument you're getting on addfb? I never tried
>>>>>>>>>> this with vkms, normally just on i915. With i915 I cannot reproduce
>>>>>>>>>> that abort you're seeing. Other kms tests run on your setup?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi Juha-Pekka,
>>>>>>>>>
>>>>>>>>>> Anyway, that revert you're suggesting would remove support for msm
>>>>>>>>>> driver on this test. Let's first summon those who made these changes
>>>>>>>>>> to comment. (cc'ing Modem and Swati)
>>>>>>>>>
>>>>>>>>> Could you please explain why this patch will remove MSM driver support?
>>>>>>>>>
>>>>>>>>
>>>>>>>> See in test what's done with data.vblank_wait_count variable. That is there because on msm legacy cursor is not updated asynchronously and msm cursor likely will miss even second frame. Taking that out will cause these tests reliably fail on msm.
>>>>>>>>
>>>>>>>> I was just today because of unrelated cursor issues looking into this, I still don't have patch though. As Swati/Modem didn't come back with a fix I was looking to take out all dynamic stuff, it should solve this issue.
>>>>>>>
>>>>>>> I am not sure, how this issue is related to dynamic subtests.
>>>>>>>
>>>>>>> Expecting that we need to skip the test if the device is vkms & cursor
>>>>>>> height/width < 20 px. From IGT, is there any way to identify the
>>>>>>> device is VKMS or not?
>>>>>>>
>>>>>>> Apart from this, I have floated patch with some minor cleanup [1].
>>>>>>> @ Alaa, can you please help to check if it helps?
>>>>>>
>>>>>> yes, sure I can check it.
>>>>>
>>>>> Floated a fix: https://patchwork.freedesktop.org/series/110407/
>>>>>
>>>>> I have adopted the approach from your patch (also kept your Sob) &
>>>>> fixed the usage of *-max-size tests.
>>>>>
>>>>> Please check if it works.
>>>>
>>>> Sure, I will.
>>>>
>>>> - Alaa
>>>>>
>>> Still, the max-size test doesn't include.
>>
>> Sorry, somehow I have floated a old rev :-(
> 
> Never mind, I will recheck
> 
> - Alaa
>>
>> Here is the updated fix: https://patchwork.freedesktop.org/series/110407/

I checked it, and it works as expected.

- Alaa
>>
>> - Bhanu
>>
>>>
>>> - Alaa
>>>
>>>>> - Bhanu
>>>>>
>>>>>>
>>>>>>>
>>>>>>> [1]: https://patchwork.freedesktop.org/series/110381/
>>>>>>>
>>>>>>> - Bhanu
>>>>>>>
>>>>>>>>
>>>>>>>> /Juha-Pekka
>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> /Juha-Pekka
>>>>>>>>>>
>>>>>>>>>> On 9.10.2022 18.18, Alaa Emad wrote:
>>>>>>>>>>> Any test failure prevents the other tests to be run, aborting the entire test loop. This behavior was introduced by commit
>>>>>>>>>>> 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic").
>>>>>>>>>>> For instance, when running the cursor-offscreen-32x10 subtest using VKMS,
>>>>>>>>>>> the execution is aborted instead of SKIP/FAIL, as in the following output:
>>>>>>>>>>>
>>>>>>>>>>> $ ./tests/kms_cursor_crc --run-subtest cursor-offscreen-32x10
>>>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Test assertion failure function igt_create_fb_with_bo_size, file ../lib/igt_fb.c:2078:
>>>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Failed assertion: (__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->modifier, fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)) == 0
>>>>>>>>>>> (kms_cursor_crc:7447) igt_fb-CRITICAL: Last errno: 22, Invalid argument
>>>>>>>>>>> Stack trace:
>>>>>>>>>>> kms_cursor_crc: ../lib/igt_core.c:1667: igt_fail: Assertion `_igt_dynamic_tests_executed < 0 || dynamic_failed_one' failed.
>>>>>>>>>>> Received signal SIGABRT.
>>>>>>>>>>>
>>>>>>>>>>> The test was aborted after convertig tests to dynamic with cursor size 32*10 that because of the assertion in the `igt_create_fb_with_bo_size` when creating cursor in `create_cursor_fb`.
>>>>>>>>>>>
>>>>>>>>>>> This happened because Within a igt_subtest_with_dynamic block, explicit failure (e.g. igt_assert) is not allowed,
>>>>>>>>>>> only dynamic subsubtests themselves will produce test results.
>>>>>>>>>>>
>>>>>>>>>>> The previous approach was running each test for all cursor sizes then move to the next test  so fix this issue
>>>>>>>>>>> by running all tests for one cursor size one by one, and check if cursor size is
>>>>>>>>>>> supported or not before running the test.
>>>>>>>>>>>
>>>>>>>>>>> Fixes: 9494d53d ("tests/kms_cursor_crc: Convert tests to dynamic")
>>>>>>>>>>>
>>>>>>>>>>> Signed-off-by: Alaa Emad <aemad@igalia.com>
>>>>>>>>>>> ---
>>>>>>>>>>>      tests/kms_cursor_crc.c | 136 +++++++++++++++++++++--------------------
>>>>>>>>>>>      1 file changed, 69 insertions(+), 67 deletions(-)
>>>>>>>>>>>
>>>>>>>>>>> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
>>>>>>>>>>> index 8d3426dd..9b620389 100644
>>>>>>>>>>> --- a/tests/kms_cursor_crc.c
>>>>>>>>>>> +++ b/tests/kms_cursor_crc.c
>>>>>>>>>>> @@ -72,7 +72,6 @@ typedef struct {
>>>>>>>>>>>          cairo_surface_t *surface;
>>>>>>>>>>>          uint32_t devid;
>>>>>>>>>>>          double alpha;
>>>>>>>>>>> -    int vblank_wait_count; /* because of msm */
>>>>>>>>>>>      } data_t;
>>>>>>>>>>>        #define TEST_DPMS (1<<0)
>>>>>>>>>>> @@ -125,12 +124,6 @@ static void cursor_disable(data_t *data)
>>>>>>>>>>>      {
>>>>>>>>>>>          igt_plane_set_fb(data->cursor, NULL);
>>>>>>>>>>>          igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>>>> -    igt_display_commit(&data->display);
>>>>>>>>>>> -
>>>>>>>>>>> -    /* do this wait here so it will not need to be added everywhere */
>>>>>>>>>>> -    igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>>>>> -                  data->display.pipes[data->pipe].crtc_offset,
>>>>>>>>>>> -                  data->vblank_wait_count);
>>>>>>>>>>>      }
>>>>>>>>>>>        static bool chv_cursor_broken(data_t *data, int x)
>>>>>>>>>>> @@ -209,9 +202,8 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>>>>              igt_display_commit(display);
>>>>>>>>>>>                /* Extra vblank wait is because nonblocking cursor ioctl */
>>>>>>>>>>> -        igt_wait_for_vblank_count(data->drm_fd,
>>>>>>>>>>> -                      display->pipes[data->pipe].crtc_offset,
>>>>>>>>>>> -                      data->vblank_wait_count);
>>>>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>>>>                igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
>>>>>>>>>>>      @@ -249,7 +241,11 @@ static void do_single_test(data_t *data, int x, int y, bool hw_test,
>>>>>>>>>>>                restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
>>>>>>>>>>>              igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
>>>>>>>>>>> +
>>>>>>>>>>>              igt_display_commit(display);
>>>>>>>>>>> +        igt_wait_for_vblank(data->drm_fd,
>>>>>>>>>>> +                display->pipes[data->pipe].crtc_offset);
>>>>>>>>>>> +
>>>>>>>>>>>              igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
>>>>>>>>>>>              igt_assert_crc_equal(&crc, hwcrc);
>>>>>>>>>>>          }
>>>>>>>>>>> @@ -267,7 +263,9 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
>>>>>>>>>>>          igt_plane_set_position(data->cursor, x, y);
>>>>>>>>>>>          ret = igt_display_try_commit2(display, COMMIT_LEGACY);
>>>>>>>>>>>      +    igt_plane_set_position(data->cursor, 0, 0);
>>>>>>>>>>>          cursor_disable(data);
>>>>>>>>>>> +    igt_display_commit(display);
>>>>>>>>>>>            igt_assert_eq(ret, expect);
>>>>>>>>>>>      }
>>>>>>>>>>> @@ -689,10 +687,28 @@ static void test_rapid_movement(data_t *data)
>>>>>>>>>>>          igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
>>>>>>>>>>>      }
>>>>>>>>>>>      -static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>>>> -               int w, int h)
>>>>>>>>>>> +static void run_size_tests(data_t *data, int w, int h)
>>>>>>>>>>>      {
>>>>>>>>>>>          enum pipe pipe;
>>>>>>>>>>> +    int i;
>>>>>>>>>>> +
>>>>>>>>>>> +    struct
>>>>>>>>>>> +    {
>>>>>>>>>>> +        const char *name;
>>>>>>>>>>> +        void (*testfunc)(data_t *);
>>>>>>>>>>> +        const char *desc;
>>>>>>>>>>> +    } size_tests[] = {
>>>>>>>>>>> +        {"cursor-onscreen", test_crc_onscreen,
>>>>>>>>>>> +         "Check if a given-size cursor is well-positioned inside the screen."},
>>>>>>>>>>> +        {"cursor-offscreen", test_crc_offscreen,
>>>>>>>>>>> +         "Check if a given-size cursor is well-positioned outside the screen."},
>>>>>>>>>>> +        {"cursor-sliding", test_crc_sliding,
>>>>>>>>>>> +         "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal."},
>>>>>>>>>>> +        {"cursor-random", test_crc_random,
>>>>>>>>>>> +         "Check random placement of a cursor with given size."},
>>>>>>>>>>> +        {"cursor-rapid-movement", test_rapid_movement,
>>>>>>>>>>> +         "Check the rapid update of given-size cursor movements."},
>>>>>>>>>>> +    };
>>>>>>>>>>>            if (w == 0 && h == 0) {
>>>>>>>>>>>              w = data->cursor_max_w;
>>>>>>>>>>> @@ -709,45 +725,38 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>>>>>>>>>>>              }
>>>>>>>>>>>          }
>>>>>>>>>>>      -    create_cursor_fb(data, w, h);
>>>>>>>>>>> -    if (require_cursor_size(data, w, h)) {
>>>>>>>>>>> -        igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>>>>> -
>>>>>>>>>>> -        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>>> -        return;
>>>>>>>>>>> -    }
>>>>>>>>>>> +    igt_fixture
>>>>>>>>>>> +        create_cursor_fb(data, w, h);
>>>>>>>>>>>      -    for_each_pipe(&data->display, pipe) {
>>>>>>>>>>> -        data->pipe = pipe;
>>>>>>>>>>> -        igt_dynamic_f("pipe-%s-%s",
>>>>>>>>>>> -                  kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>>>>> -            run_test(data, testfunc, w, h);
>>>>>>>>>>> +    for (i = 0; i < ARRAY_SIZE(size_tests); i++)
>>>>>>>>>>> +    {
>>>>>>>>>>> +        igt_describe(size_tests[i].desc);
>>>>>>>>>>> +        igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>>>> +        {
>>>>>>>>>>> +            for_each_pipe(&data->display, pipe)
>>>>>>>>>>> +            {
>>>>>>>>>>> +                data->pipe = pipe;
>>>>>>>>>>> +                if (require_cursor_size(data, w, h))
>>>>>>>>>>> +                {
>>>>>>>>>>> +                    igt_info("Cursor size %dx%d not supported by driver\n", w, h);
>>>>>>>>>>> +                    continue;
>>>>>>>>>>> +                }
>>>>>>>>>>> +
>>>>>>>>>>> +                igt_dynamic_f("pipe-%s-%s",
>>>>>>>>>>> +                              kmstest_pipe_name(pipe), igt_output_name(data->output))
>>>>>>>>>>> +                    run_test(data, size_tests[i].testfunc, w, h);
>>>>>>>>>>> +            }
>>>>>>>>>>> +        }
>>>>>>>>>>>          }
>>>>>>>>>>>      -    igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>>> +    igt_fixture
>>>>>>>>>>> +        igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>>>      }
>>>>>>>>>>>        static void run_tests_on_pipe(data_t *data)
>>>>>>>>>>>      {
>>>>>>>>>>>          enum pipe pipe;
>>>>>>>>>>>          int cursor_size;
>>>>>>>>>>> -    int i;
>>>>>>>>>>> -    struct {
>>>>>>>>>>> -        const char *name;
>>>>>>>>>>> -        void (*testfunc)(data_t *);
>>>>>>>>>>> -        const char *desc;
>>>>>>>>>>> -    } size_tests[] = {
>>>>>>>>>>> -        { "cursor-onscreen", test_crc_onscreen,
>>>>>>>>>>> -            "Check if a given-size cursor is well-positioned inside the screen." },
>>>>>>>>>>> -        { "cursor-offscreen", test_crc_offscreen,
>>>>>>>>>>> -            "Check if a given-size cursor is well-positioned outside the screen." },
>>>>>>>>>>> -        { "cursor-sliding", test_crc_sliding,
>>>>>>>>>>> -            "Check the smooth and pixel-by-pixel given-size cursor movements on horizontal, vertical and diagonal." },
>>>>>>>>>>> -        { "cursor-random", test_crc_random,
>>>>>>>>>>> -            "Check random placement of a cursor with given size." },
>>>>>>>>>>> -        { "cursor-rapid-movement", test_rapid_movement,
>>>>>>>>>>> -            "Check the rapid update of given-size cursor movements." },
>>>>>>>>>>> -    };
>>>>>>>>>>>            igt_fixture {
>>>>>>>>>>>              data->output = igt_get_single_output_for_pipe(&data->display, pipe);
>>>>>>>>>>> @@ -848,30 +857,26 @@ static void run_tests_on_pipe(data_t *data)
>>>>>>>>>>>          igt_fixture
>>>>>>>>>>>              igt_remove_fb(data->drm_fd, &data->fb);
>>>>>>>>>>>      -    for (i = 0; i < ARRAY_SIZE(size_tests); i++) {
>>>>>>>>>>> -        igt_describe(size_tests[i].desc);
>>>>>>>>>>> -        igt_subtest_group {
>>>>>>>>>>> -            for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2) {
>>>>>>>>>>> -                int w = cursor_size;
>>>>>>>>>>> -                int h = cursor_size;
>>>>>>>>>>> -
>>>>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>>>>> -
>>>>>>>>>>> -                /*
>>>>>>>>>>> -                 * Test non-square cursors a bit on the platforms
>>>>>>>>>>> -                 * that support such things. And make it a bit more
>>>>>>>>>>> -                 * interesting by using a non-pot height.
>>>>>>>>>>> -                 */
>>>>>>>>>>> -                h /= 3;
>>>>>>>>>>> -                igt_subtest_with_dynamic_f("%s-%dx%d", size_tests[i].name, w, h)
>>>>>>>>>>> -                    run_size_tests(data, size_tests[i].testfunc, w, h);
>>>>>>>>>>> -            }
>>>>>>>>>>> +    for (cursor_size = 32; cursor_size <= 512; cursor_size *= 2)
>>>>>>>>>>> +    {
>>>>>>>>>>> +        int w = cursor_size;
>>>>>>>>>>> +        int h = cursor_size;
>>>>>>>>>>>      -            igt_subtest_with_dynamic_f("%s-max-size", size_tests[i].name)
>>>>>>>>>>> -                run_size_tests(data, size_tests[i].testfunc, 0, 0);
>>>>>>>>>>> -        }
>>>>>>>>>>> +        igt_subtest_group
>>>>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>>>> +
>>>>>>>>>>> +        /*
>>>>>>>>>>> +         * Test non-square cursors a bit on the platforms
>>>>>>>>>>> +         * that support such things. And make it a bit more
>>>>>>>>>>> +         * interesting by using a non-pot height.
>>>>>>>>>>> +         */
>>>>>>>>>>> +        h /= 3;
>>>>>>>>>>> +
>>>>>>>>>>> +        igt_subtest_group
>>>>>>>>>>> +            run_size_tests(data, w, h);
>>>>>>>>>>>          }
>>>>>>>>>>> +
>>>>>>>>>>> +    run_size_tests(data, 0, 0);
>>>>>>>>>>>      }
>>>>>>>>>>>        static data_t data;
>>>>>>>>>>> @@ -896,8 +901,6 @@ igt_main
>>>>>>>>>>>              kmstest_set_vt_graphics_mode();
>>>>>>>>>>>                igt_require_pipe_crc(data.drm_fd);
>>>>>>>>>>> -
>>>>>>>>>>> -        data.vblank_wait_count = is_msm_device(data.drm_fd) ? 2 : 1;
>>>>>>>>>>>          }
>>>>>>>>>>>            data.cursor_max_w = cursor_width;
>>>>>>>>>>> @@ -913,6 +916,5 @@ igt_main
>>>>>>>>>>>              }
>>>>>>>>>>>                igt_display_fini(&data.display);
>>>>>>>>>>> -        close(data.drm_fd);
>>>>>>>>>>>          }
>>>>>>>>>>>      }
>>>>>>>>

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

end of thread, other threads:[~2022-11-05 20:05 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-09 15:18 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: prevent the entire test from being aborted when a subtest fails Alaa Emad
2022-10-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-10-09 16:57 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-10-10 11:16 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila
2022-10-10 14:26   ` aemad
2022-10-10 18:52     ` Juha-Pekka Heikkila
2022-10-11 17:08       ` aemad
2022-10-11 17:35         ` Juha-Pekka Heikkila
2022-10-11 17:53           ` aemad
2022-11-01 16:43           ` Modem, Bhanuprakash
2022-11-01 11:25   ` aemad
2022-11-01 15:11     ` Juha-Pekka Heikkila
2022-11-01 16:50       ` Modem, Bhanuprakash
2022-11-01 17:31         ` Juha-Pekka Heikkila
2022-11-01 18:52           ` aemad
2022-11-01 18:49         ` aemad
2022-11-02 11:25           ` Modem, Bhanuprakash
2022-11-03 16:07             ` aemad
2022-11-03 19:36               ` aemad
2022-11-04  2:07                 ` Modem, Bhanuprakash
2022-11-05 19:17                   ` aemad
2022-11-05 20:05                     ` aemad
2022-11-01 18:46       ` aemad
2022-10-11 12:56 ` Modem, Bhanuprakash
2022-10-11 17:25   ` aemad

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.