All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests
@ 2021-08-16 12:58 Juha-Pekka Heikkila
  2021-08-16 14:50 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: separate hw and sw runs on tests (rev3) Patchwork
  2021-08-16 18:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2021-08-16 12:58 UTC (permalink / raw)
  To: igt-dev; +Cc: Juha-Pekka Heikkila

Reset display structure settings and commit them in before starting
test in case some earlier test left tail.

While at it did some simple cleanup and optimization.

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

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index a9bc3a745..22f81281d 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -46,10 +46,17 @@ IGT_TEST_DESCRIPTION(
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
 
+enum cursor_buffers {
+	HWCURSORBUFFER,
+	SWCOMPARISONBUFFER1,
+	SWCOMPARISONBUFFER2,
+	MAXCURSORBUFFER
+};
+
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
-	struct igt_fb primary_fb[2];
+	struct igt_fb primary_fb[MAXCURSORBUFFER];
 	struct igt_fb fb;
 	igt_output_t *output;
 	enum pipe pipe;
@@ -70,29 +77,35 @@ typedef struct {
 #define TEST_DPMS (1<<0)
 #define TEST_SUSPEND (1<<1)
 
-#define HWCURSORBUFFER 0
-#define SWCOMPARISONBUFFER 1
+typedef struct {
+	int x;
+	int y;
+	int width;
+	int height;
+} cursorarea;
 
-static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch, double a)
+static void draw_cursor(cairo_t *cr, cursorarea *cursor)
 {
 	int wl, wr, ht, hb;
 
 	/* deal with odd cursor width/height */
-	wl = cw / 2;
-	wr = (cw + 1) / 2;
-	ht = ch / 2;
-	hb = (ch + 1) / 2;
+	wl = cursor->width / 2;
+	wr = (cursor->width + 1) / 2;
+	ht = cursor->height / 2;
+	hb = (cursor->height + 1) / 2;
 
 	/* Cairo doesn't like to be fed numbers that are too wild */
-	if ((x < SHRT_MIN) || (x > SHRT_MAX) || (y < SHRT_MIN) || (y > SHRT_MAX))
+	if ((cursor->x < SHRT_MIN) || (cursor->x > SHRT_MAX) ||
+	    (cursor->y < SHRT_MIN) || (cursor->y > SHRT_MAX))
 		return;
+
 	cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
 	cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
 	/* 4 color rectangles in the corners, RGBY */
-	igt_paint_color_alpha(cr, x,      y,      wl, ht, 1.0, 0.0, 0.0, a);
-	igt_paint_color_alpha(cr, x + wl, y,      wr, ht, 0.0, 1.0, 0.0, a);
-	igt_paint_color_alpha(cr, x,      y + ht, wl, hb, 0.0, 0.0, 1.0, a);
-	igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 1.0, 1.0, 1.0, a);
+	igt_paint_color(cr, cursor->x, cursor->y, wl, ht, 1.0, 0.0, 0.0);
+	igt_paint_color(cr, cursor->x + wl, cursor->y, wr, ht, 0.0, 1.0, 0.0);
+	igt_paint_color(cr, cursor->x, cursor->y + ht, wl, hb, 0.0, 0.0, 1.0);
+	igt_paint_color(cr, cursor->x + wl, cursor->y + ht, wr, hb, 1.0, 1.0, 1.0);
 }
 
 static void cursor_enable(data_t *data)
@@ -144,7 +157,7 @@ static bool cursor_visible(data_t *data, int x, int y)
 	return true;
 }
 
-static void restore_image(data_t *data, uint32_t buffer)
+static void restore_image(data_t *data, uint32_t buffer, cursorarea *cursor)
 {
 	cairo_t *cr;
 
@@ -153,80 +166,84 @@ static void restore_image(data_t *data, uint32_t buffer)
 	cairo_set_source_surface(cr, data->surface, 0, 0);
 	cairo_rectangle(cr, 0, 0, data->screenw, data->screenh);
 	cairo_fill(cr);
+
+	if (cursor)
+		draw_cursor(cr, cursor);
+
 	igt_put_cairo_ctx(cr);
 }
 
-static void do_single_test(data_t *data, int x, int y)
+static void do_single_test(data_t *data, int x, int y, bool hw_test,
+			   igt_crc_t *hwcrc)
 {
 	igt_display_t *display = &data->display;
 	igt_pipe_crc_t *pipe_crc = data->pipe_crc;
-	igt_crc_t crc, ref_crc;
-	cairo_t *cr;
-	int ret = 0;
+	igt_crc_t crc;
+	int ret = 0, swbufidx;
 
 	igt_print_activity();
 
-	/* Hardware test */
-	igt_plane_set_position(data->cursor, x, y);
-	cursor_enable(data);
+	if (hw_test) {
+		/* Hardware test */
+		igt_plane_set_position(data->cursor, x, y);
 
-	if (chv_cursor_broken(data, x) && cursor_visible(data, x, y)) {
-		ret = igt_display_try_commit2(display, COMMIT_LEGACY);
-		igt_assert_eq(ret, -EINVAL);
-		igt_plane_set_position(data->cursor, 0, y);
-		return;
-	}
+		if (chv_cursor_broken(data, x) && cursor_visible(data, x, y)) {
+			ret = igt_display_try_commit2(display, COMMIT_LEGACY);
+			igt_assert_eq(ret, -EINVAL);
+			igt_plane_set_position(data->cursor, 0, y);
+			return;
+		}
 
-	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
-	igt_display_commit(display);
+		igt_display_commit(display);
 
-	/* Extra vblank wait is because nonblocking cursor ioctl */
-	igt_wait_for_vblank(data->drm_fd,
-			    display->pipes[data->pipe].crtc_offset);
+		/* Extra vblank wait is because nonblocking cursor ioctl */
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
-	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
-	restore_image(data, SWCOMPARISONBUFFER);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
 
-	if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
-		igt_crc_t crc_after;
-		/*
-		 * stop/start crc to avoid dmesg notifications about userspace
-		 * reading too slow.
-		 */
-		igt_pipe_crc_stop(pipe_crc);
-
-		if (data->flags & TEST_DPMS) {
-			igt_debug("dpms off/on cycle\n");
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_OFF);
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_ON);
+		if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
+			igt_crc_t crc_after;
+			/*
+			* stop/start crc to avoid dmesg notifications about userspace
+			* reading too slow.
+			*/
+			igt_pipe_crc_stop(pipe_crc);
+
+			if (data->flags & TEST_DPMS) {
+				igt_debug("dpms off/on cycle\n");
+				kmstest_set_connector_dpms(data->drm_fd,
+							data->output->config.connector,
+							DRM_MODE_DPMS_OFF);
+				kmstest_set_connector_dpms(data->drm_fd,
+							data->output->config.connector,
+							DRM_MODE_DPMS_ON);
+			}
+
+			if (data->flags & TEST_SUSPEND)
+				igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
+							SUSPEND_TEST_NONE);
+
+			igt_pipe_crc_start(pipe_crc);
+			igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
+			igt_assert_crc_equal(hwcrc, &crc_after);
 		}
+	} else {
+		/* Now render the same in software and collect crc */
+		swbufidx = (data->primary->drm_plane->fb_id ==
+			    data->primary_fb[SWCOMPARISONBUFFER1].fb_id) ?
+			    SWCOMPARISONBUFFER2 : SWCOMPARISONBUFFER1;
 
-		if (data->flags & TEST_SUSPEND)
-			igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
-						      SUSPEND_TEST_NONE);
-
-		igt_pipe_crc_start(pipe_crc);
-		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
-		igt_assert_crc_equal(&crc, &crc_after);
-	}
+		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
+		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
 
-	/* Now render the same in software and collect crc */
-	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
-	draw_cursor(cr, x, y, data->curw, data->curh, 1.0);
-	igt_put_cairo_ctx(cr);
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
-	cursor_disable(data);
-	igt_display_commit(display);
-
-	igt_wait_for_vblank(data->drm_fd,
-			display->pipes[data->pipe].crtc_offset);
+		igt_display_commit(display);
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
-	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
-	igt_assert_crc_equal(&crc, &ref_crc);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
+		igt_assert_crc_equal(&crc, hwcrc);
+	}
 }
 
 static void do_fail_test(data_t *data, int x, int y, int expect)
@@ -248,70 +265,112 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
 	igt_assert_eq(ret, expect);
 }
 
-static void do_test(data_t *data,
-		    int left, int right, int top, int bottom)
+static void do_test(data_t *data, const cursorarea *coords, igt_crc_t crc[4],
+		    bool hwtest)
 {
-	do_single_test(data, left, top);
-	do_single_test(data, right, top);
-	do_single_test(data, right, bottom);
-	do_single_test(data, left, bottom);
+	do_single_test(data, coords->x, coords->width, hwtest, &crc[0]);
+	do_single_test(data, coords->y, coords->width, hwtest, &crc[1]);
+	do_single_test(data, coords->y, coords->height, hwtest, &crc[2]);
+	do_single_test(data, coords->x, coords->height, hwtest, &crc[3]);
 }
 
 static void test_crc_onscreen(data_t *data)
 {
-	int left = data->left;
-	int right = data->right;
-	int top = data->top;
-	int bottom = data->bottom;
-	int cursor_w = data->curw;
-	int cursor_h = data->curh;
-
-	/* fully inside  */
-	do_test(data, left, right, top, bottom);
-
-	/* 2 pixels inside */
-	do_test(data, left - (cursor_w-2), right + (cursor_w-2), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h-2), bottom + (cursor_h-2));
-	do_test(data, left - (cursor_w-2), right + (cursor_w-2), top - (cursor_h-2), bottom + (cursor_h-2));
-
-	/* 1 pixel inside */
-	do_test(data, left - (cursor_w-1), right + (cursor_w-1), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h-1), bottom + (cursor_h-1));
-	do_test(data, left - (cursor_w-1), right + (cursor_w-1), top - (cursor_h-1), bottom + (cursor_h-1));
+	const int left = data->left;
+	const int right = data->right;
+	const int top = data->top;
+	const int bottom = data->bottom;
+	const int cursor_w = data->curw;
+	const int cursor_h = data->curh;
+
+	struct {
+		const cursorarea coords;
+		igt_crc_t crc[4];
+	} tests[] = {
+		/* fully inside  */
+		{{left, right, top, bottom}},
+		/* 2 pixels inside */
+		{{left - (cursor_w - 2), right + (cursor_w - 2), top, bottom}},
+		{{left, right, top - (cursor_h - 2), bottom + (cursor_h - 2)}},
+		{{left - (cursor_w - 2), right + (cursor_w - 2),
+		  top - (cursor_h - 2), bottom + (cursor_h - 2)}},
+		/* 1 pixel inside */
+		{{left - (cursor_w - 1), right + (cursor_w - 1), top, bottom}},
+		{{left, right, top - (cursor_h - 1), bottom + (cursor_h - 1)}},
+		{{left - (cursor_w - 1), right + (cursor_w - 1),
+		  top - (cursor_h - 1), bottom + (cursor_h - 1)}},
+	};
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, &tests[i].coords, tests[i].crc, true);
+
+	/* SW test */
+	cursor_disable(data);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, &tests[i].coords, tests[i].crc, false);
 }
 
 static void test_crc_offscreen(data_t *data)
 {
-	int left = data->left;
-	int right = data->right;
-	int top = data->top;
-	int bottom = data->bottom;
-	int cursor_w = data->curw;
-	int cursor_h = data->curh;
-
-	/* fully outside */
-	do_test(data, left - (cursor_w), right + (cursor_w), top             , bottom             );
-	do_test(data, left             , right             , top - (cursor_h), bottom + (cursor_h));
-	do_test(data, left - (cursor_w), right + (cursor_w), top - (cursor_h), bottom + (cursor_h));
-
-	/* fully outside by 1 extra pixels */
-	do_test(data, left - (cursor_w+1), right + (cursor_w+1), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h+1), bottom + (cursor_h+1));
-	do_test(data, left - (cursor_w+1), right + (cursor_w+1), top - (cursor_h+1), bottom + (cursor_h+1));
-
-	/* fully outside by 2 extra pixels */
-	do_test(data, left - (cursor_w+2), right + (cursor_w+2), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h+2), bottom + (cursor_h+2));
-	do_test(data, left - (cursor_w+2), right + (cursor_w+2), top - (cursor_h+2), bottom + (cursor_h+2));
-
-	/* fully outside by a lot of extra pixels */
-	do_test(data, left - (cursor_w+512), right + (cursor_w+512), top                 , bottom                 );
-	do_test(data, left                 , right                 , top - (cursor_h+512), bottom + (cursor_h+512));
-	do_test(data, left - (cursor_w+512), right + (cursor_w+512), top - (cursor_h+512), bottom + (cursor_h+512));
-
-	/* go nuts */
-	do_test(data, INT_MIN, INT_MAX - cursor_w, INT_MIN, INT_MAX - cursor_h);
-	do_test(data, SHRT_MIN, SHRT_MAX, SHRT_MIN, SHRT_MAX);
+	const int left = data->left;
+	const int right = data->right;
+	const int top = data->top;
+	const int bottom = data->bottom;
+	const int cursor_w = data->curw;
+	const int cursor_h = data->curh;
+
+	struct {
+		const cursorarea coords;
+		igt_crc_t crc[4];
+	} tests[] = {
+		/* fully outside */
+		{{left - (cursor_w), right + (cursor_w), top, bottom}},
+		{{left, right, top - (cursor_h), bottom + (cursor_h)}},
+		{{left - (cursor_w), right + (cursor_w), top - (cursor_h),
+		  bottom + (cursor_h)}},
+		/* fully outside by 1 extra pixels */
+		{{left - (cursor_w + 1), right + (cursor_w + 1), top, bottom}},
+		{{left, right, top - (cursor_h + 1), bottom + (cursor_h + 1)}},
+		{{left - (cursor_w + 1), right + (cursor_w + 1),
+		  top - (cursor_h + 1), bottom + (cursor_h + 1)}},
+		/* fully outside by 2 extra pixels */
+		{{left - (cursor_w + 2), right + (cursor_w + 2), top, bottom}},
+		{{left, right, top - (cursor_h + 2), bottom + (cursor_h + 2)}},
+		{{left - (cursor_w + 2), right + (cursor_w + 2),
+		  top - (cursor_h + 2), bottom + (cursor_h + 2)}},
+		/* fully outside by a lot of extra pixels */
+		{{left - (cursor_w + 512), right + (cursor_w + 512), top, bottom}},
+		{{left, right, top - (cursor_h + 512), bottom + (cursor_h + 512)}},
+		{{left - (cursor_w + 512), right + (cursor_w + 512),
+		  top - (cursor_h + 512), bottom + (cursor_h + 512)}},
+		/* go nuts */
+		{{INT_MIN, INT_MAX - cursor_w, INT_MIN, INT_MAX - cursor_h}},
+		{{SHRT_MIN, SHRT_MAX, SHRT_MIN, SHRT_MAX}},
+	};
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, &tests[i].coords, tests[i].crc, true);
+
+	/* SW test */
+	cursor_disable(data);
+	/*
+	 * all these crc's should be the same, actually render only first image
+	 * to check crc and then compare rest of crc are matching
+	 */
+	do_test(data, &tests[0].coords, tests[0].crc, false);
+
+	for (int i = 1; i < ARRAY_SIZE(tests); i++) {
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[0]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[1]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[2]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[3]);
+	}
 
 	/* Make sure we get -ERANGE on integer overflow */
 	do_fail_test(data, INT_MAX - cursor_w + 1, INT_MAX - cursor_h + 1, -ERANGE);
@@ -320,29 +379,75 @@ static void test_crc_offscreen(data_t *data)
 static void test_crc_sliding(data_t *data)
 {
 	int i;
+	igt_crc_t crc[16 * 3];
 
 	/* Make sure cursor moves smoothly and pixel-by-pixel, and that there are
 	 * no alignment issues. Horizontal, vertical and diagonal test.
 	 */
-	for (i = 0; i < 16; i++) {
-		do_single_test(data, i, 0);
-		do_single_test(data, 0, i);
-		do_single_test(data, i, i);
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+
+	for (i = 0; i < ARRAY_SIZE(crc); i++) {
+		switch (i % 3) {
+		case 0:
+			do_single_test(data, i / 3, 0, true, &crc[i]);
+			break;
+		case 1:
+			do_single_test(data, 0, i / 3, true, &crc[i]);
+			break;
+		case 2:
+			do_single_test(data, i / 3, i / 3, true, &crc[i]);
+			break;
+		default:
+			igt_assert(false);
+		}
+	}
+
+	/* SW test */
+	cursor_disable(data);
+	for (i = 0; i < ARRAY_SIZE(crc); i++) {
+		switch (i % 3) {
+		case 0:
+			do_single_test(data, i / 3, 0, false, &crc[i]);
+			break;
+		case 1:
+			do_single_test(data, 0, i / 3, false, &crc[i]);
+			break;
+		case 2:
+			do_single_test(data, i / 3, i / 3, false, &crc[i]);
+			break;
+		default:
+			igt_assert(false);
+		}
 	}
 }
 
 static void test_crc_random(data_t *data)
 {
-	int i, max;
+	igt_crc_t crc[50];
+	int i, max, x[ARRAY_SIZE(crc)], y[ARRAY_SIZE(crc)];
 
-	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : 50;
+	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : ARRAY_SIZE(crc);
 
 	/* Random cursor placement */
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+
 	for (i = 0; i < max; i++) {
-		int x = rand() % (data->screenw + data->curw * 2) - data->curw;
-		int y = rand() % (data->screenh + data->curh * 2) - data->curh;
-		do_single_test(data, x, y);
+		x[i] = rand() % (data->screenw + data->curw * 2) - data->curw;
+		y[i] = rand() % (data->screenh + data->curh * 2) - data->curh;
+		do_single_test(data, x[i], y[i], true, &crc[i]);
 	}
+
+	/* SW test */
+	cursor_disable(data);
+	for (i = 0; i < max; i++)
+		do_single_test(data, x[i], y[i], false, &crc[i]);
+
 }
 
 static void cleanup_crtc(data_t *data)
@@ -362,7 +467,8 @@ static void cleanup_crtc(data_t *data)
 	igt_display_commit(display);
 
 	igt_remove_fb(data->drm_fd, &data->primary_fb[HWCURSORBUFFER]);
-	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
+	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER2]);
 
 	igt_display_reset(display);
 }
@@ -375,26 +481,28 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 	cairo_t *cr;
 
 	/* select the pipe we want to use */
+	igt_display_reset(&data->display);
 	igt_output_set_pipe(output, data->pipe);
+	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
 	/* create and set the primary plane fbs */
 	mode = igt_output_get_mode(output);
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_NONE,
-			    0.0, 0.0, 0.0,
-			    &data->primary_fb[HWCURSORBUFFER]);
-
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_NONE,
-			    0.0, 0.0, 0.0,
-			    &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[HWCURSORBUFFER]);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[SWCOMPARISONBUFFER1]);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[SWCOMPARISONBUFFER2]);
 
 	data->primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	data->cursor = igt_output_get_plane_type(output, DRM_PLANE_TYPE_CURSOR);
 
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 
 	igt_display_commit(display);
 
@@ -427,7 +535,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 		cairo_destroy(cr);
 
 		/* Set HW cursor buffer in place */
-			restore_image(data, HWCURSORBUFFER);
+		restore_image(data, HWCURSORBUFFER, NULL);
 	} else
 		data->surface = NULL;
 
@@ -469,10 +577,10 @@ static void test_cursor_alpha(data_t *data, double a)
 	igt_remove_fb(data->drm_fd, &data->fb);
 
 	/* Software Test - render cursor in software, drawn it directly on PF */
-	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
 	igt_paint_color_alpha(cr, 0, 0, curw, curh, 1.0, 1.0, 1.0, a);
 	igt_put_cairo_ctx(cr);
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 	igt_display_commit(display);
 	igt_wait_for_vblank(data->drm_fd,
 			display->pipes[data->pipe].crtc_offset);
@@ -513,7 +621,7 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
 	igt_assert(fb_id);
 
 	cr = igt_get_cairo_ctx(data->drm_fd, &data->fb);
-	draw_cursor(cr, 0, 0, cur_w, cur_h, 1.0);
+	draw_cursor(cr, &((cursorarea){0, 0, cur_w, cur_h}));
 	igt_put_cairo_ctx(cr);
 }
 
@@ -610,7 +718,7 @@ static void test_cursor_size(data_t *data)
 		igt_display_commit(display);
 
 		/* Now render the same in software and collect crc */
-		cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+		cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
 
 		/* remove previous cursor sw image */
 		if (prevsize > 0)
@@ -619,7 +727,7 @@ static void test_cursor_size(data_t *data)
 
 		igt_paint_color_alpha(cr, 0, 0, size, size, 1.0, 1.0, 1.0, 1.0);
 		igt_put_cairo_ctx(cr);
-		igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+		igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 		igt_display_commit(display);
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
 
@@ -666,6 +774,8 @@ static void test_rapid_movement(data_t *data)
 	timersub(&end, &start, &delta);
 	usec = delta.tv_usec + 1000000 * delta.tv_sec;
 	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
+
+	cursor_disable(data);
 }
 
 static void run_size_tests(data_t *data, enum pipe pipe,
-- 
2.28.0

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

* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: separate hw and sw runs on tests (rev3)
  2021-08-16 12:58 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests Juha-Pekka Heikkila
@ 2021-08-16 14:50 ` Patchwork
  2021-08-16 18:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2021-08-16 14:50 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev

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

== Series Details ==

Series: tests/kms_cursor_crc: separate hw and sw runs on tests (rev3)
URL   : https://patchwork.freedesktop.org/series/93642/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10489 -> IGTPW_6125
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@query-info:
    - fi-bsw-kefka:       NOTRUN -> [SKIP][1] ([fdo#109271]) +17 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-bsw-kefka/igt@amdgpu/amd_basic@query-info.html
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][2] ([fdo#109315])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@amdgpu/amd_basic@query-info.html

  * igt@amdgpu/amd_cs_nop@nop-gfx0:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][3] ([fdo#109315] / [i915#2575]) +16 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@amdgpu/amd_cs_nop@nop-gfx0.html

  * igt@gem_exec_suspend@basic-s3:
    - fi-tgl-1115g4:      [PASS][4] -> [FAIL][5] ([i915#1888])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@gem_exec_suspend@basic-s3.html

  * igt@i915_pm_backlight@basic-brightness:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][6] ([i915#1155])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@i915_pm_backlight@basic-brightness.html

  * igt@i915_selftest@live@execlists:
    - fi-bsw-nick:        [PASS][7] -> [INCOMPLETE][8] ([i915#2940])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/fi-bsw-nick/igt@i915_selftest@live@execlists.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-bsw-nick/igt@i915_selftest@live@execlists.html

  * igt@kms_psr@primary_mmap_gtt:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][9] ([i915#1072]) +3 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@kms_psr@primary_mmap_gtt.html

  * igt@prime_vgem@basic-userptr:
    - fi-tgl-1115g4:      NOTRUN -> [SKIP][10] ([i915#3301])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@prime_vgem@basic-userptr.html

  * igt@runner@aborted:
    - fi-bsw-nick:        NOTRUN -> [FAIL][11] ([fdo#109271] / [i915#1436])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-bsw-nick/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@execlists:
    - fi-bsw-kefka:       [INCOMPLETE][12] ([i915#2940]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/fi-bsw-kefka/igt@i915_selftest@live@execlists.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-bsw-kefka/igt@i915_selftest@live@execlists.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
    - fi-tgl-1115g4:      [DMESG-WARN][14] ([i915#1887]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/fi-tgl-1115g4/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/fi-tgl-1115g4/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a.html

  
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1887]: https://gitlab.freedesktop.org/drm/intel/issues/1887
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301


Participating hosts (36 -> 34)
------------------------------

  Missing    (2): fi-bsw-cyan fi-bdw-samus 


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6177 -> IGTPW_6125

  CI-20190529: 20190529
  CI_DRM_10489: a5e502cef015ed88de65a044cf260c8beb63abc8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_6125: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/index.html
  IGT_6177: f474644e7226dd319195ca03b3cde82ad10ac54c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

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

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for tests/kms_cursor_crc: separate hw and sw runs on tests (rev3)
  2021-08-16 12:58 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests Juha-Pekka Heikkila
  2021-08-16 14:50 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: separate hw and sw runs on tests (rev3) Patchwork
@ 2021-08-16 18:05 ` Patchwork
  1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2021-08-16 18:05 UTC (permalink / raw)
  To: Juha-Pekka Heikkila; +Cc: igt-dev

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

== Series Details ==

Series: tests/kms_cursor_crc: separate hw and sw runs on tests (rev3)
URL   : https://patchwork.freedesktop.org/series/93642/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_10489_full -> IGTPW_6125_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_persistence@engines-hang@rcs0:
    - shard-tglb:         [PASS][1] -> [FAIL][2] ([i915#2410])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-tglb2/igt@gem_ctx_persistence@engines-hang@rcs0.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb7/igt@gem_ctx_persistence@engines-hang@rcs0.html

  * igt@gem_ctx_persistence@idempotent:
    - shard-snb:          NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#1099]) +4 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-snb2/igt@gem_ctx_persistence@idempotent.html

  * igt@gem_ctx_sseu@invalid-sseu:
    - shard-tglb:         NOTRUN -> [SKIP][4] ([i915#280])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb2/igt@gem_ctx_sseu@invalid-sseu.html

  * igt@gem_eio@unwedge-stress:
    - shard-tglb:         [PASS][5] -> [TIMEOUT][6] ([i915#2369] / [i915#3063] / [i915#3648])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-tglb5/igt@gem_eio@unwedge-stress.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-apl:          NOTRUN -> [FAIL][7] ([i915#2846])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl3/igt@gem_exec_fair@basic-deadline.html

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

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-iclb:         [PASS][9] -> [FAIL][10] ([i915#2842])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb2/igt@gem_exec_fair@basic-none-share@rcs0.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb7/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_fair@basic-pace@vcs0:
    - shard-kbl:          NOTRUN -> [FAIL][11] ([i915#2842])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl2/igt@gem_exec_fair@basic-pace@vcs0.html

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

  * igt@gem_exec_fair@basic-pace@vecs0:
    - shard-glk:          [PASS][13] -> [FAIL][14] ([i915#2842]) +2 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-glk4/igt@gem_exec_fair@basic-pace@vecs0.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk3/igt@gem_exec_fair@basic-pace@vecs0.html

  * igt@gem_huc_copy@huc-copy:
    - shard-apl:          NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#2190])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl7/igt@gem_huc_copy@huc-copy.html

  * igt@gem_pread@exhaustion:
    - shard-glk:          NOTRUN -> [WARN][16] ([i915#2658])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk7/igt@gem_pread@exhaustion.html
    - shard-apl:          NOTRUN -> [WARN][17] ([i915#2658])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl7/igt@gem_pread@exhaustion.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-snb:          NOTRUN -> [WARN][18] ([i915#2658])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-snb7/igt@gem_pwrite@basic-exhaustion.html
    - shard-tglb:         NOTRUN -> [WARN][19] ([i915#2658])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb1/igt@gem_pwrite@basic-exhaustion.html

  * igt@gem_render_copy@linear-to-vebox-yf-tiled:
    - shard-iclb:         NOTRUN -> [SKIP][20] ([i915#768]) +1 similar issue
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@gem_render_copy@linear-to-vebox-yf-tiled.html

  * igt@gem_userptr_blits@access-control:
    - shard-tglb:         NOTRUN -> [SKIP][21] ([i915#3297]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb5/igt@gem_userptr_blits@access-control.html
    - shard-iclb:         NOTRUN -> [SKIP][22] ([i915#3297]) +1 similar issue
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb8/igt@gem_userptr_blits@access-control.html

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

  * igt@gen3_render_tiledy_blits:
    - shard-tglb:         NOTRUN -> [SKIP][24] ([fdo#109289]) +1 similar issue
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb1/igt@gen3_render_tiledy_blits.html
    - shard-iclb:         NOTRUN -> [SKIP][25] ([fdo#109289]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@gen3_render_tiledy_blits.html

  * igt@gen9_exec_parse@batch-invalid-length:
    - shard-snb:          NOTRUN -> [SKIP][26] ([fdo#109271]) +446 similar issues
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-snb2/igt@gen9_exec_parse@batch-invalid-length.html

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
    - shard-apl:          NOTRUN -> [SKIP][27] ([fdo#109271] / [i915#1937])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl6/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp.html

  * igt@i915_query@query-topology-unsupported:
    - shard-iclb:         NOTRUN -> [SKIP][28] ([fdo#109302])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb8/igt@i915_query@query-topology-unsupported.html
    - shard-tglb:         NOTRUN -> [SKIP][29] ([fdo#109302])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@i915_query@query-topology-unsupported.html

  * igt@kms_addfb_basic@invalid-smem-bo-on-discrete:
    - shard-tglb:         NOTRUN -> [SKIP][30] ([i915#3826])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb2/igt@kms_addfb_basic@invalid-smem-bo-on-discrete.html
    - shard-iclb:         NOTRUN -> [SKIP][31] ([i915#3826])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb3/igt@kms_addfb_basic@invalid-smem-bo-on-discrete.html

  * igt@kms_atomic@plane-primary-overlay-mutable-zpos:
    - shard-tglb:         NOTRUN -> [SKIP][32] ([i915#404])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb3/igt@kms_atomic@plane-primary-overlay-mutable-zpos.html
    - shard-iclb:         NOTRUN -> [SKIP][33] ([i915#404])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@kms_atomic@plane-primary-overlay-mutable-zpos.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-hflip:
    - shard-apl:          NOTRUN -> [SKIP][34] ([fdo#109271] / [i915#3777]) +4 similar issues
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl1/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-hflip.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip:
    - shard-kbl:          NOTRUN -> [SKIP][35] ([fdo#109271] / [i915#3777]) +2 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl2/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip.html
    - shard-glk:          NOTRUN -> [SKIP][36] ([fdo#109271] / [i915#3777]) +1 similar issue
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk5/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip.html

  * igt@kms_big_fb@yf-tiled-8bpp-rotate-180:
    - shard-tglb:         NOTRUN -> [SKIP][37] ([fdo#111615]) +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb7/igt@kms_big_fb@yf-tiled-8bpp-rotate-180.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-0-async-flip:
    - shard-iclb:         NOTRUN -> [SKIP][38] ([fdo#110723])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb6/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-0-async-flip.html

  * igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
    - shard-apl:          NOTRUN -> [SKIP][39] ([fdo#109271] / [i915#3886]) +11 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl6/igt@kms_ccs@pipe-a-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs_cc:
    - shard-glk:          NOTRUN -> [SKIP][40] ([fdo#109271] / [i915#3886]) +4 similar issues
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk7/igt@kms_ccs@pipe-b-bad-aux-stride-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-bad-rotation-90-yf_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][41] ([i915#3689]) +4 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb5/igt@kms_ccs@pipe-b-bad-rotation-90-yf_tiled_ccs.html

  * igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc:
    - shard-kbl:          NOTRUN -> [SKIP][42] ([fdo#109271] / [i915#3886]) +3 similar issues
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl7/igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-bad-rotation-90-y_tiled_gen12_rc_ccs_cc:
    - shard-iclb:         NOTRUN -> [SKIP][43] ([fdo#109278] / [i915#3886]) +3 similar issues
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@kms_ccs@pipe-c-bad-rotation-90-y_tiled_gen12_rc_ccs_cc.html

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

  * igt@kms_cdclk@plane-scaling:
    - shard-iclb:         NOTRUN -> [SKIP][45] ([i915#3742])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb7/igt@kms_cdclk@plane-scaling.html
    - shard-tglb:         NOTRUN -> [SKIP][46] ([i915#3742])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb5/igt@kms_cdclk@plane-scaling.html

  * igt@kms_color_chamelium@pipe-a-ctm-blue-to-red:
    - shard-snb:          NOTRUN -> [SKIP][47] ([fdo#109271] / [fdo#111827]) +23 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-snb5/igt@kms_color_chamelium@pipe-a-ctm-blue-to-red.html
    - shard-kbl:          NOTRUN -> [SKIP][48] ([fdo#109271] / [fdo#111827]) +7 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl4/igt@kms_color_chamelium@pipe-a-ctm-blue-to-red.html

  * igt@kms_color_chamelium@pipe-a-ctm-limited-range:
    - shard-apl:          NOTRUN -> [SKIP][49] ([fdo#109271] / [fdo#111827]) +21 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl8/igt@kms_color_chamelium@pipe-a-ctm-limited-range.html

  * igt@kms_color_chamelium@pipe-a-gamma:
    - shard-iclb:         NOTRUN -> [SKIP][50] ([fdo#109284] / [fdo#111827]) +3 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb1/igt@kms_color_chamelium@pipe-a-gamma.html

  * igt@kms_color_chamelium@pipe-d-ctm-0-25:
    - shard-glk:          NOTRUN -> [SKIP][51] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk4/igt@kms_color_chamelium@pipe-d-ctm-0-25.html
    - shard-tglb:         NOTRUN -> [SKIP][52] ([fdo#109284] / [fdo#111827]) +4 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@kms_color_chamelium@pipe-d-ctm-0-25.html
    - shard-iclb:         NOTRUN -> [SKIP][53] ([fdo#109278] / [fdo#109284] / [fdo#111827])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb5/igt@kms_color_chamelium@pipe-d-ctm-0-25.html

  * igt@kms_content_protection@atomic:
    - shard-apl:          NOTRUN -> [TIMEOUT][54] ([i915#1319])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl7/igt@kms_content_protection@atomic.html

  * igt@kms_content_protection@uevent:
    - shard-apl:          NOTRUN -> [FAIL][55] ([i915#2105])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl3/igt@kms_content_protection@uevent.html

  * igt@kms_cursor_crc@pipe-a-cursor-32x32-random:
    - shard-tglb:         NOTRUN -> [SKIP][56] ([i915#3319])
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb1/igt@kms_cursor_crc@pipe-a-cursor-32x32-random.html

  * igt@kms_cursor_crc@pipe-a-cursor-512x170-random:
    - shard-tglb:         NOTRUN -> [SKIP][57] ([fdo#109279] / [i915#3359]) +2 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb1/igt@kms_cursor_crc@pipe-a-cursor-512x170-random.html

  * igt@kms_cursor_crc@pipe-a-cursor-512x512-rapid-movement:
    - shard-iclb:         NOTRUN -> [SKIP][58] ([fdo#109278] / [fdo#109279]) +2 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb4/igt@kms_cursor_crc@pipe-a-cursor-512x512-rapid-movement.html

  * igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque:
    - shard-kbl:          NOTRUN -> [FAIL][59] ([i915#3444])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl1/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
    - shard-iclb:         [PASS][60] -> [FAIL][61] ([i915#3444]) +1 similar issue
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb4/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb8/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
    - shard-apl:          [PASS][62] -> [FAIL][63] ([i915#3444])
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-apl8/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl3/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
    - shard-glk:          [PASS][64] -> [FAIL][65] ([i915#3444])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-glk5/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk3/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
    - shard-tglb:         [PASS][66] -> [FAIL][67] ([i915#2124]) +1 similar issue
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-tglb2/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb2/igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque.html

  * igt@kms_cursor_crc@pipe-a-cursor-size-change:
    - shard-glk:          NOTRUN -> [FAIL][68] ([i915#3444])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk3/igt@kms_cursor_crc@pipe-a-cursor-size-change.html
    - shard-apl:          NOTRUN -> [FAIL][69] ([i915#3444])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl3/igt@kms_cursor_crc@pipe-a-cursor-size-change.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-kbl:          [PASS][70] -> [DMESG-WARN][71] ([i915#180]) +1 similar issue
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-kbl2/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl7/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-c-cursor-32x10-sliding:
    - shard-tglb:         NOTRUN -> [SKIP][72] ([i915#3359]) +1 similar issue
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb7/igt@kms_cursor_crc@pipe-c-cursor-32x10-sliding.html

  * igt@kms_cursor_crc@pipe-d-cursor-64x64-rapid-movement:
    - shard-iclb:         NOTRUN -> [SKIP][73] ([fdo#109278]) +13 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb5/igt@kms_cursor_crc@pipe-d-cursor-64x64-rapid-movement.html

  * igt@kms_flip@2x-wf_vblank-ts-check:
    - shard-iclb:         NOTRUN -> [SKIP][74] ([fdo#109274]) +1 similar issue
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb7/igt@kms_flip@2x-wf_vblank-ts-check.html

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

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-blt:
    - shard-kbl:          NOTRUN -> [SKIP][76] ([fdo#109271]) +89 similar issues
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl1/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-blt.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-onoff:
    - shard-tglb:         NOTRUN -> [SKIP][77] ([fdo#111825]) +19 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-onoff.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          [PASS][78] -> [DMESG-WARN][79] ([i915#180]) +1 similar issue
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-apl8/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl6/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-spr-indfb-draw-mmap-wc:
    - shard-iclb:         NOTRUN -> [SKIP][80] ([fdo#109280]) +14 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-spr-indfb-draw-mmap-wc.html

  * igt@kms_frontbuffer_tracking@psr-rgb565-draw-mmap-cpu:
    - shard-glk:          NOTRUN -> [SKIP][81] ([fdo#109271]) +70 similar issues
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk5/igt@kms_frontbuffer_tracking@psr-rgb565-draw-mmap-cpu.html

  * igt@kms_hdr@bpc-switch-suspend:
    - shard-apl:          NOTRUN -> [DMESG-WARN][82] ([i915#180])
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl3/igt@kms_hdr@bpc-switch-suspend.html

  * igt@kms_pipe_crc_basic@hang-read-crc-pipe-d:
    - shard-kbl:          NOTRUN -> [SKIP][83] ([fdo#109271] / [i915#533])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl6/igt@kms_pipe_crc_basic@hang-read-crc-pipe-d.html

  * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
    - shard-kbl:          [PASS][84] -> [INCOMPLETE][85] ([i915#155] / [i915#794])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-kbl7/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl2/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
    - shard-apl:          NOTRUN -> [FAIL][86] ([fdo#108145] / [i915#265]) +5 similar issues
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl7/igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
    - shard-glk:          NOTRUN -> [FAIL][87] ([fdo#108145] / [i915#265]) +1 similar issue
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk5/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max.html
    - shard-kbl:          NOTRUN -> [FAIL][88] ([fdo#108145] / [i915#265])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl6/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         NOTRUN -> [SKIP][89] ([i915#3536])
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb8/igt@kms_plane_lowres@pipe-a-tiling-x.html
    - shard-tglb:         NOTRUN -> [SKIP][90] ([i915#3536])
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-a-scaler-with-clipping-clamping:
    - shard-iclb:         NOTRUN -> [DMESG-WARN][91] ([i915#1226])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-a-scaler-with-clipping-clamping.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
    - shard-apl:          NOTRUN -> [SKIP][92] ([fdo#109271] / [i915#2733])
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl8/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html
    - shard-kbl:          NOTRUN -> [SKIP][93] ([fdo#109271] / [i915#2733])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl6/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html
    - shard-glk:          NOTRUN -> [SKIP][94] ([fdo#109271] / [i915#2733])
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk5/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html

  * igt@kms_psr2_sf@cursor-plane-update-sf:
    - shard-tglb:         NOTRUN -> [SKIP][95] ([i915#2920]) +2 similar issues
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@kms_psr2_sf@cursor-plane-update-sf.html
    - shard-glk:          NOTRUN -> [SKIP][96] ([fdo#109271] / [i915#658])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk4/igt@kms_psr2_sf@cursor-plane-update-sf.html

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

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
    - shard-iclb:         NOTRUN -> [SKIP][98] ([i915#658]) +2 similar issues
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb4/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1.html

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

  * igt@kms_psr@psr2_no_drrs:
    - shard-iclb:         [PASS][100] -> [SKIP][101] ([fdo#109441]) +1 similar issue
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb1/igt@kms_psr@psr2_no_drrs.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-tglb:         NOTRUN -> [FAIL][102] ([i915#132] / [i915#3467])
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb1/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_sysfs_edid_timing:
    - shard-apl:          NOTRUN -> [FAIL][103] ([IGT#2])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl2/igt@kms_sysfs_edid_timing.html

  * igt@kms_vrr@flipline:
    - shard-tglb:         NOTRUN -> [SKIP][104] ([fdo#109502])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb1/igt@kms_vrr@flipline.html
    - shard-iclb:         NOTRUN -> [SKIP][105] ([fdo#109502])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@kms_vrr@flipline.html

  * igt@nouveau_crc@pipe-a-ctx-flip-skip-current-frame:
    - shard-tglb:         NOTRUN -> [SKIP][106] ([i915#2530]) +1 similar issue
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@nouveau_crc@pipe-a-ctx-flip-skip-current-frame.html
    - shard-iclb:         NOTRUN -> [SKIP][107] ([i915#2530])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb8/igt@nouveau_crc@pipe-a-ctx-flip-skip-current-frame.html

  * igt@nouveau_crc@pipe-b-ctx-flip-skip-current-frame:
    - shard-apl:          NOTRUN -> [SKIP][108] ([fdo#109271]) +282 similar issues
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl2/igt@nouveau_crc@pipe-b-ctx-flip-skip-current-frame.html

  * igt@nouveau_crc@pipe-d-ctx-flip-skip-current-frame:
    - shard-iclb:         NOTRUN -> [SKIP][109] ([fdo#109278] / [i915#2530])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@nouveau_crc@pipe-d-ctx-flip-skip-current-frame.html

  * igt@prime_nv_pcopy@test1_macro:
    - shard-tglb:         NOTRUN -> [SKIP][110] ([fdo#109291])
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb7/igt@prime_nv_pcopy@test1_macro.html
    - shard-iclb:         NOTRUN -> [SKIP][111] ([fdo#109291])
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb5/igt@prime_nv_pcopy@test1_macro.html

  * igt@sysfs_clients@fair-7:
    - shard-apl:          NOTRUN -> [SKIP][112] ([fdo#109271] / [i915#2994]) +4 similar issues
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-apl6/igt@sysfs_clients@fair-7.html
    - shard-iclb:         NOTRUN -> [SKIP][113] ([i915#2994]) +1 similar issue
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb1/igt@sysfs_clients@fair-7.html
    - shard-tglb:         NOTRUN -> [SKIP][114] ([i915#2994]) +1 similar issue
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb8/igt@sysfs_clients@fair-7.html

  * igt@sysfs_clients@sema-50:
    - shard-kbl:          NOTRUN -> [SKIP][115] ([fdo#109271] / [i915#2994]) +1 similar issue
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl3/igt@sysfs_clients@sema-50.html
    - shard-glk:          NOTRUN -> [SKIP][116] ([fdo#109271] / [i915#2994]) +1 similar issue
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk4/igt@sysfs_clients@sema-50.html

  
#### Possible fixes ####

  * igt@gem_eio@in-flight-contexts-10ms:
    - shard-tglb:         [TIMEOUT][117] ([i915#3063]) -> [PASS][118]
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-tglb3/igt@gem_eio@in-flight-contexts-10ms.html
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb7/igt@gem_eio@in-flight-contexts-10ms.html

  * igt@gem_eio@unwedge-stress:
    - shard-iclb:         [TIMEOUT][119] ([i915#2369] / [i915#2481] / [i915#3070]) -> [PASS][120]
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb8/igt@gem_eio@unwedge-stress.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb5/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-kbl:          [FAIL][121] ([i915#2846]) -> [PASS][122]
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-kbl6/igt@gem_exec_fair@basic-deadline.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl6/igt@gem_exec_fair@basic-deadline.html
    - shard-glk:          [FAIL][123] ([i915#2846]) -> [PASS][124]
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-glk1/igt@gem_exec_fair@basic-deadline.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk4/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-none-vip@rcs0:
    - shard-tglb:         [FAIL][125] ([i915#2842]) -> [PASS][126] +1 similar issue
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-tglb5/igt@gem_exec_fair@basic-none-vip@rcs0.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-tglb6/igt@gem_exec_fair@basic-none-vip@rcs0.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - shard-glk:          [FAIL][127] ([i915#2842]) -> [PASS][128] +1 similar issue
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-glk3/igt@gem_exec_fair@basic-pace-solo@rcs0.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-glk1/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-iclb:         [FAIL][129] ([i915#2842]) -> [PASS][130]
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb1/igt@gem_exec_fair@basic-throttle@rcs0.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb2/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-kbl:          [DMESG-WARN][131] ([i915#180]) -> [PASS][132]
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-kbl7/igt@gem_exec_suspend@basic-s3.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl4/igt@gem_exec_suspend@basic-s3.html

  * igt@gem_mmap_gtt@cpuset-big-copy-odd:
    - shard-iclb:         [FAIL][133] ([i915#307]) -> [PASS][134]
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb6/igt@gem_mmap_gtt@cpuset-big-copy-odd.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb7/igt@gem_mmap_gtt@cpuset-big-copy-odd.html

  * igt@i915_pm_dc@dc6-psr:
    - shard-iclb:         [FAIL][135] ([i915#454]) -> [PASS][136]
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-iclb6/igt@i915_pm_dc@dc6-psr.html
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-iclb5/igt@i915_pm_dc@dc6-psr.html

  * igt@i915_suspend@forcewake:
    - shard-kbl:          [INCOMPLETE][137] ([i915#155] / [i915#636]) -> [PASS][138]
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10489/shard-kbl3/igt@i915_suspend@forcewake.html
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6125/shard-kbl7/igt@i915_suspend@forcewake.html

  * igt@kms_big_fb@x-tiled-32bpp-rotate-180:
    - shard-glk:

== Logs ==

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

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

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

* [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests
@ 2021-08-13 10:06 Juha-Pekka Heikkila
  0 siblings, 0 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2021-08-13 10:06 UTC (permalink / raw)
  To: igt-dev; +Cc: Juha-Pekka Heikkila

On some hw versions it seems setting cursor plane on may get delayed.
Mitigate this away from test by separating cursor hw and sw runs so
that during test cursor will be switched on only once and kept on until
it is no more needed.

While at it did some simple cleanup and optimization.

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

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index a9bc3a745..351a2e930 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -46,10 +46,17 @@ IGT_TEST_DESCRIPTION(
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
 
+enum cursor_buffers {
+	HWCURSORBUFFER,
+	SWCOMPARISONBUFFER1,
+	SWCOMPARISONBUFFER2,
+	MAXCURSORBUFFER
+};
+
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
-	struct igt_fb primary_fb[2];
+	struct igt_fb primary_fb[MAXCURSORBUFFER];
 	struct igt_fb fb;
 	igt_output_t *output;
 	enum pipe pipe;
@@ -70,29 +77,35 @@ typedef struct {
 #define TEST_DPMS (1<<0)
 #define TEST_SUSPEND (1<<1)
 
-#define HWCURSORBUFFER 0
-#define SWCOMPARISONBUFFER 1
+typedef struct {
+	int x;
+	int y;
+	int width;
+	int height;
+} cursorarea;
 
-static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch, double a)
+static void draw_cursor(cairo_t *cr, cursorarea *cursor)
 {
 	int wl, wr, ht, hb;
 
 	/* deal with odd cursor width/height */
-	wl = cw / 2;
-	wr = (cw + 1) / 2;
-	ht = ch / 2;
-	hb = (ch + 1) / 2;
+	wl = cursor->width / 2;
+	wr = (cursor->width + 1) / 2;
+	ht = cursor->height / 2;
+	hb = (cursor->height + 1) / 2;
 
 	/* Cairo doesn't like to be fed numbers that are too wild */
-	if ((x < SHRT_MIN) || (x > SHRT_MAX) || (y < SHRT_MIN) || (y > SHRT_MAX))
+	if ((cursor->x < SHRT_MIN) || (cursor->x > SHRT_MAX) ||
+	    (cursor->y < SHRT_MIN) || (cursor->y > SHRT_MAX))
 		return;
+
 	cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
 	cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
 	/* 4 color rectangles in the corners, RGBY */
-	igt_paint_color_alpha(cr, x,      y,      wl, ht, 1.0, 0.0, 0.0, a);
-	igt_paint_color_alpha(cr, x + wl, y,      wr, ht, 0.0, 1.0, 0.0, a);
-	igt_paint_color_alpha(cr, x,      y + ht, wl, hb, 0.0, 0.0, 1.0, a);
-	igt_paint_color_alpha(cr, x + wl, y + ht, wr, hb, 1.0, 1.0, 1.0, a);
+	igt_paint_color(cr, cursor->x, cursor->y, wl, ht, 1.0, 0.0, 0.0);
+	igt_paint_color(cr, cursor->x + wl, cursor->y, wr, ht, 0.0, 1.0, 0.0);
+	igt_paint_color(cr, cursor->x, cursor->y + ht, wl, hb, 0.0, 0.0, 1.0);
+	igt_paint_color(cr, cursor->x + wl, cursor->y + ht, wr, hb, 1.0, 1.0, 1.0);
 }
 
 static void cursor_enable(data_t *data)
@@ -144,7 +157,7 @@ static bool cursor_visible(data_t *data, int x, int y)
 	return true;
 }
 
-static void restore_image(data_t *data, uint32_t buffer)
+static void restore_image(data_t *data, uint32_t buffer, cursorarea *cursor)
 {
 	cairo_t *cr;
 
@@ -153,80 +166,84 @@ static void restore_image(data_t *data, uint32_t buffer)
 	cairo_set_source_surface(cr, data->surface, 0, 0);
 	cairo_rectangle(cr, 0, 0, data->screenw, data->screenh);
 	cairo_fill(cr);
+
+	if (cursor)
+		draw_cursor(cr, cursor);
+
 	igt_put_cairo_ctx(cr);
 }
 
-static void do_single_test(data_t *data, int x, int y)
+static void do_single_test(data_t *data, int x, int y, bool hw_test,
+			   igt_crc_t *hwcrc)
 {
 	igt_display_t *display = &data->display;
 	igt_pipe_crc_t *pipe_crc = data->pipe_crc;
-	igt_crc_t crc, ref_crc;
-	cairo_t *cr;
-	int ret = 0;
+	igt_crc_t crc;
+	int ret = 0, swbufidx;
 
 	igt_print_activity();
 
-	/* Hardware test */
-	igt_plane_set_position(data->cursor, x, y);
-	cursor_enable(data);
+	if (hw_test) {
+		/* Hardware test */
+		igt_plane_set_position(data->cursor, x, y);
 
-	if (chv_cursor_broken(data, x) && cursor_visible(data, x, y)) {
-		ret = igt_display_try_commit2(display, COMMIT_LEGACY);
-		igt_assert_eq(ret, -EINVAL);
-		igt_plane_set_position(data->cursor, 0, y);
-		return;
-	}
+		if (chv_cursor_broken(data, x) && cursor_visible(data, x, y)) {
+			ret = igt_display_try_commit2(display, COMMIT_LEGACY);
+			igt_assert_eq(ret, -EINVAL);
+			igt_plane_set_position(data->cursor, 0, y);
+			return;
+		}
 
-	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
-	igt_display_commit(display);
+		igt_display_commit(display);
 
-	/* Extra vblank wait is because nonblocking cursor ioctl */
-	igt_wait_for_vblank(data->drm_fd,
-			    display->pipes[data->pipe].crtc_offset);
+		/* Extra vblank wait is because nonblocking cursor ioctl */
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
-	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
-	restore_image(data, SWCOMPARISONBUFFER);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
 
-	if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
-		igt_crc_t crc_after;
-		/*
-		 * stop/start crc to avoid dmesg notifications about userspace
-		 * reading too slow.
-		 */
-		igt_pipe_crc_stop(pipe_crc);
-
-		if (data->flags & TEST_DPMS) {
-			igt_debug("dpms off/on cycle\n");
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_OFF);
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_ON);
+		if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
+			igt_crc_t crc_after;
+			/*
+			* stop/start crc to avoid dmesg notifications about userspace
+			* reading too slow.
+			*/
+			igt_pipe_crc_stop(pipe_crc);
+
+			if (data->flags & TEST_DPMS) {
+				igt_debug("dpms off/on cycle\n");
+				kmstest_set_connector_dpms(data->drm_fd,
+							data->output->config.connector,
+							DRM_MODE_DPMS_OFF);
+				kmstest_set_connector_dpms(data->drm_fd,
+							data->output->config.connector,
+							DRM_MODE_DPMS_ON);
+			}
+
+			if (data->flags & TEST_SUSPEND)
+				igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
+							SUSPEND_TEST_NONE);
+
+			igt_pipe_crc_start(pipe_crc);
+			igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
+			igt_assert_crc_equal(hwcrc, &crc_after);
 		}
+	} else {
+		/* Now render the same in software and collect crc */
+		swbufidx = (data->primary->drm_plane->fb_id ==
+			    data->primary_fb[SWCOMPARISONBUFFER1].fb_id) ?
+			    SWCOMPARISONBUFFER2 : SWCOMPARISONBUFFER1;
 
-		if (data->flags & TEST_SUSPEND)
-			igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
-						      SUSPEND_TEST_NONE);
-
-		igt_pipe_crc_start(pipe_crc);
-		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
-		igt_assert_crc_equal(&crc, &crc_after);
-	}
-
-	/* Now render the same in software and collect crc */
-	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
-	draw_cursor(cr, x, y, data->curw, data->curh, 1.0);
-	igt_put_cairo_ctx(cr);
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
-	cursor_disable(data);
-	igt_display_commit(display);
+		restore_image(data, swbufidx, &((cursorarea){x, y, data->curw, data->curh}));
+		igt_plane_set_fb(data->primary, &data->primary_fb[swbufidx]);
 
-	igt_wait_for_vblank(data->drm_fd,
-			display->pipes[data->pipe].crtc_offset);
+		igt_display_commit(display);
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
-	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
-	igt_assert_crc_equal(&crc, &ref_crc);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
+		igt_assert_crc_equal(&crc, hwcrc);
+	}
 }
 
 static void do_fail_test(data_t *data, int x, int y, int expect)
@@ -248,70 +265,112 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
 	igt_assert_eq(ret, expect);
 }
 
-static void do_test(data_t *data,
-		    int left, int right, int top, int bottom)
+static void do_test(data_t *data, const cursorarea *coords, igt_crc_t crc[4],
+		    bool hwtest)
 {
-	do_single_test(data, left, top);
-	do_single_test(data, right, top);
-	do_single_test(data, right, bottom);
-	do_single_test(data, left, bottom);
+	do_single_test(data, coords->x, coords->width, hwtest, &crc[0]);
+	do_single_test(data, coords->y, coords->width, hwtest, &crc[1]);
+	do_single_test(data, coords->y, coords->height, hwtest, &crc[2]);
+	do_single_test(data, coords->x, coords->height, hwtest, &crc[3]);
 }
 
 static void test_crc_onscreen(data_t *data)
 {
-	int left = data->left;
-	int right = data->right;
-	int top = data->top;
-	int bottom = data->bottom;
-	int cursor_w = data->curw;
-	int cursor_h = data->curh;
-
-	/* fully inside  */
-	do_test(data, left, right, top, bottom);
-
-	/* 2 pixels inside */
-	do_test(data, left - (cursor_w-2), right + (cursor_w-2), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h-2), bottom + (cursor_h-2));
-	do_test(data, left - (cursor_w-2), right + (cursor_w-2), top - (cursor_h-2), bottom + (cursor_h-2));
-
-	/* 1 pixel inside */
-	do_test(data, left - (cursor_w-1), right + (cursor_w-1), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h-1), bottom + (cursor_h-1));
-	do_test(data, left - (cursor_w-1), right + (cursor_w-1), top - (cursor_h-1), bottom + (cursor_h-1));
+	const int left = data->left;
+	const int right = data->right;
+	const int top = data->top;
+	const int bottom = data->bottom;
+	const int cursor_w = data->curw;
+	const int cursor_h = data->curh;
+
+	struct {
+		const cursorarea coords;
+		igt_crc_t crc[4];
+	} tests[] = {
+		/* fully inside  */
+		{{left, right, top, bottom}},
+		/* 2 pixels inside */
+		{{left - (cursor_w - 2), right + (cursor_w - 2), top, bottom}},
+		{{left, right, top - (cursor_h - 2), bottom + (cursor_h - 2)}},
+		{{left - (cursor_w - 2), right + (cursor_w - 2),
+		  top - (cursor_h - 2), bottom + (cursor_h - 2)}},
+		/* 1 pixel inside */
+		{{left - (cursor_w - 1), right + (cursor_w - 1), top, bottom}},
+		{{left, right, top - (cursor_h - 1), bottom + (cursor_h - 1)}},
+		{{left - (cursor_w - 1), right + (cursor_w - 1),
+		  top - (cursor_h - 1), bottom + (cursor_h - 1)}},
+	};
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, &tests[i].coords, tests[i].crc, true);
+
+	/* SW test */
+	cursor_disable(data);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, &tests[i].coords, tests[i].crc, false);
 }
 
 static void test_crc_offscreen(data_t *data)
 {
-	int left = data->left;
-	int right = data->right;
-	int top = data->top;
-	int bottom = data->bottom;
-	int cursor_w = data->curw;
-	int cursor_h = data->curh;
-
-	/* fully outside */
-	do_test(data, left - (cursor_w), right + (cursor_w), top             , bottom             );
-	do_test(data, left             , right             , top - (cursor_h), bottom + (cursor_h));
-	do_test(data, left - (cursor_w), right + (cursor_w), top - (cursor_h), bottom + (cursor_h));
-
-	/* fully outside by 1 extra pixels */
-	do_test(data, left - (cursor_w+1), right + (cursor_w+1), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h+1), bottom + (cursor_h+1));
-	do_test(data, left - (cursor_w+1), right + (cursor_w+1), top - (cursor_h+1), bottom + (cursor_h+1));
-
-	/* fully outside by 2 extra pixels */
-	do_test(data, left - (cursor_w+2), right + (cursor_w+2), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h+2), bottom + (cursor_h+2));
-	do_test(data, left - (cursor_w+2), right + (cursor_w+2), top - (cursor_h+2), bottom + (cursor_h+2));
-
-	/* fully outside by a lot of extra pixels */
-	do_test(data, left - (cursor_w+512), right + (cursor_w+512), top                 , bottom                 );
-	do_test(data, left                 , right                 , top - (cursor_h+512), bottom + (cursor_h+512));
-	do_test(data, left - (cursor_w+512), right + (cursor_w+512), top - (cursor_h+512), bottom + (cursor_h+512));
-
-	/* go nuts */
-	do_test(data, INT_MIN, INT_MAX - cursor_w, INT_MIN, INT_MAX - cursor_h);
-	do_test(data, SHRT_MIN, SHRT_MAX, SHRT_MIN, SHRT_MAX);
+	const int left = data->left;
+	const int right = data->right;
+	const int top = data->top;
+	const int bottom = data->bottom;
+	const int cursor_w = data->curw;
+	const int cursor_h = data->curh;
+
+	struct {
+		const cursorarea coords;
+		igt_crc_t crc[4];
+	} tests[] = {
+		/* fully outside */
+		{{left - (cursor_w), right + (cursor_w), top, bottom}},
+		{{left, right, top - (cursor_h), bottom + (cursor_h)}},
+		{{left - (cursor_w), right + (cursor_w), top - (cursor_h),
+		  bottom + (cursor_h)}},
+		/* fully outside by 1 extra pixels */
+		{{left - (cursor_w + 1), right + (cursor_w + 1), top, bottom}},
+		{{left, right, top - (cursor_h + 1), bottom + (cursor_h + 1)}},
+		{{left - (cursor_w + 1), right + (cursor_w + 1),
+		  top - (cursor_h + 1), bottom + (cursor_h + 1)}},
+		/* fully outside by 2 extra pixels */
+		{{left - (cursor_w + 2), right + (cursor_w + 2), top, bottom}},
+		{{left, right, top - (cursor_h + 2), bottom + (cursor_h + 2)}},
+		{{left - (cursor_w + 2), right + (cursor_w + 2),
+		  top - (cursor_h + 2), bottom + (cursor_h + 2)}},
+		/* fully outside by a lot of extra pixels */
+		{{left - (cursor_w + 512), right + (cursor_w + 512), top, bottom}},
+		{{left, right, top - (cursor_h + 512), bottom + (cursor_h + 512)}},
+		{{left - (cursor_w + 512), right + (cursor_w + 512),
+		  top - (cursor_h + 512), bottom + (cursor_h + 512)}},
+		/* go nuts */
+		{{INT_MIN, INT_MAX - cursor_w, INT_MIN, INT_MAX - cursor_h}},
+		{{SHRT_MIN, SHRT_MAX, SHRT_MIN, SHRT_MAX}},
+	};
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, &tests[i].coords, tests[i].crc, true);
+
+	/* SW test */
+	cursor_disable(data);
+	/*
+	 * all these crc's should be the same, actually render only first image
+	 * to check crc and then compare rest of crc are matching
+	 */
+	do_test(data, &tests[0].coords, tests[0].crc, false);
+
+	for (int i = 1; i < ARRAY_SIZE(tests); i++) {
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[0]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[1]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[2]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[3]);
+	}	
 
 	/* Make sure we get -ERANGE on integer overflow */
 	do_fail_test(data, INT_MAX - cursor_w + 1, INT_MAX - cursor_h + 1, -ERANGE);
@@ -320,29 +379,75 @@ static void test_crc_offscreen(data_t *data)
 static void test_crc_sliding(data_t *data)
 {
 	int i;
+	igt_crc_t crc[16 * 3];
 
 	/* Make sure cursor moves smoothly and pixel-by-pixel, and that there are
 	 * no alignment issues. Horizontal, vertical and diagonal test.
 	 */
-	for (i = 0; i < 16; i++) {
-		do_single_test(data, i, 0);
-		do_single_test(data, 0, i);
-		do_single_test(data, i, i);
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+
+	for (i = 0; i < ARRAY_SIZE(crc); i++) {
+		switch (i % 3) {
+		case 0:
+			do_single_test(data, i, 0, true, &crc[i]);
+			break;
+		case 1:
+			do_single_test(data, 0, i, true, &crc[i]);
+			break;
+		case 2:
+			do_single_test(data, i, i, true, &crc[i]);
+			break;
+		default:
+			igt_assert(false);
+		}
+	}
+
+	/* SW test */
+	cursor_disable(data);
+	for (i = 0; i < ARRAY_SIZE(crc); i++) {
+		switch (i % 3) {
+		case 0:
+			do_single_test(data, i, 0, false, &crc[i]);
+			break;
+		case 1:
+			do_single_test(data, 0, i, false, &crc[i]);
+			break;
+		case 2:
+			do_single_test(data, i, i, false, &crc[i]);
+			break;
+		default:
+			igt_assert(false);
+		}
 	}
 }
 
 static void test_crc_random(data_t *data)
 {
-	int i, max;
+	igt_crc_t crc[50];
+	int i, max, x[ARRAY_SIZE(crc)], y[ARRAY_SIZE(crc)];
 
-	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : 50;
+	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : ARRAY_SIZE(crc);
 
 	/* Random cursor placement */
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+
 	for (i = 0; i < max; i++) {
-		int x = rand() % (data->screenw + data->curw * 2) - data->curw;
-		int y = rand() % (data->screenh + data->curh * 2) - data->curh;
-		do_single_test(data, x, y);
+		x[i] = rand() % (data->screenw + data->curw * 2) - data->curw;
+		y[i] = rand() % (data->screenh + data->curh * 2) - data->curh;
+		do_single_test(data, x[i], y[i], true, &crc[i]);
 	}
+
+	/* SW test */
+	cursor_disable(data);
+	for (i = 0; i < max; i++)
+		do_single_test(data, x[i], y[i], false, &crc[i]);
+
 }
 
 static void cleanup_crtc(data_t *data)
@@ -362,7 +467,8 @@ static void cleanup_crtc(data_t *data)
 	igt_display_commit(display);
 
 	igt_remove_fb(data->drm_fd, &data->primary_fb[HWCURSORBUFFER]);
-	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
+	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER2]);
 
 	igt_display_reset(display);
 }
@@ -379,22 +485,22 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 
 	/* create and set the primary plane fbs */
 	mode = igt_output_get_mode(output);
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_NONE,
-			    0.0, 0.0, 0.0,
-			    &data->primary_fb[HWCURSORBUFFER]);
-
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_NONE,
-			    0.0, 0.0, 0.0,
-			    &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[HWCURSORBUFFER]);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[SWCOMPARISONBUFFER1]);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[SWCOMPARISONBUFFER2]);
 
 	data->primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	data->cursor = igt_output_get_plane_type(output, DRM_PLANE_TYPE_CURSOR);
 
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 
 	igt_display_commit(display);
 
@@ -427,7 +533,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 		cairo_destroy(cr);
 
 		/* Set HW cursor buffer in place */
-			restore_image(data, HWCURSORBUFFER);
+		restore_image(data, HWCURSORBUFFER, NULL);
 	} else
 		data->surface = NULL;
 
@@ -469,10 +575,10 @@ static void test_cursor_alpha(data_t *data, double a)
 	igt_remove_fb(data->drm_fd, &data->fb);
 
 	/* Software Test - render cursor in software, drawn it directly on PF */
-	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
 	igt_paint_color_alpha(cr, 0, 0, curw, curh, 1.0, 1.0, 1.0, a);
 	igt_put_cairo_ctx(cr);
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 	igt_display_commit(display);
 	igt_wait_for_vblank(data->drm_fd,
 			display->pipes[data->pipe].crtc_offset);
@@ -513,7 +619,7 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
 	igt_assert(fb_id);
 
 	cr = igt_get_cairo_ctx(data->drm_fd, &data->fb);
-	draw_cursor(cr, 0, 0, cur_w, cur_h, 1.0);
+	draw_cursor(cr, &((cursorarea){0, 0, cur_w, cur_h}));
 	igt_put_cairo_ctx(cr);
 }
 
@@ -610,7 +716,7 @@ static void test_cursor_size(data_t *data)
 		igt_display_commit(display);
 
 		/* Now render the same in software and collect crc */
-		cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+		cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
 
 		/* remove previous cursor sw image */
 		if (prevsize > 0)
@@ -619,7 +725,7 @@ static void test_cursor_size(data_t *data)
 
 		igt_paint_color_alpha(cr, 0, 0, size, size, 1.0, 1.0, 1.0, 1.0);
 		igt_put_cairo_ctx(cr);
-		igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+		igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 		igt_display_commit(display);
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
 
@@ -666,6 +772,8 @@ static void test_rapid_movement(data_t *data)
 	timersub(&end, &start, &delta);
 	usec = delta.tv_usec + 1000000 * delta.tv_sec;
 	igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
+
+	cursor_disable(data);
 }
 
 static void run_size_tests(data_t *data, enum pipe pipe,
-- 
2.28.0

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

* [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests
@ 2021-08-12 14:33 Juha-Pekka Heikkila
  0 siblings, 0 replies; 5+ messages in thread
From: Juha-Pekka Heikkila @ 2021-08-12 14:33 UTC (permalink / raw)
  To: igt-dev; +Cc: Juha-Pekka Heikkila

On some hw versions it seems setting cursor plane on may get delayed.
Mitigate this away from test by separating cursor hw and sw runs so
that during test cursor will be switched on only once and kept on until
it is no more needed.

While at it did some simple cleanup.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 tests/kms_cursor_crc.c | 372 ++++++++++++++++++++++++++---------------
 1 file changed, 234 insertions(+), 138 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index a9bc3a745..98227d041 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -49,7 +49,7 @@ IGT_TEST_DESCRIPTION(
 typedef struct {
 	int drm_fd;
 	igt_display_t display;
-	struct igt_fb primary_fb[2];
+	struct igt_fb primary_fb[3];
 	struct igt_fb fb;
 	igt_output_t *output;
 	enum pipe pipe;
@@ -71,7 +71,8 @@ typedef struct {
 #define TEST_SUSPEND (1<<1)
 
 #define HWCURSORBUFFER 0
-#define SWCOMPARISONBUFFER 1
+#define SWCOMPARISONBUFFER1 1
+#define SWCOMPARISONBUFFER2 2
 
 static void draw_cursor(cairo_t *cr, int x, int y, int cw, int ch, double a)
 {
@@ -156,77 +157,83 @@ static void restore_image(data_t *data, uint32_t buffer)
 	igt_put_cairo_ctx(cr);
 }
 
-static void do_single_test(data_t *data, int x, int y)
+static void do_single_test(data_t *data, int x, int y, bool hw_test,
+			   igt_crc_t *hwcrc)
 {
 	igt_display_t *display = &data->display;
 	igt_pipe_crc_t *pipe_crc = data->pipe_crc;
-	igt_crc_t crc, ref_crc;
+	igt_crc_t crc;
 	cairo_t *cr;
-	int ret = 0;
+	int ret = 0, swbufidx;
 
 	igt_print_activity();
 
-	/* Hardware test */
-	igt_plane_set_position(data->cursor, x, y);
-	cursor_enable(data);
+	if (hw_test) {
+		/* Hardware test */
+		igt_plane_set_position(data->cursor, x, y);
 
-	if (chv_cursor_broken(data, x) && cursor_visible(data, x, y)) {
-		ret = igt_display_try_commit2(display, COMMIT_LEGACY);
-		igt_assert_eq(ret, -EINVAL);
-		igt_plane_set_position(data->cursor, 0, y);
-		return;
-	}
+		if (chv_cursor_broken(data, x) && cursor_visible(data, x, y)) {
+			ret = igt_display_try_commit2(display, COMMIT_LEGACY);
+			igt_assert_eq(ret, -EINVAL);
+			igt_plane_set_position(data->cursor, 0, y);
+			return;
+		}
 
-	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
-	igt_display_commit(display);
+		igt_display_commit(display);
 
-	/* Extra vblank wait is because nonblocking cursor ioctl */
-	igt_wait_for_vblank(data->drm_fd,
-			    display->pipes[data->pipe].crtc_offset);
+		/* Extra vblank wait is because nonblocking cursor ioctl */
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
-	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
-	restore_image(data, SWCOMPARISONBUFFER);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, hwcrc);
 
-	if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
-		igt_crc_t crc_after;
-		/*
-		 * stop/start crc to avoid dmesg notifications about userspace
-		 * reading too slow.
-		 */
-		igt_pipe_crc_stop(pipe_crc);
-
-		if (data->flags & TEST_DPMS) {
-			igt_debug("dpms off/on cycle\n");
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_OFF);
-			kmstest_set_connector_dpms(data->drm_fd,
-						   data->output->config.connector,
-						   DRM_MODE_DPMS_ON);
+		if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
+			igt_crc_t crc_after;
+			/*
+			* stop/start crc to avoid dmesg notifications about userspace
+			* reading too slow.
+			*/
+			igt_pipe_crc_stop(pipe_crc);
+
+			if (data->flags & TEST_DPMS) {
+				igt_debug("dpms off/on cycle\n");
+				kmstest_set_connector_dpms(data->drm_fd,
+							data->output->config.connector,
+							DRM_MODE_DPMS_OFF);
+				kmstest_set_connector_dpms(data->drm_fd,
+							data->output->config.connector,
+							DRM_MODE_DPMS_ON);
+			}
+
+			if (data->flags & TEST_SUSPEND)
+				igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
+							SUSPEND_TEST_NONE);
+
+			igt_pipe_crc_start(pipe_crc);
+			igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
+			igt_assert_crc_equal(hwcrc, &crc_after);
 		}
+	} else {
+		/* Now render the same in software and collect crc */
+		swbufidx = (data->primary->drm_plane->fb_id ==
+			    data->primary_fb[SWCOMPARISONBUFFER1].fb_id) ? 1 : 0;
 
-		if (data->flags & TEST_SUSPEND)
-			igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
-						      SUSPEND_TEST_NONE);
-
-		igt_pipe_crc_start(pipe_crc);
-		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
-		igt_assert_crc_equal(&crc, &crc_after);
-	}
+		restore_image(data, SWCOMPARISONBUFFER1 + swbufidx);
+		cr = igt_get_cairo_ctx(data->drm_fd,
+				       &data->primary_fb[SWCOMPARISONBUFFER1 + swbufidx]);
 
-	/* Now render the same in software and collect crc */
-	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
-	draw_cursor(cr, x, y, data->curw, data->curh, 1.0);
-	igt_put_cairo_ctx(cr);
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
-	cursor_disable(data);
-	igt_display_commit(display);
+		draw_cursor(cr, x, y, data->curw, data->curh, 1.0);
+		igt_put_cairo_ctx(cr);
+		igt_plane_set_fb(data->primary,
+				 &data->primary_fb[SWCOMPARISONBUFFER1 + swbufidx]);
 
-	igt_wait_for_vblank(data->drm_fd,
-			display->pipes[data->pipe].crtc_offset);
+		igt_display_commit(display);
+		igt_wait_for_vblank(data->drm_fd,
+				display->pipes[data->pipe].crtc_offset);
 
-	igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
-	igt_assert_crc_equal(&crc, &ref_crc);
+		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
+		igt_assert_crc_equal(&crc, hwcrc);
+	}
 }
 
 static void do_fail_test(data_t *data, int x, int y, int expect)
@@ -248,70 +255,112 @@ static void do_fail_test(data_t *data, int x, int y, int expect)
 	igt_assert_eq(ret, expect);
 }
 
-static void do_test(data_t *data,
-		    int left, int right, int top, int bottom)
+static void do_test(data_t *data, const int coords[4], igt_crc_t crc[4],
+		    bool hwtest)
 {
-	do_single_test(data, left, top);
-	do_single_test(data, right, top);
-	do_single_test(data, right, bottom);
-	do_single_test(data, left, bottom);
+	do_single_test(data, coords[0], coords[2], hwtest, &crc[0]);
+	do_single_test(data, coords[1], coords[2], hwtest, &crc[1]);
+	do_single_test(data, coords[1], coords[3], hwtest, &crc[2]);
+	do_single_test(data, coords[0], coords[3], hwtest, &crc[3]);
 }
 
 static void test_crc_onscreen(data_t *data)
 {
-	int left = data->left;
-	int right = data->right;
-	int top = data->top;
-	int bottom = data->bottom;
-	int cursor_w = data->curw;
-	int cursor_h = data->curh;
-
-	/* fully inside  */
-	do_test(data, left, right, top, bottom);
-
-	/* 2 pixels inside */
-	do_test(data, left - (cursor_w-2), right + (cursor_w-2), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h-2), bottom + (cursor_h-2));
-	do_test(data, left - (cursor_w-2), right + (cursor_w-2), top - (cursor_h-2), bottom + (cursor_h-2));
-
-	/* 1 pixel inside */
-	do_test(data, left - (cursor_w-1), right + (cursor_w-1), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h-1), bottom + (cursor_h-1));
-	do_test(data, left - (cursor_w-1), right + (cursor_w-1), top - (cursor_h-1), bottom + (cursor_h-1));
+	const int left = data->left;
+	const int right = data->right;
+	const int top = data->top;
+	const int bottom = data->bottom;
+	const int cursor_w = data->curw;
+	const int cursor_h = data->curh;
+
+	struct {
+		const int coords[4];
+		igt_crc_t crc[4];
+	} tests[] = {
+		/* fully inside  */
+		{{left, right, top, bottom}},
+		/* 2 pixels inside */
+		{{left - (cursor_w - 2), right + (cursor_w - 2), top, bottom}},
+		{{left, right, top - (cursor_h - 2), bottom + (cursor_h - 2)}},
+		{{left - (cursor_w - 2), right + (cursor_w - 2),
+		  top - (cursor_h - 2), bottom + (cursor_h - 2)}},
+		/* 1 pixel inside */
+		{{left - (cursor_w - 1), right + (cursor_w - 1), top, bottom}},
+		{{left, right, top - (cursor_h - 1), bottom + (cursor_h - 1)}},
+		{{left - (cursor_w - 1), right + (cursor_w - 1),
+		  top - (cursor_h - 1), bottom + (cursor_h - 1)}},
+	};
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, tests[i].coords, tests[i].crc, true);
+
+	/* SW test */
+	cursor_disable(data);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, tests[i].coords, tests[i].crc, false);
 }
 
 static void test_crc_offscreen(data_t *data)
 {
-	int left = data->left;
-	int right = data->right;
-	int top = data->top;
-	int bottom = data->bottom;
-	int cursor_w = data->curw;
-	int cursor_h = data->curh;
-
-	/* fully outside */
-	do_test(data, left - (cursor_w), right + (cursor_w), top             , bottom             );
-	do_test(data, left             , right             , top - (cursor_h), bottom + (cursor_h));
-	do_test(data, left - (cursor_w), right + (cursor_w), top - (cursor_h), bottom + (cursor_h));
-
-	/* fully outside by 1 extra pixels */
-	do_test(data, left - (cursor_w+1), right + (cursor_w+1), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h+1), bottom + (cursor_h+1));
-	do_test(data, left - (cursor_w+1), right + (cursor_w+1), top - (cursor_h+1), bottom + (cursor_h+1));
-
-	/* fully outside by 2 extra pixels */
-	do_test(data, left - (cursor_w+2), right + (cursor_w+2), top               , bottom               );
-	do_test(data, left               , right               , top - (cursor_h+2), bottom + (cursor_h+2));
-	do_test(data, left - (cursor_w+2), right + (cursor_w+2), top - (cursor_h+2), bottom + (cursor_h+2));
-
-	/* fully outside by a lot of extra pixels */
-	do_test(data, left - (cursor_w+512), right + (cursor_w+512), top                 , bottom                 );
-	do_test(data, left                 , right                 , top - (cursor_h+512), bottom + (cursor_h+512));
-	do_test(data, left - (cursor_w+512), right + (cursor_w+512), top - (cursor_h+512), bottom + (cursor_h+512));
-
-	/* go nuts */
-	do_test(data, INT_MIN, INT_MAX - cursor_w, INT_MIN, INT_MAX - cursor_h);
-	do_test(data, SHRT_MIN, SHRT_MAX, SHRT_MIN, SHRT_MAX);
+	const int left = data->left;
+	const int right = data->right;
+	const int top = data->top;
+	const int bottom = data->bottom;
+	const int cursor_w = data->curw;
+	const int cursor_h = data->curh;
+
+	struct {
+		const int coords[4];
+		igt_crc_t crc[4];
+	} tests[] = {
+		/* fully outside */
+		{{left - (cursor_w), right + (cursor_w), top, bottom}},
+		{{left, right, top - (cursor_h), bottom + (cursor_h)}},
+		{{left - (cursor_w), right + (cursor_w), top - (cursor_h),
+		  bottom + (cursor_h)}},
+		/* fully outside by 1 extra pixels */
+		{{left - (cursor_w + 1), right + (cursor_w + 1), top, bottom}},
+		{{left, right, top - (cursor_h + 1), bottom + (cursor_h + 1)}},
+		{{left - (cursor_w + 1), right + (cursor_w + 1),
+		  top - (cursor_h + 1), bottom + (cursor_h + 1)}},
+		/* fully outside by 2 extra pixels */
+		{{left - (cursor_w + 2), right + (cursor_w + 2), top, bottom}},
+		{{left, right, top - (cursor_h + 2), bottom + (cursor_h + 2)}},
+		{{left - (cursor_w + 2), right + (cursor_w + 2),
+		  top - (cursor_h + 2), bottom + (cursor_h + 2)}},
+		/* fully outside by a lot of extra pixels */
+		{{left - (cursor_w + 512), right + (cursor_w + 512), top, bottom}},
+		{{left, right, top - (cursor_h + 512), bottom + (cursor_h + 512)}},
+		{{left - (cursor_w + 512), right + (cursor_w + 512),
+		  top - (cursor_h + 512), bottom + (cursor_h + 512)}},
+		/* go nuts */
+		{{INT_MIN, INT_MAX - cursor_w, INT_MIN, INT_MAX - cursor_h}},
+		{{SHRT_MIN, SHRT_MAX, SHRT_MIN, SHRT_MAX}},
+	};
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+	for (int i = 0; i < ARRAY_SIZE(tests); i++)
+		do_test(data, tests[i].coords, tests[i].crc, true);
+
+	/* SW test */
+	cursor_disable(data);
+	/*
+	 * all these crc's should be the same, actually render only first image
+	 * to check crc and then compare rest of crc are matching
+	 */
+	do_test(data, tests[0].coords, tests[0].crc, false);
+
+	for (int i = 1; i < ARRAY_SIZE(tests); i++) {
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[0]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[1]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[2]);
+		igt_assert_crc_equal(&tests[0].crc[0], &tests[i].crc[3]);
+	}	
 
 	/* Make sure we get -ERANGE on integer overflow */
 	do_fail_test(data, INT_MAX - cursor_w + 1, INT_MAX - cursor_h + 1, -ERANGE);
@@ -320,29 +369,75 @@ static void test_crc_offscreen(data_t *data)
 static void test_crc_sliding(data_t *data)
 {
 	int i;
+	igt_crc_t crc[16 * 3];
 
 	/* Make sure cursor moves smoothly and pixel-by-pixel, and that there are
 	 * no alignment issues. Horizontal, vertical and diagonal test.
 	 */
-	for (i = 0; i < 16; i++) {
-		do_single_test(data, i, 0);
-		do_single_test(data, 0, i);
-		do_single_test(data, i, i);
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+
+	for (i = 0; i < ARRAY_SIZE(crc); i++) {
+		switch (i % 3) {
+		case 0:
+			do_single_test(data, i, 0, true, &crc[i]);
+			break;
+		case 1:
+			do_single_test(data, 0, i, true, &crc[i]);
+			break;
+		case 2:
+			do_single_test(data, i, i, true, &crc[i]);
+			break;
+		default:
+			igt_assert(false);
+		}
+	}
+
+	/* SW test */
+	cursor_disable(data);
+	for (i = 0; i < ARRAY_SIZE(crc); i++) {
+		switch (i % 3) {
+		case 0:
+			do_single_test(data, i, 0, false, &crc[i]);
+			break;
+		case 1:
+			do_single_test(data, 0, i, false, &crc[i]);
+			break;
+		case 2:
+			do_single_test(data, i, i, false, &crc[i]);
+			break;
+		default:
+			igt_assert(false);
+		}
 	}
 }
 
 static void test_crc_random(data_t *data)
 {
-	int i, max;
+	igt_crc_t crc[50];
+	int i, max, x[ARRAY_SIZE(crc)], y[ARRAY_SIZE(crc)];
 
-	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : 50;
+	max = data->flags & (TEST_DPMS | TEST_SUSPEND) ? 2 : ARRAY_SIZE(crc);
 
 	/* Random cursor placement */
+
+	/* HW test */
+	cursor_enable(data);
+	igt_plane_set_fb(data->primary, &data->primary_fb[HWCURSORBUFFER]);
+
 	for (i = 0; i < max; i++) {
-		int x = rand() % (data->screenw + data->curw * 2) - data->curw;
-		int y = rand() % (data->screenh + data->curh * 2) - data->curh;
-		do_single_test(data, x, y);
+		x[i] = rand() % (data->screenw + data->curw * 2) - data->curw;
+		y[i] = rand() % (data->screenh + data->curh * 2) - data->curh;
+		do_single_test(data, x[i], y[i], true, &crc[i]);
 	}
+
+	/* SW test */
+	cursor_disable(data);
+	for (i = 0; i < max; i++)
+		do_single_test(data, x[i], y[i], false, &crc[i]);
+
 }
 
 static void cleanup_crtc(data_t *data)
@@ -362,7 +457,8 @@ static void cleanup_crtc(data_t *data)
 	igt_display_commit(display);
 
 	igt_remove_fb(data->drm_fd, &data->primary_fb[HWCURSORBUFFER]);
-	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
+	igt_remove_fb(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER2]);
 
 	igt_display_reset(display);
 }
@@ -379,22 +475,22 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 
 	/* create and set the primary plane fbs */
 	mode = igt_output_get_mode(output);
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_NONE,
-			    0.0, 0.0, 0.0,
-			    &data->primary_fb[HWCURSORBUFFER]);
-
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_NONE,
-			    0.0, 0.0, 0.0,
-			    &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[HWCURSORBUFFER]);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[SWCOMPARISONBUFFER1]);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+		      &data->primary_fb[SWCOMPARISONBUFFER2]);
 
 	data->primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
 	data->cursor = igt_output_get_plane_type(output, DRM_PLANE_TYPE_CURSOR);
 
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 
 	igt_display_commit(display);
 
@@ -427,7 +523,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 		cairo_destroy(cr);
 
 		/* Set HW cursor buffer in place */
-			restore_image(data, HWCURSORBUFFER);
+		restore_image(data, HWCURSORBUFFER);
 	} else
 		data->surface = NULL;
 
@@ -469,10 +565,10 @@ static void test_cursor_alpha(data_t *data, double a)
 	igt_remove_fb(data->drm_fd, &data->fb);
 
 	/* Software Test - render cursor in software, drawn it directly on PF */
-	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+	cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
 	igt_paint_color_alpha(cr, 0, 0, curw, curh, 1.0, 1.0, 1.0, a);
 	igt_put_cairo_ctx(cr);
-	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+	igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 	igt_display_commit(display);
 	igt_wait_for_vblank(data->drm_fd,
 			display->pipes[data->pipe].crtc_offset);
@@ -610,7 +706,7 @@ static void test_cursor_size(data_t *data)
 		igt_display_commit(display);
 
 		/* Now render the same in software and collect crc */
-		cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER]);
+		cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb[SWCOMPARISONBUFFER1]);
 
 		/* remove previous cursor sw image */
 		if (prevsize > 0)
@@ -619,7 +715,7 @@ static void test_cursor_size(data_t *data)
 
 		igt_paint_color_alpha(cr, 0, 0, size, size, 1.0, 1.0, 1.0, 1.0);
 		igt_put_cairo_ctx(cr);
-		igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER]);
+		igt_plane_set_fb(data->primary, &data->primary_fb[SWCOMPARISONBUFFER1]);
 		igt_display_commit(display);
 		igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
 
-- 
2.28.0

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

end of thread, other threads:[~2021-08-16 18:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 12:58 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests Juha-Pekka Heikkila
2021-08-16 14:50 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: separate hw and sw runs on tests (rev3) Patchwork
2021-08-16 18:05 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-08-13 10:06 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: separate hw and sw runs on tests Juha-Pekka Heikkila
2021-08-12 14:33 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.