Skip to contentSkip to conversation

tests/kms_render: Rewrite test to take advantage of igt_display.

PATCH In review Maarten Lankhorst 6 participants 9 messages Jan 24, 2018 – Jan 31, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_render: Rewrite test to take advantage of igt_display.

This test was taking ~100s for each subtest, and both tests were the same, but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

This reduces the runtime for the test from about 200s to 10s (with NV12 enabled), and checks whether pixel formats are supported without special casing them.

---
 tests/kms_render.c | 191 ++++++++++++++++++-----------------------------------
 1 file changed, 64 insertions(+), 127 deletions(-)
tests/kms_render.c +64 -127
index 255cf3de39cf..0b31d351dd90 100644
@@ -31,16 +31,7 @@
 
 #include "intel_bufmgr.h"
 
-drmModeRes *resources;
-int drm_fd;
-
-enum test_flags {
-	TEST_DIRECT_RENDER	= 0x01,
-	TEST_GPU_BLIT		= 0x02,
-};
-
-static int paint_fb(struct igt_fb *fb, const char *test_name,
-		    const char *mode_format_str, const char *cconf_str)
+static int paint_fb(int drm_fd, struct igt_fb *fb, const char *mode_format_str, const char *cconf_str)
 {
 	cairo_t *cr;
 
@@ -51,7 +42,7 @@ static int paint_fb(struct igt_fb *fb, const char *test_name,
 
 	cairo_move_to(cr, fb->width / 2, fb->height / 2);
 	cairo_set_font_size(cr, 36);
-	igt_cairo_printf_line(cr, align_hcenter, 10, "%s", test_name);
+	igt_cairo_printf_line(cr, align_hcenter, 10, "kms_render");
 	igt_cairo_printf_line(cr, align_hcenter, 10, "%s", mode_format_str);
 	igt_cairo_printf_line(cr, align_hcenter, 10, "%s", cconf_str);
 
@@ -60,7 +51,7 @@ static int paint_fb(struct igt_fb *fb, const char *test_name,
 	return 0;
 }
 
-static void gpu_blit(struct igt_fb *dst_fb, struct igt_fb *src_fb)
+static void gpu_blit(int drm_fd, struct igt_fb *dst_fb, struct igt_fb *src_fb)
 {
 	drm_intel_bo *dst_bo;
 	drm_intel_bo *src_bo;
@@ -101,156 +92,102 @@ static void gpu_blit(struct igt_fb *dst_fb, struct igt_fb *src_fb)
 	drm_intel_bo_unreference(dst_bo);
 }
 
-static int test_format(const char *test_name,
-		       struct kmstest_connector_config *cconf,
-		       drmModeModeInfo *mode, uint32_t format,
-		       enum test_flags flags)
+static void test_format(igt_display_t *display,
+			enum pipe pipe,
+			igt_output_t *output,
+			igt_plane_t *primary,
+			uint32_t format)
 {
-	int width;
-	int height;
+	drmModeModeInfo *mode = igt_output_get_mode(output);
+	int width = mode->hdisplay, height = mode->vdisplay, ret, drm_fd = display->drm_fd;
 	struct igt_fb fb[2];
 	char *mode_format_str;
 	char *cconf_str;
-	int ret;
+	igt_pipe_crc_t *pipe_crc;
+	igt_crc_t direct, blit;
 
 	ret = asprintf(&mode_format_str, "%s @ %dHz / %s",
-		 mode->name, mode->vrefresh, igt_format_str(format));
+		       mode->name, mode->vrefresh, igt_format_str(format));
 	igt_assert_lt(0, ret);
+
 	ret = asprintf(&cconf_str, "pipe %s, encoder %s, connector %s",
-		       kmstest_pipe_name(cconf->pipe),
-		       kmstest_encoder_type_str(cconf->encoder->encoder_type),
-		       kmstest_connector_type_str(cconf->connector->connector_type));
+		       kmstest_pipe_name(pipe),
+		       kmstest_encoder_type_str(output->config.encoder->encoder_type),
+		       output->name);
 	igt_assert_lt(0, ret);
 
-	igt_info("Beginning test %s with %s on %s\n",
-		 test_name, mode_format_str, cconf_str);
-
-	width = mode->hdisplay;
-	height = mode->vdisplay;
-
-	if (!igt_create_fb(drm_fd, width, height, format,
-			   LOCAL_DRM_FORMAT_MOD_NONE, &fb[0]))
-		goto err1;
-
-	if (!igt_create_fb(drm_fd, width, height, format,
-			   LOCAL_DRM_FORMAT_MOD_NONE,	&fb[1]))
-		goto err2;
-
-	if (drmModeSetCrtc(drm_fd, cconf->crtc->crtc_id, fb[0].fb_id,
-				 0, 0, &cconf->connector->connector_id, 1,
-				 mode))
-		goto err2;
-	do_or_die(drmModePageFlip(drm_fd, cconf->crtc->crtc_id, fb[0].fb_id,
-				  0, NULL));
-	sleep(2);
-
-	if (flags & TEST_DIRECT_RENDER) {
-		paint_fb(&fb[0], test_name, mode_format_str, cconf_str);
-	} else if (flags & TEST_GPU_BLIT) {
-		paint_fb(&fb[1], test_name, mode_format_str, cconf_str);
-		gpu_blit(&fb[0], &fb[1]);
-	}
-	sleep(5);
+	igt_create_fb(drm_fd, width, height, format,
+		      LOCAL_DRM_FORMAT_MOD_NONE, &fb[0]);
 
-	igt_info("Test %s with %s on %s: PASSED\n",
-		 test_name, mode_format_str, cconf_str);
-	free(mode_format_str);
-	free(cconf_str);
+	igt_create_fb(drm_fd, width, height, format,
+		      LOCAL_DRM_FORMAT_MOD_NONE, &fb[1]);
 
-	igt_remove_fb(drm_fd, &fb[1]);
-	igt_remove_fb(drm_fd, &fb[0]);
+	paint_fb(drm_fd, &fb[0], mode_format_str, cconf_str);
+	gpu_blit(drm_fd, &fb[1], &fb[0]);
 
-	return 0;
+	igt_plane_set_fb(primary, &fb[0]);
+	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+	pipe_crc = igt_pipe_crc_new(drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	igt_pipe_crc_collect_crc(pipe_crc, &direct);
+
+	igt_plane_set_fb(primary, &fb[1]);
+	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+	igt_pipe_crc_collect_crc(pipe_crc, &blit);
+
+	igt_assert_crc_equal(&direct, &blit);
+
+	igt_pipe_crc_free(pipe_crc);
 
-err2:
-	igt_remove_fb(drm_fd, &fb[0]);
-err1:
-	igt_info("Test %s with %s on %s: SKIPPED\n",
-		 test_name, mode_format_str, cconf_str);
 	free(mode_format_str);
 	free(cconf_str);
 
-	return -1;
+	igt_remove_fb(drm_fd, &fb[1]);
+	igt_remove_fb(drm_fd, &fb[0]);
 }
 
-static void test_connector(const char *test_name,
-			   struct kmstest_connector_config *cconf,
-			   enum test_flags flags)
+static void test_connector(igt_display_t *display, enum pipe pipe,
+			   igt_output_t *output)
 {
 	const uint32_t *formats;
-	int format_count;
-	int i;
+	igt_plane_t *primary = &display->pipes[pipe].planes[0];
+	int format_count, i, j, tested = 0;
+
+	igt_display_reset(display);
+	igt_output_set_pipe(output, pipe);
 
 	igt_get_all_cairo_formats(&formats, &format_count);
 	for (i = 0; i < format_count; i++) {
-		if (is_i915_device(drm_fd)
-		    && intel_gen(intel_get_drm_devid(drm_fd)) < 4
-		    && formats[i] == DRM_FORMAT_XRGB2101010) {
-			igt_info("gen2/3 don't support 10bpc, skipping\n");
-			continue;
-		}
-
-		test_format(test_name,
-			    cconf, &cconf->connector->modes[0],
-			    formats[i], flags);
-	}
-}
-
-static int run_test(const char *test_name, enum test_flags flags)
-{
-	int i;
-
-	resources = drmModeGetResources(drm_fd);
-	igt_assert(resources);
-
-	/* Find any connected displays */
-	for (i = 0; i < resources->count_connectors; i++) {
-		uint32_t connector_id;
-		int j;
-
-		connector_id = resources->connectors[i];
-		for (j = 0; j < resources->count_crtcs; j++) {
-			struct kmstest_connector_config cconf;
-
-			if (!kmstest_get_connector_config(drm_fd, connector_id,
-							   1 << j, &cconf))
+		for (j = 0; j < primary->drm_plane->count_formats; j++) {
+			if (primary->drm_plane->formats[j] != formats[i])
 				continue;
 
-			test_connector(test_name, &cconf, flags);
-
-			kmstest_free_connector_config(&cconf);
+			test_format(display, pipe, output,
+				    primary, formats[i]);
+			tested = 1;
+			break;
 		}
 	}
-
-	drmModeFreeResources(resources);
-
-	return 1;
+	igt_require_f(tested > 0, "No valid formats could be tested\n");
 }
 
-igt_main
+igt_simple_main
 {
-	struct {
-		enum test_flags flags;
-		const char *name;
-	} tests[] = {
-		{ TEST_DIRECT_RENDER,	"direct-render" },
-		{ TEST_GPU_BLIT,	"gpu-blit" },
-	};
-	int i;
+	igt_display_t display;
+	igt_output_t *output;
+	enum pipe pipe;
 
 	igt_skip_on_simulation();
 
-	igt_fixture {
-		drm_fd = drm_open_driver_master(DRIVER_ANY);
+	display.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
-		kmstest_set_vt_graphics_mode();
-	}
+	kmstest_set_vt_graphics_mode();
+	igt_display_init(&display, display.drm_fd);
+	igt_display_require_output(&display);
 
-	for (i = 0; i < ARRAY_SIZE(tests); i++) {
-		igt_subtest(tests[i].name)
-			run_test(tests[i].name, tests[i].flags);
-	}
+	for_each_pipe_with_valid_output(&display, pipe, output)
+		test_connector(&display, pipe, output);
 
-	igt_fixture
-		close(drm_fd);
+	igt_display_fini(&display);
+	close(display.drm_fd);
 }
Signature · 6 lines
2.15.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for tests/kms_render: Rewrite test to take advantage of igt_display.

== Series Details ==

== Series Details ==

Series: tests/kms_render: Rewrite test to take advantage of igt_display.
URL : https://patchwork.freedesktop.org/series/37024/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 37bd27f28a868c287faf361864a16e77b8d9246f tools/intel_vbt_decode: add --describe option

with latest DRM-Tip kernel build CI_DRM_3680
ef2011c63806 drm-tip: 2018y-01m-24d-09h-45m-08s UTC integration manifest

Testlist changes:
+igt@kms_render
-igt@kms_render@direct-render
-igt@kms_render@gpu-blit

Test debugfs_test:

        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:419s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:427s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:374s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:494s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:488s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:472s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:456s
fi-elk-e7500     total:224  pass:168  dwarn:10  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:278s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:394s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:403s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:418s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:457s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:417s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:466s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:498s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:456s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:502s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:580s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:437s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:518s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:497s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:424s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:436s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:529s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:396s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:576s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:473s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_818/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw
In reply to Maarten Lankhorst

Quoting Maarten Lankhorst (2018-01-24 10:25:00)

Quoted 3 lines

This test was taking ~100s for each subtest, and both tests were the same, but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

What do we do here that isn't covered by kms_frontbuffer*? My guess would be do simple testing of more configurations (as opposed to kms_frontbuffer that does lots of different drawing to the same configuration).
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

Op 24-01-18 om 12:08 schreef Chris Wilson:

Quoted 8 lines

Quoting Maarten Lankhorst (2018-01-24 10:25:00)

Quoted 3 lines

This test was taking ~100s for each subtest, and both tests were the same, but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

What do we do here that isn't covered by kms_frontbuffer*? My guess would be do simple testing of more configurations (as opposed to kms_frontbuffer that does lots of different drawing to the same configuration).

Hm probably right. I wouldn't mind removing it too, to be honest..
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#7 lore raw
In reply to Maarten Lankhorst
Quoted 8 lines · Maarten Lankhorst

This test was taking ~100s for each subtest, and both tests were the same,
but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

This reduces the runtime for the test from about 200s to 10s (with NV12 enabled), and checks whether pixel formats are supported without special casing them.

I welcome this idea to reduce test execution time. At the moment our IGT tests takes quite much time to complete.

Quoted 74 lines

---
 tests/kms_render.c | 191 ++++++++++++++++++-------------------------
----------

 1 file changed, 64 insertions(+), 127 deletions(-)
tests/kms_render.c +0 -0
index 255cf3de39cf..0b31d351dd90 100644
@@ -31,16 +31,7 @@


 #include "intel_bufmgr.h"

tests/kms_render.c +0 -10
-drmModeRes *resources;
-int drm_fd;
-
-enum test_flags {
-	TEST_DIRECT_RENDER	= 0x01,
-	TEST_GPU_BLIT		= 0x02,
-};
-
-static int paint_fb(struct igt_fb *fb, const char *test_name,
-		    const char *mode_format_str, const char

*cconf_str)
+static int paint_fb(int drm_fd, struct igt_fb *fb, const char *mode_format_str, const char *cconf_str)
 {
  cairo_t *cr;

tests/kms_render.c +0 -0
@@ -51,7 +42,7 @@ static int paint_fb(struct igt_fb *fb, const char
 *test_name,


  cairo_move_to(cr, fb->width / 2, fb->height / 2); cairo_set_font_size(cr, 36);

tests/kms_render.c +0 -1
-	igt_cairo_printf_line(cr, align_hcenter, 10, "%s",

test_name);

tests/kms_render.c +1 -0
+	igt_cairo_printf_line(cr, align_hcenter, 10, "kms_render");

  igt_cairo_printf_line(cr, align_hcenter, 10, "%s", mode_format_str);
  igt_cairo_printf_line(cr, align_hcenter, 10, "%s", cconf_str);

tests/kms_render.c +0 -0
@@ -60,7 +51,7 @@ static int paint_fb(struct igt_fb *fb, const char
 *test_name,
  	return 0;
  }

tests/kms_render.c +1 -1
-static void gpu_blit(struct igt_fb *dst_fb, struct igt_fb *src_fb)
+static void gpu_blit(int drm_fd, struct igt_fb *dst_fb, struct

igt_fb *src_fb)
 {
  drm_intel_bo *dst_bo;
  drm_intel_bo *src_bo;

tests/kms_render.c +0 -0
@@ -101,156 +92,102 @@ static void gpu_blit(struct igt_fb *dst_fb,
 struct igt_fb *src_fb)
  	drm_intel_bo_unreference(dst_bo);
  }

tests/kms_render.c +5 -4
-static int test_format(const char *test_name,
-		       struct kmstest_connector_config *cconf,
-		       drmModeModeInfo *mode, uint32_t format,
-		       enum test_flags flags)
+static void test_format(igt_display_t *display,
+			enum pipe pipe,
+			igt_output_t *output,
+			igt_plane_t *primary,
+			uint32_t format)

 {

tests/kms_render.c +2 -2
-	int width;
-	int height;
+	drmModeModeInfo *mode = igt_output_get_mode(output);
+	int width = mode->hdisplay, height = mode->vdisplay, ret,
Quoted 1 line

drm_fd = display->drm_fd;

This could be split into separate lines. It would be easier to read that way.

Otherwise the patch looks ok.

Quoted 221 lines

  struct igt_fb fb[2];
  char *mode_format_str;
  char *cconf_str;

tests/kms_render.c +2 -1
-	int ret;
+	igt_pipe_crc_t *pipe_crc;
+	igt_crc_t direct, blit;


  ret = asprintf(&mode_format_str, "%s @ %dHz / %s",

tests/kms_render.c +0 -1
-		 mode->name, mode->vrefresh,

igt_format_str(format));

tests/kms_render.c +1 -0
+		       mode->name, mode->vrefresh,

igt_format_str(format));
  igt_assert_lt(0, ret);
+
  ret = asprintf(&cconf_str, "pipe %s, encoder %s, connector %s",

tests/kms_render.c +0 -2
-		       kmstest_pipe_name(cconf->pipe),
-		       kmstest_encoder_type_str(cconf->encoder-
Quoted 1 line

encoder_type),

tests/kms_render.c +0 -1
-		       kmstest_connector_type_str(cconf->connector-
Quoted 1 line

connector_type));

tests/kms_render.c +2 -0
+		       kmstest_pipe_name(pipe),
+		       kmstest_encoder_type_str(output-
Quoted 1 line

config.encoder->encoder_type),

tests/kms_render.c +1 -0
+		       output->name);

  igt_assert_lt(0, ret);

tests/kms_render.c +0 -12
-	igt_info("Beginning test %s with %s on %s\n",
-		 test_name, mode_format_str, cconf_str);
-
-	width = mode->hdisplay;
-	height = mode->vdisplay;
-
-	if (!igt_create_fb(drm_fd, width, height, format,
-			   LOCAL_DRM_FORMAT_MOD_NONE, &fb[0]))
-		goto err1;
-
-	if (!igt_create_fb(drm_fd, width, height, format,
-			   LOCAL_DRM_FORMAT_MOD_NONE,	&fb[1])

)

tests/kms_render.c +0 -3
-		goto err2;
-
-	if (drmModeSetCrtc(drm_fd, cconf->crtc->crtc_id,

fb[0].fb_id,

tests/kms_render.c +0 -1
-				 0, 0, &cconf->connector-
Quoted 1 line

connector_id, 1,

tests/kms_render.c +0 -3
-				 mode))
-		goto err2;
-	do_or_die(drmModePageFlip(drm_fd, cconf->crtc->crtc_id,

fb[0].fb_id,

tests/kms_render.c +0 -5
-				  0, NULL));
-	sleep(2);
-
-	if (flags & TEST_DIRECT_RENDER) {
-		paint_fb(&fb[0], test_name, mode_format_str,

cconf_str);

tests/kms_render.c +0 -2
-	} else if (flags & TEST_GPU_BLIT) {
-		paint_fb(&fb[1], test_name, mode_format_str,

cconf_str);

tests/kms_render.c +2 -3
-		gpu_blit(&fb[0], &fb[1]);
-	}
-	sleep(5);
+	igt_create_fb(drm_fd, width, height, format,
+		      LOCAL_DRM_FORMAT_MOD_NONE, &fb[0]);

tests/kms_render.c +2 -4
-	igt_info("Test %s with %s on %s: PASSED\n",
-		 test_name, mode_format_str, cconf_str);
-	free(mode_format_str);
-	free(cconf_str);
+	igt_create_fb(drm_fd, width, height, format,
+		      LOCAL_DRM_FORMAT_MOD_NONE, &fb[1]);

tests/kms_render.c +2 -2
-	igt_remove_fb(drm_fd, &fb[1]);
-	igt_remove_fb(drm_fd, &fb[0]);
+	paint_fb(drm_fd, &fb[0], mode_format_str, cconf_str);
+	gpu_blit(drm_fd, &fb[1], &fb[0]);

tests/kms_render.c +2 -1
-	return 0;
+	igt_plane_set_fb(primary, &fb[0]);
+	igt_display_commit2(display, display->is_atomic ?

COMMIT_ATOMIC : COMMIT_LEGACY);

tests/kms_render.c +2 -0
+
+	pipe_crc = igt_pipe_crc_new(drm_fd, pipe,

INTEL_PIPE_CRC_SOURCE_AUTO);

tests/kms_render.c +4 -0
+	igt_pipe_crc_collect_crc(pipe_crc, &direct);
+
+	igt_plane_set_fb(primary, &fb[1]);
+	igt_display_commit2(display, display->is_atomic ?

COMMIT_ATOMIC : COMMIT_LEGACY);

tests/kms_render.c +5 -0
+	igt_pipe_crc_collect_crc(pipe_crc, &blit);
+
+	igt_assert_crc_equal(&direct, &blit);
+
+	igt_pipe_crc_free(pipe_crc);

tests/kms_render.c +0 -5
-err2:
-	igt_remove_fb(drm_fd, &fb[0]);
-err1:
-	igt_info("Test %s with %s on %s: SKIPPED\n",
-		 test_name, mode_format_str, cconf_str);

  free(mode_format_str);
  free(cconf_str);

tests/kms_render.c +2 -1
-	return -1;
+	igt_remove_fb(drm_fd, &fb[1]);
+	igt_remove_fb(drm_fd, &fb[0]);

 }

tests/kms_render.c +2 -3
-static void test_connector(const char *test_name,
-			   struct kmstest_connector_config *cconf,
-			   enum test_flags flags)
+static void test_connector(igt_display_t *display, enum pipe pipe,
+			   igt_output_t *output)

 {
  const uint32_t *formats;

tests/kms_render.c +5 -2
-	int format_count;
-	int i;
+	igt_plane_t *primary = &display->pipes[pipe].planes[0];
+	int format_count, i, j, tested = 0;
+
+	igt_display_reset(display);
+	igt_output_set_pipe(output, pipe);


  igt_get_all_cairo_formats(&formats, &format_count); for (i = 0; i < format_count; i++) {

tests/kms_render.c +0 -4
-		if (is_i915_device(drm_fd)
-		    && intel_gen(intel_get_drm_devid(drm_fd)) < 4
-		    && formats[i] == DRM_FORMAT_XRGB2101010) {
-			igt_info("gen2/3 don't support 10bpc,

skipping\n");

tests/kms_render.c +0 -26
-			continue;
-		}
-
-		test_format(test_name,
-			    cconf, &cconf->connector->modes[0],
-			    formats[i], flags);
-	}
-}
-
-static int run_test(const char *test_name, enum test_flags flags)
-{
-	int i;
-
-	resources = drmModeGetResources(drm_fd);
-	igt_assert(resources);
-
-	/* Find any connected displays */
-	for (i = 0; i < resources->count_connectors; i++) {
-		uint32_t connector_id;
-		int j;
-
-		connector_id = resources->connectors[i];
-		for (j = 0; j < resources->count_crtcs; j++) {
-			struct kmstest_connector_config cconf;
-
-			if (!kmstest_get_connector_config(drm_fd,

connector_id,

tests/kms_render.c +0 -1
-							   1 << j,

&cconf))

tests/kms_render.c +1 -0
+		for (j = 0; j < primary->drm_plane->count_formats;

j++) {

tests/kms_render.c +1 -0
+			if (primary->drm_plane->formats[j] !=

formats[i])
  continue;

tests/kms_render.c +4 -3
-			test_connector(test_name, &cconf, flags);
-
-			kmstest_free_connector_config(&cconf);
+			test_format(display, pipe, output,
+				    primary, formats[i]);
+			tested = 1;
+			break;

  }
  }

tests/kms_render.c +1 -4
-
-	drmModeFreeResources(resources);
-
-	return 1;
+	igt_require_f(tested > 0, "No valid formats could be

tested\n");
 }

tests/kms_render.c +1 -1
-igt_main
+igt_simple_main

 {

tests/kms_render.c +3 -8
-	struct {
-		enum test_flags flags;
-		const char *name;
-	} tests[] = {
-		{ TEST_DIRECT_RENDER,	"direct-render" },
-		{ TEST_GPU_BLIT,	"gpu-blit" },
-	};
-	int i;
+	igt_display_t display;
+	igt_output_t *output;
+	enum pipe pipe;


  igt_skip_on_simulation();

tests/kms_render.c +1 -2
-	igt_fixture {
-		drm_fd = drm_open_driver_master(DRIVER_ANY);
+	display.drm_fd = drm_open_driver_master(DRIVER_ANY);

tests/kms_render.c +3 -2
-		kmstest_set_vt_graphics_mode();
-	}
+	kmstest_set_vt_graphics_mode();
+	igt_display_init(&display, display.drm_fd);
+	igt_display_require_output(&display);

tests/kms_render.c +2 -4
-	for (i = 0; i < ARRAY_SIZE(tests); i++) {
-		igt_subtest(tests[i].name)
-			run_test(tests[i].name, tests[i].flags);
-	}
+	for_each_pipe_with_valid_output(&display, pipe, output)
+		test_connector(&display, pipe, output);

tests/kms_render.c +2 -2
-	igt_fixture
-		close(drm_fd);
+	igt_display_fini(&display);
+	close(display.drm_fd);

 }

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#8 lore raw

[igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_render: Rewrite test to take advantage of igt_display.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: tests/kms_render: Rewrite test to take advantage of igt_display.
URL : https://patchwork.freedesktop.org/series/37024/
State : failure

== Summary ==

Test kms_chv_cursor_fail:

        Subgroup pipe-a-256x256-bottom-edge:
                pass       -> FAIL       (shard-apl)
Test perf:
        Subgroup buffer-fill:
                fail       -> PASS       (shard-apl) fdo#103755
        Subgroup blocking:
                pass       -> FAIL       (shard-hsw) fdo#102252
Test kms_frontbuffer_tracking:
        Subgroup fbc-rgb565-draw-blt:
                pass       -> FAIL       (shard-snb) fdo#101623 +1
Test kms_flip:
        Subgroup flip-vs-absolute-wf_vblank:
                pass       -> FAIL       (shard-apl) fdo#100368
        Subgroup 2x-flip-vs-wf_vblank-interruptible:
                pass       -> FAIL       (shard-hsw)
Test perf_pmu:
        Subgroup semaphore-wait-vecs0:
                pass       -> FAIL       (shard-apl)
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-toggle:
                pass       -> FAIL       (shard-hsw) fdo#102670
Test gem_eio:
        Subgroup in-flight-suspend:
                pass       -> FAIL       (shard-hsw) fdo#104676 +1
Test gem_exec_suspend:
        Subgroup basic-s3:
                skip       -> PASS       (shard-snb) fdo#103880
Test kms_plane:
        Subgroup pixel-format-pipe-b-planes:
                pass       -> INCOMPLETE (shard-hsw)

fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880

shard-apl        total:2752 pass:1713 dwarn:1   dfail:0   fail:25  skip:1013 time:13864s
shard-hsw        total:2737 pass:1714 dwarn:1   dfail:0   fail:15  skip:1005 time:14462s
shard-snb        total:2752 pass:1316 dwarn:1   dfail:0   fail:12  skip:1423 time:7895s

Blacklisted hosts:
shard-kbl total:2752 pass:1839 dwarn:1 dfail:0 fail:24 skip:888 time:10878s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_818/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by Rodrigo Vivi
#4 lore raw
In reply to Maarten Lankhorst
Quoted 10 lines · Maarten Lankhorst

Op 24-01-18 om 12:08 schreef Chris Wilson:

Quoted 8 lines

Quoting Maarten Lankhorst (2018-01-24 10:25:00)

Quoted 3 lines

This test was taking ~100s for each subtest, and both tests were the same, but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

What do we do here that isn't covered by kms_frontbuffer*? My guess would be do simple testing of more configurations (as opposed to kms_frontbuffer that does lots of different drawing to the same configuration).

Hm probably right. I wouldn't mind removing it too, to be honest..

Originally added by Imre and reviewed by Rodrigo, but no mention why we need this testcase:

commit 528b1f381c4e67c2e63e23b5597070fffe8033d6

Author: Imre Deak <[email protected]>
Date:   Thu May 30 22:59:59 2013 +0300

tests: add kms_render

Add a test going through all connectors/crtcs/modes/formats painting to a front FB with CPU or painting to a back FB with CPU and blitting it to the front FB.

Only formats understood by cairo are supported for now.

I'm voting for removal too, assuming Imre doesn't come up with a very good reason for why we need it.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#5 lore raw

Hey,

Op 30-01-18 om 09:01 schreef Daniel Vetter:

Quoted 24 lines · Maarten Lankhorst
Quoted 10 lines

Op 24-01-18 om 12:08 schreef Chris Wilson:

Quoted 8 lines

Quoting Maarten Lankhorst (2018-01-24 10:25:00)

Quoted 3 lines

This test was taking ~100s for each subtest, and both tests were the same, but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

What do we do here that isn't covered by kms_frontbuffer*? My guess would be do simple testing of more configurations (as opposed to kms_frontbuffer that does lots of different drawing to the same configuration).

Hm probably right. I wouldn't mind removing it too, to be honest..

Originally added by Imre and reviewed by Rodrigo, but no mention why we need this testcase:

commit 528b1f381c4e67c2e63e23b5597070fffe8033d6

Author: Imre Deak <[email protected]>
Date:   Thu May 30 22:59:59 2013 +0300

tests: add kms_render

Add a test going through all connectors/crtcs/modes/formats painting to a front FB with CPU or painting to a back FB with CPU and blitting it to the front FB.

Quoted 8 lines

Only formats understood by cairo are supported for now.

I'm voting for removal too, assuming Imre doesn't come up with a very good reason for why we need it.
-Daniel

Ok I'll wait a few days longer then remove this test. kms_frontbuffer_tracking probably superceeds it.

~Maarten

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#6 lore raw
In reply to Daniel Vetter
Quoted 25 lines · Daniel Vetter
Quoted 10 lines · Maarten Lankhorst

Op 24-01-18 om 12:08 schreef Chris Wilson:

Quoted 8 lines

Quoting Maarten Lankhorst (2018-01-24 10:25:00)

Quoted 3 lines

This test was taking ~100s for each subtest, and both tests were the same, but required the user to pay attention. I've changed it to automated checking with CRC, and removed the subtests.

What do we do here that isn't covered by kms_frontbuffer*? My guess would be do simple testing of more configurations (as opposed to kms_frontbuffer that does lots of different drawing to the same configuration).

Hm probably right. I wouldn't mind removing it too, to be honest..

Originally added by Imre and reviewed by Rodrigo, but no mention why we need this testcase:

commit 528b1f381c4e67c2e63e23b5597070fffe8033d6

Author: Imre Deak <[email protected]>
Date:   Thu May 30 22:59:59 2013 +0300

tests: add kms_render

Add a test going through all connectors/crtcs/modes/formats painting to a front FB with CPU or painting to a back FB with CPU and blitting it to the front FB.

Quoted 7 lines

Only formats understood by cairo are supported for now.

I'm voting for removal too, assuming Imre doesn't come up with a very good reason for why we need it.

Looking at IRC logs, it was added to test FBC with different formats/outputs as FBC has different requirements based on these. But yes it was all manual. No objection to remove it if there is an other test doing front buffer rendering.

--Imre
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev