From: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: start crc only once per test
Date: Tue, 26 Nov 2019 18:52:53 +0200 [thread overview]
Message-ID: <1574787173-22590-1-git-send-email-juhapekka.heikkila@gmail.com> (raw)
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@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
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2019-11-26 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 16:52 Juha-Pekka Heikkila [this message]
2019-11-26 18:21 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_cursor_crc: start crc only once per test Patchwork
2019-11-26 19:38 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_cursor_crc: start crc only once per test (rev2) Patchwork
2019-11-27 7:45 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2019-11-27 12:19 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: start crc only once per test Juha-Pekka Heikkila
2019-11-28 12:32 ` Petri Latvala
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=1574787173-22590-1-git-send-email-juhapekka.heikkila@gmail.com \
--to=juhapekka.heikkila@gmail.com \
--cc=igt-dev@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