From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH i-g-t v2] kms_rotation_crc: 90 degree flip test is not a stress test
Date: Fri, 4 Aug 2017 09:43:41 +0100 [thread overview]
Message-ID: <20170804084341.28499-1-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20170803124250.24958-1-tvrtko.ursulin@linux.intel.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
To the best of my recollection the page flipping test was added
simply to start exercising page flips with 90/270 rotation.
There is no need to do 60 flips which can take quite some time,
because we do 60 flips against each pipe and each fb geometry.
Also, calling this a stress test is also not matching the
original idea of the test.
Several changes:
1. Remove the stress from the name and reduce the number of
flips to one only.
2. Move the page flip before CRC collection for a more useful
test.
3. Add more flipping tests, for different rotation and sprite
planes.
4. Convert to table driven subtest generation.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/intel-ci/extended.testlist | 2 +-
tests/kms_rotation_crc.c | 137 ++++++++++++++++++++++++---------------
2 files changed, 85 insertions(+), 54 deletions(-)
diff --git a/tests/intel-ci/extended.testlist b/tests/intel-ci/extended.testlist
index 17eed013f810..fb71091758c6 100644
--- a/tests/intel-ci/extended.testlist
+++ b/tests/intel-ci/extended.testlist
@@ -82,7 +82,7 @@ igt@gem_ringfill@vebox-bomb
igt@gem_userptr_blits@stress-mm
igt@gem_userptr_blits@stress-mm-invalidate-close
igt@gem_userptr_blits@stress-mm-invalidate-close-overlap
-igt@kms_rotation_crc@primary-rotation-90-flip-stress
+igt@kms_rotation_crc@primary-rotation-90-flip
igt@pm_rpm@gem-execbuf-stress
igt@pm_rpm@gem-execbuf-stress-extra-wait
igt@pm_rpm@gem-execbuf-stress-pc8
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 83e37f126f40..20f1adb67769 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -41,7 +41,7 @@ typedef struct {
int pos_y;
uint32_t override_fmt;
uint64_t override_tiling;
- unsigned int flip_stress;
+ unsigned int flips;
} data_t;
static void
@@ -219,7 +219,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling, &data->fb);
- if (data->flip_stress) {
+ if (data->flips) {
igt_create_fb(data->gfx_fd, w, h, pixel_format, tiling, &data->fb_flip);
paint_squares(data, IGT_ROTATION_0, &data->fb_flip, 0.92);
}
@@ -351,15 +351,17 @@ static void test_plane_rotation(data_t *data, int plane_type)
ret = igt_display_try_commit2(display, commit);
if (data->override_fmt || data->override_tiling) {
igt_assert_eq(ret, -EINVAL);
- } else {
- igt_assert_eq(ret, 0);
- igt_pipe_crc_collect_crc(data->pipe_crc,
- &crc_output);
- igt_assert_crc_equal(&data->ref_crc,
- &crc_output);
+ continue;
}
- flip_count = data->flip_stress;
+ /* Verify commit was ok. */
+ igt_assert_eq(ret, 0);
+
+ /*
+ * If flips are requested flip away and back before
+ * checking CRC.
+ */
+ flip_count = data->flips;
while (flip_count--) {
ret = drmModePageFlip(data->gfx_fd,
output->config.crtc->crtc_id,
@@ -376,6 +378,9 @@ static void test_plane_rotation(data_t *data, int plane_type)
igt_assert_eq(ret, 0);
wait_for_pageflip(data->gfx_fd);
}
+
+ igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
+ igt_assert_crc_equal(&data->ref_crc, &crc_output);
}
valid_tests++;
@@ -569,8 +574,66 @@ err_commit:
igt_assert_eq(ret, 0);
}
+static const char *plane_test_str(unsigned plane)
+{
+ switch (plane) {
+ case DRM_PLANE_TYPE_PRIMARY:
+ return "primary";
+ case DRM_PLANE_TYPE_OVERLAY:
+ return "sprite";
+ case DRM_PLANE_TYPE_CURSOR:
+ return "cursor";
+ default:
+ igt_assert(0);
+ }
+}
+
+static const char *rot_test_str(igt_rotation_t rot)
+{
+ switch (rot) {
+ case IGT_ROTATION_90:
+ return "90";
+ case IGT_ROTATION_180:
+ return "180";
+ case IGT_ROTATION_270:
+ return "270";
+ default:
+ igt_assert(0);
+ }
+}
+
+static const char *flip_test_str(unsigned flips)
+{
+ if (flips > 1)
+ return "-flip-stress";
+ else if (flips)
+ return "-flip";
+ else
+ return "";
+}
+
igt_main
{
+ struct rot_subtest {
+ unsigned plane;
+ igt_rotation_t rot;
+ unsigned flips;
+ } *subtest, subtests[] = {
+ { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90, 0 },
+ { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180, 0 },
+ { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270, 0 },
+ { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90, 1 },
+ { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180, 1 },
+ { DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270, 1 },
+ { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90, 0 },
+ { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180, 0 },
+ { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270, 0 },
+ { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90, 1 },
+ { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180, 1 },
+ { DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270, 1 },
+ { DRM_PLANE_TYPE_CURSOR, IGT_ROTATION_180, 0 },
+ { 0, 0, 0}
+ };
data_t data = {};
int gen = 0;
@@ -586,43 +649,19 @@ igt_main
igt_display_init(&data.display, data.gfx_fd);
}
- igt_subtest_f("primary-rotation-180") {
- data.rotation = IGT_ROTATION_180;
- test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
- }
-
- igt_subtest_f("sprite-rotation-180") {
- data.rotation = IGT_ROTATION_180;
- test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
- }
-
- igt_subtest_f("cursor-rotation-180") {
- data.rotation = IGT_ROTATION_180;
- test_plane_rotation(&data, DRM_PLANE_TYPE_CURSOR);
- }
-
- igt_subtest_f("primary-rotation-90") {
- igt_require(gen >= 9);
- data.rotation = IGT_ROTATION_90;
- test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
- }
- igt_subtest_f("primary-rotation-270") {
- igt_require(gen >= 9);
- data.rotation = IGT_ROTATION_270;
- test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
- }
-
- igt_subtest_f("sprite-rotation-90") {
- igt_require(gen >= 9);
- data.rotation = IGT_ROTATION_90;
- test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
- }
-
- igt_subtest_f("sprite-rotation-270") {
- igt_require(gen >= 9);
- data.rotation = IGT_ROTATION_270;
- test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
+ for (subtest = subtests; subtest->rot; subtest++) {
+ igt_subtest_f("%s-rotation-%s%s",
+ plane_test_str(subtest->plane),
+ rot_test_str(subtest->rot),
+ flip_test_str(subtest->flips)) {
+ igt_require(!(subtest->rot &
+ (IGT_ROTATION_90 | IGT_ROTATION_270)) ||
+ gen >= 9);
+ data.rotation = subtest->rot;
+ data.flips = subtest->flips;
+ test_plane_rotation(&data, subtest->plane);
+ }
}
igt_subtest_f("sprite-rotation-90-pos-100-0") {
@@ -650,14 +689,6 @@ igt_main
test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
}
- igt_subtest_f("primary-rotation-90-flip-stress") {
- igt_require(gen >= 9);
- data.override_tiling = 0;
- data.flip_stress = 60;
- data.rotation = IGT_ROTATION_90;
- test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
- }
-
igt_subtest_f("primary-rotation-90-Y-tiled") {
enum pipe pipe;
igt_output_t *output;
--
2.9.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-04 8:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 12:42 [PATCH i-g-t] kms_rotation_crc: 90 degree flip test is not a stress test Tvrtko Ursulin
2017-08-03 12:53 ` Chris Wilson
2017-08-03 13:09 ` Tvrtko Ursulin
2017-08-03 13:27 ` Chris Wilson
2017-08-03 13:41 ` Tvrtko Ursulin
2017-08-03 14:19 ` Chris Wilson
2017-08-03 14:33 ` Tvrtko Ursulin
2017-08-03 14:50 ` Chris Wilson
2017-08-03 15:23 ` Daniel Vetter
2017-08-04 8:43 ` Tvrtko Ursulin [this message]
2017-08-07 15:53 ` [PATCH i-g-t v2] " Daniel Vetter
2017-09-04 14:27 ` Tvrtko Ursulin
2017-09-04 14:36 ` Tvrtko Ursulin
2017-09-04 14:43 ` Daniel Vetter
2017-09-04 14:56 ` Tvrtko Ursulin
[not found] ` <20170907141307.GA15917@kdec5-desk.ger.corp.intel.com>
[not found] ` <804db97c-0746-3796-01c0-8d0b390528f5@linux.intel.com>
2017-09-07 15:07 ` Katarzyna Dec
-- strict thread matches above, loose matches on Subject: below --
2017-09-08 11:10 Tvrtko Ursulin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170804084341.28499-1-tvrtko.ursulin@linux.intel.com \
--to=tursulin@ursulin.net \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=daniel.vetter@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox