* [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display.
@ 2018-01-24 10:25 Maarten Lankhorst
2018-01-24 11:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Maarten Lankhorst @ 2018-01-24 10:25 UTC (permalink / raw)
To: igt-dev
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.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
tests/kms_render.c | 191 ++++++++++++++++++-----------------------------------
1 file changed, 64 insertions(+), 127 deletions(-)
diff --git a/tests/kms_render.c b/tests/kms_render.c
index 255cf3de39cf..0b31d351dd90 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -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);
}
--
2.15.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 9+ messages in thread* [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-24 10:25 [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display Maarten Lankhorst @ 2018-01-24 11:01 ` Patchwork 2018-01-24 11:08 ` [igt-dev] [PATCH i-g-t] " Chris Wilson ` (2 subsequent siblings) 3 siblings, 0 replies; 9+ messages in thread From: Patchwork @ 2018-01-24 11:01 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev == 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-24 10:25 [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display Maarten Lankhorst 2018-01-24 11:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork @ 2018-01-24 11:08 ` Chris Wilson 2018-01-24 11:22 ` Maarten Lankhorst 2018-01-24 11:55 ` Mika Kahola 2018-01-24 13:24 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork 3 siblings, 1 reply; 9+ messages in thread From: Chris Wilson @ 2018-01-24 11:08 UTC (permalink / raw) To: Maarten Lankhorst, igt-dev Quoting Maarten Lankhorst (2018-01-24 10:25:00) > 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-24 11:08 ` [igt-dev] [PATCH i-g-t] " Chris Wilson @ 2018-01-24 11:22 ` Maarten Lankhorst 2018-01-30 8:01 ` Daniel Vetter 0 siblings, 1 reply; 9+ messages in thread From: Maarten Lankhorst @ 2018-01-24 11:22 UTC (permalink / raw) To: Chris Wilson, igt-dev Op 24-01-18 om 12:08 schreef Chris Wilson: > Quoting Maarten Lankhorst (2018-01-24 10:25:00) >> 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-24 11:22 ` Maarten Lankhorst @ 2018-01-30 8:01 ` Daniel Vetter 2018-01-30 9:54 ` Maarten Lankhorst 2018-01-31 14:25 ` Imre Deak 0 siblings, 2 replies; 9+ messages in thread From: Daniel Vetter @ 2018-01-30 8:01 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev On Wed, Jan 24, 2018 at 12:22:07PM +0100, Maarten Lankhorst wrote: > Op 24-01-18 om 12:08 schreef Chris Wilson: > > Quoting Maarten Lankhorst (2018-01-24 10:25:00) > >> 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 <imre.deak@intel.com> 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. Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> I'm voting for removal too, assuming Imre doesn't come up with a very good reason for why we need it. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-30 8:01 ` Daniel Vetter @ 2018-01-30 9:54 ` Maarten Lankhorst 2018-01-31 14:25 ` Imre Deak 1 sibling, 0 replies; 9+ messages in thread From: Maarten Lankhorst @ 2018-01-30 9:54 UTC (permalink / raw) To: Daniel Vetter; +Cc: igt-dev Hey, Op 30-01-18 om 09:01 schreef Daniel Vetter: > On Wed, Jan 24, 2018 at 12:22:07PM +0100, Maarten Lankhorst wrote: >> Op 24-01-18 om 12:08 schreef Chris Wilson: >>> Quoting Maarten Lankhorst (2018-01-24 10:25:00) >>>> 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 <imre.deak@intel.com> > 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. > > Signed-off-by: Imre Deak <imre.deak@intel.com> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> > > 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-30 8:01 ` Daniel Vetter 2018-01-30 9:54 ` Maarten Lankhorst @ 2018-01-31 14:25 ` Imre Deak 1 sibling, 0 replies; 9+ messages in thread From: Imre Deak @ 2018-01-31 14:25 UTC (permalink / raw) To: Daniel Vetter; +Cc: igt-dev On Tue, Jan 30, 2018 at 09:01:14AM +0100, Daniel Vetter wrote: > On Wed, Jan 24, 2018 at 12:22:07PM +0100, Maarten Lankhorst wrote: > > Op 24-01-18 om 12:08 schreef Chris Wilson: > > > Quoting Maarten Lankhorst (2018-01-24 10:25:00) > > >> 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 <imre.deak@intel.com> > 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. > > Signed-off-by: Imre Deak <imre.deak@intel.com> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> > > 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-24 10:25 [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display Maarten Lankhorst 2018-01-24 11:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork 2018-01-24 11:08 ` [igt-dev] [PATCH i-g-t] " Chris Wilson @ 2018-01-24 11:55 ` Mika Kahola 2018-01-24 13:24 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork 3 siblings, 0 replies; 9+ messages in thread From: Mika Kahola @ 2018-01-24 11:55 UTC (permalink / raw) To: Maarten Lankhorst, igt-dev On Wed, 2018-01-24 at 11:25 +0100, Maarten Lankhorst wrote: > 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. > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > --- > tests/kms_render.c | 191 ++++++++++++++++++------------------------- > ---------- > 1 file changed, 64 insertions(+), 127 deletions(-) > > diff --git a/tests/kms_render.c b/tests/kms_render.c > index 255cf3de39cf..0b31d351dd90 100644 > --- a/tests/kms_render.c > +++ b/tests/kms_render.c > @@ -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; This could be split into separate lines. It would be easier to read that way. Otherwise the patch looks ok. > 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); > } -- Mika Kahola - Intel OTC _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_render: Rewrite test to take advantage of igt_display. 2018-01-24 10:25 [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display Maarten Lankhorst ` (2 preceding siblings ...) 2018-01-24 11:55 ` Mika Kahola @ 2018-01-24 13:24 ` Patchwork 3 siblings, 0 replies; 9+ messages in thread From: Patchwork @ 2018-01-24 13:24 UTC (permalink / raw) To: Maarten Lankhorst; +Cc: igt-dev == 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 igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-01-31 14:25 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-01-24 10:25 [igt-dev] [PATCH i-g-t] tests/kms_render: Rewrite test to take advantage of igt_display Maarten Lankhorst 2018-01-24 11:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork 2018-01-24 11:08 ` [igt-dev] [PATCH i-g-t] " Chris Wilson 2018-01-24 11:22 ` Maarten Lankhorst 2018-01-30 8:01 ` Daniel Vetter 2018-01-30 9:54 ` Maarten Lankhorst 2018-01-31 14:25 ` Imre Deak 2018-01-24 11:55 ` Mika Kahola 2018-01-24 13:24 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox