All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce execution time
@ 2021-01-21 18:35 Jeevan B
  2021-01-21 18:35 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Jeevan B
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Jeevan B @ 2021-01-21 18:35 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

Restricting the execution to 2 pipes
with this change we see 50% improvement in time efficiency.

v2: Updated commit message
v3: Updated check condition

Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 tests/kms_rotation_crc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 33a97cca..e7072e20 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -405,6 +405,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	enum pipe pipe;
+	int pipe_count = 0;
 
 	if (plane_type == DRM_PLANE_TYPE_CURSOR)
 		igt_require(display->has_cursor_plane);
@@ -421,6 +422,11 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 		if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
 			continue;
 
+		/* restricting the execution to 2 pipes to reduce execution time*/
+		if (pipe_count == 2 && !data->extended)
+			break;
+		pipe_count++;
+
 		igt_output_set_pipe(output, pipe);
 
 		plane = igt_output_get_plane_type(output, plane_type);
-- 
2.19.1

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

^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: different display modes can have different crc
@ 2021-01-18 15:00 Juha-Pekka Heikkila
  2021-01-18 15:00 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
  0 siblings, 1 reply; 14+ messages in thread
From: Juha-Pekka Heikkila @ 2021-01-18 15:00 UTC (permalink / raw)
  To: igt-dev

Different resolutions with same content may have different crc hence generate
buffer verification crcs for different modes if needed.

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

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 33a97ccaa..9a3ada5bc 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -30,6 +30,7 @@
 #define MAXMULTIPLANESAMOUNT 2
 #define TEST_MAX_WIDTH 640
 #define TEST_MAX_HEIGHT 480
+#define MAX_TESTED_MODES 8
 
 struct p_struct {
 	igt_plane_t *plane;
@@ -79,11 +80,15 @@ typedef struct {
 	bool use_native_resolution;
 	bool extended;
 
+	int output_crc_in_use, max_crc_in_use;
 	struct crc_rect_tag {
+		int mode;
 		bool valid;
 		igt_crc_t ref_crc;
 		igt_crc_t flip_crc;
-	} crc_rect[num_rectangle_types];
+	} crc_rect[MAX_TESTED_MODES][num_rectangle_types];
+
+	igt_fb_t last_on_screen;
 } data_t;
 
 typedef struct {
@@ -169,7 +174,6 @@ static void remove_fbs(data_t *data)
 {
 	igt_remove_fb(data->gfx_fd, &data->fb);
 	igt_remove_fb(data->gfx_fd, &data->fb_reference);
-	igt_remove_fb(data->gfx_fd, &data->fb_flip);
 }
 
 static void cleanup_crtc(data_t *data)
@@ -272,7 +276,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 	 */
 	igt_require(igt_display_has_format_mod(display, pixel_format, tiling));
 
-	if (!data->crc_rect[rect].valid) {
+	if (!data->crc_rect[data->output_crc_in_use][rect].valid) {
 		/*
 		* Create a reference software rotated flip framebuffer.
 		*/
@@ -285,7 +289,9 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 			igt_plane_set_position(plane, data->pos_x, data->pos_y);
 		igt_display_commit2(display, COMMIT_ATOMIC);
 
-		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].flip_crc);
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+					 &data->crc_rect[data->output_crc_in_use][rect].flip_crc);
+
 		igt_remove_fb(data->gfx_fd, &data->fb_flip);
 
 		/*
@@ -300,10 +306,13 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 			igt_plane_set_position(plane, data->pos_x, data->pos_y);
 		igt_display_commit2(display, COMMIT_ATOMIC);
 
-		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].ref_crc);
-		data->crc_rect[rect].valid = true;
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc,
+					 &data->crc_rect[data->output_crc_in_use][rect].ref_crc);
+
+		data->crc_rect[data->output_crc_in_use][rect].valid = true;
 	}
 
+	data->last_on_screen = data->fb_flip;
 	/*
 	  * Prepare the non-rotated flip fb.
 	  */
@@ -340,6 +349,13 @@ static void test_single_case(data_t *data, enum pipe pipe,
 		igt_plane_set_size(plane, data->fb.height, data->fb.width);
 
 	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
+
+	/*
+	 * Remove this last fb after it was taken out from screen
+	 * to avoid unnecessary delays.
+	 */
+	igt_remove_fb(data->gfx_fd, &data->fb_flip);
+
 	if (test_bad_format) {
 		igt_pipe_crc_drain(data->pipe_crc);
 		igt_assert_eq(ret, -EINVAL);
@@ -351,7 +367,8 @@ static void test_single_case(data_t *data, enum pipe pipe,
 
 	/* Check CRC */
 	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
-	igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);
+	igt_assert_crc_equal(&data->crc_rect[data->output_crc_in_use][rect].ref_crc,
+			     &crc_output);
 
 	/*
 	 * If flips are requested flip to a different fb and
@@ -374,7 +391,8 @@ static void test_single_case(data_t *data, enum pipe pipe,
 		}
 		kmstest_wait_for_pageflip(data->gfx_fd);
 		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
-		igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, &crc_output);
+		igt_assert_crc_equal(&data->crc_rect[data->output_crc_in_use][rect].flip_crc,
+				     &crc_output);
 	}
 }
 
@@ -403,6 +421,7 @@ static bool test_format(data_t *data,
 static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_format)
 {
 	igt_display_t *display = &data->display;
+	drmModeModeInfo *mode;
 	igt_output_t *output;
 	enum pipe pipe;
 
@@ -415,8 +434,29 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 		igt_plane_t *plane;
 		int i, j, c;
 
+		mode = igt_output_get_mode(output);
+
+		for (data->output_crc_in_use = 0;
+		     data->output_crc_in_use < data->max_crc_in_use &&
+		     data->crc_rect[data->output_crc_in_use][0].mode != mode->vdisplay;
+		     data->output_crc_in_use++)
+			;
+
+		/*
+		 * This is if there was different mode on different connector.
+		 */
+		if (data->crc_rect[data->output_crc_in_use][0].mode != mode->vdisplay) {
+			data->crc_rect[data->output_crc_in_use][0].mode = mode->vdisplay;
+			if (++data->max_crc_in_use >= MAX_TESTED_MODES) {
+				data->max_crc_in_use = MAX_TESTED_MODES - 1;
+				for (c = 0; c < num_rectangle_types; c++)
+					data->crc_rect[data->output_crc_in_use][c].valid = false;
+			}
+		}
+		data->output_crc_in_use = 0;
+
 		for (c = 0; c < num_rectangle_types; c++)
-			data->crc_rect[c].valid = false;
+			data->crc_rect[data->output_crc_in_use][c].valid = false;
 
 		if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
 			continue;
-- 
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] 14+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: fix crc buffer overflow for slow platforms
@ 2021-01-09 19:10 Juha-Pekka Heikkila
  2021-01-09 19:10 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
  0 siblings, 1 reply; 14+ messages in thread
From: Juha-Pekka Heikkila @ 2021-01-09 19:10 UTC (permalink / raw)
  To: igt-dev

on bad tiling tests there was nothing reading running crcs
which could fill up crc ringbuffer. Fix this by draining
crc buffer per round. Also unify all platforms execution
path by taking reference crcs per pipe.

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

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index be27103fa..33a97ccaa 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -272,11 +272,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 	 */
 	igt_require(igt_display_has_format_mod(display, pixel_format, tiling));
 
-	/*
-	 * HSW will need to have those CRCs calculated each time, it
-	 * seems to behave different from other platforms.
-	 */
-	if (!data->crc_rect[rect].valid || IS_HASWELL(data->devid)) {
+	if (!data->crc_rect[rect].valid) {
 		/*
 		* Create a reference software rotated flip framebuffer.
 		*/
@@ -345,6 +341,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 
 	ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
 	if (test_bad_format) {
+		igt_pipe_crc_drain(data->pipe_crc);
 		igt_assert_eq(ret, -EINVAL);
 		return;
 	}
@@ -408,10 +405,6 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	enum pipe pipe;
-	int c;
-
-	for (c = 0; c < num_rectangle_types; c++)
-		data->crc_rect[c].valid = false;
 
 	if (plane_type == DRM_PLANE_TYPE_CURSOR)
 		igt_require(display->has_cursor_plane);
@@ -420,7 +413,10 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 
 	for_each_pipe_with_valid_output(display, pipe, output) {
 		igt_plane_t *plane;
-		int i, j;
+		int i, j, c;
+
+		for (c = 0; c < num_rectangle_types; c++)
+			data->crc_rect[c].valid = false;
 
 		if (IS_CHERRYVIEW(data->devid) && pipe != PIPE_B)
 			continue;
-- 
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] 14+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs
@ 2021-01-07 15:51 Juha-Pekka Heikkila
  2021-01-07 15:51 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
  0 siblings, 1 reply; 14+ messages in thread
From: Juha-Pekka Heikkila @ 2021-01-07 15:51 UTC (permalink / raw)
  To: igt-dev

Get those reference crcs only once since they stay the same.

v2: Need to make exception for HSW, there crcs seem to vary across
rendering pipes.

This reduces generic rotation tests execution time on my ICL from 26s to 14s

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

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index ffcc2cc2e..be27103fa 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -49,6 +49,14 @@ struct p_point{
 	float_t y;
 };
 
+enum rectangle_type {
+	rectangle,
+	square,
+	portrait,
+	landscape,
+	num_rectangle_types /* must be last */
+};
+
 typedef struct {
 	int gfx_fd;
 	igt_display_t display;
@@ -70,6 +78,12 @@ typedef struct {
 
 	bool use_native_resolution;
 	bool extended;
+
+	struct crc_rect_tag {
+		bool valid;
+		igt_crc_t ref_crc;
+		igt_crc_t flip_crc;
+	} crc_rect[num_rectangle_types];
 } data_t;
 
 typedef struct {
@@ -190,14 +204,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 		igt_pipe_crc_start(data->pipe_crc);
 }
 
-enum rectangle_type {
-	rectangle,
-	square,
-	portrait,
-	landscape,
-	num_rectangle_types /* must be last */
-};
-
 static void prepare_fbs(data_t *data, igt_output_t *output,
 			igt_plane_t *plane, enum rectangle_type rect, uint32_t format)
 {
@@ -267,42 +273,49 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 	igt_require(igt_display_has_format_mod(display, pixel_format, tiling));
 
 	/*
-	 * Create a reference software rotated flip framebuffer.
+	 * HSW will need to have those CRCs calculated each time, it
+	 * seems to behave different from other platforms.
 	 */
-	igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format, tiling,
-		      &data->fb_flip);
-	paint_squares(data, data->rotation, &data->fb_flip,
-		      flip_opacity);
-	igt_plane_set_fb(plane, &data->fb_flip);
-	if (plane->type != DRM_PLANE_TYPE_CURSOR)
-		igt_plane_set_position(plane, data->pos_x, data->pos_y);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	if (!data->crc_rect[rect].valid || IS_HASWELL(data->devid)) {
+		/*
+		* Create a reference software rotated flip framebuffer.
+		*/
+		igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format, tiling,
+			&data->fb_flip);
+		paint_squares(data, data->rotation, &data->fb_flip,
+			flip_opacity);
+		igt_plane_set_fb(plane, &data->fb_flip);
+		if (plane->type != DRM_PLANE_TYPE_CURSOR)
+			igt_plane_set_position(plane, data->pos_x, data->pos_y);
+		igt_display_commit2(display, COMMIT_ATOMIC);
 
-	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->flip_crc);
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].flip_crc);
+		igt_remove_fb(data->gfx_fd, &data->fb_flip);
+
+		/*
+		* Create a reference CRC for a software-rotated fb.
+		*/
+		igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,
+			data->override_tiling ?: LOCAL_DRM_FORMAT_MOD_NONE, &data->fb_reference);
+		paint_squares(data, data->rotation, &data->fb_reference, 1.0);
+
+		igt_plane_set_fb(plane, &data->fb_reference);
+		if (plane->type != DRM_PLANE_TYPE_CURSOR)
+			igt_plane_set_position(plane, data->pos_x, data->pos_y);
+		igt_display_commit2(display, COMMIT_ATOMIC);
+
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].ref_crc);
+		data->crc_rect[rect].valid = true;
+	}
 
 	/*
 	  * Prepare the non-rotated flip fb.
 	  */
-	igt_remove_fb(data->gfx_fd, &data->fb_flip);
 	igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling,
 		      &data->fb_flip);
 	paint_squares(data, IGT_ROTATION_0, &data->fb_flip,
 		      flip_opacity);
 
-	/*
-	 * Create a reference CRC for a software-rotated fb.
-	 */
-	igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,
-		      data->override_tiling ?: LOCAL_DRM_FORMAT_MOD_NONE, &data->fb_reference);
-	paint_squares(data, data->rotation, &data->fb_reference, 1.0);
-
-	igt_plane_set_fb(plane, &data->fb_reference);
-	if (plane->type != DRM_PLANE_TYPE_CURSOR)
-		igt_plane_set_position(plane, data->pos_x, data->pos_y);
-	igt_display_commit2(display, COMMIT_ATOMIC);
-
-	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->ref_crc);
-
 	/*
 	 * Prepare the plane with an non-rotated fb let the hw rotate it.
 	 */
@@ -341,7 +354,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 
 	/* Check CRC */
 	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
-	igt_assert_crc_equal(&data->ref_crc, &crc_output);
+	igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);
 
 	/*
 	 * If flips are requested flip to a different fb and
@@ -364,8 +377,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 		}
 		kmstest_wait_for_pageflip(data->gfx_fd);
 		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
-		igt_assert_crc_equal(&data->flip_crc,
-				     &crc_output);
+		igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, &crc_output);
 	}
 }
 
@@ -396,6 +408,10 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	enum pipe pipe;
+	int c;
+
+	for (c = 0; c < num_rectangle_types; c++)
+		data->crc_rect[c].valid = false;
 
 	if (plane_type == DRM_PLANE_TYPE_CURSOR)
 		igt_require(display->has_cursor_plane);
-- 
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] 14+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs
@ 2021-01-05  8:25 Juha-Pekka Heikkila
  2021-01-05  8:25 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
  0 siblings, 1 reply; 14+ messages in thread
From: Juha-Pekka Heikkila @ 2021-01-05  8:25 UTC (permalink / raw)
  To: igt-dev

Get those reference crcs only once since they stay the same.

This reduces generic rotation tests execution time on my ICL from 26s to 14s

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

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index ffcc2cc2e..e160bd901 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -49,6 +49,14 @@ struct p_point{
 	float_t y;
 };
 
+enum rectangle_type {
+	rectangle,
+	square,
+	portrait,
+	landscape,
+	num_rectangle_types /* must be last */
+};
+
 typedef struct {
 	int gfx_fd;
 	igt_display_t display;
@@ -70,6 +78,12 @@ typedef struct {
 
 	bool use_native_resolution;
 	bool extended;
+
+	struct crc_rect_tag {
+		bool valid;
+		igt_crc_t ref_crc;
+		igt_crc_t flip_crc;
+	} crc_rect[num_rectangle_types];
 } data_t;
 
 typedef struct {
@@ -190,14 +204,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 		igt_pipe_crc_start(data->pipe_crc);
 }
 
-enum rectangle_type {
-	rectangle,
-	square,
-	portrait,
-	landscape,
-	num_rectangle_types /* must be last */
-};
-
 static void prepare_fbs(data_t *data, igt_output_t *output,
 			igt_plane_t *plane, enum rectangle_type rect, uint32_t format)
 {
@@ -266,43 +272,46 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
 	 */
 	igt_require(igt_display_has_format_mod(display, pixel_format, tiling));
 
-	/*
-	 * Create a reference software rotated flip framebuffer.
-	 */
-	igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format, tiling,
-		      &data->fb_flip);
-	paint_squares(data, data->rotation, &data->fb_flip,
-		      flip_opacity);
-	igt_plane_set_fb(plane, &data->fb_flip);
-	if (plane->type != DRM_PLANE_TYPE_CURSOR)
-		igt_plane_set_position(plane, data->pos_x, data->pos_y);
-	igt_display_commit2(display, COMMIT_ATOMIC);
+	if (!data->crc_rect[rect].valid) {
+		/*
+		* Create a reference software rotated flip framebuffer.
+		*/
+		igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format, tiling,
+			&data->fb_flip);
+		paint_squares(data, data->rotation, &data->fb_flip,
+			flip_opacity);
+		igt_plane_set_fb(plane, &data->fb_flip);
+		if (plane->type != DRM_PLANE_TYPE_CURSOR)
+			igt_plane_set_position(plane, data->pos_x, data->pos_y);
+		igt_display_commit2(display, COMMIT_ATOMIC);
 
-	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->flip_crc);
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].flip_crc);
+		igt_remove_fb(data->gfx_fd, &data->fb_flip);
+
+		/*
+		* Create a reference CRC for a software-rotated fb.
+		*/
+		igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,
+			data->override_tiling ?: LOCAL_DRM_FORMAT_MOD_NONE, &data->fb_reference);
+		paint_squares(data, data->rotation, &data->fb_reference, 1.0);
+
+		igt_plane_set_fb(plane, &data->fb_reference);
+		if (plane->type != DRM_PLANE_TYPE_CURSOR)
+			igt_plane_set_position(plane, data->pos_x, data->pos_y);
+		igt_display_commit2(display, COMMIT_ATOMIC);
+
+		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->crc_rect[rect].ref_crc);
+		data->crc_rect[rect].valid = true;
+	}
 
 	/*
 	  * Prepare the non-rotated flip fb.
 	  */
-	igt_remove_fb(data->gfx_fd, &data->fb_flip);
 	igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling,
 		      &data->fb_flip);
 	paint_squares(data, IGT_ROTATION_0, &data->fb_flip,
 		      flip_opacity);
 
-	/*
-	 * Create a reference CRC for a software-rotated fb.
-	 */
-	igt_create_fb(data->gfx_fd, ref_w, ref_h, pixel_format,
-		      data->override_tiling ?: LOCAL_DRM_FORMAT_MOD_NONE, &data->fb_reference);
-	paint_squares(data, data->rotation, &data->fb_reference, 1.0);
-
-	igt_plane_set_fb(plane, &data->fb_reference);
-	if (plane->type != DRM_PLANE_TYPE_CURSOR)
-		igt_plane_set_position(plane, data->pos_x, data->pos_y);
-	igt_display_commit2(display, COMMIT_ATOMIC);
-
-	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->ref_crc);
-
 	/*
 	 * Prepare the plane with an non-rotated fb let the hw rotate it.
 	 */
@@ -341,7 +350,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 
 	/* Check CRC */
 	igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
-	igt_assert_crc_equal(&data->ref_crc, &crc_output);
+	igt_assert_crc_equal(&data->crc_rect[rect].ref_crc, &crc_output);
 
 	/*
 	 * If flips are requested flip to a different fb and
@@ -364,8 +373,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
 		}
 		kmstest_wait_for_pageflip(data->gfx_fd);
 		igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
-		igt_assert_crc_equal(&data->flip_crc,
-				     &crc_output);
+		igt_assert_crc_equal(&data->crc_rect[rect].flip_crc, &crc_output);
 	}
 }
 
@@ -396,6 +404,10 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	enum pipe pipe;
+	int c;
+
+	for (c = 0; c < num_rectangle_types; c++)
+		data->crc_rect[c].valid = false;
 
 	if (plane_type == DRM_PLANE_TYPE_CURSOR)
 		igt_require(display->has_cursor_plane);
-- 
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] 14+ messages in thread

end of thread, other threads:[~2021-01-27 13:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 18:35 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: reduce execution time Jeevan B
2021-01-21 18:35 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Jeevan B
2021-01-21 20:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] tests/kms_rotation_crc: reduce execution time Patchwork
2021-01-22  6:59   ` B, Jeevan
2021-01-22 16:39     ` Vudum, Lakshminarayana
2021-01-22 16:34 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2021-01-23  2:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-01-27 11:41 ` [igt-dev] [PATCH i-g-t 1/2] " Petri Latvala
2021-01-27 13:54   ` Juha-Pekka Heikkila
  -- strict thread matches above, loose matches on Subject: below --
2021-01-18 15:00 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: different display modes can have different crc Juha-Pekka Heikkila
2021-01-18 15:00 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
2021-01-09 19:10 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: fix crc buffer overflow for slow platforms Juha-Pekka Heikkila
2021-01-09 19:10 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
2021-01-12 13:27   ` Kahola, Mika
2021-01-07 15:51 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs Juha-Pekka Heikkila
2021-01-07 15:51 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist Juha-Pekka Heikkila
2021-01-05  8:25 [igt-dev] [PATCH i-g-t 1/2] tests/kms_rotation_crc: avoid recalculating refecence crcs Juha-Pekka Heikkila
2021-01-05  8:25 ` [igt-dev] [PATCH i-g-t 2/2] HAX remove rotation tests from blacklist 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.