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-15 14:30 Juha-Pekka Heikkila
  2021-02-15 14:30 ` [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-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 2/2] HAX remove rotation test from blacklist
  2021-02-15 14:30 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
@ 2021-02-15 14:30 ` Juha-Pekka Heikkila
  2021-02-15 15:25 ` [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-15 16:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 13+ messages in thread
From: Juha-Pekka Heikkila @ 2021-02-15 14:30 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-15 14:30 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
  2021-02-15 14:30 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
@ 2021-02-15 15:25 ` Patchwork
  2021-02-15 16:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  2 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2021-02-15 15:25 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev


[-- Attachment #1.1: Type: text/plain, Size: 2821 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/87097/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9776 -> IGTPW_5509
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@prime_vgem@basic-fence-flip:
    - fi-tgl-y:           [PASS][1] -> [DMESG-WARN][2] ([i915#402]) +2 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/fi-tgl-y/igt@prime_vgem@basic-fence-flip.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/fi-tgl-y/igt@prime_vgem@basic-fence-flip.html

  
#### Possible fixes ####

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

  * igt@gem_exec_suspend@basic-s0:
    - fi-tgl-u2:          [FAIL][5] ([i915#1888]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-7500u:       [DMESG-WARN][7] ([i915#2605]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/fi-kbl-7500u/igt@i915_pm_rpm@module-reload.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/fi-kbl-7500u/igt@i915_pm_rpm@module-reload.html

  
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2605]: https://gitlab.freedesktop.org/drm/intel/issues/2605
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402


Participating hosts (44 -> 37)
------------------------------

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


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

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

  CI-20190529: 20190529
  CI_DRM_9776: 1d63cb5a7f02df241021731ce1ed8de3e3379bef @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_5509: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/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_5509/index.html

[-- Attachment #1.2: Type: text/html, Size: 3566 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-15 14:30 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
  2021-02-15 14:30 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
  2021-02-15 15:25 ` [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-15 16:53 ` Patchwork
  2 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2021-02-15 16:53 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/87097/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9776_full -> IGTPW_5509_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_param@set-priority-not-supported:
    - shard-tglb:         NOTRUN -> [SKIP][1] ([fdo#109314])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb7/igt@gem_ctx_param@set-priority-not-supported.html
    - shard-iclb:         NOTRUN -> [SKIP][2] ([fdo#109314])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb2/igt@gem_ctx_param@set-priority-not-supported.html

  * igt@gem_ctx_persistence@engines-mixed:
    - shard-hsw:          NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#1099])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-hsw2/igt@gem_ctx_persistence@engines-mixed.html
    - shard-snb:          NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#1099])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-snb7/igt@gem_ctx_persistence@engines-mixed.html

  * igt@gem_exec_fair@basic-none@vcs1:
    - shard-iclb:         NOTRUN -> [FAIL][5] ([i915#2842])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb1/igt@gem_exec_fair@basic-none@vcs1.html
    - shard-kbl:          [PASS][6] -> [FAIL][7] ([i915#2842]) +1 similar issue
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-kbl7/igt@gem_exec_fair@basic-none@vcs1.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl7/igt@gem_exec_fair@basic-none@vcs1.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [PASS][8] -> [FAIL][9] ([i915#2842])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-tglb3/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb5/igt@gem_exec_fair@basic-pace-share@rcs0.html

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

  * igt@gem_exec_reloc@basic-wide-active@bcs0:
    - shard-glk:          NOTRUN -> [FAIL][11] ([i915#2389]) +3 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk9/igt@gem_exec_reloc@basic-wide-active@bcs0.html
    - shard-tglb:         NOTRUN -> [FAIL][12] ([i915#2389]) +4 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb2/igt@gem_exec_reloc@basic-wide-active@bcs0.html

  * igt@gem_exec_reloc@basic-wide-active@rcs0:
    - shard-iclb:         NOTRUN -> [FAIL][13] ([i915#2389]) +3 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb6/igt@gem_exec_reloc@basic-wide-active@rcs0.html

  * igt@gem_exec_schedule@u-fairslice@bcs0:
    - shard-glk:          [PASS][14] -> [DMESG-WARN][15] ([i915#1610] / [i915#2803])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-glk2/igt@gem_exec_schedule@u-fairslice@bcs0.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk2/igt@gem_exec_schedule@u-fairslice@bcs0.html

  * igt@gen7_exec_parse@basic-offset:
    - shard-apl:          NOTRUN -> [SKIP][16] ([fdo#109271]) +62 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl1/igt@gen7_exec_parse@basic-offset.html
    - shard-tglb:         NOTRUN -> [SKIP][17] ([fdo#109289]) +2 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb5/igt@gen7_exec_parse@basic-offset.html

  * igt@gen9_exec_parse@bb-secure:
    - shard-tglb:         NOTRUN -> [SKIP][18] ([fdo#112306]) +1 similar issue
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb3/igt@gen9_exec_parse@bb-secure.html
    - shard-iclb:         NOTRUN -> [SKIP][19] ([fdo#112306])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb1/igt@gen9_exec_parse@bb-secure.html

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

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

  * igt@i915_pm_rpm@gem-execbuf-stress-pc8:
    - shard-iclb:         NOTRUN -> [SKIP][23] ([fdo#109293] / [fdo#109506])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb5/igt@i915_pm_rpm@gem-execbuf-stress-pc8.html

  * igt@kms_big_fb@linear-8bpp-rotate-90:
    - shard-glk:          NOTRUN -> [SKIP][24] ([fdo#109271]) +44 similar issues
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk6/igt@kms_big_fb@linear-8bpp-rotate-90.html
    - shard-tglb:         NOTRUN -> [SKIP][25] ([fdo#111614]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb1/igt@kms_big_fb@linear-8bpp-rotate-90.html

  * igt@kms_big_fb@x-tiled-32bpp-rotate-270:
    - shard-iclb:         NOTRUN -> [SKIP][26] ([fdo#110725] / [fdo#111614]) +2 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb5/igt@kms_big_fb@x-tiled-32bpp-rotate-270.html

  * igt@kms_big_joiner@basic:
    - shard-tglb:         NOTRUN -> [SKIP][27] ([i915#2705])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb6/igt@kms_big_joiner@basic.html
    - shard-kbl:          NOTRUN -> [SKIP][28] ([fdo#109271] / [i915#2705]) +1 similar issue
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl2/igt@kms_big_joiner@basic.html
    - shard-iclb:         NOTRUN -> [SKIP][29] ([i915#2705])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb7/igt@kms_big_joiner@basic.html
    - shard-glk:          NOTRUN -> [SKIP][30] ([fdo#109271] / [i915#2705])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk1/igt@kms_big_joiner@basic.html
    - shard-apl:          NOTRUN -> [SKIP][31] ([fdo#109271] / [i915#2705]) +1 similar issue
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl3/igt@kms_big_joiner@basic.html

  * igt@kms_chamelium@vga-hpd:
    - shard-apl:          NOTRUN -> [SKIP][32] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl7/igt@kms_chamelium@vga-hpd.html
    - shard-tglb:         NOTRUN -> [SKIP][33] ([fdo#109284] / [fdo#111827]) +5 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb8/igt@kms_chamelium@vga-hpd.html

  * igt@kms_color@pipe-a-degamma:
    - shard-tglb:         NOTRUN -> [FAIL][34] ([i915#1149])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb1/igt@kms_color@pipe-a-degamma.html
    - shard-iclb:         NOTRUN -> [FAIL][35] ([i915#1149])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb3/igt@kms_color@pipe-a-degamma.html

  * igt@kms_color@pipe-b-ctm-0-25:
    - shard-iclb:         NOTRUN -> [FAIL][36] ([i915#1149] / [i915#315])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb5/igt@kms_color@pipe-b-ctm-0-25.html
    - shard-tglb:         NOTRUN -> [FAIL][37] ([i915#1149] / [i915#315])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb6/igt@kms_color@pipe-b-ctm-0-25.html

  * igt@kms_color@pipe-c-legacy-gamma-reset:
    - shard-kbl:          [PASS][38] -> [FAIL][39] ([i915#2964])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-kbl4/igt@kms_color@pipe-c-legacy-gamma-reset.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl2/igt@kms_color@pipe-c-legacy-gamma-reset.html
    - shard-apl:          [PASS][40] -> [FAIL][41] ([i915#2964])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-apl4/igt@kms_color@pipe-c-legacy-gamma-reset.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl2/igt@kms_color@pipe-c-legacy-gamma-reset.html
    - shard-glk:          [PASS][42] -> [FAIL][43] ([i915#2964])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-glk2/igt@kms_color@pipe-c-legacy-gamma-reset.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk4/igt@kms_color@pipe-c-legacy-gamma-reset.html
    - shard-hsw:          [PASS][44] -> [FAIL][45] ([i915#2964])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-hsw1/igt@kms_color@pipe-c-legacy-gamma-reset.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-hsw7/igt@kms_color@pipe-c-legacy-gamma-reset.html

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

  * igt@kms_color_chamelium@pipe-a-ctm-red-to-blue:
    - shard-iclb:         NOTRUN -> [SKIP][47] ([fdo#109284] / [fdo#111827]) +6 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb5/igt@kms_color_chamelium@pipe-a-ctm-red-to-blue.html

  * igt@kms_color_chamelium@pipe-c-ctm-limited-range:
    - shard-hsw:          NOTRUN -> [SKIP][48] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-hsw1/igt@kms_color_chamelium@pipe-c-ctm-limited-range.html
    - shard-kbl:          NOTRUN -> [SKIP][49] ([fdo#109271] / [fdo#111827]) +3 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl6/igt@kms_color_chamelium@pipe-c-ctm-limited-range.html

  * igt@kms_color_chamelium@pipe-d-degamma:
    - shard-glk:          NOTRUN -> [SKIP][50] ([fdo#109271] / [fdo#111827]) +4 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk6/igt@kms_color_chamelium@pipe-d-degamma.html
    - shard-snb:          NOTRUN -> [SKIP][51] ([fdo#109271] / [fdo#111827])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-snb5/igt@kms_color_chamelium@pipe-d-degamma.html
    - shard-iclb:         NOTRUN -> [SKIP][52] ([fdo#109278] / [fdo#109284] / [fdo#111827])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb3/igt@kms_color_chamelium@pipe-d-degamma.html

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

  * igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque:
    - shard-kbl:          [PASS][54] -> [FAIL][55] ([i915#54])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-kbl4/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
    - shard-apl:          [PASS][56] -> [FAIL][57] ([i915#54])
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-apl4/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl8/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html

  * igt@kms_cursor_crc@pipe-b-cursor-512x512-random:
    - shard-kbl:          NOTRUN -> [SKIP][58] ([fdo#109271]) +44 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl7/igt@kms_cursor_crc@pipe-b-cursor-512x512-random.html
    - shard-iclb:         NOTRUN -> [SKIP][59] ([fdo#109278] / [fdo#109279]) +2 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb1/igt@kms_cursor_crc@pipe-b-cursor-512x512-random.html

  * igt@kms_cursor_crc@pipe-b-cursor-size-change:
    - shard-glk:          [PASS][60] -> [FAIL][61] ([i915#54])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-glk6/igt@kms_cursor_crc@pipe-b-cursor-size-change.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk6/igt@kms_cursor_crc@pipe-b-cursor-size-change.html

  * igt@kms_cursor_crc@pipe-c-cursor-512x512-random:
    - shard-tglb:         NOTRUN -> [SKIP][62] ([fdo#109279]) +1 similar issue
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb8/igt@kms_cursor_crc@pipe-c-cursor-512x512-random.html

  * igt@kms_cursor_crc@pipe-d-cursor-256x85-onscreen:
    - shard-iclb:         NOTRUN -> [SKIP][63] ([fdo#109278]) +16 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb7/igt@kms_cursor_crc@pipe-d-cursor-256x85-onscreen.html

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

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
    - shard-iclb:         NOTRUN -> [SKIP][65] ([fdo#109274] / [fdo#109278]) +2 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb8/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html

  * igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size:
    - shard-hsw:          [PASS][66] -> [FAIL][67] ([i915#2370])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-hsw4/igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-hsw1/igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size.html

  * igt@kms_cursor_legacy@pipe-d-torture-bo:
    - shard-kbl:          NOTRUN -> [SKIP][68] ([fdo#109271] / [i915#533])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl1/igt@kms_cursor_legacy@pipe-d-torture-bo.html
    - shard-glk:          NOTRUN -> [SKIP][69] ([fdo#109271] / [i915#533])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk1/igt@kms_cursor_legacy@pipe-d-torture-bo.html

  * igt@kms_flip@2x-blocking-wf_vblank:
    - shard-iclb:         NOTRUN -> [SKIP][70] ([fdo#109274]) +3 similar issues
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb4/igt@kms_flip@2x-blocking-wf_vblank.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2:
    - shard-glk:          NOTRUN -> [FAIL][71] ([i915#79])
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk2/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html

  * igt@kms_flip@flip-vs-suspend-interruptible@b-dp1:
    - shard-kbl:          [PASS][72] -> [DMESG-WARN][73] ([i915#180])
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-kbl7/igt@kms_flip@flip-vs-suspend-interruptible@b-dp1.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl7/igt@kms_flip@flip-vs-suspend-interruptible@b-dp1.html

  * igt@kms_flip@flip-vs-suspend-interruptible@c-dp1:
    - shard-apl:          [PASS][74] -> [DMESG-WARN][75] ([i915#180]) +1 similar issue
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-apl4/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl2/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html

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

  * igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile:
    - shard-kbl:          NOTRUN -> [SKIP][77] ([fdo#109271] / [i915#2642])
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl7/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile.html

  * igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile:
    - shard-apl:          NOTRUN -> [FAIL][78] ([i915#2641])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl2/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-16bpp-ytile.html

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

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-render:
    - shard-snb:          NOTRUN -> [SKIP][80] ([fdo#109271]) +37 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-snb5/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][81] ([fdo#109280]) +16 similar issues
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb4/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-pgflip-blt.html

  * igt@kms_frontbuffer_tracking@fbc-2p-shrfb-fliptrack:
    - shard-tglb:         NOTRUN -> [SKIP][82] ([fdo#111825]) +22 similar issues
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb7/igt@kms_frontbuffer_tracking@fbc-2p-shrfb-fliptrack.html

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

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

  * igt@kms_pipe_crc_basic@read-crc-pipe-d-frame-sequence:
    - shard-apl:          NOTRUN -> [SKIP][85] ([fdo#109271] / [i915#533])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl1/igt@kms_pipe_crc_basic@read-crc-pipe-d-frame-sequence.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-apl:          NOTRUN -> [FAIL][86] ([fdo#108145] / [i915#265]) +1 similar issue
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl2/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
    - shard-glk:          NOTRUN -> [FAIL][87] ([fdo#108145] / [i915#265])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk4/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html
    - shard-kbl:          NOTRUN -> [FAIL][88] ([fdo#108145] / [i915#265])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl2/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html

  * igt@kms_prime@basic-crc@first-to-second:
    - shard-iclb:         NOTRUN -> [SKIP][89] ([i915#1836])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb4/igt@kms_prime@basic-crc@first-to-second.html
    - shard-tglb:         NOTRUN -> [SKIP][90] ([i915#1836])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb2/igt@kms_prime@basic-crc@first-to-second.html

  * igt@kms_psr2_sf@cursor-plane-update-sf:
    - shard-tglb:         NOTRUN -> [SKIP][91] ([i915#2920]) +1 similar issue
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb8/igt@kms_psr2_sf@cursor-plane-update-sf.html
    - shard-iclb:         NOTRUN -> [SKIP][92] ([i915#658]) +1 similar issue
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb1/igt@kms_psr2_sf@cursor-plane-update-sf.html
    - shard-kbl:          NOTRUN -> [SKIP][93] ([fdo#109271] / [i915#658])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl1/igt@kms_psr2_sf@cursor-plane-update-sf.html

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

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [PASS][96] -> [SKIP][97] ([fdo#109441]) +2 similar issues
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb4/igt@kms_psr@psr2_primary_page_flip.html

  * igt@kms_psr@psr2_sprite_plane_onoff:
    - shard-hsw:          NOTRUN -> [SKIP][98] ([fdo#109271] / [i915#1072])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-hsw7/igt@kms_psr@psr2_sprite_plane_onoff.html
    - shard-iclb:         NOTRUN -> [SKIP][99] ([fdo#109441])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb4/igt@kms_psr@psr2_sprite_plane_onoff.html

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

  * igt@nouveau_crc@pipe-b-source-outp-inactive:
    - shard-iclb:         NOTRUN -> [SKIP][101] ([i915#2530]) +2 similar issues
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb6/igt@nouveau_crc@pipe-b-source-outp-inactive.html

  * igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame:
    - shard-tglb:         NOTRUN -> [SKIP][102] ([i915#2530]) +1 similar issue
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb7/igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame.html

  * igt@prime_nv_api@nv_i915_import_twice_check_flink_name:
    - shard-iclb:         NOTRUN -> [SKIP][103] ([fdo#109291]) +1 similar issue
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb2/igt@prime_nv_api@nv_i915_import_twice_check_flink_name.html
    - shard-tglb:         NOTRUN -> [SKIP][104] ([fdo#109291]) +1 similar issue
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb3/igt@prime_nv_api@nv_i915_import_twice_check_flink_name.html

  
#### Possible fixes ####

  * igt@gem_exec_fair@basic-none@rcs0:
    - shard-glk:          [FAIL][105] ([i915#2842]) -> [PASS][106] +2 similar issues
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-glk7/igt@gem_exec_fair@basic-none@rcs0.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk6/igt@gem_exec_fair@basic-none@rcs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-iclb:         [FAIL][107] ([i915#2842]) -> [PASS][108]
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb8/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fair@basic-pace@bcs0:
    - shard-tglb:         [FAIL][109] ([i915#2842]) -> [PASS][110] +2 similar issues
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-tglb1/igt@gem_exec_fair@basic-pace@bcs0.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb6/igt@gem_exec_fair@basic-pace@bcs0.html

  * igt@gem_exec_reloc@basic-many-active@rcs0:
    - shard-glk:          [FAIL][111] ([i915#2389]) -> [PASS][112]
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-glk2/igt@gem_exec_reloc@basic-many-active@rcs0.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk7/igt@gem_exec_reloc@basic-many-active@rcs0.html

  * igt@gem_exec_schedule@u-fairslice-all:
    - shard-iclb:         [DMESG-WARN][113] ([i915#2803]) -> [PASS][114]
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb4/igt@gem_exec_schedule@u-fairslice-all.html
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb1/igt@gem_exec_schedule@u-fairslice-all.html

  * igt@gem_exec_schedule@u-fairslice@vcs1:
    - shard-tglb:         [DMESG-WARN][115] ([i915#2803]) -> [PASS][116]
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-tglb2/igt@gem_exec_schedule@u-fairslice@vcs1.html
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb1/igt@gem_exec_schedule@u-fairslice@vcs1.html

  * igt@i915_pm_rc6_residency@rc6-fence:
    - shard-tglb:         [WARN][117] ([i915#2681]) -> [PASS][118]
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-tglb1/igt@i915_pm_rc6_residency@rc6-fence.html
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb6/igt@i915_pm_rc6_residency@rc6-fence.html
    - shard-iclb:         [WARN][119] ([i915#1804] / [i915#2684]) -> [PASS][120]
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb6/igt@i915_pm_rc6_residency@rc6-fence.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb5/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-hsw:          [WARN][121] ([i915#1519]) -> [PASS][122] +1 similar issue
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-hsw5/igt@i915_pm_rc6_residency@rc6-idle.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-hsw4/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@i915_suspend@fence-restore-untiled:
    - shard-kbl:          [DMESG-WARN][123] ([i915#180]) -> [PASS][124]
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-kbl3/igt@i915_suspend@fence-restore-untiled.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl1/igt@i915_suspend@fence-restore-untiled.html

  * igt@kms_async_flips@test-time-stamp:
    - shard-tglb:         [FAIL][125] ([i915#2574]) -> [PASS][126]
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-tglb6/igt@kms_async_flips@test-time-stamp.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb2/igt@kms_async_flips@test-time-stamp.html

  * igt@kms_fbcon_fbt@fbc-suspend:
    - shard-kbl:          [INCOMPLETE][127] ([i915#155] / [i915#180] / [i915#636]) -> [PASS][128]
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-kbl3/igt@kms_fbcon_fbt@fbc-suspend.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-kbl1/igt@kms_fbcon_fbt@fbc-suspend.html

  * igt@kms_psr@psr2_sprite_blt:
    - shard-iclb:         [SKIP][129] ([fdo#109441]) -> [PASS][130] +1 similar issue
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb6/igt@kms_psr@psr2_sprite_blt.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html

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

  * igt@perf_pmu@rc6-suspend:
    - shard-apl:          [DMESG-WARN][133] ([i915#180]) -> [PASS][134]
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-apl4/igt@perf_pmu@rc6-suspend.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-apl6/igt@perf_pmu@rc6-suspend.html

  * igt@sysfs_clients@recycle:
    - shard-snb:          [FAIL][135] ([i915#3028]) -> [PASS][136]
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-snb4/igt@sysfs_clients@recycle.html
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-snb7/igt@sysfs_clients@recycle.html

  * {igt@sysfs_clients@recycle-many}:
    - shard-tglb:         [FAIL][137] ([i915#3028]) -> [PASS][138]
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-tglb2/igt@sysfs_clients@recycle-many.html
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-tglb8/igt@sysfs_clients@recycle-many.html

  * igt@sysfs_clients@sema-10@vcs0:
    - shard-glk:          [SKIP][139] ([fdo#109271] / [i915#3026]) -> [PASS][140]
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-glk3/igt@sysfs_clients@sema-10@vcs0.html
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-glk5/igt@sysfs_clients@sema-10@vcs0.html

  
#### Warnings ####

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][141] ([i915#1804] / [i915#2684]) -> [WARN][142] ([i915#2684])
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb3/igt@i915_pm_rc6_residency@rc6-idle.html
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb2/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [DMESG-WARN][143] ([i915#1226]) -> [SKIP][144] ([fdo#109349])
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [144]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb6/igt@kms_dp_dsc@basic-dsc-enable-edp.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2:
    - shard-iclb:         [SKIP][145] ([i915#658]) -> [SKIP][146] ([i915#2920]) +1 similar issue
   [145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9776/shard-iclb1/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2.html
   [146]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5509/shard-iclb2/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2.html

  * igt@kms_psr2_sf@overlay-plane-upd

== Logs ==

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

[-- Attachment #1.2: Type: text/html, Size: 33724 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-14 20:35 Juha-Pekka Heikkila
  0 siblings, 0 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 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-15 14:30 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce executions time on multiplane tests Juha-Pekka Heikkila
2021-02-15 14:30 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation test from blacklist Juha-Pekka Heikkila
2021-02-15 15:25 ` [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-15 16:53 ` [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-14 20:35 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.