[igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: start crc only once per test
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Tue Nov 26 16:52:53 UTC 2019
starting pipe crc causes modeset on psr panels which take
lot of time. Fix this by starting crc only in the beginning
and stop at the end of test.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
tests/kms_cursor_crc.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 0125122..0d05a45 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -175,7 +175,7 @@ static void do_single_test(data_t *data, int x, int y)
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
- igt_pipe_crc_collect_crc(pipe_crc, &crc);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
if (data->flags & (TEST_DPMS | TEST_SUSPEND)) {
igt_crc_t crc_after;
@@ -194,7 +194,7 @@ static void do_single_test(data_t *data, int x, int y)
igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
SUSPEND_TEST_NONE);
- igt_pipe_crc_collect_crc(pipe_crc, &crc_after);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc_after);
igt_assert_crc_equal(&crc, &crc_after);
}
@@ -207,8 +207,8 @@ static void do_single_test(data_t *data, int x, int y)
igt_put_cairo_ctx(data->drm_fd, &data->primary_fb, cr);
igt_display_commit(display);
- igt_wait_for_vblank(data->drm_fd, data->pipe);
- igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
+
igt_assert_crc_equal(&crc, &ref_crc);
/* Clear screen afterwards */
@@ -344,6 +344,7 @@ static void cleanup_crtc(data_t *data)
{
igt_display_t *display = &data->display;
+ igt_pipe_crc_stop(data->pipe_crc);
igt_pipe_crc_free(data->pipe_crc);
data->pipe_crc = NULL;
@@ -359,8 +360,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
igt_display_t *display = &data->display;
igt_plane_t *primary;
- cleanup_crtc(data);
-
/* select the pipe we want to use */
igt_output_set_pipe(output, data->pipe);
@@ -393,7 +392,8 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
data->refresh = mode->vrefresh;
/* get reference crc w/o cursor */
- igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
+ igt_pipe_crc_start(data->pipe_crc);
+ igt_pipe_crc_get_current(data->drm_fd, data->pipe_crc, &data->ref_crc);
}
static void test_cursor_alpha(data_t *data, double a)
@@ -420,7 +420,7 @@ static void test_cursor_alpha(data_t *data, double a)
cursor_enable(data);
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
- igt_pipe_crc_collect_crc(pipe_crc, &crc);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc);
cursor_disable(data);
igt_remove_fb(data->drm_fd, &data->fb);
@@ -431,7 +431,7 @@ static void test_cursor_alpha(data_t *data, double a)
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
- igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
igt_assert_crc_equal(&crc, &ref_crc);
/*Clear Screen*/
@@ -456,6 +456,7 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
{
prepare_crtc(data, data->output, cursor_w, cursor_h);
testfunc(data);
+ cleanup_crtc(data);
}
static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
@@ -537,7 +538,7 @@ static void test_cursor_size(data_t *data)
igt_fb_set_size(&data->fb, cursor, size, size);
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
- igt_pipe_crc_collect_crc(pipe_crc, &crc[i]);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc[i]);
}
cursor_disable(data);
igt_display_commit(display);
@@ -551,7 +552,7 @@ static void test_cursor_size(data_t *data)
igt_display_commit(display);
igt_wait_for_vblank(data->drm_fd, data->pipe);
- igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
+ igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &ref_crc);
/* Clear screen afterwards */
cr = igt_get_cairo_ctx(data->drm_fd, &data->primary_fb);
igt_paint_color(cr, 0, 0, data->screenw, data->screenh,
--
2.7.4
More information about the igt-dev
mailing list