From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org, igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_rotation_crc: Switch to one-shot CRC collection
Date: Mon, 9 Sep 2019 09:31:38 -0700 [thread overview]
Message-ID: <20190909163138.9701-1-matthew.d.roper@intel.com> (raw)
kms_rotation_crc manually starts and stops CRC collection and reads
single CRC values when it needs them. Depending on how long the other
test setup and execution operations take, the CRC buffer (128 entries)
can fill up CRC values that the test never reads or uses. Our CI system
has stumbled over several cases where the buffer fills up and overflows
due to this. Let's switch this test over to the
igt_pipe_crc_collect_crc API which will handle the start+stop of CRC
collection when a single CRC is needed so that we won't collect a bunch
of unwanted CRC values and run the risk of overflow.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105127
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
tests/kms_rotation_crc.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 668c1732..8f36fd2f 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -167,7 +167,7 @@ static void cleanup_crtc(data_t *data)
}
static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
- igt_plane_t *plane, bool start_crc)
+ igt_plane_t *plane)
{
igt_display_t *display = &data->display;
@@ -181,9 +181,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
igt_display_commit2(display, COMMIT_ATOMIC);
data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
-
- if (start_crc)
- igt_pipe_crc_start(data->pipe_crc);
}
enum rectangle_type {
@@ -263,7 +260,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
igt_plane_set_position(plane, data->pos_x, data->pos_y);
igt_display_commit2(display, COMMIT_ATOMIC);
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->flip_crc);
+ igt_pipe_crc_collect_crc(data->pipe_crc, &data->flip_crc);
/*
* Prepare the non-rotated flip fb.
@@ -286,7 +283,7 @@ static void prepare_fbs(data_t *data, igt_output_t *output,
igt_plane_set_position(plane, data->pos_x, data->pos_y);
igt_display_commit2(display, COMMIT_ATOMIC);
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &data->ref_crc);
+ igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
/*
* Prepare the non-rotated reference fb.
@@ -336,7 +333,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
igt_assert_eq(ret, 0);
/* Check CRC */
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+ igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
igt_assert_crc_equal(&data->ref_crc, &crc_output);
/*
@@ -359,7 +356,7 @@ static void test_single_case(data_t *data, enum pipe pipe,
igt_assert_eq(ret, 0);
}
kmstest_wait_for_pageflip(data->gfx_fd);
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc_output);
+ igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output);
igt_assert_crc_equal(&data->flip_crc,
&crc_output);
}
@@ -388,7 +385,7 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
plane = igt_output_get_plane_type(output, plane_type);
igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));
- prepare_crtc(data, output, pipe, plane, true);
+ prepare_crtc(data, output, pipe, plane);
for (i = 0; i < num_rectangle_types; i++) {
/* Unsupported on i915 */
@@ -416,7 +413,6 @@ static void test_plane_rotation(data_t *data, int plane_type, bool test_bad_form
data->override_fmt, test_bad_format);
}
}
- igt_pipe_crc_stop(data->pipe_crc);
}
}
@@ -473,7 +469,7 @@ static bool get_multiplane_crc(data_t *data, igt_output_t *output,
ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
igt_assert_eq(ret, 0);
- igt_pipe_crc_get_current(data->gfx_fd, data->pipe_crc, crc_output);
+ igt_pipe_crc_collect_crc(data->pipe_crc, crc_output);
for (c = 0; c < numplanes && oldplanes; c++)
igt_remove_fb(data->gfx_fd, &oldplanes[c].fb);
@@ -564,7 +560,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
- igt_pipe_crc_start(data->pipe_crc);
for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
p[0].planetype = DRM_PLANE_TYPE_PRIMARY;
@@ -620,7 +615,6 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
}
}
}
- igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
igt_output_set_pipe(output, PIPE_ANY);
}
@@ -656,7 +650,7 @@ static void test_plane_rotation_exhaust_fences(data_t *data,
igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));
- prepare_crtc(data, output, pipe, plane, false);
+ prepare_crtc(data, output, pipe, plane);
mode = igt_output_get_mode(output);
w = mode->hdisplay;
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2019-09-09 16:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-09 16:31 Matt Roper [this message]
2019-09-09 17:15 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_rotation_crc: Switch to one-shot CRC collection Patchwork
2019-09-09 23:56 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20190909163138.9701-1-matthew.d.roper@intel.com \
--to=matthew.d.roper@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/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