All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-14 20:35 Juha-Pekka Heikkila
  2021-02-14 20:35 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-14 20:35 UTC (permalink / raw)
  To: igt-dev

reduce repetitive work and wait less

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 143 ++++++++++++++++++++-------------------
 1 file changed, 75 insertions(+), 68 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..9b8f05477 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -527,20 +529,18 @@ typedef struct {
 } planeinfos;
 
 static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+			       planeinfos *planeinfo,
+			       struct igt_fb *fbleft, struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
+	struct igt_fb *planes[2] = {fbleft, fbright};
 
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
+	int c;
 
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	for (c = 0; c < MAXMULTIPLANESAMOUNT; c++) {
+		igt_plane_t *lplane;
+		lplane = igt_output_get_plane_type(output,
+						   planeinfo[c].planetype);
 
 		/*
 		 * make plane and fb width and height always divisible by 4
@@ -552,34 +552,25 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(lplane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw, planes[c], 1.0f);
+		}
+		igt_plane_set_fb(lplane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
+			igt_plane_set_size(lplane, h, w);
 
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
+		igt_plane_set_position(lplane, planeinfo[c].x1, planeinfo[c].y1);
+		igt_plane_set_rotation(lplane, planeinfo[c].rotation_hw);
 	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
-
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
 	return true;
 }
 
@@ -624,30 +615,9 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h;
 	drmModeModeInfo *mode;
 
-	static const struct {
-		igt_rotation_t rotation;
-		float_t width;
-		float_t height;
-		uint64_t tiling;
-	} planeconfigs[] = {
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	};
-
 	/*
 	* These are those modes which are tested. For testing feel interesting
 	* case with tiling are 2 bpp, 4 bpp and NV12.
@@ -655,8 +625,30 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
 		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
+	static struct {
+		const char* txt;
+		igt_rotation_t rotation;
+		float_t width;
+		float_t height;
+		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
+	} planeconfigs[] = {
+	{"rotation 0 modifier none", IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 0 modifier x-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 0 modifier y-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 0 modifier yf-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 90 modifier y-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 90 modifier yf-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 180 modifier none", IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 180 modifier x-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 180 modifier y-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 180 modifier yf-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 270 modifier y-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 270 modifier yf-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	};
+
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -704,20 +696,39 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     && intel_gen(data->devid) < 11)
 							continue;
 
+						igt_debug("plane1 %s %.4s plane2 %s %.4s\n",
+							  planeconfigs[i].txt,
+							  (char*) &p[0].format,
+							  planeconfigs[j].txt,
+							  (char*) &p[1].format);
+
 						p[0].rotation_sw = planeconfigs[i].rotation;
 						p[0].rotation_hw = IGT_ROTATION_0;
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
 							continue;
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, flipsw, &retcrc_sw);
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
 				}
@@ -725,19 +736,15 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
-
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
 
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][0]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][1]);
+			}
+		}
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist
  2021-02-14 20:35 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
@ 2021-02-14 20:35 ` Juha-Pekka Heikkila
  2021-02-14 21:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Patchwork
  2021-02-14 22:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-14 20:35 UTC (permalink / raw)
  To: igt-dev

---
 tests/intel-ci/blacklist-pre-merge.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/intel-ci/blacklist-pre-merge.txt b/tests/intel-ci/blacklist-pre-merge.txt
index cddb77c1f..b46c7d050 100644
--- a/tests/intel-ci/blacklist-pre-merge.txt
+++ b/tests/intel-ci/blacklist-pre-merge.txt
@@ -17,7 +17,7 @@
 #
 # Data acquired on 2020-02-19 by Martin Peres
 ###############################################################################
-igt@kms_rotation_crc@.*
+#igt@kms_rotation_crc@.*
 
 
 ###############################################################################
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
  2021-02-14 20:35 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
  2021-02-14 20:35 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
@ 2021-02-14 21:08 ` Patchwork
  2021-02-14 22:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2021-02-14 21:08 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 4113 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
URL   : https://patchwork.freedesktop.org/series/87079/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9774 -> IGTPW_5506
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@query-info:
    - fi-tgl-y:           NOTRUN -> [SKIP][1] ([fdo#109315] / [i915#2575])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-tgl-y/igt@amdgpu/amd_basic@query-info.html

  * igt@debugfs_test@read_all_entries:
    - fi-tgl-y:           [PASS][2] -> [DMESG-WARN][3] ([i915#402]) +1 similar issue
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/fi-tgl-y/igt@debugfs_test@read_all_entries.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-tgl-y/igt@debugfs_test@read_all_entries.html

  * igt@gem_huc_copy@huc-copy:
    - fi-byt-j1900:       NOTRUN -> [SKIP][4] ([fdo#109271]) +9 similar issues
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-byt-j1900/igt@gem_huc_copy@huc-copy.html

  * igt@i915_pm_rpm@module-reload:
    - fi-byt-j1900:       NOTRUN -> [INCOMPLETE][5] ([i915#142] / [i915#2405])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-byt-j1900/igt@i915_pm_rpm@module-reload.html

  * igt@kms_chamelium@hdmi-crc-fast:
    - fi-byt-j1900:       NOTRUN -> [SKIP][6] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-byt-j1900/igt@kms_chamelium@hdmi-crc-fast.html

  * igt@runner@aborted:
    - fi-byt-j1900:       NOTRUN -> [FAIL][7] ([i915#1814] / [i915#2505])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-byt-j1900/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3:
    - fi-tgl-y:           [DMESG-WARN][8] ([i915#2411] / [i915#402]) -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/fi-tgl-y/igt@gem_exec_suspend@basic-s3.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-tgl-y/igt@gem_exec_suspend@basic-s3.html

  * igt@prime_self_import@basic-with_one_bo:
    - fi-tgl-y:           [DMESG-WARN][10] ([i915#402]) -> [PASS][11]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/fi-tgl-y/igt@prime_self_import@basic-with_one_bo.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/fi-tgl-y/igt@prime_self_import@basic-with_one_bo.html

  
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#142]: https://gitlab.freedesktop.org/drm/intel/issues/142
  [i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
  [i915#2405]: https://gitlab.freedesktop.org/drm/intel/issues/2405
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2505]: https://gitlab.freedesktop.org/drm/intel/issues/2505
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402


Participating hosts (44 -> 39)
------------------------------

  Additional (1): fi-byt-j1900 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-dg1-1 fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6003 -> IGTPW_5506

  CI-20190529: 20190529
  CI_DRM_9774: 75084ba7750368d8a2bf6ccc543b729e1b3394a6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5506: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/index.html
  IGT_6003: 627cc5353535d61fa33c5f7ff7e64f154c84f10a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 5097 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
  2021-02-14 20:35 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
  2021-02-14 20:35 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
  2021-02-14 21:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Patchwork
@ 2021-02-14 22:05 ` Patchwork
  2 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2021-02-14 22:05 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 30317 bytes --]

== Series Details ==

Series: series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
URL   : https://patchwork.freedesktop.org/series/87079/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9774_full -> IGTPW_5506_full
====================================================

Summary
-------

  **WARNING**

  Minor unknown changes coming with IGTPW_5506_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_5506_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_5506/index.html

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

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

### IGT changes ###

#### Warnings ####

  * igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
    - shard-glk:          [TIMEOUT][1] ([i915#1280]) -> [FAIL][2] +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-glk7/igt@kms_rotation_crc@multiplane-rotation-cropping-bottom.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk1/igt@kms_rotation_crc@multiplane-rotation-cropping-bottom.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@feature_discovery@psr2:
    - shard-iclb:         [PASS][3] -> [SKIP][4] ([i915#658])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb2/igt@feature_discovery@psr2.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb3/igt@feature_discovery@psr2.html

  * igt@gem_ctx_param@set-priority-not-supported:
    - shard-tglb:         NOTRUN -> [SKIP][5] ([fdo#109314])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb6/igt@gem_ctx_param@set-priority-not-supported.html
    - shard-iclb:         NOTRUN -> [SKIP][6] ([fdo#109314])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb8/igt@gem_ctx_param@set-priority-not-supported.html

  * igt@gem_ctx_persistence@engines-mixed:
    - shard-hsw:          NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#1099])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw1/igt@gem_ctx_persistence@engines-mixed.html
    - shard-snb:          NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#1099])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-snb2/igt@gem_ctx_persistence@engines-mixed.html

  * igt@gem_eio@unwedge-stress:
    - shard-tglb:         [PASS][9] -> [TIMEOUT][10] ([i915#1037] / [i915#3063])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-tglb8/igt@gem_eio@unwedge-stress.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb5/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-flow@rcs0:
    - shard-tglb:         [PASS][11] -> [FAIL][12] ([i915#2842]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-tglb1/igt@gem_exec_fair@basic-flow@rcs0.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb2/igt@gem_exec_fair@basic-flow@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-apl:          [PASS][13] -> [FAIL][14] ([i915#2842])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl7/igt@gem_exec_fair@basic-none@vcs0.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl4/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - shard-kbl:          [PASS][15] -> [FAIL][16] ([i915#2842]) +1 similar issue
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl7/igt@gem_exec_fair@basic-pace-solo@rcs0.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl3/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs1:
    - shard-iclb:         NOTRUN -> [FAIL][17] ([i915#2842])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb4/igt@gem_exec_fair@basic-pace@vcs1.html

  * igt@gem_exec_fair@basic-pace@vecs0:
    - shard-glk:          [PASS][18] -> [FAIL][19] ([i915#2842])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-glk4/igt@gem_exec_fair@basic-pace@vecs0.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk7/igt@gem_exec_fair@basic-pace@vecs0.html
    - shard-iclb:         [PASS][20] -> [FAIL][21] ([i915#2842]) +1 similar issue
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb8/igt@gem_exec_fair@basic-pace@vecs0.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb4/igt@gem_exec_fair@basic-pace@vecs0.html

  * igt@gem_exec_params@secure-non-master:
    - shard-tglb:         NOTRUN -> [SKIP][22] ([fdo#112283])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb1/igt@gem_exec_params@secure-non-master.html

  * igt@gem_exec_reloc@basic-many-active@rcs0:
    - shard-tglb:         NOTRUN -> [FAIL][23] ([i915#2389]) +9 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb7/igt@gem_exec_reloc@basic-many-active@rcs0.html

  * igt@gem_exec_reloc@basic-wide-active@bcs0:
    - shard-apl:          NOTRUN -> [FAIL][24] ([i915#2389]) +3 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl8/igt@gem_exec_reloc@basic-wide-active@bcs0.html
    - shard-glk:          NOTRUN -> [FAIL][25] ([i915#2389]) +3 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk7/igt@gem_exec_reloc@basic-wide-active@bcs0.html

  * igt@gem_exec_reloc@basic-wide-active@rcs0:
    - shard-iclb:         NOTRUN -> [FAIL][26] ([i915#2389]) +3 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb3/igt@gem_exec_reloc@basic-wide-active@rcs0.html
    - shard-kbl:          NOTRUN -> [FAIL][27] ([i915#2389]) +4 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl6/igt@gem_exec_reloc@basic-wide-active@rcs0.html

  * igt@gem_exec_whisper@basic-forked-all:
    - shard-glk:          [PASS][28] -> [DMESG-WARN][29] ([i915#118] / [i915#95])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-glk2/igt@gem_exec_whisper@basic-forked-all.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk7/igt@gem_exec_whisper@basic-forked-all.html

  * igt@gem_softpin@noreloc-s3:
    - shard-kbl:          [PASS][30] -> [DMESG-WARN][31] ([i915#180]) +1 similar issue
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl6/igt@gem_softpin@noreloc-s3.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl3/igt@gem_softpin@noreloc-s3.html

  * igt@gen7_exec_parse@basic-offset:
    - shard-tglb:         NOTRUN -> [SKIP][32] ([fdo#109289]) +2 similar issues
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb7/igt@gen7_exec_parse@basic-offset.html

  * igt@gen9_exec_parse@bb-secure:
    - shard-tglb:         NOTRUN -> [SKIP][33] ([fdo#112306]) +1 similar issue
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb2/igt@gen9_exec_parse@bb-secure.html
    - shard-iclb:         NOTRUN -> [SKIP][34] ([fdo#112306])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb4/igt@gen9_exec_parse@bb-secure.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-tglb:         NOTRUN -> [FAIL][35] ([i915#454])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_pm_rpm@dpms-mode-unset-non-lpsp:
    - shard-tglb:         NOTRUN -> [SKIP][36] ([fdo#111644] / [i915#1397] / [i915#2411])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html
    - shard-iclb:         NOTRUN -> [SKIP][37] ([fdo#110892])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb1/igt@i915_pm_rpm@dpms-mode-unset-non-lpsp.html

  * igt@i915_selftest@live@hangcheck:
    - shard-hsw:          [PASS][38] -> [INCOMPLETE][39] ([i915#2782])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-hsw6/igt@i915_selftest@live@hangcheck.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw2/igt@i915_selftest@live@hangcheck.html

  * igt@kms_big_fb@linear-8bpp-rotate-90:
    - shard-glk:          NOTRUN -> [SKIP][40] ([fdo#109271]) +42 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk5/igt@kms_big_fb@linear-8bpp-rotate-90.html
    - shard-tglb:         NOTRUN -> [SKIP][41] ([fdo#111614]) +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb6/igt@kms_big_fb@linear-8bpp-rotate-90.html

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

  * igt@kms_big_joiner@basic:
    - shard-tglb:         NOTRUN -> [SKIP][43] ([i915#2705])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb5/igt@kms_big_joiner@basic.html
    - shard-kbl:          NOTRUN -> [SKIP][44] ([fdo#109271] / [i915#2705])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl3/igt@kms_big_joiner@basic.html
    - shard-iclb:         NOTRUN -> [SKIP][45] ([i915#2705])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb6/igt@kms_big_joiner@basic.html
    - shard-glk:          NOTRUN -> [SKIP][46] ([fdo#109271] / [i915#2705])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk4/igt@kms_big_joiner@basic.html
    - shard-apl:          NOTRUN -> [SKIP][47] ([fdo#109271] / [i915#2705])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl3/igt@kms_big_joiner@basic.html

  * igt@kms_chamelium@vga-hpd:
    - shard-apl:          NOTRUN -> [SKIP][48] ([fdo#109271] / [fdo#111827]) +16 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl3/igt@kms_chamelium@vga-hpd.html
    - shard-tglb:         NOTRUN -> [SKIP][49] ([fdo#109284] / [fdo#111827]) +8 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb5/igt@kms_chamelium@vga-hpd.html

  * igt@kms_chamelium@vga-hpd-for-each-pipe:
    - shard-kbl:          NOTRUN -> [SKIP][50] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl2/igt@kms_chamelium@vga-hpd-for-each-pipe.html

  * igt@kms_color@pipe-a-degamma:
    - shard-tglb:         NOTRUN -> [FAIL][51] ([i915#1149])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb6/igt@kms_color@pipe-a-degamma.html
    - shard-iclb:         NOTRUN -> [FAIL][52] ([i915#1149])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb8/igt@kms_color@pipe-a-degamma.html

  * igt@kms_color@pipe-d-ctm-0-5:
    - shard-iclb:         NOTRUN -> [SKIP][53] ([fdo#109278] / [i915#1149])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb4/igt@kms_color@pipe-d-ctm-0-5.html

  * igt@kms_color_chamelium@pipe-c-ctm-limited-range:
    - shard-hsw:          NOTRUN -> [SKIP][54] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw4/igt@kms_color_chamelium@pipe-c-ctm-limited-range.html
    - shard-snb:          NOTRUN -> [SKIP][55] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-snb7/igt@kms_color_chamelium@pipe-c-ctm-limited-range.html
    - shard-iclb:         NOTRUN -> [SKIP][56] ([fdo#109284] / [fdo#111827]) +3 similar issues
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb6/igt@kms_color_chamelium@pipe-c-ctm-limited-range.html

  * igt@kms_color_chamelium@pipe-d-degamma:
    - shard-glk:          NOTRUN -> [SKIP][57] ([fdo#109271] / [fdo#111827]) +4 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk1/igt@kms_color_chamelium@pipe-d-degamma.html
    - shard-iclb:         NOTRUN -> [SKIP][58] ([fdo#109278] / [fdo#109284] / [fdo#111827])
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb2/igt@kms_color_chamelium@pipe-d-degamma.html

  * igt@kms_content_protection@legacy:
    - shard-tglb:         NOTRUN -> [SKIP][59] ([fdo#111828])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@kms_content_protection@legacy.html

  * igt@kms_cursor_crc@pipe-b-cursor-512x512-random:
    - shard-kbl:          NOTRUN -> [SKIP][60] ([fdo#109271]) +89 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl6/igt@kms_cursor_crc@pipe-b-cursor-512x512-random.html
    - shard-iclb:         NOTRUN -> [SKIP][61] ([fdo#109278] / [fdo#109279])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb5/igt@kms_cursor_crc@pipe-b-cursor-512x512-random.html

  * igt@kms_cursor_crc@pipe-c-cursor-256x85-random:
    - shard-kbl:          [PASS][62] -> [FAIL][63] ([i915#54])
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl2/igt@kms_cursor_crc@pipe-c-cursor-256x85-random.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl6/igt@kms_cursor_crc@pipe-c-cursor-256x85-random.html
    - shard-apl:          [PASS][64] -> [FAIL][65] ([i915#54])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl6/igt@kms_cursor_crc@pipe-c-cursor-256x85-random.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl7/igt@kms_cursor_crc@pipe-c-cursor-256x85-random.html

  * igt@kms_cursor_crc@pipe-c-cursor-512x512-random:
    - shard-tglb:         NOTRUN -> [SKIP][66] ([fdo#109279]) +2 similar issues
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb5/igt@kms_cursor_crc@pipe-c-cursor-512x512-random.html

  * igt@kms_cursor_edge_walk@pipe-d-64x64-top-edge:
    - shard-hsw:          NOTRUN -> [SKIP][67] ([fdo#109271] / [i915#533]) +7 similar issues
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw8/igt@kms_cursor_edge_walk@pipe-d-64x64-top-edge.html

  * igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
    - shard-tglb:         [PASS][68] -> [FAIL][69] ([i915#2346])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-tglb1/igt@kms_cursor_legacy@flip-vs-cursor-varying-size.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb2/igt@kms_cursor_legacy@flip-vs-cursor-varying-size.html

  * igt@kms_cursor_legacy@pipe-d-torture-bo:
    - shard-kbl:          NOTRUN -> [SKIP][70] ([fdo#109271] / [i915#533]) +2 similar issues
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl3/igt@kms_cursor_legacy@pipe-d-torture-bo.html
    - shard-apl:          NOTRUN -> [SKIP][71] ([fdo#109271] / [i915#533]) +1 similar issue
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl1/igt@kms_cursor_legacy@pipe-d-torture-bo.html
    - shard-glk:          NOTRUN -> [SKIP][72] ([fdo#109271] / [i915#533])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk9/igt@kms_cursor_legacy@pipe-d-torture-bo.html

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-kbl:          [PASS][73] -> [INCOMPLETE][74] ([i915#155] / [i915#180] / [i915#636])
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl2/igt@kms_fbcon_fbt@fbc-suspend.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl3/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_flip@2x-blocking-absolute-wf_vblank-interruptible:
    - shard-tglb:         NOTRUN -> [SKIP][75] ([fdo#111825]) +27 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb5/igt@kms_flip@2x-blocking-absolute-wf_vblank-interruptible.html

  * igt@kms_flip@2x-plain-flip-interruptible:
    - shard-iclb:         NOTRUN -> [SKIP][76] ([fdo#109274]) +1 similar issue
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb6/igt@kms_flip@2x-plain-flip-interruptible.html

  * igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
    - shard-apl:          [PASS][77] -> [DMESG-WARN][78] ([i915#180] / [i915#1982])
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl6/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl3/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html

  * igt@kms_flip@flip-vs-suspend@a-dp1:
    - shard-apl:          NOTRUN -> [DMESG-WARN][79] ([i915#180]) +1 similar issue
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl3/igt@kms_flip@flip-vs-suspend@a-dp1.html

  * igt@kms_flip@flip-vs-suspend@c-dp1:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][80] ([i915#180]) +2 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl1/igt@kms_flip@flip-vs-suspend@c-dp1.html

  * igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile:
    - shard-apl:          NOTRUN -> [FAIL][81] ([i915#2641]) +1 similar issue
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl6/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile.html

  * igt@kms_flip_tiling@flip-to-yf-tiled:
    - shard-tglb:         NOTRUN -> [SKIP][82] ([fdo#111615]) +1 similar issue
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@kms_flip_tiling@flip-to-yf-tiled.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-render:
    - shard-snb:          NOTRUN -> [SKIP][83] ([fdo#109271]) +46 similar issues
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-snb4/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-pgflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][84] ([fdo#109280]) +13 similar issues
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-pgflip-blt.html

  * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu:
    - shard-hsw:          NOTRUN -> [SKIP][85] ([fdo#109271]) +34 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw5/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu.html

  * igt@kms_hdr@static-toggle:
    - shard-tglb:         NOTRUN -> [SKIP][86] ([i915#1187])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@kms_hdr@static-toggle.html

  * igt@kms_pipe_b_c_ivb@disable-pipe-b-enable-pipe-c:
    - shard-iclb:         NOTRUN -> [SKIP][87] ([fdo#109289]) +2 similar issues
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb8/igt@kms_pipe_b_c_ivb@disable-pipe-b-enable-pipe-c.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-apl:          NOTRUN -> [FAIL][88] ([fdo#108145] / [i915#265]) +1 similar issue
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl4/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
    - shard-glk:          NOTRUN -> [FAIL][89] ([fdo#108145] / [i915#265])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk9/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-7efc:
    - shard-kbl:          NOTRUN -> [FAIL][90] ([fdo#108145] / [i915#265]) +1 similar issue
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl6/igt@kms_plane_alpha_blend@pipe-c-alpha-7efc.html

  * igt@kms_plane_cursor@pipe-d-viewport-size-64:
    - shard-iclb:         NOTRUN -> [SKIP][91] ([fdo#109278]) +11 similar issues
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb7/igt@kms_plane_cursor@pipe-d-viewport-size-64.html

  * igt@kms_prime@basic-crc@first-to-second:
    - shard-iclb:         NOTRUN -> [SKIP][92] ([i915#1836])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb3/igt@kms_prime@basic-crc@first-to-second.html
    - shard-tglb:         NOTRUN -> [SKIP][93] ([i915#1836])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb5/igt@kms_prime@basic-crc@first-to-second.html

  * igt@kms_psr2_sf@cursor-plane-update-sf:
    - shard-tglb:         NOTRUN -> [SKIP][94] ([i915#2920]) +1 similar issue
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb8/igt@kms_psr2_sf@cursor-plane-update-sf.html
    - shard-iclb:         NOTRUN -> [SKIP][95] ([i915#658])
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb1/igt@kms_psr2_sf@cursor-plane-update-sf.html

  * igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-1:
    - shard-apl:          NOTRUN -> [SKIP][96] ([fdo#109271] / [i915#658]) +3 similar issues
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl1/igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-1.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
    - shard-kbl:          NOTRUN -> [SKIP][97] ([fdo#109271] / [i915#658]) +3 similar issues
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl1/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1.html

  * igt@kms_psr2_su@page_flip:
    - shard-glk:          NOTRUN -> [SKIP][98] ([fdo#109271] / [i915#658]) +1 similar issue
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk1/igt@kms_psr2_su@page_flip.html
    - shard-iclb:         NOTRUN -> [SKIP][99] ([fdo#109642] / [fdo#111068] / [i915#658])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb3/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         NOTRUN -> [SKIP][100] ([fdo#109441]) +1 similar issue
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb8/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [PASS][101] -> [SKIP][102] ([fdo#109441]) +2 similar issues
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb8/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@kms_psr@psr2_sprite_plane_onoff:
    - shard-hsw:          NOTRUN -> [SKIP][103] ([fdo#109271] / [i915#1072])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw8/igt@kms_psr@psr2_sprite_plane_onoff.html

  * igt@kms_rotation_crc@sprite-rotation-90-pos-100-0:
    - shard-hsw:          NOTRUN -> [SKIP][104] ([fdo#109271] / [fdo#109289])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw5/igt@kms_rotation_crc@sprite-rotation-90-pos-100-0.html

  * igt@kms_vblank@pipe-c-ts-continuation-suspend:
    - shard-apl:          [PASS][105] -> [DMESG-WARN][106] ([i915#180])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl3/igt@kms_vblank@pipe-c-ts-continuation-suspend.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl2/igt@kms_vblank@pipe-c-ts-continuation-suspend.html

  * igt@kms_vblank@pipe-d-wait-forked-hang:
    - shard-apl:          NOTRUN -> [SKIP][107] ([fdo#109271]) +151 similar issues
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl4/igt@kms_vblank@pipe-d-wait-forked-hang.html

  * igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame:
    - shard-tglb:         NOTRUN -> [SKIP][108] ([i915#2530])
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame.html
    - shard-iclb:         NOTRUN -> [SKIP][109] ([i915#2530])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb7/igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame.html

  * igt@prime_nv_api@nv_i915_import_twice_check_flink_name:
    - shard-tglb:         NOTRUN -> [SKIP][110] ([fdo#109291]) +2 similar issues
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb3/igt@prime_nv_api@nv_i915_import_twice_check_flink_name.html

  * igt@prime_nv_api@nv_i915_reimport_twice_check_flink_name:
    - shard-iclb:         NOTRUN -> [SKIP][111] ([fdo#109291])
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb5/igt@prime_nv_api@nv_i915_reimport_twice_check_flink_name.html

  
#### Possible fixes ####

  * igt@gem_eio@unwedge-stress:
    - shard-iclb:         [TIMEOUT][112] ([i915#1037] / [i915#2481]) -> [PASS][113]
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb3/igt@gem_eio@unwedge-stress.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb3/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-iclb:         [FAIL][114] ([i915#2842]) -> [PASS][115]
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb2/igt@gem_exec_fair@basic-none-share@rcs0.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb5/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_fair@basic-pace@rcs0:
    - shard-glk:          [FAIL][116] ([i915#2842]) -> [PASS][117]
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-glk4/igt@gem_exec_fair@basic-pace@rcs0.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk7/igt@gem_exec_fair@basic-pace@rcs0.html

  * igt@gem_exec_schedule@u-fairslice-all:
    - shard-kbl:          [DMESG-WARN][118] ([i915#1610] / [i915#2803]) -> [PASS][119]
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl6/igt@gem_exec_schedule@u-fairslice-all.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl4/igt@gem_exec_schedule@u-fairslice-all.html

  * igt@gem_softpin@noreloc-s3:
    - shard-apl:          [DMESG-WARN][120] ([i915#180]) -> [PASS][121]
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl2/igt@gem_softpin@noreloc-s3.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl3/igt@gem_softpin@noreloc-s3.html

  * igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a1:
    - shard-glk:          [FAIL][122] ([i915#79]) -> [PASS][123]
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-glk5/igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a1.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-glk2/igt@kms_flip@flip-vs-expired-vblank@b-hdmi-a1.html

  * igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
    - shard-kbl:          [DMESG-WARN][124] ([i915#180]) -> [PASS][125] +3 similar issues
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl7/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl2/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
    - shard-apl:          [DMESG-WARN][126] ([i915#180] / [i915#533]) -> [PASS][127]
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [SKIP][128] ([fdo#109441]) -> [PASS][129] +1 similar issue
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb8/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html

  * igt@kms_rotation_crc@multiplane-rotation:
    - shard-kbl:          [FAIL][130] ([i915#1041] / [i915#65]) -> [PASS][131]
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl4/igt@kms_rotation_crc@multiplane-rotation.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl4/igt@kms_rotation_crc@multiplane-rotation.html

  * igt@prime_vgem@sync@bcs0:
    - shard-tglb:         [INCOMPLETE][132] ([i915#409]) -> [PASS][133]
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-tglb3/igt@prime_vgem@sync@bcs0.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-tglb1/igt@prime_vgem@sync@bcs0.html

  * igt@sysfs_clients@busy@rcs0:
    - shard-apl:          [FAIL][134] ([i915#3019]) -> [PASS][135]
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-apl2/igt@sysfs_clients@busy@rcs0.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-apl6/igt@sysfs_clients@busy@rcs0.html

  * igt@sysfs_clients@recycle:
    - shard-snb:          [FAIL][136] ([i915#3028]) -> [PASS][137]
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-snb5/igt@sysfs_clients@recycle.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-snb4/igt@sysfs_clients@recycle.html
    - shard-hsw:          [FAIL][138] ([i915#3028]) -> [PASS][139]
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-hsw2/igt@sysfs_clients@recycle.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-hsw2/igt@sysfs_clients@recycle.html

  * {igt@sysfs_clients@recycle-many}:
    - shard-kbl:          [FAIL][140] ([i915#3028]) -> [PASS][141]
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-kbl2/igt@sysfs_clients@recycle-many.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-kbl3/igt@sysfs_clients@recycle-many.html

  
#### Warnings ####

  * igt@i915_pm_rc6_residency@rc6-fence:
    - shard-iclb:         [WARN][142] ([i915#2681] / [i915#2684]) -> [WARN][143] ([i915#1804] / [i915#2684])
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9774/shard-iclb8/igt@i915_pm_rc6_residency@rc6-fence.html
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5506/shard-iclb7/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][144] ([i915#1804] / [i915#2684]) -> [FAIL][145] ([i915#268

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 33762 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
  2021-02-18 16:14 [igt-dev] [PATCH i-g-t 1/2] " Juha-Pekka Heikkila
@ 2021-03-02 11:13 ` Karthik B S
  0 siblings, 0 replies; 13+ messages in thread
From: Karthik B S @ 2021-03-02 11:13 UTC (permalink / raw)
  To: Juha-Pekka Heikkila, igt-dev

On 2/18/2021 9:44 PM, Juha-Pekka Heikkila wrote:
> Reduce repetitive work and wait less. Buffer created fbs. Log counted crcs.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Looks good to me.

Reviewed-by: Karthik B S <karthik.b.s@intel.com>

> ---
>   tests/kms_rotation_crc.c | 235 +++++++++++++++++++++++++++------------
>   1 file changed, 165 insertions(+), 70 deletions(-)
>
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 6d4e87ed9..6233c773a 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -31,6 +31,8 @@
>   #define TEST_MAX_WIDTH 640
>   #define TEST_MAX_HEIGHT 480
>   #define MAX_TESTED_MODES 8
> +#define MULTIPLANE_REFERENCE 0
> +#define MULTIPLANE_ROTATED 1
>   
>   struct p_struct {
>   	igt_plane_t *plane;
> @@ -522,26 +524,19 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
>   
>   typedef struct {
>   	int32_t x1, y1;
> -	uint64_t width, height, tiling, planetype, format;
> +	uint64_t width, height, tiling, format;
> +	igt_plane_t *plane;
>   	igt_rotation_t rotation_sw, rotation_hw;
>   } planeinfos;
>   
> -static bool get_multiplane_crc(data_t *data, igt_output_t *output,
> -			       igt_crc_t *crc_output, planeinfos *planeinfo,
> -			       int numplanes)
> +static bool setup_multiplane(data_t *data, planeinfos *planeinfo,
> +			     struct igt_fb *fbleft,  struct igt_fb *fbright)
>   {
>   	uint32_t w, h;
> -	igt_display_t *display = &data->display;
> -	struct p_struct *planes, *oldplanes;
> -	int c, ret;
> -
> -	oldplanes = data->multiplaneoldview;
> -	planes = calloc(sizeof(*planes), numplanes);
> -
> -	for (c = 0; c < numplanes; c++) {
> -		planes[c].plane = igt_output_get_plane_type(output,
> -							    planeinfo[c].planetype);
> +	struct igt_fb *planes[2] = {fbleft, fbright};
> +	int c;
>   
> +	for (c = 0; c < ARRAY_SIZE(planes); c++) {
>   		/*
>   		 * make plane and fb width and height always divisible by 4
>   		 * due to NV12 support and Intel hw workarounds.
> @@ -552,34 +547,33 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
>   		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
>   			igt_swap(w, h);
>   
> -		if (!igt_plane_has_format_mod(planes[c].plane,
> +		if (!igt_plane_has_format_mod(planeinfo[c].plane,
>   					      planeinfo[c].format,
>   					      planeinfo[c].tiling))
>   			return false;
>   
> -		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
> -			      planeinfo[c].tiling, &planes[c].fb);
> +		/*
> +		 * was this hw/sw rotation ran already or need to create
> +		 * new fb?
> +		 */
> +		if (planes[c]->fb_id == 0) {
> +			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
> +				      planeinfo[c].tiling, planes[c]);
>   
> -		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
> -		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
> +			paint_squares(data, planeinfo[c].rotation_sw,
> +				      planes[c], 1.0f);
> +		}
> +		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
>   
>   		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
> -			igt_plane_set_size(planes[c].plane, h, w);
> -
> -		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
> -		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
> -	}
> -
> -	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
> -	igt_assert_eq(ret, 0);
> -
> -	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
> +			igt_plane_set_size(planeinfo[c].plane, h, w);
>   
> -	for (c = 0; c < numplanes && oldplanes; c++)
> -		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
> +		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1,
> +				       planeinfo[c].y1);
>   
> -	free(oldplanes);
> -	data->multiplaneoldview = (void*)planes;
> +		igt_plane_set_rotation(planeinfo[c].plane,
> +				       planeinfo[c].rotation_hw);
> +	}
>   	return true;
>   }
>   
> @@ -613,6 +607,11 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
>   	}
>   }
>   
> +/*
> + * count trailing zeroes
> + */
> +#define ctz __builtin_ctz
> +
>   /*
>    * Here is pipe parameter which is now used only for first pipe.
>    * It is left here if this test ever was wanted to be run on
> @@ -624,15 +623,26 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   	igt_output_t *output;
>   	igt_crc_t retcrc_sw, retcrc_hw;
>   	planeinfos p[2];
> -	int c, used_w, used_h;
> -	struct p_struct *oldplanes;
> +	int used_w, used_h, lastroundirotation = 0, lastroundjrotation = 0,
> +	    lastroundjformat = 0, c, d;
>   	drmModeModeInfo *mode;
> +	bool have_crc; // flag if can use previously logged crc for comparison
> +	igt_crc_t crclog[16] = {}; //4 * 4 rotation crc storage for packed formats
> +	char *str1, *str2; // for debug printouts
> +
> +	/*
> +	 * These are those modes which are tested. For testing feel interesting
> +	 * case with tiling are 2 bpp, 4 bpp and NV12.
> +	 */
> +	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
> +		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
>   
> -	static const struct {
> +	static struct {
>   		igt_rotation_t rotation;
>   		float_t width;
>   		float_t height;
>   		uint64_t tiling;
> +		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
>   	} planeconfigs[] = {
>   	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
>   	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
> @@ -648,15 +658,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
>   	};
>   
> -	/*
> -	* These are those modes which are tested. For testing feel interesting
> -	* case with tiling are 2 bpp, 4 bpp and NV12.
> -	*/
> -	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
> -		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
> -
>   	for_each_valid_output_on_pipe(display, pipe, output) {
> -		int i, j, k, l;
> +		int i, j, k, l, flipsw, fliphw;
>   		igt_output_set_pipe(output, pipe);
>   		mode = igt_output_get_mode(output);
>   		igt_display_require_output(display);
> @@ -665,12 +668,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
>   		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
>   
> +		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> +		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
> +
>   		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
>   						  INTEL_PIPE_CRC_SOURCE_AUTO);
>   		igt_pipe_crc_start(data->pipe_crc);
>   
>   		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
> -			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
>   			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
>   			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
>   			p[0].tiling = planeconfigs[i].tiling;
> @@ -680,7 +685,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   				p[0].format = formatlist[k];
>   
>   				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
> -					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
>   					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
>   					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
>   					p[1].tiling = planeconfigs[j].tiling;
> @@ -689,7 +693,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   
>   					for (l = 0; l < ARRAY_SIZE(formatlist); l++) {
>   						p[1].format = formatlist[l];
> -
>   						/*
>   						 * RGB565 90/270 degrees rotation is supported
>   						 * from gen11 onwards.
> @@ -703,42 +706,134 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   						     (planeconfigs[j].rotation & (IGT_ROTATION_90 | IGT_ROTATION_270))
>   						     && intel_gen(data->devid) < 11)
>   							continue;
> +						/*
> +						 * if using packed formats crc's will be
> +						 * same and can store them so there's
> +						 * no need to redo comparison image and
> +						 * just use stored crc.
> +						 */
> +						if (p[0].format != DRM_FORMAT_NV12 &&
> +						    p[1].format != DRM_FORMAT_NV12 &&
> +						    crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)].frame != 0) {
> +							retcrc_sw = crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)];
> +							have_crc = true;
> +						} else if (p[0].format == DRM_FORMAT_NV12 &&
> +							   p[1].format != DRM_FORMAT_NV12 &&
> +							   lastroundjformat != DRM_FORMAT_NV12 &&
> +							   planeconfigs[i].rotation == lastroundirotation &&
> +							   planeconfigs[j].rotation == lastroundjrotation) {
> +							/*
> +							 * With NV12 can benefit from
> +							 * previous crc if rotations
> +							 * stay same. If both planes
> +							 * have NV12 in use we need to
> +							 * skip that case.
> +							 * If last round right plane
> +							 * had NV12 need to skip this.
> +							 */
> +							have_crc = true;
> +						} else {
> +							/*
> +							 * here will be created
> +							 * comparison image and get crc
> +							 * if didn't have stored crc
> +							 * or planar format is in use.
> +							 * have_crc flag will control
> +							 * crc comparison part.
> +							 */
> +							p[0].rotation_sw = planeconfigs[i].rotation;
> +							p[0].rotation_hw = IGT_ROTATION_0;
> +							p[1].rotation_sw = planeconfigs[j].rotation;
> +							p[1].rotation_hw = IGT_ROTATION_0;
> +							if (!setup_multiplane(data,
> +									(planeinfos *)&p,
> +									&planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
> +									&planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
> +								continue;
> +							igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +							flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
> +							have_crc = false;
> +						}
>   
> -						p[0].rotation_sw = planeconfigs[i].rotation;
> -						p[0].rotation_hw = IGT_ROTATION_0;
> -						p[1].rotation_sw = planeconfigs[j].rotation;
> -						p[1].rotation_hw = IGT_ROTATION_0;
> -						if (!get_multiplane_crc(data, output, &retcrc_sw,
> -								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
> +						/*
> +						 * create hw rotated image and
> +						 * get vblank where interesting
> +						 * crc will be at, grab crc bit later
> +						 */
> +						p[0].rotation_sw = IGT_ROTATION_0;
> +						p[0].rotation_hw = planeconfigs[i].rotation;
> +						p[1].rotation_sw = IGT_ROTATION_0;
> +						p[1].rotation_hw = planeconfigs[j].rotation;
> +
> +						if (!setup_multiplane(data,
> +								      (planeinfos *)&p,
> +								      &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
> +								      &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
>   							continue;
>   
> -						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
> -						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
> -						if (!get_multiplane_crc(data, output, &retcrc_hw,
> -								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
> -							continue;
> +						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
> +
> +						if (!have_crc) {
> +							igt_pipe_crc_get_for_frame(data->gfx_fd,
> +										   data->pipe_crc,
> +										   flipsw,
> +										   &retcrc_sw);
> +
> +							if (p[0].format != DRM_FORMAT_NV12 && p[1].format != DRM_FORMAT_NV12)
> +								crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)]
> +								= retcrc_sw;
> +						}
> +						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
> +
> +						str1 = igt_crc_to_string(&retcrc_sw);
> +						str2 = igt_crc_to_string(&retcrc_hw);
> +
> +						igt_debug("crc %.8s vs %.8s -- %.4s - %.4s crc buffered:%s rot1 %d rot2 %d\n",
> +							str1, str2,
> +							(char *) &p[0].format, (char *) &p[1].format,
> +							have_crc?"yes":" no",
> +							(int[]) {0, 90, 180, 270} [ctz(planeconfigs[i].rotation)],
> +							(int[]) {0, 90, 180, 270} [ctz(planeconfigs[j].rotation)]);
> +
> +						free(str1);
> +						free(str2);
> +
>   
>   						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
> +
> +						lastroundjformat = p[1].format;
> +						lastroundirotation = planeconfigs[i].rotation;
> +						lastroundjrotation = planeconfigs[j].rotation;
>   					}
>   				}
>   			}
>   		}
>   		igt_pipe_crc_stop(data->pipe_crc);
>   		igt_pipe_crc_free(data->pipe_crc);
> -		igt_output_set_pipe(output, PIPE_ANY);
> -	}
>   
> -	/*
> -	* Old fbs are deleted only after new ones are set on planes.
> -	* This is done to speed up the test
> -	*/
> -	oldplanes = data->multiplaneoldview;
> -	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
> -		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
> -
> -	free(oldplanes);
> -	data->multiplaneoldview = NULL;
> +		igt_plane_set_fb(p[0].plane, NULL);
> +		igt_plane_set_fb(p[1].plane, NULL);
> +		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +
> +		for (i = 0; i < ARRAY_SIZE(crclog); i++)
> +			crclog[i].frame = 0;
> +
> +		lastroundjformat = 0;
> +		lastroundirotation = 0;
> +		lastroundjrotation = 0;
> +
> +
> +		igt_output_set_pipe(output, PIPE_NONE);
> +	}
>   	data->pipe_crc = NULL;
> +
> +	for (c = 0; c < ARRAY_SIZE(planeconfigs); c++) {
> +		for  (d = 0; d < ARRAY_SIZE(formatlist); d++) {
> +			igt_remove_fb(data->gfx_fd, &planeconfigs[c].fbs[d][MULTIPLANE_REFERENCE]);
> +			igt_remove_fb(data->gfx_fd, &planeconfigs[c].fbs[d][MULTIPLANE_ROTATED]);
> +		}
> +	}
>   }
>   
>   static void test_plane_rotation_exhaust_fences(data_t *data,


_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-18 16:14 Juha-Pekka Heikkila
  2021-03-02 11:13 ` Karthik B S
  0 siblings, 1 reply; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-18 16:14 UTC (permalink / raw)
  To: igt-dev

Reduce repetitive work and wait less. Buffer created fbs. Log counted crcs.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 235 +++++++++++++++++++++++++++------------
 1 file changed, 165 insertions(+), 70 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..6233c773a 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -522,26 +524,19 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 typedef struct {
 	int32_t x1, y1;
-	uint64_t width, height, tiling, planetype, format;
+	uint64_t width, height, tiling, format;
+	igt_plane_t *plane;
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
-static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+static bool setup_multiplane(data_t *data, planeinfos *planeinfo,
+			     struct igt_fb *fbleft,  struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
-
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
-
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	struct igt_fb *planes[2] = {fbleft, fbright};
+	int c;
 
+	for (c = 0; c < ARRAY_SIZE(planes); c++) {
 		/*
 		 * make plane and fb width and height always divisible by 4
 		 * due to NV12 support and Intel hw workarounds.
@@ -552,34 +547,33 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(planeinfo[c].plane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		/*
+		 * was this hw/sw rotation ran already or need to create
+		 * new fb?
+		 */
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				      planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw,
+				      planes[c], 1.0f);
+		}
+		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
-
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
-	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
+			igt_plane_set_size(planeinfo[c].plane, h, w);
 
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1,
+				       planeinfo[c].y1);
 
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
+		igt_plane_set_rotation(planeinfo[c].plane,
+				       planeinfo[c].rotation_hw);
+	}
 	return true;
 }
 
@@ -613,6 +607,11 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
 	}
 }
 
+/*
+ * count trailing zeroes
+ */
+#define ctz __builtin_ctz
+
 /*
  * Here is pipe parameter which is now used only for first pipe.
  * It is left here if this test ever was wanted to be run on
@@ -624,15 +623,26 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h, lastroundirotation = 0, lastroundjrotation = 0,
+	    lastroundjformat = 0, c, d;
 	drmModeModeInfo *mode;
+	bool have_crc; // flag if can use previously logged crc for comparison
+	igt_crc_t crclog[16] = {}; //4 * 4 rotation crc storage for packed formats
+	char *str1, *str2; // for debug printouts
+
+	/*
+	 * These are those modes which are tested. For testing feel interesting
+	 * case with tiling are 2 bpp, 4 bpp and NV12.
+	 */
+	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
+		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
-	static const struct {
+	static struct {
 		igt_rotation_t rotation;
 		float_t width;
 		float_t height;
 		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
 	} planeconfigs[] = {
 	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
 	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
@@ -648,15 +658,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
 	};
 
-	/*
-	* These are those modes which are tested. For testing feel interesting
-	* case with tiling are 2 bpp, 4 bpp and NV12.
-	*/
-	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
-		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
-
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -665,12 +668,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
 		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
 
+		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
+
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
 						  INTEL_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
-			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
 			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
 			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
 			p[0].tiling = planeconfigs[i].tiling;
@@ -680,7 +685,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 				p[0].format = formatlist[k];
 
 				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
-					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
 					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
 					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
 					p[1].tiling = planeconfigs[j].tiling;
@@ -689,7 +693,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 
 					for (l = 0; l < ARRAY_SIZE(formatlist); l++) {
 						p[1].format = formatlist[l];
-
 						/*
 						 * RGB565 90/270 degrees rotation is supported
 						 * from gen11 onwards.
@@ -703,42 +706,134 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     (planeconfigs[j].rotation & (IGT_ROTATION_90 | IGT_ROTATION_270))
 						     && intel_gen(data->devid) < 11)
 							continue;
+						/*
+						 * if using packed formats crc's will be
+						 * same and can store them so there's
+						 * no need to redo comparison image and
+						 * just use stored crc.
+						 */
+						if (p[0].format != DRM_FORMAT_NV12 &&
+						    p[1].format != DRM_FORMAT_NV12 &&
+						    crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)].frame != 0) {
+							retcrc_sw = crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)];
+							have_crc = true;
+						} else if (p[0].format == DRM_FORMAT_NV12 &&
+							   p[1].format != DRM_FORMAT_NV12 &&
+							   lastroundjformat != DRM_FORMAT_NV12 &&
+							   planeconfigs[i].rotation == lastroundirotation &&
+							   planeconfigs[j].rotation == lastroundjrotation) {
+							/*
+							 * With NV12 can benefit from
+							 * previous crc if rotations
+							 * stay same. If both planes
+							 * have NV12 in use we need to
+							 * skip that case.
+							 * If last round right plane
+							 * had NV12 need to skip this.
+							 */
+							have_crc = true;
+						} else {
+							/*
+							 * here will be created
+							 * comparison image and get crc
+							 * if didn't have stored crc
+							 * or planar format is in use.
+							 * have_crc flag will control
+							 * crc comparison part.
+							 */
+							p[0].rotation_sw = planeconfigs[i].rotation;
+							p[0].rotation_hw = IGT_ROTATION_0;
+							p[1].rotation_sw = planeconfigs[j].rotation;
+							p[1].rotation_hw = IGT_ROTATION_0;
+							if (!setup_multiplane(data,
+									(planeinfos *)&p,
+									&planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+									&planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
+								continue;
+							igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+							flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+							have_crc = false;
+						}
 
-						p[0].rotation_sw = planeconfigs[i].rotation;
-						p[0].rotation_hw = IGT_ROTATION_0;
-						p[1].rotation_sw = planeconfigs[j].rotation;
-						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						/*
+						 * create hw rotated image and
+						 * get vblank where interesting
+						 * crc will be at, grab crc bit later
+						 */
+						p[0].rotation_sw = IGT_ROTATION_0;
+						p[0].rotation_hw = planeconfigs[i].rotation;
+						p[1].rotation_sw = IGT_ROTATION_0;
+						p[1].rotation_hw = planeconfigs[j].rotation;
+
+						if (!setup_multiplane(data,
+								      (planeinfos *)&p,
+								      &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								      &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
-						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
-						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
-							continue;
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						if (!have_crc) {
+							igt_pipe_crc_get_for_frame(data->gfx_fd,
+										   data->pipe_crc,
+										   flipsw,
+										   &retcrc_sw);
+
+							if (p[0].format != DRM_FORMAT_NV12 && p[1].format != DRM_FORMAT_NV12)
+								crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)]
+								= retcrc_sw;
+						}
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
+
+						str1 = igt_crc_to_string(&retcrc_sw);
+						str2 = igt_crc_to_string(&retcrc_hw);
+
+						igt_debug("crc %.8s vs %.8s -- %.4s - %.4s crc buffered:%s rot1 %d rot2 %d\n",
+							str1, str2,
+							(char *) &p[0].format, (char *) &p[1].format,
+							have_crc?"yes":" no",
+							(int[]) {0, 90, 180, 270} [ctz(planeconfigs[i].rotation)],
+							(int[]) {0, 90, 180, 270} [ctz(planeconfigs[j].rotation)]);
+
+						free(str1);
+						free(str2);
+
 
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
+
+						lastroundjformat = p[1].format;
+						lastroundirotation = planeconfigs[i].rotation;
+						lastroundjrotation = planeconfigs[j].rotation;
 					}
 				}
 			}
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
 
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		igt_plane_set_fb(p[0].plane, NULL);
+		igt_plane_set_fb(p[1].plane, NULL);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+
+		for (i = 0; i < ARRAY_SIZE(crclog); i++)
+			crclog[i].frame = 0;
+
+		lastroundjformat = 0;
+		lastroundirotation = 0;
+		lastroundjrotation = 0;
+
+
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
+
+	for (c = 0; c < ARRAY_SIZE(planeconfigs); c++) {
+		for  (d = 0; d < ARRAY_SIZE(formatlist); d++) {
+			igt_remove_fb(data->gfx_fd, &planeconfigs[c].fbs[d][MULTIPLANE_REFERENCE]);
+			igt_remove_fb(data->gfx_fd, &planeconfigs[c].fbs[d][MULTIPLANE_ROTATED]);
+		}
+	}
 }
 
 static void test_plane_rotation_exhaust_fences(data_t *data,
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-17 20:12 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-17 20:12 UTC (permalink / raw)
  To: igt-dev

Reduce repetitive work and wait less. Buffer created fbs. Log counted crcs.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 224 +++++++++++++++++++++++++++------------
 1 file changed, 155 insertions(+), 69 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..eb3ec3372 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -522,26 +524,19 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 typedef struct {
 	int32_t x1, y1;
-	uint64_t width, height, tiling, planetype, format;
+	uint64_t width, height, tiling, format;
+	igt_plane_t *plane;
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
-static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+static bool setup_multiplane(data_t *data, planeinfos *planeinfo,
+			     struct igt_fb *fbleft,  struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
-
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
-
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	struct igt_fb *planes[2] = {fbleft, fbright};
+	int c;
 
+	for (c = 0; c < ARRAY_SIZE(planes); c++) {
 		/*
 		 * make plane and fb width and height always divisible by 4
 		 * due to NV12 support and Intel hw workarounds.
@@ -552,34 +547,33 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(planeinfo[c].plane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		/*
+		 * was this hw/sw rotation ran already or need to create
+		 * new fb?
+		 */
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				      planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw,
+				      planes[c], 1.0f);
+		}
+		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
-
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
-	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
+			igt_plane_set_size(planeinfo[c].plane, h, w);
 
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1,
+				       planeinfo[c].y1);
 
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
+		igt_plane_set_rotation(planeinfo[c].plane,
+				       planeinfo[c].rotation_hw);
+	}
 	return true;
 }
 
@@ -613,6 +607,11 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
 	}
 }
 
+/*
+ * count trailing zeroes
+ */
+#define ctz __builtin_ctz
+
 /*
  * Here is pipe parameter which is now used only for first pipe.
  * It is left here if this test ever was wanted to be run on
@@ -624,15 +623,26 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h, lastroundirotation = 0, lastroundjrotation = 0,
+	    lastroundjformat = 0;
 	drmModeModeInfo *mode;
+	bool have_crc; // flag if can use previously logged crc for comparison
+	igt_crc_t crclog[16] = {}; //4 * 4 rotation crc storage for packed formats
+	char *str1, *str2; // for debug printouts
 
-	static const struct {
+	/*
+	* These are those modes which are tested. For testing feel interesting
+	* case with tiling are 2 bpp, 4 bpp and NV12.
+	*/
+	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
+		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
+
+	static struct {
 		igt_rotation_t rotation;
 		float_t width;
 		float_t height;
 		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
 	} planeconfigs[] = {
 	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
 	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
@@ -648,15 +658,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
 	};
 
-	/*
-	* These are those modes which are tested. For testing feel interesting
-	* case with tiling are 2 bpp, 4 bpp and NV12.
-	*/
-	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
-		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
-
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -665,12 +668,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
 		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
 
+		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
+
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
 						  INTEL_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
-			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
 			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
 			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
 			p[0].tiling = planeconfigs[i].tiling;
@@ -680,7 +685,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 				p[0].format = formatlist[k];
 
 				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
-					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
 					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
 					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
 					p[1].tiling = planeconfigs[j].tiling;
@@ -689,7 +693,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 
 					for (l = 0; l < ARRAY_SIZE(formatlist); l++) {
 						p[1].format = formatlist[l];
-
 						/*
 						 * RGB565 90/270 degrees rotation is supported
 						 * from gen11 onwards.
@@ -703,41 +706,124 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     (planeconfigs[j].rotation & (IGT_ROTATION_90 | IGT_ROTATION_270))
 						     && intel_gen(data->devid) < 11)
 							continue;
+						/*
+						 * if using packed formats crc's will be
+						 * same and can store them so there's
+						 * no need to redo comparison image and
+						 * just use stored crc.
+						 */
+						if (p[0].format != DRM_FORMAT_NV12 &&
+						    p[1].format != DRM_FORMAT_NV12 &&
+						    crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)].frame != 0) {
+							retcrc_sw = crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)];
+							have_crc = true;
+						} else if (p[0].format == DRM_FORMAT_NV12 &&
+							   p[1].format != DRM_FORMAT_NV12 &&
+							   lastroundjformat != DRM_FORMAT_NV12 &&
+							   planeconfigs[i].rotation == lastroundirotation &&
+							   planeconfigs[j].rotation == lastroundjrotation) {
+							/*
+							 * With NV12 can benefit from
+							 * previous crc if rotations
+							 * stay same. If both planes
+							 * have NV12 in use we need to
+							 * skip that case.
+							 * If last round right plane
+							 * had NV12 need to skip this.
+							 */
+							have_crc = true;
+						} else {
+							/*
+							 * here will be created
+							 * comparison image and get crc
+							 * if didn't have stored crc
+							 * or planar format is in use.
+							 * have_crc flag will control
+							 * crc comparison part.
+							 */
+							p[0].rotation_sw = planeconfigs[i].rotation;
+							p[0].rotation_hw = IGT_ROTATION_0;
+							p[1].rotation_sw = planeconfigs[j].rotation;
+							p[1].rotation_hw = IGT_ROTATION_0;
+							if (!setup_multiplane(data,
+									(planeinfos *)&p,
+									&planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+									&planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
+								continue;
+							igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+							flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+							have_crc = false;
+						}
 
-						p[0].rotation_sw = planeconfigs[i].rotation;
-						p[0].rotation_hw = IGT_ROTATION_0;
-						p[1].rotation_sw = planeconfigs[j].rotation;
-						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						/*
+						 * create hw rotated image and
+						 * get vblank where interesting
+						 * crc will be at, grab crc bit later
+						 */
+						p[0].rotation_sw = IGT_ROTATION_0;
+						p[0].rotation_hw = planeconfigs[i].rotation;
+						p[1].rotation_sw = IGT_ROTATION_0;
+						p[1].rotation_hw = planeconfigs[j].rotation;
+
+						if (!setup_multiplane(data,
+								      (planeinfos *)&p,
+								      &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								      &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
-						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
-						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
-							continue;
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						if (!have_crc) {
+							igt_pipe_crc_get_for_frame(data->gfx_fd,
+										   data->pipe_crc,
+										   flipsw,
+										   &retcrc_sw);
+
+							if (p[0].format != DRM_FORMAT_NV12 && p[1].format != DRM_FORMAT_NV12 )
+								crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)]
+								= retcrc_sw;
+						}
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
+
+						str1 = igt_crc_to_string(&retcrc_sw);
+						str2 = igt_crc_to_string(&retcrc_hw);
+
+						igt_debug("crc %.8s vs %.8s -- %.4s - %.4s crc buffered:%s rot1 %d rot2 %d\n",
+							str1, str2,
+							(char*) &p[0].format, (char*) &p[1].format,
+							have_crc?"yes":" no",
+							(int[]) {0, 90, 180, 270}[ctz(planeconfigs[i].rotation)],
+							(int[]) {0, 90, 180, 270}[ctz(planeconfigs[j].rotation)]);
+
+						free(str1);
+						free(str2);
+
 
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
+
+						lastroundjformat = p[1].format;
+						lastroundirotation = planeconfigs[i].rotation;
+						lastroundjrotation = planeconfigs[j].rotation;
 					}
 				}
 			}
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
 
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_fb(p[0].plane, NULL);
+		igt_plane_set_fb(p[1].plane, NULL);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][MULTIPLANE_REFERENCE]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][MULTIPLANE_ROTATED]);
+			}
+		}
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-17 16:03 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-17 16:03 UTC (permalink / raw)
  To: igt-dev

Reduce repetitive work and wait less. Buffer created fbs. Log counted crcs.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 223 +++++++++++++++++++++++++++------------
 1 file changed, 154 insertions(+), 69 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..be3401be6 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -522,26 +524,19 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 typedef struct {
 	int32_t x1, y1;
-	uint64_t width, height, tiling, planetype, format;
+	uint64_t width, height, tiling, format;
+	igt_plane_t *plane;
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
-static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+static bool setup_multiplane(data_t *data, planeinfos *planeinfo,
+			     struct igt_fb *fbleft,  struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
-
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
-
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	struct igt_fb *planes[2] = {fbleft, fbright};
+	int c;
 
+	for (c = 0; c < ARRAY_SIZE(planes); c++) {
 		/*
 		 * make plane and fb width and height always divisible by 4
 		 * due to NV12 support and Intel hw workarounds.
@@ -552,34 +547,33 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(planeinfo[c].plane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		/*
+		 * was this hw/sw rotation ran already or need to create
+		 * new fb?
+		 */
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				      planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw,
+				      planes[c], 1.0f);
+		}
+		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
-
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
-	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
+			igt_plane_set_size(planeinfo[c].plane, h, w);
 
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1,
+				       planeinfo[c].y1);
 
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
+		igt_plane_set_rotation(planeinfo[c].plane,
+				       planeinfo[c].rotation_hw);
+	}
 	return true;
 }
 
@@ -613,6 +607,11 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
 	}
 }
 
+/*
+ * count trailing zeroes
+ */
+#define ctz __builtin_ctz
+
 /*
  * Here is pipe parameter which is now used only for first pipe.
  * It is left here if this test ever was wanted to be run on
@@ -624,15 +623,26 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h, lastroundirotation = 0, lastroundjrotation = 0,
+	    lastroundjformat = 0;
 	drmModeModeInfo *mode;
+	bool have_crc; // flag if can use previously logged crc for comparison
+	igt_crc_t crclog[16] = {}; //4 * 4 rotation crc storage for packed formats
+	char *str1, *str2; // for debug printouts
 
-	static const struct {
+	/*
+	* These are those modes which are tested. For testing feel interesting
+	* case with tiling are 2 bpp, 4 bpp and NV12.
+	*/
+	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
+		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
+
+	static struct {
 		igt_rotation_t rotation;
 		float_t width;
 		float_t height;
 		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
 	} planeconfigs[] = {
 	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
 	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
@@ -648,15 +658,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
 	};
 
-	/*
-	* These are those modes which are tested. For testing feel interesting
-	* case with tiling are 2 bpp, 4 bpp and NV12.
-	*/
-	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
-		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
-
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -665,12 +668,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
 		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
 
+		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
+
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
 						  INTEL_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
-			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
 			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
 			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
 			p[0].tiling = planeconfigs[i].tiling;
@@ -680,7 +685,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 				p[0].format = formatlist[k];
 
 				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
-					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
 					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
 					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
 					p[1].tiling = planeconfigs[j].tiling;
@@ -689,7 +693,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 
 					for (l = 0; l < ARRAY_SIZE(formatlist); l++) {
 						p[1].format = formatlist[l];
-
 						/*
 						 * RGB565 90/270 degrees rotation is supported
 						 * from gen11 onwards.
@@ -703,41 +706,123 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     (planeconfigs[j].rotation & (IGT_ROTATION_90 | IGT_ROTATION_270))
 						     && intel_gen(data->devid) < 11)
 							continue;
+						/*
+						 * if using packed formats crc's will be
+						 * same and can store them so there's
+						 * no need to redo comparison image and
+						 * just use stored crc.
+						 */
+						if (p[0].format != DRM_FORMAT_NV12 &&
+						    crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)].frame != 0) {
+							retcrc_sw = crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)];
+							have_crc = true;
+						} else if (p[0].format == DRM_FORMAT_NV12 &&
+							   p[1].format != DRM_FORMAT_NV12 &&
+							   lastroundjformat != DRM_FORMAT_NV12 &&
+							   planeconfigs[i].rotation == lastroundirotation &&
+							   planeconfigs[j].rotation == lastroundjrotation) {
+							/*
+							 * With NV12 can benefit from
+							 * previous crc if rotations
+							 * stay same. If both planes
+							 * have NV12 in use we need to
+							 * skip that case.
+							 * If last round right plane
+							 * had NV12 need to skip this.
+							 */
+							have_crc = true;
+						} else {
+							/*
+							 * here will be created
+							 * comparison image and get crc
+							 * if didn't have stored crc
+							 * or planar format is in use.
+							 * have_crc flag will control
+							 * crc comparison part.
+							 */
+							p[0].rotation_sw = planeconfigs[i].rotation;
+							p[0].rotation_hw = IGT_ROTATION_0;
+							p[1].rotation_sw = planeconfigs[j].rotation;
+							p[1].rotation_hw = IGT_ROTATION_0;
+							if (!setup_multiplane(data,
+									(planeinfos *)&p,
+									&planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+									&planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
+								continue;
+							igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+							flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+							have_crc = false;
+						}
 
-						p[0].rotation_sw = planeconfigs[i].rotation;
-						p[0].rotation_hw = IGT_ROTATION_0;
-						p[1].rotation_sw = planeconfigs[j].rotation;
-						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						/*
+						 * create hw rotated image and
+						 * get vblank where interesting
+						 * crc will be at, grab crc bit later
+						 */
+						p[0].rotation_sw = IGT_ROTATION_0;
+						p[0].rotation_hw = planeconfigs[i].rotation;
+						p[1].rotation_sw = IGT_ROTATION_0;
+						p[1].rotation_hw = planeconfigs[j].rotation;
+
+						if (!setup_multiplane(data,
+								      (planeinfos *)&p,
+								      &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								      &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
-						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
-						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
-							continue;
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						if (!have_crc) {
+							igt_pipe_crc_get_for_frame(data->gfx_fd,
+										   data->pipe_crc,
+										   flipsw,
+										   &retcrc_sw);
+
+							if (p[0].format != DRM_FORMAT_NV12 && p[1].format != DRM_FORMAT_NV12 )
+								crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)]
+								= retcrc_sw;
+						}
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
+
+						str1 = igt_crc_to_string(&retcrc_sw);
+						str2 = igt_crc_to_string(&retcrc_hw);
+
+						igt_debug("crc %.8s vs %.8s -- %.4s - %.4s crc buffered:%s rot1 %d rot2 %d\n",
+							str1, str2,
+							(char*) &p[0].format, (char*) &p[1].format,
+							have_crc?"yes":" no",
+							(int[]) {0, 90, 180, 270}[ctz(planeconfigs[i].rotation)],
+							(int[]) {0, 90, 180, 270}[ctz(planeconfigs[j].rotation)]);
+
+						free(str1);
+						free(str2);
+
 
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
+
+						lastroundjformat = p[1].format;
+						lastroundirotation = planeconfigs[i].rotation;
+						lastroundjrotation = planeconfigs[j].rotation;
 					}
 				}
 			}
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
 
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_fb(p[0].plane, NULL);
+		igt_plane_set_fb(p[1].plane, NULL);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][MULTIPLANE_REFERENCE]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][MULTIPLANE_ROTATED]);
+			}
+		}
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-16 15:34 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-16 15:34 UTC (permalink / raw)
  To: igt-dev

Reduce repetitive work and wait less. Buffer created fbs. Log counted crcs.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 228 +++++++++++++++++++++++++--------------
 1 file changed, 148 insertions(+), 80 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..6e10d6e13 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -522,26 +524,19 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 typedef struct {
 	int32_t x1, y1;
-	uint64_t width, height, tiling, planetype, format;
+	uint64_t width, height, tiling, format;
+	igt_plane_t *plane;
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
-static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+static bool setup_multiplane(data_t *data, planeinfos *planeinfo,
+			     struct igt_fb *fbleft,  struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
-
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
-
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	struct igt_fb *planes[2] = {fbleft, fbright};
+	int c;
 
+	for (c = 0; c < ARRAY_SIZE(planes); c++) {
 		/*
 		 * make plane and fb width and height always divisible by 4
 		 * due to NV12 support and Intel hw workarounds.
@@ -552,34 +547,33 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(planeinfo[c].plane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		/*
+		 * was this hw/sw rotation ran already or need to create
+		 * new fb?
+		 */
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				      planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw,
+				      planes[c], 1.0f);
+		}
+		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
-
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
-	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
+			igt_plane_set_size(planeinfo[c].plane, h, w);
 
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
+		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1,
+				       planeinfo[c].y1);
 
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
+		igt_plane_set_rotation(planeinfo[c].plane,
+				       planeinfo[c].rotation_hw);
+	}
 	return true;
 }
 
@@ -613,6 +607,11 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,
 	}
 }
 
+/*
+ * count trailing zeroes
+ */
+#define ctz __builtin_ctz
+
 /*
  * Here is pipe parameter which is now used only for first pipe.
  * It is left here if this test ever was wanted to be run on
@@ -624,29 +623,10 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h, lastroundirotation = 0, lastroundjrotation = 0;
 	drmModeModeInfo *mode;
-
-	static const struct {
-		igt_rotation_t rotation;
-		float_t width;
-		float_t height;
-		uint64_t tiling;
-	} planeconfigs[] = {
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	};
+	bool have_crc;
+	igt_crc_t crclog[16] = {}; //4 * 4 rotation crc storage for packed formats
 
 	/*
 	* These are those modes which are tested. For testing feel interesting
@@ -655,8 +635,30 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
 		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
+	static struct {
+		const char* txt;
+		igt_rotation_t rotation;
+		float_t width;
+		float_t height;
+		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
+	} planeconfigs[] = {
+	{"rotation 0 modifier none", IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 0 modifier x-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 0 modifier y-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 0 modifier yf-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 90 modifier y-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 90 modifier yf-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 180 modifier none", IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 180 modifier x-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 180 modifier y-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 180 modifier yf-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 270 modifier y-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 270 modifier yf-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	};
+
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -665,12 +667,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
 		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
 
+		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
+
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
 						  INTEL_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
-			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
 			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
 			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
 			p[0].tiling = planeconfigs[i].tiling;
@@ -680,7 +684,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 				p[0].format = formatlist[k];
 
 				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
-					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
 					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
 					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
 					p[1].tiling = planeconfigs[j].tiling;
@@ -704,20 +707,85 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     && intel_gen(data->devid) < 11)
 							continue;
 
-						p[0].rotation_sw = planeconfigs[i].rotation;
-						p[0].rotation_hw = IGT_ROTATION_0;
-						p[1].rotation_sw = planeconfigs[j].rotation;
-						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
-							continue;
+						igt_debug("plane1 %s %.4s plane2 %s %.4s\n",
+							  planeconfigs[i].txt,
+							  (char*) &p[0].format,
+							  planeconfigs[j].txt,
+							  (char*) &p[1].format);
+
+						/*
+						 * if using packed formats crc's will be
+						 * same and can store them so there's
+						 * no need to redo comparison image and
+						 * just use stored crc.
+						 * --
+						 * Only p[0].format can be NV12
+						 */
+						if (p[0].format != DRM_FORMAT_NV12 &&
+						    crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)].frame != 0) {
+							retcrc_sw = crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)];
+							have_crc = true;
+						} else if (p[0].format == DRM_FORMAT_NV12 &&
+							   planeconfigs[i].rotation == lastroundirotation &&
+							   planeconfigs[j].rotation == lastroundjrotation) {
+							/*
+							 * With NV12 can benefit from
+							 * previous crc if rotations
+							 * stay same
+							 */
+							have_crc = true;
+						} else {
+							/*
+							 * here will be created
+							 * comparison image and get crc
+							 * if didn't have stored crc
+							 * or planar format is in use.
+							 * have_crc flag will control
+							 * crc comparison part.
+							 */
+							p[0].rotation_sw = planeconfigs[i].rotation;
+							p[0].rotation_hw = IGT_ROTATION_0;
+							p[1].rotation_sw = planeconfigs[j].rotation;
+							p[1].rotation_hw = IGT_ROTATION_0;
+							if (!setup_multiplane(data,
+									(planeinfos *)&p,
+									&planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+									&planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
+								continue;
+							igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+							flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+							have_crc = false;
+						}
 
-						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
-						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						/*
+						 * create hw rotated image and
+						 * get vblank where interesting
+						 * crc will be at, grab crc bit later
+						 */
+						p[0].rotation_sw = IGT_ROTATION_0;
+						p[0].rotation_hw = lastroundirotation = planeconfigs[i].rotation;
+						p[1].rotation_sw = IGT_ROTATION_0;
+						p[1].rotation_hw = lastroundjrotation = planeconfigs[j].rotation;
+
+						if (!setup_multiplane(data,
+								      (planeinfos *)&p,
+								      &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								      &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						if (!have_crc) {
+							igt_pipe_crc_get_for_frame(data->gfx_fd,
+										   data->pipe_crc,
+										   flipsw,
+										   &retcrc_sw);
+
+							if (p[0].format != DRM_FORMAT_NV12)
+								crclog[ctz(planeconfigs[i].rotation) | (ctz(planeconfigs[j].rotation) << 2)] = retcrc_sw;
+						}
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
 				}
@@ -725,19 +793,19 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
 
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_fb(p[0].plane, NULL);
+		igt_plane_set_fb(p[1].plane, NULL);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][MULTIPLANE_REFERENCE]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][MULTIPLANE_ROTATED]);
+			}
+		}
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-15 15:13 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-15 15:13 UTC (permalink / raw)
  To: igt-dev

reduce repetitive work and wait less

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 153 +++++++++++++++++++++------------------
 1 file changed, 81 insertions(+), 72 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..107d7e0ee 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -522,26 +524,20 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 typedef struct {
 	int32_t x1, y1;
-	uint64_t width, height, tiling, planetype, format;
+	uint64_t width, height, tiling, format;
+	igt_plane_t *plane;
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
 static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+			       planeinfos *planeinfo, struct igt_fb *fbleft,
+			       struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
-
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
-
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	struct igt_fb *planes[2] = {fbleft, fbright};
+	int c;
 
+	for (c = 0; c < ARRAY_SIZE(planes); c++) {
 		/*
 		 * make plane and fb width and height always divisible by 4
 		 * due to NV12 support and Intel hw workarounds.
@@ -552,34 +548,26 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(planeinfo[c].plane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				      planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw,
+				      planes[c], 1.0f);
+		}
+		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
+			igt_plane_set_size(planeinfo[c].plane, h, w);
 
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
+		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1, planeinfo[c].y1);
+		igt_plane_set_rotation(planeinfo[c].plane, planeinfo[c].rotation_hw);
 	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
-
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
 	return true;
 }
 
@@ -624,30 +612,9 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h;
 	drmModeModeInfo *mode;
 
-	static const struct {
-		igt_rotation_t rotation;
-		float_t width;
-		float_t height;
-		uint64_t tiling;
-	} planeconfigs[] = {
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	};
-
 	/*
 	* These are those modes which are tested. For testing feel interesting
 	* case with tiling are 2 bpp, 4 bpp and NV12.
@@ -655,8 +622,30 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
 		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
+	static struct {
+		const char* txt;
+		igt_rotation_t rotation;
+		float_t width;
+		float_t height;
+		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
+	} planeconfigs[] = {
+	{"rotation 0 modifier none", IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 0 modifier x-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 0 modifier y-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 0 modifier yf-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 90 modifier y-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 90 modifier yf-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 180 modifier none", IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 180 modifier x-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 180 modifier y-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 180 modifier yf-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 270 modifier y-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 270 modifier yf-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	};
+
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -665,12 +654,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
 		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
 
+		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
+
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
 						  INTEL_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
-			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
 			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
 			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
 			p[0].tiling = planeconfigs[i].tiling;
@@ -680,7 +671,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 				p[0].format = formatlist[k];
 
 				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
-					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
 					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
 					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
 					p[1].tiling = planeconfigs[j].tiling;
@@ -704,20 +694,39 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     && intel_gen(data->devid) < 11)
 							continue;
 
+						igt_debug("plane1 %s %.4s plane2 %s %.4s\n",
+							  planeconfigs[i].txt,
+							  (char*) &p[0].format,
+							  planeconfigs[j].txt,
+							  (char*) &p[1].format);
+
 						p[0].rotation_sw = planeconfigs[i].rotation;
 						p[0].rotation_hw = IGT_ROTATION_0;
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
 							continue;
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, flipsw, &retcrc_sw);
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
 				}
@@ -725,19 +734,19 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
 
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_fb(p[0].plane, NULL);
+		igt_plane_set_fb(p[1].plane, NULL);
+		igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
 
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][0]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][1]);
+			}
+		}
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-15 14:30 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-15 14:30 UTC (permalink / raw)
  To: igt-dev

reduce repetitive work and wait less

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 152 ++++++++++++++++++++-------------------
 1 file changed, 80 insertions(+), 72 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..ff24afe14 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -522,26 +524,20 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 typedef struct {
 	int32_t x1, y1;
-	uint64_t width, height, tiling, planetype, format;
+	uint64_t width, height, tiling, format;
+	igt_plane_t *plane;
 	igt_rotation_t rotation_sw, rotation_hw;
 } planeinfos;
 
 static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+			       planeinfos *planeinfo, struct igt_fb *fbleft,
+			       struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
-
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
-
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	struct igt_fb *planes[2] = {fbleft, fbright};
+	int c;
 
+	for (c = 0; c < ARRAY_SIZE(planes); c++) {
 		/*
 		 * make plane and fb width and height always divisible by 4
 		 * due to NV12 support and Intel hw workarounds.
@@ -552,34 +548,26 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(planeinfo[c].plane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				      planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw,
+				      planes[c], 1.0f);
+		}
+		igt_plane_set_fb(planeinfo[c].plane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
+			igt_plane_set_size(planeinfo[c].plane, h, w);
 
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
+		igt_plane_set_position(planeinfo[c].plane, planeinfo[c].x1, planeinfo[c].y1);
+		igt_plane_set_rotation(planeinfo[c].plane, planeinfo[c].rotation_hw);
 	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
-
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
 	return true;
 }
 
@@ -624,30 +612,9 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h;
 	drmModeModeInfo *mode;
 
-	static const struct {
-		igt_rotation_t rotation;
-		float_t width;
-		float_t height;
-		uint64_t tiling;
-	} planeconfigs[] = {
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	};
-
 	/*
 	* These are those modes which are tested. For testing feel interesting
 	* case with tiling are 2 bpp, 4 bpp and NV12.
@@ -655,8 +622,30 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
 		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
+	static struct {
+		const char* txt;
+		igt_rotation_t rotation;
+		float_t width;
+		float_t height;
+		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
+	} planeconfigs[] = {
+	{"rotation 0 modifier none", IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 0 modifier x-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 0 modifier y-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 0 modifier yf-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 90 modifier y-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 90 modifier yf-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 180 modifier none", IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 180 modifier x-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 180 modifier y-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 180 modifier yf-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 270 modifier y-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 270 modifier yf-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	};
+
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -665,12 +654,14 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		used_w = min(TEST_MAX_WIDTH, mode->hdisplay);
 		used_h = min(TEST_MAX_HEIGHT, mode->vdisplay);
 
+		p[0].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
+
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
 						  INTEL_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
-			p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
 			p[0].width = (uint64_t)(planeconfigs[i].width * used_w);
 			p[0].height = (uint64_t)(planeconfigs[i].height * used_h);
 			p[0].tiling = planeconfigs[i].tiling;
@@ -680,7 +671,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 				p[0].format = formatlist[k];
 
 				for (j = 0; j < ARRAY_SIZE(planeconfigs); j++) {
-					p[1].planetype = DRM_PLANE_TYPE_OVERLAY;
 					p[1].width = (uint64_t)(planeconfigs[j].width * used_w);
 					p[1].height = (uint64_t)(planeconfigs[j].height * used_h);
 					p[1].tiling = planeconfigs[j].tiling;
@@ -704,20 +694,39 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     && intel_gen(data->devid) < 11)
 							continue;
 
+						igt_debug("plane1 %s %.4s plane2 %s %.4s\n",
+							  planeconfigs[i].txt,
+							  (char*) &p[0].format,
+							  planeconfigs[j].txt,
+							  (char*) &p[1].format);
+
 						p[0].rotation_sw = planeconfigs[i].rotation;
 						p[0].rotation_hw = IGT_ROTATION_0;
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
 							continue;
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
+						igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, flipsw, &retcrc_sw);
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
 				}
@@ -725,19 +734,18 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
-		igt_output_set_pipe(output, PIPE_ANY);
-	}
 
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
+		igt_plane_set_fb(p[0].plane, NULL);
+		igt_plane_set_fb(p[1].plane, NULL);
 
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][0]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][1]);
+			}
+		}
+		igt_output_set_pipe(output, PIPE_NONE);
+	}
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-14 12:25 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-14 12:25 UTC (permalink / raw)
  To: igt-dev

reduce repetitive work and wait less

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 141 ++++++++++++++++++++-------------------
 1 file changed, 74 insertions(+), 67 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..5bff6ea64 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -527,20 +529,18 @@ typedef struct {
 } planeinfos;
 
 static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+			       planeinfos *planeinfo,
+			       struct igt_fb *fbleft, struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
+	struct igt_fb *planes[2] = {fbleft, fbright};
 
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
+	int c;
 
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	for (c = 0; c < MAXMULTIPLANESAMOUNT; c++) {
+		igt_plane_t *lplane;
+		lplane = igt_output_get_plane_type(output,
+						   planeinfo[c].planetype);
 
 		/*
 		 * make plane and fb width and height always divisible by 4
@@ -552,34 +552,25 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(lplane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw, planes[c], 1.0f);
+		}
+		igt_plane_set_fb(lplane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
+			igt_plane_set_size(lplane, h, w);
 
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
+		igt_plane_set_position(lplane, planeinfo[c].x1, planeinfo[c].y1);
+		igt_plane_set_rotation(lplane, planeinfo[c].rotation_hw);
 	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
-
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
 	return true;
 }
 
@@ -624,30 +615,9 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h;
 	drmModeModeInfo *mode;
 
-	static const struct {
-		igt_rotation_t rotation;
-		float_t width;
-		float_t height;
-		uint64_t tiling;
-	} planeconfigs[] = {
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	};
-
 	/*
 	* These are those modes which are tested. For testing feel interesting
 	* case with tiling are 2 bpp, 4 bpp and NV12.
@@ -655,8 +625,30 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
 		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
+	static struct {
+		const char* txt;
+		igt_rotation_t rotation;
+		float_t width;
+		float_t height;
+		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
+	} planeconfigs[] = {
+	{"rotation 0 modifier none", IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 0 modifier x-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 0 modifier y-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 0 modifier yf-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 90 modifier y-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 90 modifier yf-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 180 modifier none", IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE},
+	{"rotation 180 modifier x-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED},
+	{"rotation 180 modifier y-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 180 modifier yf-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	{"rotation 270 modifier y-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED},
+	{"rotation 270 modifier yf-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED},
+	};
+
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -704,20 +696,39 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						     && intel_gen(data->devid) < 11)
 							continue;
 
+						igt_debug("plane1 %s %.4s plane2 %s %.4s\n",
+							  planeconfigs[i].txt,
+							  (char*) &p[0].format,
+							  planeconfigs[j].txt,
+							  (char*) &p[1].format);
+
 						p[0].rotation_sw = planeconfigs[i].rotation;
 						p[0].rotation_hw = IGT_ROTATION_0;
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
 							continue;
+						igt_display_commit_atomic(display, 0, NULL);
+						flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
+						igt_display_commit_atomic(display, 0, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, flipsw, &retcrc_sw);
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
 				}
@@ -725,19 +736,15 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
+
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][0]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][1]);
+			}
+		}
 		igt_output_set_pipe(output, PIPE_ANY);
 	}
-
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests
@ 2021-02-13 21:52 Juha-Pekka Heikkila
  0 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-13 21:52 UTC (permalink / raw)
  To: igt-dev

reduce repetitive work and wait less

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_rotation_crc.c | 141 ++++++++++++++++++++-------------------
 1 file changed, 74 insertions(+), 67 deletions(-)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 6d4e87ed9..8f0a38a75 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -31,6 +31,8 @@
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
 #define MAX_TESTED_MODES 8
+#define MULTIPLANE_REFERENCE 0
+#define MULTIPLANE_ROTATED 1
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -527,20 +529,18 @@ typedef struct {
 } planeinfos;
 
 static bool get_multiplane_crc(data_t *data, igt_output_t *output,
-			       igt_crc_t *crc_output, planeinfos *planeinfo,
-			       int numplanes)
+			       planeinfos *planeinfo,
+			       struct igt_fb *fbleft, struct igt_fb *fbright)
 {
 	uint32_t w, h;
-	igt_display_t *display = &data->display;
-	struct p_struct *planes, *oldplanes;
-	int c, ret;
+	struct igt_fb *planes[2] = {fbleft, fbright};
 
-	oldplanes = data->multiplaneoldview;
-	planes = calloc(sizeof(*planes), numplanes);
+	int c;
 
-	for (c = 0; c < numplanes; c++) {
-		planes[c].plane = igt_output_get_plane_type(output,
-							    planeinfo[c].planetype);
+	for (c = 0; c < MAXMULTIPLANESAMOUNT; c++) {
+		igt_plane_t *lplane;
+		lplane = igt_output_get_plane_type(output,
+						   planeinfo[c].planetype);
 
 		/*
 		 * make plane and fb width and height always divisible by 4
@@ -552,34 +552,25 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
 		if (planeinfo[c].rotation_sw & (IGT_ROTATION_90 | IGT_ROTATION_270))
 			igt_swap(w, h);
 
-		if (!igt_plane_has_format_mod(planes[c].plane,
+		if (!igt_plane_has_format_mod(lplane,
 					      planeinfo[c].format,
 					      planeinfo[c].tiling))
 			return false;
 
-		igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
-			      planeinfo[c].tiling, &planes[c].fb);
+		if (planes[c]->fb_id == 0) {
+			igt_create_fb(data->gfx_fd, w, h, planeinfo[c].format,
+				planeinfo[c].tiling, planes[c]);
 
-		paint_squares(data, planeinfo[c].rotation_sw, &planes[c].fb, 1.0f);
-		igt_plane_set_fb(planes[c].plane, &planes[c].fb);
+			paint_squares(data, planeinfo[c].rotation_sw, planes[c], 1.0f);
+		}
+		igt_plane_set_fb(lplane, planes[c]);
 
 		if (planeinfo[c].rotation_hw & (IGT_ROTATION_90 | IGT_ROTATION_270))
-			igt_plane_set_size(planes[c].plane, h, w);
+			igt_plane_set_size(lplane, h, w);
 
-		igt_plane_set_position(planes[c].plane, planeinfo[c].x1, planeinfo[c].y1);
-		igt_plane_set_rotation(planes[c].plane, planeinfo[c].rotation_hw);
+		igt_plane_set_position(lplane, planeinfo[c].x1, planeinfo[c].y1);
+		igt_plane_set_rotation(lplane, planeinfo[c].rotation_hw);
 	}
-
-	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
-	igt_assert_eq(ret, 0);
-
-	igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
-
-	for (c = 0; c < numplanes && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = (void*)planes;
 	return true;
 }
 
@@ -624,30 +615,9 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	igt_output_t *output;
 	igt_crc_t retcrc_sw, retcrc_hw;
 	planeinfos p[2];
-	int c, used_w, used_h;
-	struct p_struct *oldplanes;
+	int used_w, used_h;
 	drmModeModeInfo *mode;
 
-	static const struct {
-		igt_rotation_t rotation;
-		float_t width;
-		float_t height;
-		uint64_t tiling;
-	} planeconfigs[] = {
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED },
-	{IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED },
-	};
-
 	/*
 	* These are those modes which are tested. For testing feel interesting
 	* case with tiling are 2 bpp, 4 bpp and NV12.
@@ -655,8 +625,30 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	static const uint32_t formatlist[] = {DRM_FORMAT_RGB565,
 		DRM_FORMAT_XRGB8888, DRM_FORMAT_NV12};
 
+	static struct {
+		const char* txt;
+		igt_rotation_t rotation;
+		float_t width;
+		float_t height;
+		uint64_t tiling;
+		struct igt_fb fbs[ARRAY_SIZE(formatlist)][2];
+	} planeconfigs[] = {
+	{"rotation 0 modifier none", IGT_ROTATION_0, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE, {{},{}}},
+	{"rotation 0 modifier x-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED, {{},{}}},
+	{"rotation 0 modifier y-tile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED, {{},{}}},
+	{"rotation 0 modifier y-ftile", IGT_ROTATION_0, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED, {{},{}}},
+	{"rotation 90 modifier yt-ile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED, {{},{}}},
+	{"rotation 90 modifier yf-tile", IGT_ROTATION_90, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED, {{},{}}},
+	{"rotation 180 modifier none", IGT_ROTATION_180, .2f, .4f, LOCAL_DRM_FORMAT_MOD_NONE, {{},{}}},
+	{"rotation 180 modifier x-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_X_TILED, {{},{}}},
+	{"rotation 180 modifier y-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED, {{},{}}},
+	{"rotation 180 modifier yf-tile", IGT_ROTATION_180, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED, {{},{}}},
+	{"rotation 270 modifier y-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Y_TILED, {{},{}}},
+	{"rotation 270 modifier yf-tile", IGT_ROTATION_270, .2f, .4f, LOCAL_I915_FORMAT_MOD_Yf_TILED, {{},{}}},
+	};
+
 	for_each_valid_output_on_pipe(display, pipe, output) {
-		int i, j, k, l;
+		int i, j, k, l, flipsw, fliphw;
 		igt_output_set_pipe(output, pipe);
 		mode = igt_output_get_mode(output);
 		igt_display_require_output(display);
@@ -688,6 +680,12 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						      mode, 1);
 
 					for (l = 0; l < ARRAY_SIZE(formatlist); l++) {
+						igt_debug("plane1 %s %.4s plane2 %s %.4s\n",
+							  planeconfigs[i].txt,
+							  (char*) &formatlist[k],
+							  planeconfigs[j].txt,
+							  (char*) &formatlist[l]);
+
 						p[1].format = formatlist[l];
 
 						/*
@@ -708,16 +706,29 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 						p[0].rotation_hw = IGT_ROTATION_0;
 						p[1].rotation_sw = planeconfigs[j].rotation;
 						p[1].rotation_hw = IGT_ROTATION_0;
-						if (!get_multiplane_crc(data, output, &retcrc_sw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_REFERENCE],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_REFERENCE]))
 							continue;
+						igt_display_commit_atomic(display, 0, NULL);
+						flipsw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
 
 						igt_swap(p[0].rotation_sw, p[0].rotation_hw);
 						igt_swap(p[1].rotation_sw, p[1].rotation_hw);
-						if (!get_multiplane_crc(data, output, &retcrc_hw,
-								   (planeinfos *)&p, MAXMULTIPLANESAMOUNT))
+
+						if (!get_multiplane_crc(data, output,
+								   (planeinfos *)&p,
+								   &planeconfigs[i].fbs[k][MULTIPLANE_ROTATED],
+								   &planeconfigs[j].fbs[l][MULTIPLANE_ROTATED]))
 							continue;
 
+						igt_display_commit_atomic(display, 0, NULL);
+						fliphw = kmstest_get_vblank(data->gfx_fd, pipe, 0) + 1;
+
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, flipsw, &retcrc_sw);
+						igt_pipe_crc_get_for_frame(data->gfx_fd, data->pipe_crc, fliphw, &retcrc_hw);
 						igt_assert_crc_equal(&retcrc_sw, &retcrc_hw);
 					}
 				}
@@ -725,19 +736,15 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		}
 		igt_pipe_crc_stop(data->pipe_crc);
 		igt_pipe_crc_free(data->pipe_crc);
+
+		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
+			for  (j = 0; j < ARRAY_SIZE(formatlist); j++) {
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][0]);
+				igt_remove_fb(data->gfx_fd, &planeconfigs[i].fbs[j][1]);
+			}
+		}
 		igt_output_set_pipe(output, PIPE_ANY);
 	}
-
-	/*
-	* Old fbs are deleted only after new ones are set on planes.
-	* This is done to speed up the test
-	*/
-	oldplanes = data->multiplaneoldview;
-	for (c = 0; c < MAXMULTIPLANESAMOUNT && oldplanes; c++)
-		igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
-
-	free(oldplanes);
-	data->multiplaneoldview = NULL;
 	data->pipe_crc = NULL;
 }
 
-- 
2.28.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2021-03-02 11:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 20:35 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
2021-02-14 20:35 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
2021-02-14 21:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Patchwork
2021-02-14 22:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-02-18 16:14 [igt-dev] [PATCH i-g-t 1/2] " Juha-Pekka Heikkila
2021-03-02 11:13 ` Karthik B S
2021-02-17 20:12 Juha-Pekka Heikkila
2021-02-17 16:03 Juha-Pekka Heikkila
2021-02-16 15:34 Juha-Pekka Heikkila
2021-02-15 15:13 Juha-Pekka Heikkila
2021-02-15 14:30 Juha-Pekka Heikkila
2021-02-14 12:25 Juha-Pekka Heikkila
2021-02-13 21:52 Juha-Pekka Heikkila

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.